This commit is contained in:
Sumsebrum 2021-07-29 15:53:34 +02:00
parent 720e5b63ec
commit 51cd2b7311
13 changed files with 83 additions and 91 deletions

View File

@ -131,8 +131,8 @@ function Gladdy:Call(module, func, ...)
end end
end end
function Gladdy:SendMessage(message, ...) function Gladdy:SendMessage(message, ...)
for k, v in self:IterModules() do for _, module in self:IterModules() do
self:Call(v, v.messages[message], ...) self:Call(module, module.messages[message], ...)
end end
end end
@ -224,8 +224,8 @@ function Gladdy:OnInitialize()
self:SetupOptions() self:SetupOptions()
for k, v in self:IterModules() do for _, module in self:IterModules() do
self:Call(v, "Initialize") -- B.E > A.E :D self:Call(module, "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 if Gladdy.db.hideBlizzard == "always" then
@ -304,8 +304,8 @@ function Gladdy:Test()
button[k] = v button[k] = v
end end
for k, v in self:IterModules() do for _, module in self:IterModules() do
self:Call(v, "Test", unit) self:Call(module, "Test", unit)
end end
button:SetAlpha(1) button:SetAlpha(1)
@ -369,7 +369,7 @@ end
function Gladdy:Reset() function Gladdy:Reset()
if type(self.guids) == "table" then if type(self.guids) == "table" then
for k, v in pairs(self.guids) do for k,_ in pairs(self.guids) do
self.guids[k] = nil self.guids[k] = nil
end end
end end
@ -377,8 +377,8 @@ function Gladdy:Reset()
self.curBracket = nil self.curBracket = nil
self.curUnit = 1 self.curUnit = 1
for k1, v1 in self:IterModules() do for _, module in self:IterModules() do
self:Call(v1, "Reset") self:Call(module, "Reset")
end end
for unit in pairs(self.buttons) do for unit in pairs(self.buttons) do
@ -398,8 +398,8 @@ function Gladdy:ResetUnit(unit)
button:SetAlpha(0) button:SetAlpha(0)
self:ResetButton(unit) self:ResetButton(unit)
for k2, v2 in self:IterModules() do for _, module in self:IterModules() do
self:Call(v2, "ResetUnit", unit) self:Call(module, "ResetUnit", unit)
end end
end end

View File

@ -1,6 +1,5 @@
local floor, str_len, tostring, str_sub, str_find, pairs = math.floor, string.len, tostring, string.sub, string.find, pairs local floor, str_len, tostring, str_sub, str_find, pairs = math.floor, string.len, tostring, string.sub, string.find, pairs
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetLocale = GetLocale
local GetTime = GetTime local GetTime = GetTime
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")

View File

@ -8,7 +8,7 @@ local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local function defaultSpells(auraType) local function defaultSpells(auraType)
local spells = {} local spells = {}
for k,v in pairs(Gladdy:GetImportantAuras()) do for _,v in pairs(Gladdy:GetImportantAuras()) do
if not auraType or auraType == v.track then if not auraType or auraType == v.track then
spells[tostring(v.spellID)] = {} spells[tostring(v.spellID)] = {}
spells[tostring(v.spellID)].enabled = true spells[tostring(v.spellID)].enabled = true
@ -20,7 +20,7 @@ local function defaultSpells(auraType)
end end
local function defaultInterrupts() local function defaultInterrupts()
local spells = {} local spells = {}
for k,v in pairs(Gladdy:GetInterrupts()) do for _,v in pairs(Gladdy:GetInterrupts()) do
spells[tostring(v.spellID)] = {} spells[tostring(v.spellID)] = {}
spells[tostring(v.spellID)].enabled = true spells[tostring(v.spellID)].enabled = true
spells[tostring(v.spellID)].priority = v.priority spells[tostring(v.spellID)].priority = v.priority
@ -327,10 +327,10 @@ function Auras:Test(unit)
end end
function Auras:JOINED_ARENA() function Auras:JOINED_ARENA()
for i=1, Gladdy.curBracket do --[[for i=1, Gladdy.curBracket do
--self.frames["arena" .. i]:RegisterUnitEvent("UNIT_AURA", "arena" .. i) self.frames["arena" .. i]:RegisterUnitEvent("UNIT_AURA", "arena" .. i)
--self.frames["arena" .. i]:SetScript("OnEvent", Auras.OnEvent) self.frames["arena" .. i]:SetScript("OnEvent", Auras.OnEvent)
end end--]]
end end
function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, expirationTime, count, debuffType) function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, expirationTime, count, debuffType)
@ -498,7 +498,7 @@ function Auras:GetOptions()
order = i + 13, order = i + 13,
hasAlpha = true, hasAlpha = true,
width = "0.8", width = "0.8",
set = function(info, r, g, b, a) set = function(_, r, g, b, a)
Gladdy.db.auraInterruptColors[v.key].r = r Gladdy.db.auraInterruptColors[v.key].r = r
Gladdy.db.auraInterruptColors[v.key].g = g Gladdy.db.auraInterruptColors[v.key].g = g
Gladdy.db.auraInterruptColors[v.key].b = b Gladdy.db.auraInterruptColors[v.key].b = b
@ -626,8 +626,8 @@ function Auras:GetAuraOptions(auraType)
width = "0.7", width = "0.7",
name = L["Check All"], name = L["Check All"],
type = "execute", type = "execute",
func = function(info) func = function()
for k,v in pairs(defaultSpells(auraType)) do for k,_ in pairs(defaultSpells(auraType)) do
Gladdy.db.auraListDefault[k].enabled = true Gladdy.db.auraListDefault[k].enabled = true
end end
end, end,
@ -637,15 +637,15 @@ function Auras:GetAuraOptions(auraType)
width = "0.7", width = "0.7",
name = L["Uncheck All"], name = L["Uncheck All"],
type = "execute", type = "execute",
func = function(info) func = function()
for k,v in pairs(defaultSpells(auraType)) do for k,_ in pairs(defaultSpells(auraType)) do
Gladdy.db.auraListDefault[k].enabled = false Gladdy.db.auraListDefault[k].enabled = false
end end
end, end,
}, },
} }
local auras = {} local auras = {}
for k,v in pairs(Gladdy:GetImportantAuras()) do for _,v in pairs(Gladdy:GetImportantAuras()) do
if v.track == auraType then if v.track == auraType then
tinsert(auras, v.spellID) tinsert(auras, v.spellID)
end end
@ -670,10 +670,10 @@ function Auras:GetAuraOptions(auraType)
type = "toggle", type = "toggle",
image = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)), image = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
width = "2", width = "2",
set = function(info, value) set = function(_, value)
Gladdy.db.auraListDefault[tostring(k)].enabled = value Gladdy.db.auraListDefault[tostring(k)].enabled = value
end, end,
get = function(info) get = function()
return Gladdy.db.auraListDefault[tostring(k)].enabled return Gladdy.db.auraListDefault[tostring(k)].enabled
end end
}, },
@ -685,10 +685,10 @@ function Auras:GetAuraOptions(auraType)
max = 50, max = 50,
width = "2", width = "2",
step = 1, step = 1,
get = function(info) get = function()
return Gladdy.db.auraListDefault[tostring(k)].priority return Gladdy.db.auraListDefault[tostring(k)].priority
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.auraListDefault[tostring(k)].priority = value Gladdy.db.auraListDefault[tostring(k)].priority = value
end, end,
width = "full", width = "full",
@ -706,8 +706,8 @@ function Auras:GetInterruptOptions()
width = "0.7", width = "0.7",
name = L["Check All"], name = L["Check All"],
type = "execute", type = "execute",
func = function(info) func = function()
for k,v in pairs(defaultInterrupts()) do for k,_ in pairs(defaultInterrupts()) do
Gladdy.db.auraListInterrupts[k].enabled = true Gladdy.db.auraListInterrupts[k].enabled = true
end end
end, end,
@ -717,15 +717,15 @@ function Auras:GetInterruptOptions()
width = "0.7", width = "0.7",
name = L["Uncheck All"], name = L["Uncheck All"],
type = "execute", type = "execute",
func = function(info) func = function()
for k,v in pairs(defaultInterrupts()) do for k,_ in pairs(defaultInterrupts()) do
Gladdy.db.auraListInterrupts[k].enabled = false Gladdy.db.auraListInterrupts[k].enabled = false
end end
end, end,
}, },
} }
local auras = {} local auras = {}
for k,v in pairs(Gladdy:GetInterrupts()) do for _,v in pairs(Gladdy:GetInterrupts()) do
tinsert(auras, v.spellID) tinsert(auras, v.spellID)
end end
tbl_sort(auras, function(a, b) return GetSpellInfo(a) < GetSpellInfo(b) end) tbl_sort(auras, function(a, b) return GetSpellInfo(a) < GetSpellInfo(b) end)
@ -745,10 +745,10 @@ function Auras:GetInterruptOptions()
type = "toggle", type = "toggle",
image = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)), image = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
width = "2", width = "2",
set = function(info, value) set = function(_, value)
Gladdy.db.auraListInterrupts[tostring(k)].enabled = value Gladdy.db.auraListInterrupts[tostring(k)].enabled = value
end, end,
get = function(info) get = function()
return Gladdy.db.auraListInterrupts[tostring(k)].enabled return Gladdy.db.auraListInterrupts[tostring(k)].enabled
end end
}, },
@ -760,10 +760,10 @@ function Auras:GetInterruptOptions()
max = 50, max = 50,
width = "2", width = "2",
step = 1, step = 1,
get = function(info) get = function()
return Gladdy.db.auraListInterrupts[tostring(k)].priority return Gladdy.db.auraListInterrupts[tostring(k)].priority
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.auraListInterrupts[tostring(k)].priority = value Gladdy.db.auraListInterrupts[tostring(k)].priority = value
end, end,
width = "full", width = "full",

View File

@ -178,8 +178,8 @@ function Classicon:GetOptions()
name = L["Show Spec Icon"], name = L["Show Spec Icon"],
desc = L["Shows Spec Icon once spec is detected"], desc = L["Shows Spec Icon once spec is detected"],
order = 3, order = 3,
get = function(info) return Gladdy.db.classIconSpecIcon end, get = function() return Gladdy.db.classIconSpecIcon end,
set = function(info, value) set = function(_, value)
Gladdy.db.classIconSpecIcon = value Gladdy.db.classIconSpecIcon = value
if Gladdy.curBracket and Gladdy.curBracket > 0 then if Gladdy.curBracket and Gladdy.curBracket > 0 then
for i=1,Gladdy.curBracket do for i=1,Gladdy.curBracket do

View File

@ -70,7 +70,7 @@ function Clicks:UpdateFrame(unit)
end end
function Clicks:UpdateFrameOnce() function Clicks:UpdateFrameOnce()
for k, v in pairs(Gladdy.buttons) do for _, v in pairs(Gladdy.buttons) do
local left = GetBindingKey(("GLADDYBUTTON%d_LEFT"):format(v.id)) local left = GetBindingKey(("GLADDYBUTTON%d_LEFT"):format(v.id))
local right = GetBindingKey(("GLADDYBUTTON%d_RIGHT"):format(v.id)) local right = GetBindingKey(("GLADDYBUTTON%d_RIGHT"):format(v.id))
local middle = GetBindingKey(("GLADDYBUTTON%d_MIDDLE"):format(v.id)) local middle = GetBindingKey(("GLADDYBUTTON%d_MIDDLE"):format(v.id))
@ -107,7 +107,7 @@ function Clicks:SetupAttributes(unit)
return return
end end
for k, v in pairs(Gladdy.db.attributes) do for _, v in pairs(Gladdy.db.attributes) do
self:SetupAttribute(button, v.button, v.modifier, v.action, v.spell) self:SetupAttribute(button, v.button, v.modifier, v.action, v.spell)
end end
end end

View File

@ -36,9 +36,9 @@ local L = Gladdy.L
local function getDefaultCooldown() local function getDefaultCooldown()
local cooldowns = {} local cooldowns = {}
for class, t in pairs(Gladdy:GetCooldownList()) do for _,spellTable in pairs(Gladdy:GetCooldownList()) do
for spellId, v in pairs(t) do for spellId,_ in pairs(spellTable) do
local spellName, _, texture = GetSpellInfo(spellId) local spellName = GetSpellInfo(spellId)
if spellName then if spellName then
cooldowns[tostring(spellId)] = true cooldowns[tostring(spellId)] = true
else else
@ -72,14 +72,14 @@ local Cooldowns = Gladdy:NewModule("Cooldowns", nil, {
function Cooldowns:Initialize() function Cooldowns:Initialize()
self.cooldownSpellIds = {} self.cooldownSpellIds = {}
self.spellTextures = {} self.spellTextures = {}
for class, t in pairs(Gladdy:GetCooldownList()) do for _,spellTable in pairs(Gladdy:GetCooldownList()) do
for k, v in pairs(t) do for spellId,_ in pairs(spellTable) do
local spellName, _, texture = GetSpellInfo(k) local spellName, _, texture = GetSpellInfo(spellId)
if spellName then if spellName then
self.cooldownSpellIds[spellName] = k self.cooldownSpellIds[spellName] = spellId
self.spellTextures[k] = texture self.spellTextures[spellId] = texture
else else
Gladdy:Print("spellid does not exist " .. k) Gladdy:Print("spellid does not exist " .. spellId)
end end
end end
end end
@ -261,13 +261,12 @@ function Cooldowns:UpdateTestCooldowns(unit)
button.test = true button.test = true
-- use class spells -- use class spells
for k, v in pairs(Gladdy:GetCooldownList()[button.class]) do for spellId,_ in pairs(Gladdy:GetCooldownList()[button.class]) do
--k is spellId self:CooldownUsed(unit, button.class, spellId)
self:CooldownUsed(unit, button.class, k, nil)
end end
-- use race spells -- use race spells
for k, v in pairs(Gladdy:GetCooldownList()[button.race]) do for spellId,_ in pairs(Gladdy:GetCooldownList()[button.race]) do
self:CooldownUsed(unit, button.race, k, nil) self:CooldownUsed(unit, button.race, spellId)
end end
end end
end end
@ -353,7 +352,6 @@ function Cooldowns:DetectSpec(unit, spec)
]] ]]
if (Gladdy.db.cooldown) then if (Gladdy.db.cooldown) then
local class = Gladdy.buttons[unit].class local class = Gladdy.buttons[unit].class
local race = Gladdy.buttons[unit].race
for k, v in pairs(Gladdy:GetCooldownList()[class]) do for k, v in pairs(Gladdy:GetCooldownList()[class]) do
if Gladdy.db.cooldownCooldowns[tostring(k)] then if Gladdy.db.cooldownCooldowns[tostring(k)] then
--if (self.db.cooldownList[k] ~= false and self.db.cooldownList[class] ~= false) then --if (self.db.cooldownList[k] ~= false and self.db.cooldownList[class] ~= false) then
@ -484,7 +482,7 @@ function Cooldowns:UpdateCooldowns(button)
end end
end end
function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName) function Cooldowns:CooldownUsed(unit, unitClass, spellId)
local button = Gladdy.buttons[unit] local button = Gladdy.buttons[unit]
if not button then if not button then
return return
@ -502,8 +500,8 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
-- check if we need to reset other cooldowns because of this spell -- check if we need to reset other cooldowns because of this spell
if (cooldown.resetCD ~= nil) then if (cooldown.resetCD ~= nil) then
for k, v in pairs(cooldown.resetCD) do for spellID,_ in pairs(cooldown.resetCD) do
self:CooldownReady(button, k, false) self:CooldownReady(button, spellID, false)
end end
end end
@ -519,9 +517,9 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
if (cooldown.sharedCD ~= nil) then if (cooldown.sharedCD ~= nil) then
local sharedCD = cooldown.sharedCD.cd and cooldown.sharedCD.cd or cd local sharedCD = cooldown.sharedCD.cd and cooldown.sharedCD.cd or cd
for k, v in pairs(cooldown.sharedCD) do for spellID,_ in pairs(cooldown.sharedCD) do
if (k ~= "cd") then if (spellID ~= "cd") then
self:CooldownStart(button, k, sharedCD) self:CooldownStart(button, spellID, sharedCD)
end end
end end
end end
@ -816,10 +814,10 @@ function Cooldowns:GetCooldownOptions()
order = o, order = o,
width = "full", width = "full",
image = select(3, GetSpellInfo(spellId)), image = select(3, GetSpellInfo(spellId)),
get = function(info) get = function()
return Gladdy.db.cooldownCooldowns[tostring(spellId)] return Gladdy.db.cooldownCooldowns[tostring(spellId)]
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.cooldownCooldowns[tostring(spellId)] = value Gladdy.db.cooldownCooldowns[tostring(spellId)] = value
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end end
@ -845,10 +843,10 @@ function Cooldowns:GetCooldownOptions()
order = o, order = o,
width = "full", width = "full",
image = select(3, GetSpellInfo(spellId)), image = select(3, GetSpellInfo(spellId)),
get = function(info) get = function()
return Gladdy.db.cooldownCooldowns[tostring(spellId)] return Gladdy.db.cooldownCooldowns[tostring(spellId)]
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.cooldownCooldowns[tostring(spellId)] = value Gladdy.db.cooldownCooldowns[tostring(spellId)] = value
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end end
@ -870,13 +868,13 @@ function Gladdy:UpdateTestCooldowns(i)
Cooldowns:DetectSpec(unit, button.testSpec) Cooldowns:DetectSpec(unit, button.testSpec)
-- use class spells -- use class spells
for k, v in pairs(Gladdy:GetCooldownList()[button.class]) do for spellID,_ in pairs(Gladdy:GetCooldownList()[button.class]) do
--k is spellId --k is spellId
Cooldowns:CooldownUsed(unit, button.class, k, nil) Cooldowns:CooldownUsed(unit, button.class, spellID)
end end
-- use race spells -- use race spells
for k, v in pairs(Gladdy:GetCooldownList()[button.race]) do for spellID,_ in pairs(Gladdy:GetCooldownList()[button.race]) do
Cooldowns:CooldownUsed(unit, button.race, k, nil) Cooldowns:CooldownUsed(unit, button.race, spellID)
end end
end end
end end

View File

@ -15,7 +15,7 @@ local function defaultCategories()
tinsert(indexList, {spellID = k, category = v}) tinsert(indexList, {spellID = k, category = v})
end end
tbl_sort(indexList, function(a, b) return a.spellID < b.spellID end) tbl_sort(indexList, function(a, b) return a.spellID < b.spellID end)
for i,v in ipairs(indexList) do for _,v in ipairs(indexList) do
if not categories[v.category] then if not categories[v.category] then
categories[v.category] = { categories[v.category] = {
enabled = true, enabled = true,
@ -596,7 +596,7 @@ end
function Diminishings:CategoryOptions() function Diminishings:CategoryOptions()
local categories = {} local categories = {}
local indexList = {} local indexList = {}
for k,v in pairs(DRData:GetCategories()) do for k,_ in pairs(DRData:GetCategories()) do
tinsert(indexList, k) tinsert(indexList, k)
end end
tbl_sort(indexList) tbl_sort(indexList)
@ -611,10 +611,10 @@ function Diminishings:CategoryOptions()
type = "toggle", type = "toggle",
name = L["Enabled"], name = L["Enabled"],
order = 1, order = 1,
get = function(info) get = function()
return Gladdy.db.drCategories[k].enabled return Gladdy.db.drCategories[k].enabled
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.drCategories[k].enabled = value Gladdy.db.drCategories[k].enabled = value
end, end,
}, },
@ -622,10 +622,10 @@ function Diminishings:CategoryOptions()
type = "toggle", type = "toggle",
name = L["Force Icon"], name = L["Force Icon"],
order = 2, order = 2,
get = function(info) get = function()
return Gladdy.db.drCategories[k].forceIcon return Gladdy.db.drCategories[k].forceIcon
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.drCategories[k].forceIcon = value Gladdy.db.drCategories[k].forceIcon = value
end, end,
}, },
@ -635,10 +635,10 @@ function Diminishings:CategoryOptions()
desc = L["Icon of the DR"], desc = L["Icon of the DR"],
order = 4, order = 4,
values = Diminishings:GetDRIcons(k), values = Diminishings:GetDRIcons(k),
get = function(info) get = function()
return Gladdy.db.drCategories[k].icon return Gladdy.db.drCategories[k].icon
end, end,
set = function(info, value) set = function(_, value)
Gladdy.db.drCategories[k].icon = value Gladdy.db.drCategories[k].icon = value
Gladdy.options.args.Diminishings.args.categories.args[k].icon = value Gladdy.options.args.Diminishings.args.categories.args[k].icon = value
end, end,

View File

@ -167,8 +167,6 @@ function Healthbar:UpdateFrame(unit)
return return
end end
local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight
healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture)) healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture))
healthBar.bg:SetVertexColor(Gladdy.db.healthBarBgColor.r, Gladdy.db.healthBarBgColor.g, Gladdy.db.healthBarBgColor.b, Gladdy.db.healthBarBgColor.a) healthBar.bg:SetVertexColor(Gladdy.db.healthBarBgColor.r, Gladdy.db.healthBarBgColor.g, Gladdy.db.healthBarBgColor.b, Gladdy.db.healthBarBgColor.a)

View File

@ -35,12 +35,12 @@ function Pets:Initialize()
end end
function Pets:JOINED_ARENA() function Pets:JOINED_ARENA()
for k,v in pairs(self.frames) do for _,v in pairs(self.frames) do
v.healthBar:SetAlpha(0) v.healthBar:SetAlpha(0)
end end
if Gladdy.db.petEnabled then if Gladdy.db.petEnabled then
self:RegisterEvent("UNIT_PET") self:RegisterEvent("UNIT_PET")
self:SetScript("OnEvent", function(self, event, unitId) self:SetScript("OnEvent", function(_, event, unitId)
if event == "UNIT_PET" then if event == "UNIT_PET" then
local unit = Gladdy.guids[UnitGUID(unitId)] local unit = Gladdy.guids[UnitGUID(unitId)]
if unit then if unit then

View File

@ -1,10 +1,8 @@
local ceil, floor, string_format, tonumber = ceil, floor, string.format, tonumber local ceil = ceil
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetTime = GetTime local GetTime = GetTime
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local Racial = Gladdy:NewModule("Racial", nil, { local Racial = Gladdy:NewModule("Racial", nil, {
@ -123,7 +121,6 @@ function Racial:UpdateFrame(unit)
racial.texture.overlay:SetVertexColor(Gladdy.db.racialBorderColor.r, Gladdy.db.racialBorderColor.g, Gladdy.db.racialBorderColor.b, Gladdy.db.racialBorderColor.a) racial.texture.overlay:SetVertexColor(Gladdy.db.racialBorderColor.r, Gladdy.db.racialBorderColor.g, Gladdy.db.racialBorderColor.b, Gladdy.db.racialBorderColor.a)
racial:ClearAllPoints() racial:ClearAllPoints()
local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor] local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor]
if (Gladdy.db.racialPos == "RIGHT") then if (Gladdy.db.racialPos == "RIGHT") then
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset) racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)

View File

@ -1,4 +1,4 @@
local floor, str_len, tostring, str_sub, str_find, pairs = math.floor, string.len, tostring, string.sub, string.find, pairs local floor, str_find, pairs = math.floor, string.find, pairs
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")

View File

@ -1,4 +1,4 @@
local ceil, floor, string_format, tonumber = ceil, floor, string.format, tonumber local ceil = ceil
local C_PvP = C_PvP local C_PvP = C_PvP
local CreateFrame = CreateFrame local CreateFrame = CreateFrame

View File

@ -1,11 +1,11 @@
local str_match, tonumber, tostring = string.match, tonumber, tostring local tonumber, tostring = tonumber, tostring
local UnitName = UnitName local UnitName = UnitName
local IsInGroup, IsInRaid = IsInGroup, IsInRaid local IsInGroup, IsInRaid = IsInGroup, IsInRaid
local LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE local LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L
local VersionCheck = Gladdy:NewModule("VersionCheck", 1, { local VersionCheck = Gladdy:NewModule("VersionCheck", 1, {
}) })
LibStub("AceComm-3.0"):Embed(VersionCheck) LibStub("AceComm-3.0"):Embed(VersionCheck)