R2API.Director: add enabling/disabling stage Combat Directors event - #692
Conversation
|
Why is currentStageCombatDirectorsHashSet needed? |
To ignore Combat Directors that are not part of Director Core object |
|
Wasn't aware there was combat directors outside of it. If the point is compat shouldn't they should all be passed to the delegate? Also |
|
I was thinking to limit it to only stage combat directors, however now I think how I could make it affect all combat directors while making an extension method to check if combat director is the stage one. One minute |
|
Made it affect all combat directors, everything seems to work fine. Though I have some dislikes like removing null Combat Directors only in RunCombatDirectorsFixedUpdate.FixedUpdate and having this feature having issues with getting stage combat directors and running disabled combat directors if stage doesn't have DirectorCore component. I don't think these issues will actually cause problems but still |
Adds an event that allows easily enabling or disabling stage Combat Directors for solving potential incompatibilities. Solution is a bit hacky but it works and shouldn't cause issues (Tested in big modpack).
If int activationCount from GetCombatDirectorActivityCountDelegate(CombatDirector combatDirector, ref int activityCount) _getCombatDirectorActivityCount event is higher than 0, then stage Combat Directors will always run even when they are disabled from something like teleporter, if less than 0 Combat Directors will never run and if equals 0 they will act as usual