Originally Posted by Baertram
|
yeh I was previously using 3 state changes for crafting machines but was more callbacks than I wanted and events driving my code savage. I prefer events that I can fully turn on and off via options as I have many features so for me its key they can properly completely shut down any feature they are not using and its no longer firing anything related.
So I reversed my thinking and switched to:
Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_CRAFTING_STATION_INTERACT, MyAddon.AutoMeticulous)
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_END_CRAFTING_STATION_INTERACT, MyAddon.AutoMetReturn)
with a filters in the functions for different things with:
Code:
if craftSkill ~= 0 and craftSkill ~= 1 and craftSkill ~= 2 and craftSkill ~= 3 and craftSkill ~= 6 and craftSkill ~= 7 then return end
and
Code:
local deconCraftScene = SCENE_MANAGER:GetScene("smithing")
local deconEnchantScene = SCENE_MANAGER:GetScene("enchanting")
local deconAssistScene = SCENE_MANAGER:GetScene("universalDeconstructionSceneKeyboard")
if deconCraftScene:GetState() ~= SCENE_SHOWN and deconEnchantScene:GetState() ~= SCENE_SHOWN and deconAssistScene:GetState() ~= SCENE_SHOWN then
etc etc.