wasabee-project / Wasabee-IITC

ENL DrawTools and Op Management
Apache License 2.0
30 stars 21 forks source link

Rename hooks #235

Closed cloudkucooland closed 3 years ago

cloudkucooland commented 3 years ago

try this again, to the correct branch

le-jeu commented 3 years ago

missed: init.js:182 window.map.fire("wasabeeDkeys", { reason: "startup" }, false);

le-jeu commented 3 years ago

current hooks are:

wasabee:crosslinks
wasabee:crosslinks:done
wasabee:defensivekeys
wasabee:op:add
wasabee:op:background
wasabee:op:delete
wasabee:op:select
wasabee:op:showhide
wasabee:paneclear
wasabee:paneset
wasabee:ui:buttonreset
wasabee:uiupdate
wasabee:uiupdate:agentlocations
wasabee:uiupdate:buttons
wasabee:uiupdate:mapdata
wasabee:uiupdate:settings
wasabee:uiupdate:teamdata
cloudkucooland commented 3 years ago

Can we split map data updates from other ui updates? We do not need to redraw all buttons on map data change

cloudkucooland commented 3 years ago

wasabee:uiupdate is replaced by

wasabee:uiupdate:mapdata (for changes that need to draw the map or dialogs of map data) wasabee:uiupdate:teamdata (for dialogs that display team info) wasabee:uiupdate:buttons (to update the buttons) wasabee:ui:buttonreset (to completely reset the buttons on skin change) wasabee:uiupdate:agentlocations (to update agents on the map when they move) wasabee:uiupdate:settings (for the settings dialog which doesn't need to change on map/team/agentlocation changes)

I think that's all.

This builds and is ready for review.

le-jeu commented 3 years ago

wasabee:uiupdate is replaced by

wasabee:uiupdate:mapdata (for changes that need to draw the map or dialogs of map data) wasabee:uiupdate:teamdata (for dialogs that display team info) wasabee:uiupdate:buttons (to update the buttons) wasabee:ui:buttonreset (to completely reset the buttons on skin change) wasabee:uiupdate:agentlocations (to update agents on the map when they move) wasabee:uiupdate:settings (for the settings dialog which doesn't need to change on map/team/agentlocation changes)

I think that's all.

This builds and is ready for review.

Maybe reverse the logic, with wasabee:uiupdate:* we fire actions , could it be clearer to use events instead ? instead of wondering if the UI need to update when synching OPs, let the UI register for op/team:update-like events