Skip to content

Commit

Permalink
Fixed scene management
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokimmel committed Jun 6, 2022
1 parent 627c098 commit 283fc59
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/WizardsWardrobe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local WWQ = WW.queue
WW.name = "WizardsWardrobe"
WW.simpleName = "Wizard's Wardrobe"
WW.displayName = "|c18bed8W|c26c2d1i|c35c6c9z|c43cac2a|c52cebar|c60d1b3d|c6fd5ab'|c7dd9a4s|c8cdd9d |c9ae195W|ca8e58ea|cb7e986r|cc5ed7fd|cd4f077r|ce2f470o|cf1f868b|cfffc61e|r"
WW.version = "1.9.0"
WW.version = "1.9.1"
WW.zones = {}

local cancelAnimation = false
Expand Down
2 changes: 1 addition & 1 deletion src/WizardsWardrobe.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Title: Wizard's Wardrobe
## Author: ownedbynico
## Version: 1.9.0
## Version: 1.9.1
## Description: Throw all your setups into the wardrobe and let the wizard equip them exactly when you need it.
## APIVersion: 101034
## DependsOn: LibAddonMenu-2.0 LibChatMessage>=105
Expand Down
30 changes: 14 additions & 16 deletions src/WizardsWardrobeGui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,23 @@ function WWG.SetSceneManagement()
SCENE_MANAGER:RegisterCallback("SceneStateChanged", onSceneChange)

-- quickslot tab will internally act like a independent scene
ZO_QuickSlot_Keyboard_TopLevel:SetHandler("OnShow", function(self)
KEYBOARD_QUICKSLOT_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
local quickslot = {
GetName = function(GetName)
return "inventoryQuickslot"
end
}
local inventoryScene = SCENE_MANAGER:GetScene("inventory")
onSceneChange(inventoryScene, SCENE_SHOWN, SCENE_HIDING)
onSceneChange(quickslot, SCENE_HIDDEN, SCENE_SHOWING)
end)
ZO_QuickSlot_Keyboard_TopLevel:SetHandler("OnHide", function(self)
local quickslot = {
GetName = function(GetName)
return "inventoryQuickslot"
if newState == SCENE_SHOWING then
onSceneChange(inventoryScene, SCENE_SHOWN, SCENE_HIDING)
onSceneChange(quickslot, SCENE_HIDDEN, SCENE_SHOWING)
elseif newState == SCENE_HIDING then
if inventoryScene:IsShowing() then
onSceneChange(quickslot, SCENE_SHOWN, SCENE_HIDING)
onSceneChange(inventoryScene, SCENE_HIDDEN, SCENE_SHOWING)
else
onSceneChange(quickslot, SCENE_SHOWN, SCENE_HIDING)
end
}
local inventoryScene = SCENE_MANAGER:GetScene("inventory")
if inventoryScene:IsShowing() then
onSceneChange(quickslot, SCENE_SHOWN, SCENE_HIDING)
onSceneChange(inventoryScene, SCENE_HIDDEN, SCENE_SHOWING)
else
onSceneChange(quickslot, SCENE_SHOWN, SCENE_HIDING)
end
end)

Expand Down Expand Up @@ -188,7 +183,7 @@ function WWG.SetSceneManagement()
WizardsWardrobeWindow:SetHidden(not WizardsWardrobeWindow:IsHidden())
return
end
if sceneName == "inventory" and not ZO_QuickSlot_Keyboard_TopLevel:IsShowing() then
if sceneName == "inventory" and KEYBOARD_QUICKSLOT_FRAGMENT:IsShowing() then
sceneName = "inventoryQuickslot"
end
local savedScene = WW.settings.window[sceneName]
Expand Down Expand Up @@ -349,6 +344,9 @@ end
function WWG.OnWindowMove()
local scene = SCENE_MANAGER:GetCurrentScene()
local sceneName = scene:GetName()
if sceneName == "inventory" and KEYBOARD_QUICKSLOT_FRAGMENT:IsShowing() then
sceneName = "inventoryQuickslot"
end
WW.settings.window[sceneName] = {
top = WizardsWardrobeWindow:GetTop(),
left = WizardsWardrobeWindow:GetLeft(),
Expand Down

0 comments on commit 283fc59

Please sign in to comment.