Leon Friedrich
b15d960c69
Try improve RaiseEvent performance ( #5925 )
...
* IEventBus -> EventBus
* Fix CompIdx.RefArray
* IEntityManager -> EntityManager
* Remove double delegate
* Add GetNetCompEventHandlers()
* release notes & cleanup
* Make PVS use GetNetCompEventHandlers
* I love event bus tests
* also fix pvs pause test
* dont trimm
---------
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com >
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com >
2025-11-13 21:32:40 +11:00
PJB3005
8891f3fa0a
Make EntitySystem.Subscriptions.SubscribeLocalEvent not require EntityEventArgs
...
This means it can be used with struct events.
2025-04-03 02:58:20 +02:00
DrSmugleaf
30907d8415
Fix ordered subscriptions not working when targeting a parent system type ( #5135 )
...
* Fix ordered subscriptions not working when targeting a parent system type
* Fix missing usages of expand ordering
* Extract method
2024-05-16 20:00:15 +02:00
Pieter-Jan Briers
3c5fbc648a
Add Subs.CVar helper for subscribing to CVar changes from entity systems
2024-02-11 13:29:27 +01:00
Pieter-Jan Briers
f9c39bce0b
Use ValueList for EntitySystem subscriptions list.
...
That's a hundred something lists just gone and I don't have to ??=
2024-02-11 13:29:27 +01:00
Pieter-Jan Briers
510846321d
BUI Improvements / fixes ( #4826 )
...
* Extension helper function for registering BUI events filtered to UI key.
Usages of events like BoundUIClosedEvent frequently did not check the UI key or do it improperly. This has, and will continue to cause, bugs.
The new helper (accessible as Subs.BuiEvents() from an entity system) makes it easy to subscribe to BUI events while also filtering to the correct UI key.
Also added missing SubscribeLocalEvent overloads with new handler types to EntitySystem.Subscriptions.
* Sprinkle [ViewVariables] around BUI
* Avoid buggy behavior if a Bound UI is closed inside the `BoundUIOpenedEvent` that's opening it.
2024-01-10 18:30:57 +01:00
DrSmugleaf
b737ecf9b3
Add generic EntityUid, remove some usages of .Owner ( #4498 )
2023-10-19 12:23:48 -07:00
DrSmugleaf
f87012e681
Allow handling by-value events by ref ( #4373 )
2023-10-18 18:37:43 -07:00
Visne
a5be8e723e
Remove some unused obsolete stuff ( #2049 )
2021-09-20 10:59:50 +02:00
Vera Aguilera Puerto
e5013d9e3f
Add support for struct directed events, add by-ref directed/broadcast events. ( #1931 )
...
* Add support for struct directed events.
- Turn transform events into readonly structs
* TransformComponent events have readonly fields.
* Reduce boxing allocations, add DirectedRegistration readonly struct.
* Use typeof in a few places instead of GetType
* Add overloads to allow passing directed events by ref.
* Raise transform events by ref.
* Fix occluder AnchorStateChangedEvent subscription
* Fix broadphase subscriptions
* Fix bug oops
* Fix transform system raising moveevents by value
* Don't reflect the test entity systems.
* Directed EventBus uses ref everywhere, internally
Deduplicates a bunch of code. Whoo!
* Add broadcast by-ref events
* Fix by-ref events bug using Unsafe, add new tests for sorted by-ref events.
* Port broadcast events to by-ref.
* Speed, more correctness, reduce generics bloat.
* Clean up subscription code some.
* Remove bad test.
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com >
2021-08-21 11:37:02 +02:00
Pieter-Jan Briers
a35a5e1645
Add EntitySystem.Subs property to aid helper methods.
2021-07-29 01:51:51 +02:00
Pieter-Jan Briers
72314a102d
EventBus improvements
...
Can do ordered session event subscription.
Can subscribe to "All" in one call, to reduce shared boilerplate.
2021-07-21 00:56:42 +02:00
Pieter-Jan Briers
fa0d4da6d1
Implement subscription ordering into EventBus. ( #1823 )
...
* Implement subscription ordering into EventBus.
* Topological helpers, rest of code uses shared topological sort, fix bugs.
* Fix tests.
Didn't realize that multi-subscriptions are allowed on input handlers like that??
* Improve and use topological sort helpers more.
2021-06-14 21:34:30 +02:00
Pieter-Jan Briers
96c0a4ae1f
Automatically unsubscribe event bus registrations in entity system shutdown. ( #1758 )
...
* Automatically unsubscribe event bus registrations in entity system shutdown.
* Fix incorrect unsubscription of local events, obsolete unsubscribe methods.
That's what we got tests for.
* = null instead of .Clear()
2021-05-17 11:01:22 +02:00