-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Events - Add CBA_fnc_addBISPlayerEventHandler
for adding EHs to just the player (from ACE3)
#1670
Conversation
@@ -0,0 +1,70 @@ | |||
#include "script_component.hpp" | |||
/* ---------------------------------------------------------------------------- | |||
Function: CBA_fnc_addPlayerEngineEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function adds an Event Handler so the name should reflect that.
We have addBISEventHandler
so something like addBISPlayerEventHandler
would be fitting. I don't like how the capitalized letters merge though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the capitalization either, but it's better than addPlayerEventHandlerBIS
imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anyone have a different name suggestion?
otherwise I think it's fine as is
I think we can replace ace_player with |
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Just a few thoughts.
I don't personally like if (_unit != player) exitWith {}; ? |
Co-authored-by: commy2 <commy-2@gmx.de>
Co-authored-by: commy2 <commy-2@gmx.de>
Co-authored-by: commy2 <commy-2@gmx.de>
This is only ever intended for internal use, to replace the polling in player events (hence, no removal option) and so the mental overhead is a one-time thing during implementation IMO. I don't like the idea of adding the EHs to every unit, due to the overhead (though it might still be better than polling). I can make this exit on |
There is some performance savings by only adding events you need. We can make it safe by wrapping in a |
Implemented as public function. Added removal, thread-safety, and multiple events of the same type can be added now. Do I need to touch anything myself for docs? |
addBISPlayerEventHandler
for adding EHs to just the player (from ACE3)
addBISPlayerEventHandler
for adding EHs to just the player (from ACE3)CBA_fnc_addBISPlayerEventHandler
for adding EHs to just the player (from ACE3)
When merged this pull request will:
addPlayerEH
for adding EHs to ace_player acemod/ACE3#10056, though this is not intended for public usage/API (it's a secret tool that will help us later).