Skip to content
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

XEH - Add more events #1588

Merged
merged 5 commits into from
Sep 3, 2023
Merged

XEH - Add more events #1588

merged 5 commits into from
Sep 3, 2023

Conversation

LinkIsGrim
Copy link
Contributor

When merged this pull request will:

  • Add CargoLoaded, CargoUnloaded, HandleDamage, OpticsModeChanged, OpticsSwitch, RopeAttach, RopeBreak, SlotItemChanged (2.14), VisionModeChanged events support to XEH.
  • Change event lists to alphabetical/wiki order.

//class Extended_HandleDamage_EventHandlers {}; // Not implemented yet
//class Extended_HandleHeal_EventHandlers {}; // Not implemented yet
class Extended_HandleDamage_EventHandlers {};
class Extended_HandleHeal_EventHandlers {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last time I checked, they ignored the return value. It was better to add handleDamage via init class event.

Does it work now? If not, don't enable these. It will only cause anger and confusion.

Copy link
Contributor Author

@LinkIsGrim LinkIsGrim Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should HandleHeal be kept in script_component.hpp and script_xeh.hpp, or removed there as well? It was previously enabled there, just not enabled in config.

Copy link
Contributor

@commy2 commy2 Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it.

If you want support for HandleDamage and HandleHeal in addClassEventHandler:

  • make sure the RV is still ignored in current version
  • if yes, make addClassEventHandler add a retroactive flag set init event handler that uses the addEventHandler command

Those would be removable by removeAllEventHandlers and removeEventHandler with hard-coded ehids, but anyone who uses the former is a terrorist and the latter goes against best practices (hard-coded or not), so is on their own.

This is a lesson in writing good comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about adding HandleDamage now
it's going to take a ton of testing to make sure it doesn't cause problems with old mods that may have used this
and to make sure that the return value doesn't override existing code

@LinkIsGrim
Copy link
Contributor Author

I've commented out/removed all instances of HandleHeal/HandleDamage, though note that HandleHeal was previously available in some places.

@PabstMirror PabstMirror added this to the 3.16.0 milestone Sep 2, 2023
@jonpas jonpas merged commit 846b173 into CBATeam:master Sep 3, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants