1 1 function ShowOrHide()
2 2 if not QSB.Settings then return end
3 3
4 4 -- CURRENT STATE OF USER-INTERFACE
5 5 local vis = QSB.Settings.Visibility
6 6 local qsb_panel_showing = not QSB.Panel:IsHidden()
7 7 local inventory_showing = not ZO_PlayerInventory:IsHidden()
8 8 local quickslot_showing = not ZO_QuickSlot:IsHidden()
9 9 local crafting = ZO_CraftingUtils_IsCraftingWindowOpen()
10 10 local digging = ANTIQUITY_DIGGING_ACTIONS_FRAGMENT:IsShowing()
11 11 local scrying = IsScryingInProgress()
12 12 local setting = SYSTEMS:IsShowing("champion") or not ZO_Skills:IsHidden()
13 13
14 14 -- SHOULD TRANSITION TO SHOWING OR HIDING
15 15 local show_msg = ""
16 16 local hide_msg = ""
17 17 if qsb_panel_showing then show_msg = "VIS-"..vis.." .. GQSB-MENU SHOWING"
18 18 elseif not QSB.Settings.LockUI then show_msg = "NOT LOCKED ON SCREEN"
19 19
20 20 -- USER DEFAULT
21 21 elseif vis == VIS_NEVER then hide_msg = "VIS-"..vis
22 22 elseif vis == VIS_ALWAYS then show_msg = "VIS-"..vis
23 23
24 24 -- USER FORCED
25 25 elseif BlockBarVisibility then hide_msg = "BLOCKED IS ON"
26 26 elseif ForceBarVisibility then show_msg = "FORCED IS ON"
27 27
28 28 elseif vis == VIS_BLINK_CHANGES then
29 29 if inventory_showing then show_msg = "VIS-"..vis.." .. INVENTORY SHOWING"
30 30 elseif quickslot_showing then show_msg = "VIS-"..vis.." .. QSB-WHEEL SHOWING"
31 31 else Show_handler(); Hide_delayed(vis, ZO_CALLLATER_DELAY_BLINK_CHANGE)
32 32 end
33 33
34 34 elseif vis == VIS_RETICLE then
35 35 if not Reticle_isHidden then show_msg = "VIS-"..vis.." .. RETICLE ON SCREEN"
36 36 elseif inventory_showing then show_msg = "VIS-"..vis.." .. INVENTORY SHOWING"
37 37 elseif quickslot_showing then show_msg = "VIS-"..vis.." .. QSB-WHEEL SHOWING"
38 38 else hide_msg = "VIS-"..vis.." .. RETICLE HIDDEN"
39 39 end
40 40
41 41 elseif vis == VIS_COMBAT then
42 42 if IsUnitInCombat('player') then show_msg = "VIS-"..vis.." .. IN COMBAT"
43 43 elseif inventory_showing then show_msg = "VIS-"..vis.." .. INVENTORY SHOWING"
44 44 elseif quickslot_showing then show_msg = "VIS-"..vis.." .. QSB-WHEEL SHOWING"
45 45 else hide_msg = "VIS-"..vis.." .. NOT IN COMBAT"
46 46 end
47 47
48 48 else
49 49 if inventory_showing then show_msg = "VIS-"..vis.." .. INVENTORY SHOWING"
50 50 elseif quickslot_showing then show_msg = "VIS-"..vis.." .. QSB-WHEEL SHOWING"
51 51 else hide_msg = "VIS-"..vis.." .. RETICLE ON SCREEN"
52 52 end
53 53
54 54 end
55 55 -- NEVER SHOW
56 56 if crafting then hide_msg = "WHILE CRAFTING"; show_msg = ""
57 57 elseif digging then hide_msg = "WHILE DIGGING" ; show_msg = ""
58 58 elseif scrying then hide_msg = "WHILE SCRYING" ; show_msg = ""
59 59 elseif setting then hide_msg = "SETUP SHOWING" ; show_msg = ""
60 60 end
61 61
62 62 -- BUTTONS SHOWING OR HIDING
63 63 if (hide_msg ~= "" ) then Hide_delayed( hide_msg ) end
64 64 if (show_msg ~= "" ) then Show_delayed( show_msg ) end
65 65
66 66 -- HANDLES SHOWING (BLINK BACK INTO HIDING)
67 67 if (show_msg ~= "" ) then ShowOrHideUIHandles( show_msg )
68 68 elseif(QSB.Settings.LockUI ) then ShowOrHideUIHandles( "LOCKED ON SCREEN" )
69 69 else HideUIHandles( hide_msg.." POSSIBLY SHOWN") end
70 70
71 71 end