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.

24 lines
835 B

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