You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
745 B

local COMPAT, _, T = select(4, GetBuildInfo()), ...
local EV, frame, pendingValue = T.Evie, COMPAT > 10e4 and StanceBar or StanceBarFrame, nil
local keeper, parent = CreateFrame("Frame"), frame:GetParent()
5 years ago
keeper:Hide()
local function SetStanceBarVisibility(_, hidden, ringID)
if ringID ~= nil then return false end
hidden = hidden ~= false
5 years ago
if InCombatLockdown() then
pendingValue = hidden
return
5 years ago
end
frame:SetParent(hidden and keeper or parent)
if hidden == false and frame:IsShown() then frame:Show() end
pendingValue = nil
5 years ago
end
T.OPieCore:RegisterOption("HideStanceBar", false, SetStanceBarVisibility)
function EV:PLAYER_REGEN_ENABLED()
if pendingValue ~= nil then
SetStanceBarVisibility("HideStanceBar", pendingValue)
end
end