Messages for crafting stations?
In "Mass Deconstructor" I'm using EVENT_CRAFTING_STATION_INTERACT to determine when to add buttons to the toolbar for mass deconstruction or mass refining (using KEYBIND_STRIP:AddKeybindButtonGroup).
It seems that there is a time lag between beginning of interaction with the crafting station and the ability to actually interact with the crafting station. Is there a new message I need to be looking for since Murkmire/Wrathstone? If I add a time delay into the message handler before adding the buttons, the buttons are added just fine. |
It might be more reliable to add/remove buttons upon scene transition. See for example: https://github.com/esoui/esoui/blob/...rd.lua#L23-L49
The downside is you'd need to add StateChange callbacks for individual crafting scenes and keyboard / gamepad variants, instead of just one event. |
Check the code of DoItAll, it may help you.
Keybinds are added via scene stateChange callback functions. Please be sure to NOT overwrite the keybsindstriop with your addon but ADD to it so other addons won't get broken. Thank you! |
Quote:
|
For the crafting this is true, but I told you the addon to check the other stuff like BankAll as well:
Lua Code:
Get the scene for the crafting, use the scene's StateChange callback function to add/remove the keybinds. Try this. SCENE_MANAGER.currentScene is providing you the current scene if you are at the crafting station. If the scene is always the same and you need a difference you could check if the scene got fragments below and use the fragment's StateChange callback function then. And check within the scene which mode is currently activated via a preHook to SMITHING.SetMode to see which mode of the crafting station gets activated (modes = e.g. --Smithing modes SMITHING_MODE_ROOT = 0 SMITHING_MODE_REFINMENT = 1 SMITHING_MODE_CREATION = 2 SMITHING_MODE_DECONSTRUCTION = 3 SMITHING_MODE_IMPROVEMENT = 4 SMITHING_MODE_RESEARCH = 5 SMITHING_MODE_RECIPES = 6 ) But as said before: Please do not overwrite the functions in smithing like SetMode or others which will most likely kill other addons! Just prehook them and add e.g. a small delay like 250ms to wait for them to be finished (via zo_callLater(function() --your stuff in here end, 250) ) |
All times are GMT -6. The time now is 06:02 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI