Hey all, back again.
My Wardrobe Manager Addon is really coming along, but I've noticed a few bugs, one of which is that when the character is sneaking and then fast travels, they're no longer sneaking but it doesn't trigger EVENT_STEALTH_STATE_CHANGED so the toon stays in the wrong outfit. I've tried forcing an outfit change listening to EVENT_ZONE_UPDATE, but I can't even get my function to call that should be hooked to it.
Any thoughts?
Code:
Lua Code:
function LeonardosWardrobeManager:Initialize()
LeonardosWardrobeManager.savedVariables = ZO_SavedVars:NewCharacterIdSettings("LeonardosWardrobeManagerVars", LeonardosWardrobeManager.variableVersion, nil, LeonardosWardrobeManager.Default, GetWorldName())
self.inCombat = IsUnitInCombat("player")
self.inStealth = GetUnitStealthState("player")
for i=1,GetNumUnlockedOutfits() do
self.allOutfits[i + OUTFIT_OFFSET] = GetOutfitName(0, i)
end
LAM2:RegisterAddonPanel("LeonardosWardrobeManagerOptions", panelData)
LAM2:RegisterOptionControls("LeonardosWardrobeManagerOptions", optionsData)
EVENT_MANAGER:RegisterForEvent(self.name, EVENT_OUTFIT_RENAME_RESPONSE, self.OnOutfitRenamed)
EVENT_MANAGER:RegisterForEvent(self.name, EVENT_ZONE_UPDATE, self.OnZoneChange)
EVENT_MANAGER:RegisterForEvent(self.name, EVENT_PLAYER_COMBAT_STATE, self.OnPlayerCombatState)
EVENT_MANAGER:RegisterForEvent(self.name, EVENT_STEALTH_STATE_CHANGED, self.OnPlayerStealthState)
end
Lua Code:
function LeonardosWardrobeManager.OnZoneChange() -- TODO: Still not working
d("triggered")
LeonardosWardrobeManager.ChangeOutfit(LeonardosWardrobeManager.savedVariables.defaultOutfitIndex)
end