View Single Post
05/23/23, 12:49 PM   #5
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 247
Originally Posted by Baertram View Post
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.

Last edited by sinnereso : 05/23/23 at 12:55 PM.
  Reply With Quote