2022-03-25 15:59:43 +01:00
|
|
|
local ceil, str_gsub = ceil, string.gsub
|
2021-05-18 16:37:22 +02:00
|
|
|
|
|
|
|
local CreateFrame = CreateFrame
|
|
|
|
local GetTime = GetTime
|
|
|
|
|
|
|
|
local Gladdy = LibStub("Gladdy")
|
|
|
|
local L = Gladdy.L
|
2022-01-11 00:29:17 +01:00
|
|
|
local Racial = Gladdy:NewModule("Racial", 79, {
|
2021-05-18 16:37:22 +02:00
|
|
|
racialFont = "DorisPP",
|
|
|
|
racialFontScale = 1,
|
|
|
|
racialEnabled = true,
|
|
|
|
racialSize = 60 + 20 + 1,
|
|
|
|
racialWidthFactor = 0.9,
|
2022-08-01 19:50:42 +02:00
|
|
|
racialIconZoomed = false,
|
2021-05-18 16:37:22 +02:00
|
|
|
racialXOffset = 0,
|
|
|
|
racialYOffset = 0,
|
|
|
|
racialBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
|
|
|
|
racialBorderColor = { r = 0, g = 0, b = 0, a = 1 },
|
|
|
|
racialDisableCircle = false,
|
|
|
|
racialCooldownAlpha = 1,
|
2021-09-18 15:00:34 +02:00
|
|
|
racialCooldownNumberAlpha = 1,
|
2022-01-12 20:21:53 +01:00
|
|
|
racialFrameStrata = "MEDIUM",
|
|
|
|
racialFrameLevel = 5,
|
2022-03-25 15:59:43 +01:00
|
|
|
racialGroup = false,
|
|
|
|
racialGroupDirection = "DOWN",
|
2021-05-18 16:37:22 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
function Racial:Initialize()
|
|
|
|
self.frames = {}
|
|
|
|
|
2022-02-15 22:59:21 +01:00
|
|
|
if Gladdy.db.racialEnabled then
|
|
|
|
self:RegisterMessage("JOINED_ARENA")
|
|
|
|
self:RegisterMessage("ENEMY_SPOTTED")
|
|
|
|
self:RegisterMessage("RACIAL_USED")
|
2022-07-29 07:41:55 +02:00
|
|
|
if Gladdy.expansion == "Wrath" then
|
|
|
|
self:RegisterMessage("TRINKET_USED")
|
|
|
|
end
|
2022-02-15 22:59:21 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:UpdateFrameOnce()
|
|
|
|
if Gladdy.db.racialEnabled then
|
|
|
|
self:RegisterMessage("JOINED_ARENA")
|
|
|
|
self:RegisterMessage("ENEMY_SPOTTED")
|
|
|
|
self:RegisterMessage("RACIAL_USED")
|
2022-07-29 07:41:55 +02:00
|
|
|
if Gladdy.expansion == "Wrath" then
|
|
|
|
self:RegisterMessage("TRINKET_USED")
|
|
|
|
end
|
2022-02-15 22:59:21 +01:00
|
|
|
else
|
|
|
|
self:UnregisterAllMessages()
|
|
|
|
end
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local function iconTimer(self,elapsed)
|
|
|
|
if (self.active) then
|
|
|
|
if (self.timeLeft <= 0) then
|
|
|
|
self.active = false
|
|
|
|
self.cooldown:Clear()
|
|
|
|
else
|
|
|
|
self.timeLeft = self.timeLeft - elapsed
|
|
|
|
end
|
|
|
|
|
|
|
|
local timeLeft = ceil(self.timeLeft)
|
|
|
|
|
|
|
|
if timeLeft >= 60 then
|
2021-09-18 15:00:34 +02:00
|
|
|
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
|
2021-09-14 23:55:17 +02:00
|
|
|
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE")
|
2021-07-26 11:27:32 +02:00
|
|
|
elseif timeLeft < 60 and timeLeft >= 30 then
|
2021-09-18 15:00:34 +02:00
|
|
|
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
|
2021-09-14 23:55:17 +02:00
|
|
|
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
2021-07-26 11:27:32 +02:00
|
|
|
elseif timeLeft < 30 and timeLeft >= 11 then
|
2021-09-18 15:00:34 +02:00
|
|
|
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
|
2021-09-14 23:55:17 +02:00
|
|
|
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
2021-07-26 11:27:32 +02:00
|
|
|
elseif timeLeft < 10 and timeLeft >= 5 then
|
2021-09-18 15:00:34 +02:00
|
|
|
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
|
2021-09-14 23:55:17 +02:00
|
|
|
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
2021-05-18 16:37:22 +02:00
|
|
|
elseif timeLeft < 5 and timeLeft > 0 then
|
2021-09-18 15:00:34 +02:00
|
|
|
self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.racialCooldownNumberAlpha)
|
2021-09-14 23:55:17 +02:00
|
|
|
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
2021-07-26 11:27:32 +02:00
|
|
|
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:CreateFrame(unit)
|
|
|
|
local racial = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit])
|
2021-05-19 19:30:32 +02:00
|
|
|
racial:EnableMouse(false)
|
2022-01-12 20:21:53 +01:00
|
|
|
racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
|
|
|
racial:SetFrameLevel(Gladdy.db.racialFrameLevel)
|
|
|
|
|
2021-05-18 16:37:22 +02:00
|
|
|
racial.texture = racial:CreateTexture(nil, "BACKGROUND")
|
|
|
|
racial.texture:SetAllPoints(racial)
|
2021-05-19 14:57:29 +02:00
|
|
|
racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
2022-08-01 19:50:42 +02:00
|
|
|
racial.texture.masked = true
|
2021-05-18 16:37:22 +02:00
|
|
|
--racial.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
|
|
|
|
|
|
|
|
racial.cooldown = CreateFrame("Cooldown", nil, racial, "CooldownFrameTemplate")
|
|
|
|
racial.cooldown.noCooldownCount = true --Gladdy.db.racialDisableOmniCC
|
|
|
|
racial.cooldown:SetHideCountdownNumbers(true)
|
2022-01-12 22:15:39 +01:00
|
|
|
racial.cooldown:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
|
|
|
racial.cooldown:SetFrameLevel(Gladdy.db.racialFrameLevel + 1)
|
2021-05-18 16:37:22 +02:00
|
|
|
|
|
|
|
racial.cooldownFrame = CreateFrame("Frame", nil, racial)
|
|
|
|
racial.cooldownFrame:ClearAllPoints()
|
|
|
|
racial.cooldownFrame:SetPoint("TOPLEFT", racial, "TOPLEFT")
|
|
|
|
racial.cooldownFrame:SetPoint("BOTTOMRIGHT", racial, "BOTTOMRIGHT")
|
2022-01-12 20:21:53 +01:00
|
|
|
racial.cooldownFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
2022-01-12 22:15:39 +01:00
|
|
|
racial.cooldownFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 2)
|
2021-05-18 16:37:22 +02:00
|
|
|
|
|
|
|
racial.cooldownFont = racial.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
2021-09-14 23:55:17 +02:00
|
|
|
racial.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), 20, "OUTLINE")
|
2021-05-18 16:37:22 +02:00
|
|
|
--trinket.cooldownFont:SetAllPoints(trinket.cooldown)
|
|
|
|
racial.cooldownFont:SetJustifyH("CENTER")
|
|
|
|
racial.cooldownFont:SetPoint("CENTER")
|
|
|
|
|
|
|
|
racial.borderFrame = CreateFrame("Frame", nil, racial)
|
|
|
|
racial.borderFrame:SetAllPoints(racial)
|
2022-01-12 20:21:53 +01:00
|
|
|
racial.borderFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
2022-01-12 22:15:39 +01:00
|
|
|
racial.borderFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 3)
|
2022-01-12 20:21:53 +01:00
|
|
|
|
2021-05-18 16:37:22 +02:00
|
|
|
racial.texture.overlay = racial.borderFrame:CreateTexture(nil, "OVERLAY")
|
|
|
|
racial.texture.overlay:SetAllPoints(racial)
|
|
|
|
racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
|
|
|
|
|
|
|
|
racial:SetScript("OnUpdate", iconTimer)
|
|
|
|
|
|
|
|
Gladdy.buttons[unit].racial = racial
|
|
|
|
self.frames[unit] = racial
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:UpdateFrame(unit)
|
|
|
|
local racial = self.frames[unit]
|
|
|
|
if (not racial) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2022-08-01 19:50:42 +02:00
|
|
|
local testAgain = false
|
2021-05-18 16:37:22 +02:00
|
|
|
local width, height = Gladdy.db.racialSize * Gladdy.db.racialWidthFactor, Gladdy.db.racialSize
|
|
|
|
|
2022-01-12 20:21:53 +01:00
|
|
|
racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
|
|
|
racial:SetFrameLevel(Gladdy.db.racialFrameLevel)
|
2022-01-12 22:15:39 +01:00
|
|
|
racial.cooldown:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
|
|
|
racial.cooldown:SetFrameLevel(Gladdy.db.racialFrameLevel + 1)
|
2022-01-12 20:21:53 +01:00
|
|
|
racial.cooldownFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
2022-01-12 22:15:39 +01:00
|
|
|
racial.cooldownFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 2)
|
2022-01-12 20:21:53 +01:00
|
|
|
racial.borderFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
2022-01-12 22:15:39 +01:00
|
|
|
racial.borderFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 3)
|
2022-01-12 20:21:53 +01:00
|
|
|
|
2021-05-18 16:37:22 +02:00
|
|
|
racial:SetWidth(width)
|
|
|
|
racial:SetHeight(height)
|
2022-08-01 19:50:42 +02:00
|
|
|
if Gladdy.db.racialIconZoomed then
|
|
|
|
racial.cooldown:SetWidth(width)
|
|
|
|
racial.cooldown:SetHeight(height)
|
|
|
|
else
|
|
|
|
racial.cooldown:SetWidth(width - width/16)
|
|
|
|
racial.cooldown:SetHeight(height - height/16)
|
|
|
|
end
|
2021-05-18 16:37:22 +02:00
|
|
|
racial.cooldown:ClearAllPoints()
|
|
|
|
racial.cooldown:SetPoint("CENTER", racial, "CENTER")
|
|
|
|
racial.cooldown.noCooldownCount = true -- Gladdy.db.racialDisableOmniCC
|
|
|
|
racial.cooldown:SetAlpha(Gladdy.db.racialCooldownAlpha)
|
|
|
|
|
|
|
|
racial.texture:ClearAllPoints()
|
|
|
|
racial.texture:SetAllPoints(racial)
|
|
|
|
|
|
|
|
racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
|
2022-01-12 23:07:23 +01:00
|
|
|
racial.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.racialBorderColor))
|
2021-05-18 16:37:22 +02:00
|
|
|
|
2022-08-01 19:50:42 +02:00
|
|
|
if Gladdy.db.racialIconZoomed then
|
|
|
|
if racial.texture.masked then
|
2023-01-18 16:45:28 +01:00
|
|
|
racial.texture:SetMask("")
|
2022-08-01 19:50:42 +02:00
|
|
|
racial.texture:SetTexCoord(0.1,0.9,0.1,0.9)
|
|
|
|
racial.texture.masked = nil
|
|
|
|
end
|
|
|
|
else
|
|
|
|
if not racial.texture.masked then
|
2023-01-18 16:45:28 +01:00
|
|
|
racial.texture:SetMask("")
|
2022-08-01 19:50:42 +02:00
|
|
|
racial.texture:SetTexCoord(0,1,0,1)
|
|
|
|
racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
|
|
|
racial.texture.masked = true
|
|
|
|
if Gladdy.frame.testing then
|
|
|
|
testAgain = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-01-11 00:29:17 +01:00
|
|
|
Gladdy:SetPosition(racial, unit, "racialXOffset", "racialYOffset", Racial:LegacySetPosition(racial, unit), Racial)
|
|
|
|
|
2022-03-25 15:59:43 +01:00
|
|
|
if (Gladdy.db.racialGroup) then
|
|
|
|
if (unit ~= "arena1") then
|
|
|
|
local previousUnit = "arena" .. str_gsub(unit, "arena", "") - 1
|
|
|
|
self.frames[unit]:ClearAllPoints()
|
|
|
|
if Gladdy.db.racialGroupDirection == "RIGHT" then
|
|
|
|
self.frames[unit]:SetPoint("LEFT", self.frames[previousUnit], "RIGHT", 0, 0)
|
|
|
|
elseif Gladdy.db.racialGroupDirection == "LEFT" then
|
|
|
|
self.frames[unit]:SetPoint("RIGHT", self.frames[previousUnit], "LEFT", 0, 0)
|
|
|
|
elseif Gladdy.db.racialGroupDirection == "UP" then
|
|
|
|
self.frames[unit]:SetPoint("BOTTOM", self.frames[previousUnit], "TOP", 0, 0)
|
|
|
|
elseif Gladdy.db.racialGroupDirection == "DOWN" then
|
|
|
|
self.frames[unit]:SetPoint("TOP", self.frames[previousUnit], "BOTTOM", 0, 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-01-11 00:29:17 +01:00
|
|
|
if (unit == "arena1") then
|
|
|
|
Gladdy:CreateMover(racial,"racialXOffset", "racialYOffset", L["Racial"],
|
|
|
|
{"TOPLEFT", "TOPLEFT"},
|
|
|
|
Gladdy.db.racialSize * Gladdy.db.racialWidthFactor,
|
|
|
|
Gladdy.db.racialSize,
|
2022-01-13 23:11:33 +01:00
|
|
|
0, 0, "racialEnabled")
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if (Gladdy.db.racialEnabled == false) then
|
|
|
|
racial:Hide()
|
|
|
|
else
|
|
|
|
racial:Show()
|
2022-08-01 19:50:42 +02:00
|
|
|
if testAgain then
|
|
|
|
Racial:ResetUnit(unit)
|
|
|
|
Racial:Test(unit)
|
|
|
|
end
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:JOINED_ARENA()
|
|
|
|
self:SetScript("OnEvent", function(self, event, ...)
|
|
|
|
if self[event] then
|
|
|
|
self[event](self, ...)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
2022-01-14 03:06:02 +01:00
|
|
|
function Racial:RACIAL_USED(unit, expirationTime, spellName)
|
2021-05-18 16:37:22 +02:00
|
|
|
local racial = self.frames[unit]
|
|
|
|
local button = Gladdy.buttons[unit]
|
2022-07-31 18:17:49 +02:00
|
|
|
if (not racial or not button or not button.race or not Gladdy.db.racialEnabled) then
|
2021-05-18 16:37:22 +02:00
|
|
|
return
|
|
|
|
end
|
2022-01-14 03:06:02 +01:00
|
|
|
if expirationTime and Gladdy:Racials()[button.race].spellName ~= spellName then
|
|
|
|
return
|
|
|
|
end
|
2022-03-03 23:40:23 +01:00
|
|
|
local startTime = expirationTime or GetTime()
|
2022-01-14 03:06:02 +01:00
|
|
|
Racial:Used(unit, startTime, Gladdy:Racials()[button.race].duration)
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
|
|
|
|
2022-07-29 07:41:55 +02:00
|
|
|
function Racial:TRINKET_USED(unit) -- Wrath only
|
|
|
|
local racial = self.frames[unit]
|
|
|
|
local button = Gladdy.buttons[unit]
|
|
|
|
if (not racial or not button or not button.race) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if button.race == "Scourge" then
|
|
|
|
if racial.active and racial.timeLeft >= 45 then
|
|
|
|
-- do nothing
|
|
|
|
else
|
|
|
|
self:Used(unit, GetTime(), 45)
|
|
|
|
end
|
|
|
|
elseif button.race == "Human" then
|
|
|
|
self:Used(unit, GetTime(), 120)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-05-18 16:37:22 +02:00
|
|
|
function Racial:Used(unit, startTime, duration)
|
|
|
|
local racial = self.frames[unit]
|
|
|
|
if (not racial) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if not racial.active then
|
|
|
|
racial.timeLeft = duration
|
2022-01-12 22:15:39 +01:00
|
|
|
if not Gladdy.db.racialDisableCircle then racial.cooldown:SetCooldown(startTime, duration) end
|
2021-05-18 16:37:22 +02:00
|
|
|
racial.active = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:ENEMY_SPOTTED(unit)
|
|
|
|
local racial = self.frames[unit]
|
2021-08-19 18:57:27 +02:00
|
|
|
if (not racial or not Gladdy.buttons[unit].race) then
|
2021-05-18 16:37:22 +02:00
|
|
|
return
|
|
|
|
end
|
|
|
|
racial.texture:SetTexture(Gladdy:Racials()[Gladdy.buttons[unit].race].texture)
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:ResetUnit(unit)
|
|
|
|
local racial = self.frames[unit]
|
|
|
|
if (not racial) then
|
|
|
|
return
|
|
|
|
end
|
2021-05-18 18:31:03 +02:00
|
|
|
racial.texture:SetTexture(nil)
|
2021-05-18 16:37:22 +02:00
|
|
|
racial.timeLeft = nil
|
|
|
|
racial.active = false
|
|
|
|
racial.cooldown:Clear()
|
|
|
|
racial.cooldownFont:SetText("")
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:Test(unit)
|
|
|
|
Racial:ENEMY_SPOTTED(unit)
|
2022-07-29 07:41:55 +02:00
|
|
|
if (unit == "arena2" or unit == "arena3") then
|
|
|
|
Gladdy:SendMessage("RACIAL_USED", unit)
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Racial:GetOptions()
|
|
|
|
return {
|
|
|
|
headerTrinket = {
|
|
|
|
type = "header",
|
|
|
|
name = L["Racial"],
|
|
|
|
order = 2,
|
|
|
|
},
|
|
|
|
racialEnabled = Gladdy:option({
|
|
|
|
type = "toggle",
|
|
|
|
name = L["Enabled"],
|
|
|
|
desc = L["Enable racial icon"],
|
|
|
|
order = 3,
|
|
|
|
}),
|
2022-03-25 15:59:43 +01:00
|
|
|
racialGroup = Gladdy:option({
|
|
|
|
type = "toggle",
|
|
|
|
name = L["Group"] .. " " .. L["Racial"],
|
|
|
|
order = 4,
|
|
|
|
disabled = function() return not Gladdy.db.racialEnabled end,
|
|
|
|
}),
|
|
|
|
racialGroupDirection = Gladdy:option({
|
|
|
|
type = "select",
|
|
|
|
name = L["Group direction"],
|
|
|
|
order = 5,
|
|
|
|
values = {
|
|
|
|
["RIGHT"] = L["Right"],
|
|
|
|
["LEFT"] = L["Left"],
|
|
|
|
["UP"] = L["Up"],
|
|
|
|
["DOWN"] = L["Down"],
|
|
|
|
},
|
|
|
|
disabled = function()
|
|
|
|
return not Gladdy.db.racialGroup or not Gladdy.db.racialEnabled
|
|
|
|
end,
|
|
|
|
}),
|
2021-05-18 16:37:22 +02:00
|
|
|
group = {
|
|
|
|
type = "group",
|
|
|
|
childGroups = "tree",
|
2021-05-24 12:41:21 +02:00
|
|
|
name = L["Frame"],
|
2022-03-25 15:59:43 +01:00
|
|
|
order = 6,
|
2022-02-15 22:59:21 +01:00
|
|
|
disabled = function() return not Gladdy.db.racialEnabled end,
|
2021-05-18 16:37:22 +02:00
|
|
|
args = {
|
|
|
|
general = {
|
|
|
|
type = "group",
|
2022-08-01 19:50:42 +02:00
|
|
|
name = L["Icon"],
|
2021-05-18 16:37:22 +02:00
|
|
|
order = 1,
|
|
|
|
args = {
|
|
|
|
header = {
|
|
|
|
type = "header",
|
2022-08-01 19:50:42 +02:00
|
|
|
name = L["Icon"],
|
2021-05-22 13:41:31 +02:00
|
|
|
order = 1,
|
2021-05-18 16:37:22 +02:00
|
|
|
},
|
2022-08-01 19:50:42 +02:00
|
|
|
racialIconZoomed = Gladdy:option({
|
|
|
|
type = "toggle",
|
|
|
|
name = L["Zoomed Icon"],
|
|
|
|
desc = L["Zoomes the icon to remove borders"],
|
|
|
|
order = 2,
|
|
|
|
width = "full",
|
|
|
|
}),
|
2021-05-18 16:37:22 +02:00
|
|
|
racialSize = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Icon size"],
|
|
|
|
min = 5,
|
|
|
|
max = 100,
|
|
|
|
step = 1,
|
2022-08-01 19:50:42 +02:00
|
|
|
order = 3,
|
2021-06-15 09:06:50 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
|
|
|
racialWidthFactor = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Icon width factor"],
|
|
|
|
min = 0.5,
|
|
|
|
max = 2,
|
|
|
|
step = 0.05,
|
2022-08-01 19:50:42 +02:00
|
|
|
order = 4,
|
2021-06-15 09:06:50 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cooldown = {
|
|
|
|
type = "group",
|
|
|
|
name = L["Cooldown"],
|
|
|
|
order = 2,
|
|
|
|
args = {
|
|
|
|
header = {
|
|
|
|
type = "header",
|
|
|
|
name = L["Cooldown"],
|
|
|
|
order = 4,
|
|
|
|
},
|
|
|
|
racialDisableCircle = Gladdy:option({
|
|
|
|
type = "toggle",
|
|
|
|
name = L["No Cooldown Circle"],
|
|
|
|
order = 7,
|
2021-05-24 12:41:21 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
|
|
|
racialCooldownAlpha = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Cooldown circle alpha"],
|
|
|
|
min = 0,
|
|
|
|
max = 1,
|
|
|
|
step = 0.1,
|
|
|
|
order = 8,
|
2021-06-15 09:06:50 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
2021-09-18 15:00:34 +02:00
|
|
|
racialCooldownNumberAlpha = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Cooldown number alpha"],
|
|
|
|
min = 0,
|
|
|
|
max = 1,
|
|
|
|
step = 0.1,
|
|
|
|
order = 9,
|
|
|
|
width = "full",
|
|
|
|
}),
|
2021-05-18 16:37:22 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
font = {
|
|
|
|
type = "group",
|
|
|
|
name = L["Font"],
|
|
|
|
order = 3,
|
|
|
|
args = {
|
|
|
|
header = {
|
|
|
|
type = "header",
|
|
|
|
name = L["Font"],
|
|
|
|
order = 4,
|
|
|
|
},
|
|
|
|
racialFont = Gladdy:option({
|
|
|
|
type = "select",
|
|
|
|
name = L["Font"],
|
|
|
|
desc = L["Font of the cooldown"],
|
|
|
|
order = 11,
|
|
|
|
dialogControl = "LSM30_Font",
|
|
|
|
values = AceGUIWidgetLSMlists.font,
|
|
|
|
}),
|
|
|
|
racialFontScale = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Font scale"],
|
|
|
|
desc = L["Scale of the font"],
|
|
|
|
order = 12,
|
|
|
|
min = 0.1,
|
|
|
|
max = 2,
|
|
|
|
step = 0.1,
|
2021-06-15 09:06:50 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
position = {
|
|
|
|
type = "group",
|
|
|
|
name = L["Position"],
|
2022-01-12 20:21:53 +01:00
|
|
|
order = 5,
|
2021-05-18 16:37:22 +02:00
|
|
|
args = {
|
|
|
|
header = {
|
|
|
|
type = "header",
|
2021-05-24 12:41:21 +02:00
|
|
|
name = L["Icon position"],
|
2021-05-18 16:37:22 +02:00
|
|
|
order = 4,
|
|
|
|
},
|
|
|
|
racialXOffset = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Horizontal offset"],
|
|
|
|
order = 23,
|
|
|
|
min = -400,
|
|
|
|
max = 400,
|
|
|
|
step = 0.1,
|
2021-06-15 09:06:50 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
|
|
|
racialYOffset = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Vertical offset"],
|
|
|
|
order = 24,
|
|
|
|
min = -400,
|
|
|
|
max = 400,
|
|
|
|
step = 0.1,
|
2021-06-15 09:06:50 +02:00
|
|
|
width = "full",
|
2021-05-18 16:37:22 +02:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
border = {
|
|
|
|
type = "group",
|
|
|
|
name = L["Border"],
|
|
|
|
order = 4,
|
|
|
|
args = {
|
|
|
|
header = {
|
|
|
|
type = "header",
|
|
|
|
name = L["Border"],
|
|
|
|
order = 4,
|
|
|
|
},
|
|
|
|
racialBorderStyle = Gladdy:option({
|
|
|
|
type = "select",
|
|
|
|
name = L["Border style"],
|
|
|
|
order = 31,
|
|
|
|
values = Gladdy:GetIconStyles()
|
|
|
|
}),
|
|
|
|
racialBorderColor = Gladdy:colorOption({
|
|
|
|
type = "color",
|
|
|
|
name = L["Border color"],
|
|
|
|
desc = L["Color of the border"],
|
|
|
|
order = 32,
|
|
|
|
hasAlpha = true,
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
2022-01-12 20:21:53 +01:00
|
|
|
frameStrata = {
|
|
|
|
type = "group",
|
|
|
|
name = L["Frame Strata and Level"],
|
|
|
|
order = 6,
|
|
|
|
args = {
|
|
|
|
headerAuraLevel = {
|
|
|
|
type = "header",
|
|
|
|
name = L["Frame Strata and Level"],
|
|
|
|
order = 1,
|
|
|
|
},
|
|
|
|
racialFrameStrata = Gladdy:option({
|
|
|
|
type = "select",
|
|
|
|
name = L["Frame Strata"],
|
|
|
|
order = 2,
|
|
|
|
values = Gladdy.frameStrata,
|
|
|
|
sorting = Gladdy.frameStrataSorting,
|
|
|
|
width = "full",
|
|
|
|
}),
|
|
|
|
racialFrameLevel = Gladdy:option({
|
|
|
|
type = "range",
|
|
|
|
name = L["Frame Level"],
|
|
|
|
min = 0,
|
|
|
|
max = 500,
|
|
|
|
step = 1,
|
|
|
|
order = 3,
|
|
|
|
width = "full",
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
2021-05-18 16:37:22 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2022-01-11 00:29:17 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
-- LAGACY HANDLER
|
|
|
|
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
function Racial:LegacySetPosition(racial, unit)
|
|
|
|
if Gladdy.db.newLayout then
|
|
|
|
return Gladdy.db.newLayout
|
|
|
|
end
|
|
|
|
|
|
|
|
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
|
|
|
|
racial:ClearAllPoints()
|
|
|
|
local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor]
|
|
|
|
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)
|
|
|
|
elseif (Gladdy.db.racialPos == "LEFT") then
|
|
|
|
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, -Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
|
|
|
|
elseif (Gladdy.db.racialPos == "TOP") then
|
|
|
|
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, Gladdy.db.padding + Gladdy.db.racialYOffset)
|
|
|
|
elseif (Gladdy.db.racialPos == "BOTTOM") then
|
|
|
|
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, -Gladdy.db.padding + Gladdy.db.racialYOffset)
|
|
|
|
end
|
|
|
|
return Gladdy.db.newLayout
|
2021-05-18 16:37:22 +02:00
|
|
|
end
|