Snakybo / Clicked

A keybind management addon for World of Warcraft.
GNU General Public License v3.0
30 stars 6 forks source link

Only reload bindings that match the changed load condition #151

Closed Snakybo closed 1 year ago

Snakybo commented 1 year ago

Currently, when a reload is triggered, everything reloads. This can be enhanced by performing a pre-pass to only reload the state of bindings that may have changed based on the cause of the reload.

For example, if the cause of the reload is a zone change, only bindings that have the "Zone name(s)" load condition enabled have to be re-evaluated, as all other bindings are guaranteed to still be in the state that they were in.

Event map to load condition map:

Event Binding type(s) Load condition(s)
PLAYER_REGEN_DISABLED UNIT_MENU, UNIT_SELECT Combat
PLAYER_REGEN_DISABLED UNIT_MENU, UNIT_SELECT Combat
ZONE_CHANGED_NEW_AREA * Zone name(s), Instance type
CHARACTER_POINTS_CHANGED * Talent selected, Spell known
PLAYER_FLAGS_CHANGED * War Mode
TRAIT_CONFIG_UPDATED * Talent selected, Spell known
PLAYER_LEVEL_CHANGED * Spell known
LEARNED_SPELL_IN_TAB * Talent selected, Spell known
PLAYER_EQUIPMENT_CHANGED * Spell known, Item equipped
GROUP_ROSTER_UPDATE * In group, Player in group