detect if HUD hidden or shown
Looking for a way to detect if the HUD is shown. ive been been trying things like this but no success.
Code:
local hud = SCENE_MANAGER:GetScene("hud") **EDIT figured it out :) Code:
local hudScene = SCENE_MANAGER:GetScene("hud") |
Maybe helps too:
https://wiki.esoui.com/Fragments_in_...t_state_change |
Code:
if IsGameCameraUIModeActive() or IsUnitInCombat("player") then |
Attention: IsUnitInCombat("player") does not tell you if you are in HUD mode as you can be in combat having the menus open or not!
|
Quote:
So I reversed my thinking and switched to: Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_CRAFTING_STATION_INTERACT, MyAddon.AutoMeticulous) Code:
if craftSkill ~= 0 and craftSkill ~= 1 and craftSkill ~= 2 and craftSkill ~= 3 and craftSkill ~= 6 and craftSkill ~= 7 then return end Code:
local deconCraftScene = SCENE_MANAGER:GetScene("smithing") |
you can also just register the same event multiple times for different features
|
You should not use the fixed numbers 0 ,1 and 2 etc. but the constants the game provides.
The constants type used for any API function or event are provided at the API documentation txt file: Code:
* EVENT_CRAFTING_STATION_INTERACT (*[TradeskillType|#TradeskillType]* _craftSkill_, *bool* _sameStation_, *[CraftingInteractionMode|#CraftingInteractionMode]* _craftMode_) Code:
h5. TradeskillType You will find those constants and their values via merTorchbug ingame too, using /tb and then click on the constants tab (search is top left). e.g. enter CRAFTING_ and it should list all + their values. Better use those as the numbers MIGHT (did) change in the future and 0 will stay 0 but CRAFTING_TYPE_INVALID might change to soemthing like -1 or similar and break your code then! This applies to all API functions and events and callbacks. Quote:
Code:
EVENT_MANAGER:RegisterForEvent("MyAddon" .. tostring(craftingType), ... You might break other addons using the same. !!!Please change that at ALL events in your addons to use a really unique name, like YOUR addon's real name, and not a generic "My Addon" or similar !!! e.g. use RidinDirty.name if this exists |
Quote:
|
All times are GMT -6. The time now is 02:03 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI