Hey guys I'm back messing with this hide armory save build button. Ive had a semi reliable working version of it for a while now but am not totally happy with the implementation built around delays for armory opening etc.
Where im experiencing the biggest issue is 1st opening the armory as the controls dont exist yet. id like to find something specific I could check and loop back to delay more if needed because I'm concerned for people with high latency and/or very slow pc's might encounter lua errors.
Here's the section of code im trying to work with and could use a tweak on:
Code:
------------------------------------------------------------------------
------------ HIDE ARMORY SAVE BUILD BUTTON -- 131761 = open armory, 131763 = equip build
------------------------------------------------------------------------
function MyAddon.HideArmorySaveBuildDelay(eventID)-- <<< function that all the events for armory open and switch builds etc fire
if MyAddon.savedVariables.armoryLock == false then return end
zo_callLater(function() MyAddon.HideArmorySaveBuild(eventID) end, GetLatency()+200)
end
function MyAddon.HideArmorySaveBuild(eventID)
if ZO_KeybindStripButtonTemplate3 == nil then MyAddon.HideArmorySaveBuildDelay(eventID) return end--<<<< LOOKING FOR HELP HERE TO LOOP BACK UP IF SAVE BUTTON NOT CREATED AND VISIBLE YET AFTER OPENING ARMORY
if ZO_KeybindStripButtonTemplate3:IsHidden() == false then
if eventID == 131763 then
zo_callLater(function() ZO_KeybindStripButtonTemplate3:ToggleHidden() end, 5000)--<< loading a build
elseif eventID == 131761 then
zo_callLater(function() ZO_KeybindStripButtonTemplate3:ToggleHidden() end, 300)--<< opening armory
else
ZO_KeybindStripButtonTemplate3:ToggleHidden()--<<< selecting different builds falls here
end
end
end
what I'm observing with this is there is a tiny 20-30ms time where the "KeybindStripButtonTemplate3" is not nil and created but is not visible yet so it skips past "IsHidden() == false" and does nothing leaving the save button sitting there. I can obviously add more delay to compensate but not everyone needs that. Id like something to check thats a concrete way to know if it can be hidden or not.