hide blizzard

This commit is contained in:
Sumsebrum 2021-06-15 09:06:32 +02:00
parent 85f63e590b
commit 0c4409fe16
2 changed files with 27 additions and 1 deletions

View File

@ -200,6 +200,7 @@ function Gladdy:OnInitialize()
self.LSM:Register("border", "Gladdy Tooltip round", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_round_selfmade") self.LSM:Register("border", "Gladdy Tooltip round", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_round_selfmade")
self.LSM:Register("border", "Gladdy Tooltip squared", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_square_selfmade") self.LSM:Register("border", "Gladdy Tooltip squared", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_square_selfmade")
self.LSM:Register("font", "DorisPP", "Interface\\AddOns\\Gladdy\\Images\\DorisPP.TTF") self.LSM:Register("font", "DorisPP", "Interface\\AddOns\\Gladdy\\Images\\DorisPP.TTF")
self.LSM:Register("border", "Square Full White", "Interface\\AddOns\\Gladdy\\Images\\Square_FullWhite.tga")
L = self.L L = self.L
@ -227,6 +228,9 @@ function Gladdy:OnInitialize()
self:Call(v, "Initialize") -- B.E > A.E :D self:Call(v, "Initialize") -- B.E > A.E :D
end end
self:DeleteUnknownOptions(self.db, self.defaults.profile) self:DeleteUnknownOptions(self.db, self.defaults.profile)
if Gladdy.db.hideBlizzard == "always" then
SetCVar("showArenaEnemyFrames", 0)
end
end end
function Gladdy:OnProfileChanged() function Gladdy:OnProfileChanged()
@ -355,6 +359,9 @@ function Gladdy:Reset()
for unit in pairs(self.buttons) do for unit in pairs(self.buttons) do
self:ResetUnit(unit) self:ResetUnit(unit)
end end
if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then
SetCVar("showArenaEnemyFrames", 1)
end
end end
function Gladdy:ResetUnit(unit) function Gladdy:ResetUnit(unit)
@ -412,4 +419,7 @@ function Gladdy:JoinedArena()
for i=1, self.curBracket do for i=1, self.curBracket do
self.buttons["arena" .. i]:SetAlpha(1) self.buttons["arena" .. i]:SetAlpha(1)
end end
if Gladdy.db.hideBlizzard == "arena" or Gladdy.db.hideBlizzard == "always" then
SetCVar("showArenaEnemyFrames", 0)
end
end end

View File

@ -13,6 +13,7 @@ local L = Gladdy.L
Gladdy.defaults = { Gladdy.defaults = {
profile = { profile = {
locked = false, locked = false,
hideBlizzard = "arena",
x = 0, x = 0,
y = 0, y = 0,
growUp = false, growUp = false,
@ -97,6 +98,11 @@ local function setOpt(info, value)
local key = info.arg or info[#info] local key = info.arg or info[#info]
Gladdy.dbi.profile[key] = value Gladdy.dbi.profile[key] = value
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
if Gladdy.db.hideBlizzard == "always" then
SetCVar("showArenaEnemyFrames", 0)
elseif Gladdy.db.hideBlizzard == "never" then
SetCVar("showArenaEnemyFrames", 1)
end
end end
local function getColorOpt(info) local function getColorOpt(info)
local key = info.arg or info[#info] local key = info.arg or info[#info]
@ -205,10 +211,20 @@ function Gladdy:SetupOptions()
["RIGHT"] = L["Right"], ["RIGHT"] = L["Right"],
} }
}, },
hideBlizzard = {
type = "select",
name = L["Hide Blizzard"],
values = {
["arena"] = L["Arena only"],
["never"] = L["Never"],
["always"] = L["Always"],
},
order = 4,
},
group = { group = {
type = "group", type = "group",
name = L["General"], name = L["General"],
order = 4, order = 5,
childGroups = "tree", childGroups = "tree",
args = { args = {
frameGeneral = { frameGeneral = {