Merge branch 'release/v1.20-Release' into main

This commit is contained in:
Sumsebrum 2021-09-15 00:55:29 +02:00
commit 2c845547a4
47 changed files with 1147 additions and 393 deletions

3
.gitignore vendored
View File

@ -5,4 +5,5 @@ BuffLib
*.psd *.psd
Ace-Libs Ace-Libs
Images_Raw Images_Raw
Gladdy_old Gladdy_old
Gladdy_TW

View File

@ -1,6 +1,7 @@
local tbl_sort, select = table.sort, select local tbl_sort, select = table.sort, select
local GetSpellInfo = GetSpellInfo local GetSpellInfo = GetSpellInfo
local GetItemInfo = GetItemInfo
local GetLocale = GetLocale local GetLocale = GetLocale
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
@ -648,7 +649,7 @@ local importantAuras = {
-- Grounding Totem Effect -- Grounding Totem Effect
[GetSpellInfo(8178)] = { [GetSpellInfo(8178)] = {
track = AURA_TYPE_BUFF, track = AURA_TYPE_BUFF,
duration = 0, duration = 4,
priority = 20, priority = 20,
spellID = 8178 spellID = 8178
}, },
@ -711,6 +712,36 @@ local importantAuras = {
magic = true, magic = true,
spellID = 34709, spellID = 34709,
}, },
-- Net-o-Matic
[GetSpellInfo(13120)] = {
track = AURA_TYPE_DEBUFF,
duration = 10,
priority = 30,
spellID = 13120,
},
-- Nigh Invulnerability Shield
[GetSpellInfo(30458)] = {
track = AURA_TYPE_BUFF,
duration = 8,
priority = 15,
spellID = 30458,
texture = select(10, GetItemInfo(23825))
},
-- Nigh Invulnerability Belt Backfire
[GetSpellInfo(30457)] = {
track = AURA_TYPE_DEBUFF,
duration = 8,
priority = 15,
spellID = 30457,
},
-- Flee (Skull of impending Doom) -- 5024
[GetSpellInfo(5024)] = {
track = AURA_TYPE_BUFF,
duration = 8,
priority = 15,
spellID = 5024,
altName = select(1, GetSpellInfo(5024)) .. " - " .. (select(1, GetItemInfo(4984)) or "Skull of Impending Doom"),
},
} }
function Gladdy:GetImportantAuras() function Gladdy:GetImportantAuras()
return importantAuras return importantAuras
@ -1063,9 +1094,9 @@ local arenaTimer = {
[0] = "Der Arenakampf hat begonnen!", [0] = "Der Arenakampf hat begonnen!",
}, },
["frFR"] = { ["frFR"] = {
[60] = "Le combat d'arène commence dans une minute\194\160!", [61] = "Le combat d'arène commence dans une minute\194\160!",
[30] = "Le combat d'arène commence dans trente secondes\194\160!", [31] = "Le combat d'arène commence dans trente secondes\194\160!",
[15] = "Le combat d'arène commence dans quinze secondes\194\160!", [16] = "Le combat d'arène commence dans quinze secondes\194\160!",
[0] = "Le combat d'arène commence\194\160!", [0] = "Le combat d'arène commence\194\160!",
}, },
["ruRU"] = { ["ruRU"] = {

View File

@ -48,6 +48,9 @@ end
function Gladdy:SpotEnemy(unit, auraScan) function Gladdy:SpotEnemy(unit, auraScan)
local button = self.buttons[unit] local button = self.buttons[unit]
if not unit or not button then
return
end
button.raceLoc = UnitRace(unit) button.raceLoc = UnitRace(unit)
button.race = select(2, UnitRace(unit)) button.race = select(2, UnitRace(unit))
button.classLoc = select(1, UnitClass(unit)) button.classLoc = select(1, UnitClass(unit))
@ -55,7 +58,9 @@ function Gladdy:SpotEnemy(unit, auraScan)
button.name = UnitName(unit) button.name = UnitName(unit)
button.stealthed = false button.stealthed = false
Gladdy.guids[UnitGUID(unit)] = unit Gladdy.guids[UnitGUID(unit)] = unit
Gladdy:SendMessage("ENEMY_SPOTTED", unit) if button.class and button.race then
Gladdy:SendMessage("ENEMY_SPOTTED", unit)
end
if auraScan and not button.spec then if auraScan and not button.spec then
for n = 1, 30 do for n = 1, 30 do
local spellName,_,_,_,_,_,unitCaster = UnitAura(unit, n, "HELPFUL") local spellName,_,_,_,_,_,unitCaster = UnitAura(unit, n, "HELPFUL")
@ -88,7 +93,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
Gladdy:SendMessage("UNIT_DEATH", destUnit) Gladdy:SendMessage("UNIT_DEATH", destUnit)
end end
-- spec detection -- spec detection
if not Gladdy.buttons[destUnit].class then if not Gladdy.buttons[destUnit].class or not Gladdy.buttons[destUnit].race then
Gladdy:SpotEnemy(destUnit, true) Gladdy:SpotEnemy(destUnit, true)
end end
--interrupt detection --interrupt detection
@ -119,7 +124,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
end end
end end
if not Gladdy.buttons[srcUnit].class then if not Gladdy.buttons[srcUnit].class or not Gladdy.buttons[srcUnit].race then
Gladdy:SpotEnemy(srcUnit, true) Gladdy:SpotEnemy(srcUnit, true)
end end
if not Gladdy.buttons[srcUnit].spec then if not Gladdy.buttons[srcUnit].spec then
@ -138,7 +143,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
-- ENEMY_SPOTTED -- ENEMY_SPOTTED
if button then if button then
Gladdy:SendMessage("ENEMY_STEALTH", unit, false) Gladdy:SendMessage("ENEMY_STEALTH", unit, false)
if not button.class then if not button.class or not button.race then
Gladdy:SpotEnemy(unit, true) Gladdy:SpotEnemy(unit, true)
end end
end end
@ -167,7 +172,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
end end
end end
local exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB Gladdy.exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
[31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence [31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence
[43523] = GetSpellInfo(30405) .. " Silence", [43523] = GetSpellInfo(30405) .. " Silence",
[24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot [24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot
@ -189,7 +194,7 @@ function EventListener:UNIT_AURA(unit)
return return
end end
for i = 1, 2 do for i = 1, 2 do
if not Gladdy.buttons[unit].class then if not Gladdy.buttons[unit].class or not Gladdy.buttons[unit].race then
Gladdy:SpotEnemy(unit, false) Gladdy:SpotEnemy(unit, false)
end end
local filter = (i == 1 and "HELPFUL" or "HARMFUL") local filter = (i == 1 and "HELPFUL" or "HARMFUL")
@ -207,8 +212,8 @@ function EventListener:UNIT_AURA(unit)
Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName]) Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName])
end end
end end
if exceptionNames[spellID] then if Gladdy.exceptionNames[spellID] then
spellName = exceptionNames[spellID] spellName = Gladdy.exceptionNames[spellID]
end end
Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, debuffType, i) Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, debuffType, i)
Gladdy:Call("Announcements", "CheckDrink", unit, spellName) Gladdy:Call("Announcements", "CheckDrink", unit, spellName)

View File

@ -275,6 +275,17 @@ function Gladdy:UpdateFrame()
for _, v in self:IterModules() do for _, v in self:IterModules() do
self:Call(v, "UpdateFrameOnce") self:Call(v, "UpdateFrameOnce")
end end
if Gladdy.db.hideBlizzard == "always" then
Gladdy:BlizzArenaSetAlpha(0)
elseif Gladdy.db.hideBlizzard == "arena" then
if Gladdy.curBracket then
Gladdy:BlizzArenaSetAlpha(0)
else
Gladdy:BlizzArenaSetAlpha(1)
end
elseif Gladdy.db.hideBlizzard == "never" then
Gladdy:BlizzArenaSetAlpha(1)
end
end end
function Gladdy:HideFrame() function Gladdy:HideFrame()

View File

@ -5,6 +5,7 @@ local select = select
local pairs = pairs local pairs = pairs
local tinsert = table.insert local tinsert = table.insert
local tsort = table.sort local tsort = table.sort
local GetTime = GetTime
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
local IsAddOnLoaded = IsAddOnLoaded local IsAddOnLoaded = IsAddOnLoaded
@ -25,9 +26,9 @@ local MAJOR, MINOR = "Gladdy", 4
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR) local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
local L local L
Gladdy.version_major_num = 1 Gladdy.version_major_num = 1
Gladdy.version_minor_num = 0.19 Gladdy.version_minor_num = 0.20
Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
Gladdy.version_releaseType = RELEASE_TYPES.beta Gladdy.version_releaseType = RELEASE_TYPES.release
Gladdy.version = PREFIX .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType Gladdy.version = PREFIX .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType
Gladdy.VERSION_REGEX = VERSION_REGEX Gladdy.VERSION_REGEX = VERSION_REGEX
@ -131,8 +132,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,18 +225,12 @@ 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
if IsAddOnLoaded("Blizzard_ArenaUI") then Gladdy:BlizzArenaSetAlpha(0)
ArenaEnemyFrame1:SetAlpha(0)
ArenaEnemyFrame2:SetAlpha(0)
ArenaEnemyFrame3:SetAlpha(0)
ArenaEnemyFrame4:SetAlpha(0)
ArenaEnemyFrame5:SetAlpha(0)
end
end end
end end
@ -310,8 +305,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)
@ -375,7 +370,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
@ -383,21 +378,15 @@ 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
self:ResetUnit(unit) self:ResetUnit(unit)
end end
if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then
if IsAddOnLoaded("Blizzard_ArenaUI") then Gladdy:BlizzArenaSetAlpha(1)
ArenaEnemyFrame1:SetAlpha(1)
ArenaEnemyFrame2:SetAlpha(1)
ArenaEnemyFrame3:SetAlpha(1)
ArenaEnemyFrame4:SetAlpha(1)
ArenaEnemyFrame5:SetAlpha(1)
end
end end
end end
@ -410,8 +399,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
@ -462,12 +451,49 @@ function Gladdy:JoinedArena()
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 if Gladdy.db.hideBlizzard == "arena" or Gladdy.db.hideBlizzard == "always" then
if IsAddOnLoaded("Blizzard_ArenaUI") then Gladdy:BlizzArenaSetAlpha(0)
ArenaEnemyFrame1:SetAlpha(0)
ArenaEnemyFrame2:SetAlpha(0)
ArenaEnemyFrame3:SetAlpha(0)
ArenaEnemyFrame4:SetAlpha(0)
ArenaEnemyFrame5:SetAlpha(0)
end
end end
end end
---------------------------
-- BLIZZARD FRAMES
---------------------------
function Gladdy:BlizzArenaSetAlpha(alpha)
if IsAddOnLoaded("Blizzard_ArenaUI") then
ArenaEnemyFrames:SetAlpha(alpha)
ArenaEnemyFrame1:SetAlpha(alpha)
ArenaEnemyFrame1PetFrame:SetAlpha(alpha)
ArenaEnemyFrame2:SetAlpha(alpha)
ArenaEnemyFrame2PetFrame:SetAlpha(alpha)
ArenaEnemyFrame3:SetAlpha(alpha)
ArenaEnemyFrame3PetFrame:SetAlpha(alpha)
ArenaEnemyFrame4:SetAlpha(alpha)
ArenaEnemyFrame4PetFrame:SetAlpha(alpha)
ArenaEnemyFrame5:SetAlpha(alpha)
ArenaEnemyFrame5PetFrame:SetAlpha(alpha)
end
end
---------------------------
-- FONT/STATUSBAR/BORDER
---------------------------
local defaults = {["statusbar"] = "Smooth", ["border"] = "Gladdy Tooltip round", ["font"] = "DorisPP"}
local lastWarning = {}
function Gladdy:SMFetch(lsmType, key)
local smMediaType = self.LSM:Fetch(lsmType, Gladdy.db[key])
if (smMediaType == nil and Gladdy.db[key] ~= "None") then
if not lastWarning[key] or GetTime() - lastWarning[key] > 120 then
lastWarning[key] = GetTime()
Gladdy:Warn("Could not find", "\"" .. lsmType .. "\" \"", Gladdy.db[key], " \" for", "\"" .. key .. "\"", "- setting it to", "\"" .. defaults[lsmType] .. "\"")
end
return self.LSM:Fetch(lsmType, defaults[lsmType])
end
return smMediaType
end

View File

@ -1,6 +1,6 @@
## Interface: 20501 ## Interface: 20502
## Title: Gladdy - TBC ## Title: Gladdy - TBC
## Version: 1.19-Beta ## Version: 1.20-Release
## Notes: The most powerful arena AddOn for WoW 2.5.1 ## Notes: The most powerful arena AddOn for WoW 2.5.1
## Author: XiconQoo, DnB_Junkee, Knall ## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751 ## X-Email: contact me on discord Knall#1751

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Images/Countdown/Horde.blp Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

430
Lang.lua
View File

@ -406,6 +406,8 @@ elseif GetLocale() == "deDE" then
L["Categories"] = "Kategorien" L["Categories"] = "Kategorien"
L["Force Icon"] = "Erzwinge Symbol" L["Force Icon"] = "Erzwinge Symbol"
L["Icon of the DR"] = "Symbol des DR" L["Icon of the DR"] = "Symbol des DR"
L["DR Duration"] = "DR Dauer"
L["Change the DR Duration in seconds (DR is dynamic between 15-20s)"] = "Verändere die DR Dauer in Sekunden (DR ist dynamisch zwischen 15-20s)"
-- ExportImport.lua -- ExportImport.lua
L["Export Import"] = "Exportieren Importieren" L["Export Import"] = "Exportieren Importieren"
@ -555,6 +557,434 @@ elseif GetLocale() == "deDE" then
L["Offset of border to statusbar (in case statusbar shows beyond the border)"] = "Offset des Rahmens zur Statusbar (falls der Balken hinter dem Rahmen erscheint)" L["Offset of border to statusbar (in case statusbar shows beyond the border)"] = "Offset des Rahmens zur Statusbar (falls der Balken hinter dem Rahmen erscheint)"
L["Statusbar border color"] = "Balken Rahmenfarbe" L["Statusbar border color"] = "Balken Rahmenfarbe"
L["This changes the border color of all statusbar frames"] = "Dies ändert die Rahmenfarbe aller Balken" L["This changes the border color of all statusbar frames"] = "Dies ändert die Rahmenfarbe aller Balken"
elseif GetLocale() == "zhTW" then
-- Announcements.lua
L["Announcements"] = "通報"
L["RESURRECTING: %s (%s)"] = "復活: %s (%s) "
L["SPEC DETECTED: %s - %s (%s)"] = "敵方天賦: %s - %s (%s)"
L["LOW HEALTH: %s (%s)"] = "低生命值: %s (%s)"
L["TRINKET USED: %s (%s)"] = "飾品已使用: %s (%s)"
L["TRINKET READY: %s (%s)"] = "飾品就緒: %s (%s)"
L["DRINKING: %s (%s)"] = "正在喝水: %s (%s)"
L["Self"] = "玩家"
L["Party"] = "隊伍"
L["Raid Warning"] = "團隊警告"
L["Blizzard's Floating Combat Text"] = "Blizzard 戰鬥浮動文字"
L["Trinket used"] = "飾品已使用"
L["Announce when an enemy's trinket is used"] = "當敵方使用飾品時發出通知"
L["Trinket ready"] = "飾品就緒"
L["Announce when an enemy's trinket is ready again"] = "當敵方飾品就緒時發出通報"
L["Drinking"] = "正在喝水"
L["Announces when enemies sit down to drink"] = "當敵方喝水時發出通報"
L["Resurrection"] = "復活"
L["Announces when an enemy tries to resurrect a teammate"] = "當敵方嘗試復活隊友時發出通報"
L["New enemies"] = "新的敵人"
L["Announces when new enemies are discovered"] = "當發現新的敵人時發出通報"
L["Spec Detection"] = "天賦偵測"
L["Announces when the spec of an enemy was detected"] = "當偵測到敵方天賦時發出通報"
L["Low health"] = "低生命值"
L["Announces when an enemy drops below a certain health threshold"] = "當敵方生命值低於一定條件時發出通報"
L["Low health threshold"] = "低生命值門檻"
L["Choose how low an enemy must be before low health is announced"] = "設定低生命值通報門檻"
L["Destination"] = "發送通報至"
L["Choose how your announcements are displayed"] = "選擇通報發送至哪個頻道"
-- ArenaCountDown.lua
L["Arena Countdown"] = "競技場計時"
L["Turns countdown before the start of an arena match on/off."] = "在競技場開始前倒數剩餘秒數"
L["Size"] = "大小"
-- Auras.lua
L["Auras"] = "光環"
L["Frame"] = "框架"
L["Cooldown"] = "冷卻時間"
L["No Cooldown Circle"] = "取消圖示冷卻倒數陰影"
L["Cooldown circle alpha"] = "冷卻倒數陰影alpha值"
L["Font"] = "字型"
L["Font of the cooldown"] = "設定冷卻時間字型"
L["Font scale"] = "字體大小"
L["Scale of the text"] = "設定字體大小"
L["Font color"] = "字體顏色"
L["Color of the text"] = "設定字體顏色"
L["Border"] = "邊框"
L["Border style"] = "邊框樣式"
L["Buff color"] = "增益顏色"
L["Debuff color"] = "減益顏色"
L["Check All"] = "全選"
L["Uncheck All"] = "取消全選"
L["Enabled"] = "啟用"
L["Priority"] = "優先"
L["Interrupt Spells School Colors"] = "打斷法術分類顏色"
L["Enable Interrupt Spell School Colors"] = "啟用"
L["Will use Debuff Color if disabled"] = "若未啟用則使用一般減益顏色"
L["Buffs"] = "增益" --Line 573
L["Debuffs"] = "減益" --Line 566
L["Interrupts"] = "斷法" --Line 580
-- BuffsDebuffs.lua
L["Buffs and Debuffs"] = "增益與減益"
L["Enabled Buffs and Debuffs module"] = "啟用增益與減益模組"
L["Show CC"] = "顯示控場"
L["Shows all debuffs, which are displayed on the ClassIcon as well"] = "顯示所有減益效果,這些減益效果也顯示在職業圖示上"
L["Buffs"] = "增益"
L["Size & Padding"] = "大小與內距"
L["Icon Size"] = "圖示大小"
L["Size of the DR Icons"] = "遞減圖示大小"
L["Icon Width Factor"] = "圖示寬度比例"
L["Stretches the icon"] = "圖示寬度"
L["Icon Padding"] = "圖示內距"
L["Space between Icons"] = "圖示間距"
L["Position"] = "位置"
L["Aura Position"] = "光環位置"
L["Position of the aura icons"] = "光環圖示位置"
L["Top"] = "頂部"
L["Bottom"] = "底部"
L["Left"] = ""
L["Right"] = ""
--L["Grow Direction"] = ""
L["Grow Direction of the aura icons"] = "光環圖示的延伸方向"
L["Horizontal offset"] = "水平位移"
L["Vertical offset"] = "垂直位移"
L["Alpha"] = "Alpha值"
L["Debuffs"] = "減益"
L["Dynamic Timer Color"] = "動態計時條顏色"
L["Show dynamic color on cooldown numbers"] = "冷卻時間數字以動態顏色顯示"
L["Color of the cooldown timer and stacks"] = "Farbe der Abklingzeit und Stapel"
L["Spell School Colors"] = "法術種類顏色"
L["Spell School Colors Enabled"] = "啟用"
L["Show border colors by spell school"] = "根據不同法術種類顯示不同邊框顏色"
L["Curse"] = "詛咒"
L["Color of the border"] = "邊框顏色"
L["Magic"] = "魔法"
L["Poison"] = "中毒"
L["Physical"] = "物理"
L["Immune"] = "免疫"
L["Disease"] = "疾病"
L["Aura"] = "光環"
L["Form"] = "形態"
L["Font"] = "字型" --Line 906
L["Border"] = "邊框" --Line 949
L["Debuff Lists"] = "減益列表" --Line 1036
L["Buff Lists"] = "增益列表" --Line 1051
-- Castbar.lua
L["Cast Bar"] = "施法條"
L["Bar"] = "施法條"
L["Bar Size"] = "施法條大小"
L["Bar height"] = "高度"
L["Height of the bar"] = "計量條高度"
L["Bar width"] = "寬度"
L["Width of the bars"] = "計量條寬度"
L["Texture"] = "材質"
L["Bar texture"] = "施法條材質"
L["Texture of the bar"] = "計量條材質"
L["Bar color"] = "施法條顏色"
L["Color of the cast bar"] = "計量條顏色"
L["Background color"] = "背景顏色"
L["Color of the cast bar background"] = "施法條背景顏色"
L["Border size"] = "邊框大小"
L["Status Bar border"] = "狀態列邊框"
L["Status Bar border color"] = "狀態列邊框顏色"
L["Icon"] = "圖示"
L["Icon size"] = "圖示大小"
L["Icon border"] = "圖示邊框"
L["Icon border color"] = "圖示邊框顏色"
L["If test is running, type \"/gladdy test\" again"] = "如果測試已經開始,調整此選項後請輸入/gladdy test以重新開始測試"
L["Spark"] = "尾端發亮"
L["Spark enabled"] = "啟用"
L["Spark color"] = "顏色"
L["Color of the cast bar spark"] = "計時條進度的尾端顏色"
L["Font of the castbar"] = "施法條字型"
L["Font size"] = "字體大小"
L["Size of the text"] = "施法條字體大小"
L["Format"] = "格式"
L["Timer Format"] = "時間格式"
L["Remaining"] = "剩餘時間"
L["Total"] = "總時間"
L["Both"] = "兩者"
L["Castbar position"] = "施法條位置"
L["Icon position"] = "圖示位置"
L["Offsets"] = "位移"
-- Classicon.lua
L["Class Icon"] = "職業圖示"
L["Balance"] = "平衡"
L["Feral"] = "野性"
L["Restoration"] = "恢復"
L["Beast Mastery"] = "獸王"
L["Marksmanship"] = "射擊"
L["Survival"] = "生存"
L["Arcane"] = "奧術"
L["Fire"] = "火焰"
L["Frost"] = "冰霜"
L["Holy"] = "神聖"
L["Protection"] = "防護"
L["Retribution"] = "懲戒"
L["Discipline"] = "戒律"
L["Shadow"] = "暗影"
L["Assassination"] = "刺殺"
L["Combat"] = "戰鬥"
L["Subtlety"] = "敏銳"
L["Elemental"] = "元素"
L["Enhancement"] = "增強"
L["Affliction"] = "痛苦"
L["Demonology"] = "惡魔"
L["Destruction"] = "毀滅"
L["Arms"] = "武器"
L["Fury"] = "狂怒"
L["Show Spec Icon"] = "顯示天賦圖示"
L["Shows Spec Icon once spec is detected"] = "若偵測到天賦則顯示天賦圖示"
L["Icon width factor"] = "圖示寬度比例"
L["This changes positions with trinket"] = "調整職業圖示位置"
L["Border color"] = "邊框顏色"
--CombatIndicator.lua
L["Combat Indicator"] = "戰鬥指示器"
L["Enable Combat Indicator icon"] = "顯示是否進入戰鬥"
L["Anchor"] = "定位"
L["This changes the anchor of the ci icon"] = "調整戰鬥指示器圖示定位點"
L["This changes position relative to its anchor of the ci icon"] = "調整戰鬥指示器位置"
-- Constants.lua
L["Physical"] = "物理" --Line 749
L["Holy"] = "神聖" --Line 750
L["Fire"] = "火焰" --Line 751
L["Nature"] = "自然" --Line 752
L["Frost"] = "冰霜" --Line 753
L["Shadow"] = "暗影" --Line 754
L["Arcane"] = "奧術" --Line 755
L["Unknown"] = "未知" --Line 756
-- Cooldowns.lua
L["Cooldowns"] = "技能冷卻監控"
L["Enabled cooldown module"] = "啟用冷卻時間監控模組"
L["Cooldown size"] = "大小"
L["Size of each cd icon"] = "冷卻時間圖示大小"
L["Icon Width Factor"] = "寬度"
L["Max Icons per row"] = "每行圖示數量"
L["Scale of the font"] = "字體大小"
L["Anchor of the cooldown icons"] = "冷卻圖示定位"
L["Grow Direction of the cooldown icons"] = "冷卻圖示延伸方向"
L["Offset"] = "位移"
L["BloodElf"] = "血精靈"
L["NightElf"] = "夜精靈"
L["Scourge"] = "不死族"
-- Diminishings.lua
L["Diminishings"] = "控場遞減"
L["Enabled DR module"] = "啟用遞減模組"
L["DR Cooldown position"] = "遞減冷卻時間位置"
L["Position of the cooldown icons"] = "遞減冷卻時間圖示位置"
L["DR Border Colors"] = "DR邊框顏色"
L["Dr Border Colors Enabled"] = "啟用"
L["Colors borders of DRs in respective DR-color below"] = "邊框顏色依遞減設定為以下顏色"
L["Half"] = "二分之一"
L["Quarter"] = "四分之一"
L["Categories"] = "法術列表"
L["Force Icon"] = "使用自訂圖示"
L["Icon of the DR"] = "選擇此區圖示取代原始技能圖示"
-- ExportImport.lua
L["Export Import"] = "匯出/匯入"
L["Profile Export Import"] = "設定檔匯出/匯入"
L["Export"] = "匯出" --Line 138
L["Export your current profile to share with others or your various accounts."] = "匯出您目前的設定檔" --Line 139
L["Import"] = "匯入" --Line 162
L["This will overwrite your current profile!"] = "這將會覆蓋您目前的設定檔" --Line 163
-- Healthbar.lua
L["Health Bar"] = "血量條"
L["DEAD"] = "死亡"
L["LEAVE"] = "暫離"
L["General"] = "一般"
L["Color of the status bar background"] = "狀態列背景顏色"
L["Font of the bar"] = "字型"
L["Name font size"] = "名稱字體大小"
L["Size of the name text"] = "設定名稱字體大小"
L["Health font size"] = "生命值字體大小"
L["Size of the health text"] = "設定生命值字體大小"
L["Size of the border"] = "邊框大小"
L["Health Bar Text"] = "血量條文字"
L["Show name text"] = "顯示名稱"
L["Show the units name"] = "顯示單位名稱"
L["Show ArenaX"] = "顯示編號"
L["Show 1-5 as name instead"] = "使用編號1-5代替角色名稱"
L["Show the actual health"] = "顯示目前生命值"
L["Show the actual health on the health bar"] = "在血量條上顯示目前生命值"
L["Show max health"] = "顯示最大生命值"
L["Show max health on the health bar"] = "在血量條上顯示最大生命值"
L["Show health percentage"] = "顯示百分比"
L["Show health percentage on the health bar"] = "在血量條上顯示生命值百分比"
-- Highlight.lua
L["Highlight"] = "高亮提示"
L["Show Inside"] = "顯示在框架內"
L["Show Highlight border inside of frame"] = "將高亮邊框顯示於框架內側"
L["Colors"] = "邊框顏色"
L["Target border color"] = "目標"
L["Color of the selected targets border"] = "目標的邊框顏色"
L["Focus border color"] = "專注"
L["Color of the focus border"] = "專注目標邊框顏色"
L["Highlight target"] = "高亮目標"
L["Toggle if the selected target should be highlighted"] = "是否高亮當前目標"
L["Show border around target"] = "顯示目標邊框"
L["Toggle if a border should be shown around the selected target"] = "是否顯示當前目標的邊框"
L["Show border around focus"] = "顯示專注邊框"
L["Toggle of a border should be shown around the current focus"] = "是否顯示當前專注目標的邊框"
-- Pets.lua
L["Pets"] = "寵物"
L["Enables Pets module"] = "啟用寵物模組"
L["Width of the bar"] = "寵物列寬度"
L["Health color"] = "生命值顏色"
L["Color of the status bar"] = "狀態列顏色"
L["Portrait"] = "頭像"
L["Health Values"] = "生命值"
-- Powerbar.lua
L["Power Bar"] = "法力/能量條"
L["Power Bar Text"] = "法力/能量條文字"
L["Power Texts"] = "法力/能量條文字"
L["Show race"] = "顯示種族"
L["Show spec"] = "顯示天賦"
L["Show the actual power"] = "顯示目前法力/能量"
L["Show the actual power on the power bar"] = "在計量條中顯示目前法力/能量值"
L["Show max power"] = "顯示最大法力/能量值"
L["Show max power on the power bar"] = "在計量條中顯示最大法力/能量值"
L["Show power percentage"] = "顯示法力/能量百分比"
L["Show power percentage on the power bar"] = "在計量條中顯示目前法力/能量百分比"
-- Racial.lua
L["Racial"] = "種族"
L["Enable racial icon"] = "啟用種族圖示"
L["This changes the anchor of the racial icon"] = "調整種族圖示定位點"
L["This changes position relative to its anchor of the racial icon"] = "調整種族圖示位置"
-- TotemPlates.lua
L["Totem Plates"] = "圖騰名條"
L["Customize Totems"] = "自訂圖騰"
L["Custom totem name"] = "自訂圖騰名稱"
L["Totem General"] = "圖騰通用設定"
L["Turns totem icons instead of nameplates on or off. (Requires reload)"] = "是否顯示圖騰名條(需重新載入)"
L["Show friendly"] = "顯示友方圖騰"
L["Show enemy"] = "顯示敵方圖騰"
L["Totem size"] = "圖騰大小"
L["Size of totem icons"] = "圖騰圖示大小"
L["Font of the custom totem name"] = "自訂圖騰字型"
L["Apply alpha when no target"] = "圖騰非目標時套用alpha值"
L["Always applies alpha, even when you don't have a target. Else it is 1."] = "若圖騰未被選為目標其圖示套用alpha值設定"
L["Apply alpha when targeted"] = "圖騰為目標時套用alpha值"
L["Always applies alpha, even when you target the totem. Else it is 1."] = "圖騰被選為目標時其圖示套用alpha值設定"
L["All totem border alphas (configurable per totem)"] = "圖騰 Alpha值 "
L["Totem icon border style"] = "圖騰邊框樣式"
L["All totem border color"] = "圖騰邊框顏色"
-- Trinket.lua
L["Trinket"] = "飾品"
L["Enable trinket icon"] = "啟用飾品圖示"
L["This changes positions of the trinket"] = "調整飾品圖示位置"
-- XiconProfiles.lua
L["Profile"] = "樣式"
L["XiconProfiles"] = "框架外觀" --Line 4
L[" No Pet"] = "(無寵物)" --Line 109, 119
-- Frame.lua
L["Gladdy - drag to move"] = "Gladdy - 拖曳移動"
-- Gladdy.lua
L["Welcome to Gladdy!"] = "歡迎使用 Gladdy!"
L["First run has been detected, displaying test frame."] = "第一次使用時,顯示此測試框架。"
L["Valid slash commands are:"] = "可用的指令為:"
L["If this is not your first run please lock or move the frame to prevent this from happening."] = "若非第一次使用,請移動或鎖定框架以避免此提示再次出現。"
-- Clicks.lua
L["Action #%d"] = "動作 #%d"
L["Target"] = "目標" --Line 15
L["Focus"] = "專注" --Line 16
L["Clicks"] = "點擊動作"
L["Left button"] = "左鍵"
L["Right button"] = "右鍵"
L["Middle button"] = "中鍵"
L["Button 4"] = "滑鼠按鍵4"
L["Button 5"] = "滑鼠按鍵5"
L["Select what action this mouse button does"] = "設定輸入按鍵後的欲執行的動作"
L["Modifier"] = "修飾鍵"
L["Select which modifier to use"] = "設定欲使用的修飾鍵"
L["Button"] = "按鍵"
L["Select which mouse button to use"] = "設定欲使用的滑鼠按鍵"
L["Name"] = "名稱"
L["Select the name of the click option"] = "設定動作名稱"
L["Action"] = "動作"
L["Cast Spell / Macro"] = "施放法術/巨集"
--RangeCheck.lua
L["Range Check"] = "距離檢查"
L["Spells"] = "法術"
L["Fade"] = "變暗"
L["Out of Range Darkening Level"] = "超出距離時變暗程度"
L["Higher is darker"] = "數值越高越暗"
L["yds"] = "" --Line 366, 388
L["Changing the spellID only applies to your player class!\n\nExample: If you are a Paladin and wish to change your range check spell to Repentance, edit the Paladin spellID to 20066."] = "對應您的職業修改欲用於監控距離的技能。\n\n範例:若您為聖騎士且想以懺悔技能用於距離監控請將聖騎士的法術ID改為20066。" --Line 352
--ShadowsightTimer.lua
L["Shadowsight Timer"] = "暗影視界計時"
L["Locked"] = "鎖定"
L["Announce"] = "通報"
L["Scale"] = "大小"
L["Shadowsight up in %ds"] = "暗影視界於%d秒後就緒"
L["Shadowsight up!"] = "暗影視界已就緒"
-- Options.lua
L["settings"] = "設定"
L["Reset module"] = "重設模組"
L["Reset module to defaults"] = "將模組重設為預設值"
L["No settings"] = "無設定"
L["Module has no settings"] = "模組沒有設定"
L["General settings"] = "通用設定"
L["Lock frame"] = "鎖定框架"
L["Toggle if frame can be moved"] = "調整框架是否可移動"
L["Grow frame upwards"] = "框架向上延伸"
L["If enabled the frame will grow upwards instead of downwards"] = "開啟此選項時框架向上延伸"
L["Down"] = ""
L["Up"] = ""
L["Frame General"] = "框架"
L["Frame scale"] = "框架大小"
L["Scale of the frame"] = "框架的尺寸"
L["Frame padding"] = "框架內距"
L["Padding of the frame"] = "框架的內距"
L["Frame width"] = "框架寬度"
L["Margin"] = "框架間距"
L["Margin between each button"] = "框架的間距"
L["Cooldown General"] = "冷卻"
L["Font General"] = "字型"
L["General Font"] = "Allgemeine Schriftart"
L["Font color text"] = "文字顏色"
L["Font color timer"] = "計時器文字顏色"
L["Color of the timers"] = "計時器顏色"
L["Icons General"] = "圖示"
L["Icon border style"] = "圖示邊框樣式"
L["This changes the border style of all icons"] = "調整所有圖示的邊框樣式"
L["This changes the border color of all icons"] = "調整所有圖示的邊框顏色"
L["Statusbar General"] = "狀態列"
L["Statusbar texture"] = "狀態列材質"
L["This changes the texture of all statusbar frames"] = "調整所有狀態列的材質"
L["Statusbar border style"] = "狀態列邊框樣式"
L["This changes the border style of all statusbar frames"] = "調整所有狀態列的邊框樣式"
L["Statusbar border offset divider (smaller is higher offset)"] = "狀態列邊框距離"
L["Offset of border to statusbar (in case statusbar shows beyond the border)"] = "調整狀態列邊框距離"
L["Statusbar border color"] = "狀態列邊框顏色"
L["This changes the border color of all statusbar frames"] = "調整所有狀態列的邊框顏色"
L["Hide Blizzard"] = "隱藏暴雪框架"
L["Grow Direction"] = "框架延伸方向"
L["Arena only"] = "只在競技場中"
L["Never"] = "從不"
L["Always"] = "永遠"
L["Load configuration"] = "設定選項" --Line 713
L["Load configuration options"] = "載入設定選項" --Line 714
L["Background Color of the frame"] = "框架的背景顏色"
L["Gladdy"] = "Gladdy目標框架" --Line 210, 709, 727
end end

View File

@ -1,4 +1,4 @@
local major = "DRData-1.0" local major = "DRData-1.0-BCC"
local minor = tonumber(string.match("$Revision: 793$", "(%d+)") or 1) local minor = tonumber(string.match("$Revision: 793$", "(%d+)") or 1)
assert(LibStub, string.format("%s requires LibStub.", major)) assert(LibStub, string.format("%s requires LibStub.", major))
@ -139,6 +139,9 @@ Data.spells = {
-- Revenge Stun -- Revenge Stun
[12798] = "rndstun", [12798] = "rndstun",
-- Pyroclasm
[18093] = "rndstun",
--[[ CYCLONE ]]-- --[[ CYCLONE ]]--
-- Blind -- Blind
@ -167,6 +170,15 @@ Data.spells = {
[9853] = "root", [9853] = "root",
[26989] = "root", [26989] = "root",
-- Nature's Grasp
[19975] = "root",
[19974] = "root",
[19973] = "root",
[19972] = "root",
[19971] = "root",
[19970] = "root",
[27010] = "root",
--[[ RANDOM ROOTS ]]-- --[[ RANDOM ROOTS ]]--
-- Improved Hamstring -- Improved Hamstring
[23694] = "rndroot", [23694] = "rndroot",
@ -181,10 +193,10 @@ Data.spells = {
[18658] = "sleep", [18658] = "sleep",
-- Wyvern Sting -- Wyvern Sting
[19386] = "sleep", [19386] = "disorient",
[24132] = "sleep", [24132] = "disorient",
[24133] = "sleep", [24133] = "disorient",
[27068] = "sleep", [27068] = "disorient",
--[[ MISC ]]-- --[[ MISC ]]--
-- Chastise (Maybe this shares DR with Imp HS?) -- Chastise (Maybe this shares DR with Imp HS?)
@ -201,15 +213,15 @@ Data.spells = {
[33042] = "dragonsbreath", -- Dragon's Breath [33042] = "dragonsbreath", -- Dragon's Breath
[33043] = "dragonsbreath", -- Dragon's Breath [33043] = "dragonsbreath", -- Dragon's Breath
-- Repentance -- Repentance
[20066] = "repentance", [20066] = "disorient",
-- Scatter Shot -- Scatter Shot
[19503] = "scatters", [19503] = "scatters",
-- Freezing Trap -- Freezing Trap
[3355] = "freezetrap", [3355] = "disorient",
[14308] = "freezetrap", [14308] = "disorient",
[14309] = "freezetrap", [14309] = "disorient",
-- Improved Conc Shot -- Improved Conc Shot
[19410] = "impconc", [19410] = "impconc",

View File

@ -140,7 +140,8 @@ Buff( { 25782 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Might
Buff( { 25895 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Salvation Buff( { 25895 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Salvation
Buff( { 25899 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Sanctuary Buff( { 25899 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Sanctuary
Buff( { 25894 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Wisdom Buff( { 25894 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Wisdom
Buff( { 642 }, { buffType = "magic"}, "PALADIN") -- Divine Shield Buff( { 642 }, { buffType = "immune"}, "PALADIN") -- Divine Shield
Buff( { 31884 }, { buffType = "magic"}, "PALADIN") -- Avenging Wrath
--Auras --Auras
Buff( { 465, 10290, 643, 10291, 1032, 10292, 10293, 27149 }, { buffType = "aura"}, "PALADIN") -- Devotion Aura Buff( { 465, 10290, 643, 10291, 1032, 10292, 10293, 27149 }, { buffType = "aura"}, "PALADIN") -- Devotion Aura
Buff( { 7294 }, { buffType = "aura"}, "PALADIN") -- Retribution Aura Buff( { 7294 }, { buffType = "aura"}, "PALADIN") -- Retribution Aura
@ -167,6 +168,8 @@ Buff( { 21082 }, { buffType = "magic"}, "PALADIN") -- Seal of the Crusade
------------- -------------
Buff( { 5384 }, { buffType = "physical"}, "HUNTER") -- Feign Death Buff( { 5384 }, { buffType = "physical"}, "HUNTER") -- Feign Death
Buff( { 19263 }, { buffType = "physical"}, "HUNTER") -- Deterrence
Buff( { 3045 }, { buffType = "physical"}, "HUNTER") -- Rapid Fire
--local FEIGN_DEATH = GetSpellInfo(5384) -- Localized name for Feign Death --local FEIGN_DEATH = GetSpellInfo(5384) -- Localized name for Feign Death

View File

@ -20,7 +20,8 @@ Debuff({ 15286 } ,{ buffType = "magic" }, "PRIEST") -- Vampiric Embrace
Debuff({ 15407, 17311, 17312, 17313, 17314, 18807, 25387 }, { buffType = "magic" }, "PRIEST") -- Mind Flay Debuff({ 15407, 17311, 17312, 17313, 17314, 18807, 25387 }, { buffType = "magic" }, "PRIEST") -- Mind Flay
Debuff({ 605, 10911, 10912 }, { buffType = "magic" }, "PRIEST") -- Mind Control Debuff({ 605, 10911, 10912 }, { buffType = "magic" }, "PRIEST") -- Mind Control
Debuff({ 8122, 8124, 10888, 10890 }, { buffType = "magic", }, "PRIEST") -- Psychic Scream Debuff({ 8122, 8124, 10888, 10890 }, { buffType = "magic", }, "PRIEST") -- Psychic Scream
Debuff({ 15269 }, { buffType = "magic"}, "PRIEST") Debuff({ 15269 }, { buffType = "magic"}, "PRIEST") -- Blackout
Debuff({ 44041, 44043, 44044, 44045, 44046, 44047 }, { buffType = "magic"}, "PRIEST") -- Chastise
--------------- ---------------
-- DRUID -- DRUID
@ -44,6 +45,8 @@ Debuff({ 1822, 1823, 1824, 9904, 27003 }, { stacking = true, buffType = "physica
Debuff({ 1079, 9492, 9493, 9752, 9894, 9896, 27008 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rip Debuff({ 1079, 9492, 9493, 9752, 9894, 9896, 27008 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rip
Debuff({ 5570, 24974, 24975, 24976, 24977, 27013 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Insect Swarm Debuff({ 5570, 24974, 24975, 24976, 24977, 27013 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Insect Swarm
Debuff({ 33745 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Lacerate Debuff({ 33745 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Lacerate
Debuff({ 33878, 33986, 33987 }, { buffType = "physical" }, "DRUID") -- Mangle (Bear)
Debuff({ 33876, 33982, 33983 }, { buffType = "physical" }, "DRUID") -- Mangle (Cat)
------------- -------------
-- WARRIOR -- WARRIOR

View File

@ -210,10 +210,15 @@ function Announcements:GetOptions()
["self"] = L["Self"], ["self"] = L["Self"],
["party"] = L["Party"], ["party"] = L["Party"],
["rw"] = L["Raid Warning"], ["rw"] = L["Raid Warning"],
["fct"] = L["Blizzard's Floating Combat Text"],
["msbt"] = L["MikScrollingBattleText"],
} }
if IsAddOnLoaded("Blizzard_CombatText") then
destValues["fct"] = L["Blizzard's Floating Combat Text"]
end
if IsAddOnLoaded("MikScrollingBattleText") then
destValues["msbt"] = L["MikScrollingBattleText"]
end
return { return {
headerAnnouncements = { headerAnnouncements = {
type = "header", type = "header",

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")
@ -22,33 +21,34 @@ function ACDFrame:Initialize()
local ACDNumFrame = CreateFrame("Frame", "ACDNumFrame", UIParent) local ACDNumFrame = CreateFrame("Frame", "ACDNumFrame", UIParent)
ACDNumFrame:EnableMouse(false) ACDNumFrame:EnableMouse(false)
ACDNumFrame:SetHeight(256) ACDNumFrame:SetHeight(512)
ACDNumFrame:SetWidth(256) ACDNumFrame:SetWidth(512)
ACDNumFrame:SetPoint("CENTER", 0, 128) ACDNumFrame:SetPoint("CENTER", 0, 256)
ACDNumFrame:Show() ACDNumFrame:Show()
self.ACDNumFrame = ACDNumFrame self.ACDNumFrame = ACDNumFrame
local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH") local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH")
ACDNumTens:SetWidth(256) ACDNumTens:SetWidth(256)
ACDNumTens:SetHeight(128) ACDNumTens:SetHeight(256)
ACDNumTens:SetPoint("CENTER", ACDNumFrame, "CENTER", -48, 0) ACDNumTens:SetPoint("CENTER", ACDNumFrame, "CENTER", -50, 0)
self.ACDNumTens = ACDNumTens self.ACDNumTens = ACDNumTens
local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH") local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH")
ACDNumOnes:SetWidth(256) ACDNumOnes:SetWidth(256)
ACDNumOnes:SetHeight(128) ACDNumOnes:SetHeight(256)
ACDNumOnes:SetPoint("CENTER", ACDNumFrame, "CENTER", 48, 0) ACDNumOnes:SetPoint("CENTER", ACDNumFrame, "CENTER", 50, 0)
self.ACDNumOnes = ACDNumOnes self.ACDNumOnes = ACDNumOnes
local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH") local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH")
ACDNumOne:SetWidth(256) ACDNumOne:SetWidth(256)
ACDNumOne:SetHeight(128) ACDNumOne:SetHeight(256)
ACDNumOne:SetPoint("CENTER", ACDNumFrame, "CENTER", 0, 0) ACDNumOne:SetPoint("CENTER", ACDNumFrame, "CENTER", 0, 0)
self.ACDNumOne = ACDNumOne self.ACDNumOne = ACDNumOne
self:RegisterMessage("JOINED_ARENA") self:RegisterMessage("JOINED_ARENA")
self:RegisterMessage("ENEMY_SPOTTED") self:RegisterMessage("ENEMY_SPOTTED")
self:RegisterMessage("UNIT_SPEC") self:RegisterMessage("UNIT_SPEC")
self.faction = UnitFactionGroup("player")
end end
function ACDFrame.OnUpdate(self, elapse) function ACDFrame.OnUpdate(self, elapse)
@ -58,11 +58,7 @@ function ACDFrame.OnUpdate(self, elapse)
if ((floor(self.countdown) ~= floor(self.countdown - elapse)) and (floor(self.countdown - elapse) >= 0)) then if ((floor(self.countdown) ~= floor(self.countdown - elapse)) and (floor(self.countdown - elapse) >= 0)) then
local str = tostring(floor(self.countdown - elapse)); local str = tostring(floor(self.countdown - elapse));
if (floor(self.countdown - elapse) == 0) then if (str_len(str) == 2) then
self.ACDNumTens:Hide();
self.ACDNumOnes:Hide();
self.ACDNumOne:Hide();
elseif (str_len(str) == 2) then
-- Display has 2 digits -- Display has 2 digits
self.ACDNumOne:Hide(); self.ACDNumOne:Hide();
self.ACDNumTens:Show(); self.ACDNumTens:Show();
@ -73,8 +69,10 @@ function ACDFrame.OnUpdate(self, elapse)
self.ACDNumFrame:SetScale(0.7) self.ACDNumFrame:SetScale(0.7)
elseif (str_len(str) == 1) then elseif (str_len(str) == 1) then
-- Display has 1 digit -- Display has 1 digit
local numStr = str_sub(str, 0, 1)
local path = numStr == "0" and self.faction or numStr
self.ACDNumOne:Show(); self.ACDNumOne:Show();
self.ACDNumOne:SetTexture(self.texturePath .. str_sub(str, 0, 1)); self.ACDNumOne:SetTexture(self.texturePath .. path);
self.ACDNumOnes:Hide(); self.ACDNumOnes:Hide();
self.ACDNumTens:Hide(); self.ACDNumTens:Hide();
self.ACDNumFrame:SetScale(1.0) self.ACDNumFrame:SetScale(1.0)
@ -93,18 +91,24 @@ function ACDFrame.OnUpdate(self, elapse)
end end
function ACDFrame:JOINED_ARENA() function ACDFrame:JOINED_ARENA()
self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL") if Gladdy.db.countdown then
self:SetScript("OnEvent", ACDFrame.OnEvent) self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
self.endTime = GetTime() + 70 self:SetScript("OnEvent", ACDFrame.OnEvent)
self:SetScript("OnUpdate", ACDFrame.OnUpdate) self.endTime = GetTime() + 70
self:SetScript("OnUpdate", ACDFrame.OnUpdate)
end
end end
function ACDFrame:ENEMY_SPOTTED() function ACDFrame:ENEMY_SPOTTED()
ACDFrame:Reset() if not Gladdy.frame.testing then
ACDFrame:Reset()
end
end end
function ACDFrame:UNIT_SPEC() function ACDFrame:UNIT_SPEC()
ACDFrame:Reset() if not Gladdy.frame.testing then
ACDFrame:Reset()
end
end end
function ACDFrame:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg) function ACDFrame:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
@ -125,15 +129,15 @@ function ACDFrame:UpdateFrame()
self.ACDNumFrame:SetPoint("CENTER", 0, 128) self.ACDNumFrame:SetPoint("CENTER", 0, 128)
self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize) self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize/2) self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0) self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize) self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize/2) self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0) self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize) self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize/2) self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumOne:SetPoint("CENTER", self.ACDNumFrame, "CENTER", 0, 0) self.ACDNumOne:SetPoint("CENTER", self.ACDNumFrame, "CENTER", 0, 0)
end end

View File

@ -1,6 +1,7 @@
local pairs, ipairs, select, tinsert, tbl_sort, tostring = pairs, ipairs, select, tinsert, table.sort, tostring local pairs, ipairs, select, tinsert, tbl_sort, tostring, tonumber, rand = pairs, ipairs, select, tinsert, table.sort, tostring, tonumber, math.random
local GetSpellInfo = GetSpellInfo local GetSpellInfo = GetSpellInfo
local GetSpellDescription = GetSpellDescription
local CreateFrame, GetTime = CreateFrame, GetTime local CreateFrame, GetTime = CreateFrame, GetTime
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
@ -8,7 +9,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 +21,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
@ -87,7 +88,7 @@ function Auras:CreateFrame(unit)
auraFrame:SetAllPoints(classIcon) auraFrame:SetAllPoints(classIcon)
auraFrame.text = auraFrame.cooldownFrame:CreateFontString(nil, "OVERLAY") auraFrame.text = auraFrame.cooldownFrame:CreateFontString(nil, "OVERLAY")
auraFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE") auraFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), 10, "OUTLINE")
auraFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a) auraFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
--auraFrame.text:SetShadowOffset(1, -1) --auraFrame.text:SetShadowOffset(1, -1)
--auraFrame.text:SetShadowColor(0, 0, 0, 1) --auraFrame.text:SetShadowColor(0, 0, 0, 1)
@ -151,7 +152,7 @@ function Auras:CreateInterrupt(unit)
interruptFrame:SetAllPoints(classIcon) interruptFrame:SetAllPoints(classIcon)
interruptFrame.text = interruptFrame.cooldownFrame:CreateFontString(nil, "OVERLAY") interruptFrame.text = interruptFrame.cooldownFrame:CreateFontString(nil, "OVERLAY")
interruptFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE") interruptFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), 10, "OUTLINE")
interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a) interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
--auraFrame.text:SetShadowOffset(1, -1) --auraFrame.text:SetShadowOffset(1, -1)
--auraFrame.text:SetShadowColor(0, 0, 0, 1) --auraFrame.text:SetShadowColor(0, 0, 0, 1)
@ -204,7 +205,7 @@ function Auras:UpdateFrame(unit)
auraFrame.cooldown:SetPoint("CENTER", auraFrame, "CENTER") auraFrame.cooldown:SetPoint("CENTER", auraFrame, "CENTER")
auraFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha) auraFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha)
auraFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE") auraFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
auraFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a) auraFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
auraFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle) auraFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle)
@ -242,7 +243,7 @@ function Auras:UpdateInterruptFrame(unit)
interruptFrame.cooldown:SetPoint("CENTER", interruptFrame, "CENTER") interruptFrame.cooldown:SetPoint("CENTER", interruptFrame, "CENTER")
interruptFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha) interruptFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha)
interruptFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE") interruptFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a) interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
interruptFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle) interruptFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle)
@ -266,36 +267,72 @@ function Auras:ResetUnit(unit)
end end
function Auras:Test(unit) function Auras:Test(unit)
local spellName, _, icon local spellName, spellid, icon, limit
if (unit == "arena1") then self:AURA_FADE(unit, AURA_TYPE_BUFF)
spellName, _, icon = GetSpellInfo(7922) self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
self:AURA_FADE(unit, AURA_TYPE_BUFF)
self:AURA_FADE(unit, AURA_TYPE_DEBUFF) --Auras
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 7922, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration) local enabledDebuffs, enabledBuffs, testauras = {}, {}
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64) for spellIdStr,value in pairs(Gladdy.db.auraListDefault) do
elseif (unit == "arena2") then if value.enabled then
spellName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)) if value.track == AURA_TYPE_BUFF then
_, _, icon = GetSpellInfo(27010) tinsert(enabledBuffs, {value = value, spellIdStr = spellIdStr})
self:AURA_FADE(unit, AURA_TYPE_BUFF) else
self:AURA_FADE(unit,AURA_TYPE_DEBUFF) tinsert(enabledDebuffs, {value = value, spellIdStr = spellIdStr})
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 27010, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration) end
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64) end
elseif (unit == "arena3") then end
spellName, _, icon = GetSpellInfo(34709) if unit == "arena2" then
self:AURA_FADE(unit, AURA_TYPE_BUFF) testauras = enabledBuffs
self:AURA_GAIN(unit,AURA_TYPE_BUFF, 34709, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration) else
spellName, _, icon = GetSpellInfo(18425) testauras = enabledDebuffs
--self:AURA_FADE(unit, AURA_TYPE_DEBUFF) end
--self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 18425, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
if #testauras > 0 then
limit = rand(1, #testauras)
local v = testauras[rand(1, #testauras)]
spellid = tonumber(v.spellIdStr)
spellName = select(1, GetSpellInfo(tonumber(v.spellIdStr)))
icon = select(3, GetSpellInfo(tonumber(v.spellIdStr)))
if Gladdy.exceptionNames[spellid] then
spellName = Gladdy.exceptionNames[spellid]
end
if (unit == "arena2") then
if (v.value.track == AURA_TYPE_BUFF) then
self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
end
else
self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
end
end
--Interrupts
if (unit == "arena1" or unit == "arena3") then
local enabledInterrupts = {}
local spellSchools = {}
for k,_ in pairs(Gladdy:GetSpellSchoolColors()) do
tinsert(spellSchools, k)
end
for spellIdStr, value in pairs(Gladdy.db.auraListInterrupts) do
if value.enabled then
tinsert(enabledInterrupts, spellIdStr)
end
end
if #enabledInterrupts > 0 then
local extraSpellSchool = spellSchools[rand(1, #spellSchools)]
spellid = tonumber(enabledInterrupts[rand(1, #enabledInterrupts)])
spellName = select(1, GetSpellInfo(spellid))
self:SPELL_INTERRUPT(unit,spellid, spellName, "physical", spellid, spellName, extraSpellSchool)
end
end end
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)
@ -459,11 +496,11 @@ function Auras:GetOptions()
for i,v in ipairs(list) do for i,v in ipairs(list) do
borderArgs["auraSpellSchool" .. v.key] = { borderArgs["auraSpellSchool" .. v.key] = {
type = "color", type = "color",
name = v.val.type, name = L[v.val.type],
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
@ -563,21 +600,21 @@ function Auras:GetOptions()
debuffList = { debuffList = {
type = "group", type = "group",
childGroups = "tree", childGroups = "tree",
name = "Debuffs", name = L["Debuffs"],
order = 4, order = 4,
args = Auras:GetAuraOptions(AURA_TYPE_DEBUFF) args = Auras:GetAuraOptions(AURA_TYPE_DEBUFF)
}, },
buffList = { buffList = {
type = "group", type = "group",
childGroups = "tree", childGroups = "tree",
name = "Buffs", name = L["Buffs"],
order = 5, order = 5,
args = Auras:GetAuraOptions(AURA_TYPE_BUFF) args = Auras:GetAuraOptions(AURA_TYPE_BUFF)
}, },
interruptList = { interruptList = {
type = "group", type = "group",
childGroups = "tree", childGroups = "tree",
name = "Interrupts", name = L["Interrupts"],
order = 6, order = 6,
args = Auras:GetInterruptOptions() args = Auras:GetInterruptOptions()
} }
@ -591,8 +628,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,
@ -602,15 +639,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
@ -625,6 +662,7 @@ function Auras:GetAuraOptions(auraType)
or (Gladdy:GetImportantAuras()[select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))] or (Gladdy:GetImportantAuras()[select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))]
and Gladdy:GetImportantAuras()[select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))].spellID == k and Gladdy:GetImportantAuras()[select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))].spellID == k
and Gladdy:GetImportantAuras()[select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))].altName) and Gladdy:GetImportantAuras()[select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))].altName)
or Gladdy:GetImportantAuras()[GetSpellInfo(k)].altName
or GetSpellInfo(k), or GetSpellInfo(k),
order = i+2, order = i+2,
icon = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)), icon = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
@ -632,13 +670,14 @@ function Auras:GetAuraOptions(auraType)
enabled = { enabled = {
order = 1, order = 1,
name = L["Enabled"], name = L["Enabled"],
desc = GetSpellDescription(k),
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
}, },
@ -650,10 +689,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",
@ -666,13 +705,13 @@ end
function Auras:GetInterruptOptions() function Auras:GetInterruptOptions()
local options = { local options = {
ckeckAll = { checkAll = {
order = 1, order = 1,
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,
@ -682,15 +721,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)
@ -710,10 +749,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
}, },
@ -725,10 +764,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

@ -264,9 +264,9 @@ local function styleIcon(aura, auraType)
aura.border:SetTexture(Gladdy.db.buffsBorderStyle) aura.border:SetTexture(Gladdy.db.buffsBorderStyle)
aura.border:SetVertexColor(spellSchoolToOptionValue(aura.spellSchool)) aura.border:SetVertexColor(spellSchoolToOptionValue(aura.spellSchool))
aura.cooldown:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.buffsFont), (Gladdy.db.buffsIconSize/2 - 1) * Gladdy.db.buffsFontScale, "OUTLINE") aura.cooldown:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/2 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
aura.cooldown:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a) aura.cooldown:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
aura.stacks:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.buffsFont), (Gladdy.db.buffsIconSize/3 - 1) * Gladdy.db.buffsFontScale, "OUTLINE") aura.stacks:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/3 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a) aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
end end
@ -903,7 +903,7 @@ function BuffsDebuffs:GetOptions()
}, },
font = { font = {
type = "group", type = "group",
name = "Font", name = L["Font"],
order = 4, order = 4,
args = { args = {
header = { header = {
@ -946,7 +946,7 @@ function BuffsDebuffs:GetOptions()
}, },
border = { border = {
type = "group", type = "group",
name = "Border", name = L["Border"],
order = 5, order = 5,
args = { args = {
header = { header = {
@ -1033,7 +1033,7 @@ function BuffsDebuffs:GetOptions()
}, },
}, },
debuffList = { debuffList = {
name = "Debuff Lists", name = L["Debuff Lists"],
type = "group", type = "group",
order = 11, order = 11,
childGroups = "tree", childGroups = "tree",
@ -1048,7 +1048,7 @@ function BuffsDebuffs:GetOptions()
end, end,
}, },
buffList = { buffList = {
name = "Buff Lists", name = L["Buff Lists"],
type = "group", type = "group",
order = 12, order = 12,
childGroups = "tree", childGroups = "tree",

View File

@ -61,13 +61,13 @@ function Castbar:CreateFrame(unit)
castBar:EnableMouse(false) castBar:EnableMouse(false)
castBar.unit = unit castBar.unit = unit
castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle), castBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "castBarBorderStyle"),
edgeSize = Gladdy.db.castBarBorderSize }) edgeSize = Gladdy.db.castBarBorderSize })
castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a) castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a)
castBar:SetFrameLevel(1) castBar:SetFrameLevel(1)
castBar.bar = CreateFrame("StatusBar", nil, castBar) castBar.bar = CreateFrame("StatusBar", nil, castBar)
castBar.bar:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture)) castBar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a) castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
castBar.bar:SetMinMaxValues(0, 100) castBar.bar:SetMinMaxValues(0, 100)
castBar.bar:SetFrameLevel(0) castBar.bar:SetFrameLevel(0)
@ -81,7 +81,7 @@ function Castbar:CreateFrame(unit)
castBar.bg = castBar.bar:CreateTexture(nil, "BACKGROUND") castBar.bg = castBar.bar:CreateTexture(nil, "BACKGROUND")
castBar.bg:SetAlpha(1) castBar.bg:SetAlpha(1)
castBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture)) castBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a) castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a)
castBar.bg:SetAllPoints(castBar.bar) castBar.bg:SetAllPoints(castBar.bar)
@ -101,7 +101,7 @@ function Castbar:CreateFrame(unit)
end end
castBar.spellText = castBar:CreateFontString(nil, "LOW") castBar.spellText = castBar:CreateFontString(nil, "LOW")
castBar.spellText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), Gladdy.db.castBarFontSize) castBar.spellText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize)
castBar.spellText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a) castBar.spellText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
castBar.spellText:SetShadowOffset(1, -1) castBar.spellText:SetShadowOffset(1, -1)
castBar.spellText:SetShadowColor(0, 0, 0, 1) castBar.spellText:SetShadowColor(0, 0, 0, 1)
@ -109,7 +109,7 @@ function Castbar:CreateFrame(unit)
castBar.spellText:SetPoint("LEFT", 7, 0) -- Text of the spell castBar.spellText:SetPoint("LEFT", 7, 0) -- Text of the spell
castBar.timeText = castBar:CreateFontString(nil, "LOW") castBar.timeText = castBar:CreateFontString(nil, "LOW")
castBar.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), Gladdy.db.castBarFontSize) castBar.timeText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize)
castBar.timeText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a) castBar.timeText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
castBar.timeText:SetShadowOffset(1, -1) castBar.timeText:SetShadowOffset(1, -1)
castBar.timeText:SetShadowColor(0, 0, 0, 1) castBar.timeText:SetShadowColor(0, 0, 0, 1)
@ -122,7 +122,6 @@ function Castbar:CreateFrame(unit)
end end
function Castbar:UpdateFrame(unit) function Castbar:UpdateFrame(unit)
local button = Gladdy.buttons[unit]
local castBar = self.frames[unit] local castBar = self.frames[unit]
if (not castBar) then if (not castBar) then
return return
@ -130,17 +129,17 @@ function Castbar:UpdateFrame(unit)
castBar:SetWidth(Gladdy.db.castBarWidth) castBar:SetWidth(Gladdy.db.castBarWidth)
castBar:SetHeight(Gladdy.db.castBarHeight) castBar:SetHeight(Gladdy.db.castBarHeight)
castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle), castBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "castBarBorderStyle"),
edgeSize = Gladdy.db.castBarBorderSize }) edgeSize = Gladdy.db.castBarBorderSize })
castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a) castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a)
castBar.bar:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture)) castBar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
castBar.bar:ClearAllPoints() castBar.bar:ClearAllPoints()
castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a) castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
castBar.bar:SetPoint("TOPLEFT", castBar, "TOPLEFT", (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset)) castBar.bar:SetPoint("TOPLEFT", castBar, "TOPLEFT", (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset))
castBar.bar:SetPoint("BOTTOMRIGHT", castBar, "BOTTOMRIGHT", -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset)) castBar.bar:SetPoint("BOTTOMRIGHT", castBar, "BOTTOMRIGHT", -(Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.castBarBorderSize/Gladdy.db.statusbarBorderOffset))
castBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture)) castBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a) castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a)
if Gladdy.db.castBarSparkEnabled then if Gladdy.db.castBarSparkEnabled then
@ -184,10 +183,10 @@ function Castbar:UpdateFrame(unit)
end end
end end
castBar.spellText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.castBarFont), Gladdy.db.castBarFontSize) castBar.spellText:SetFont(Gladdy:SMFetch("font", "castBarFont"), Gladdy.db.castBarFontSize)
castBar.spellText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a) castBar.spellText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
castBar.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.castBarFont), Gladdy.db.castBarFontSize) castBar.timeText:SetFont(Gladdy:SMFetch("font", "castBarFont"), Gladdy.db.castBarFontSize)
castBar.timeText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a) castBar.timeText:SetTextColor(Gladdy.db.castBarFontColor.r, Gladdy.db.castBarFontColor.g, Gladdy.db.castBarFontColor.b, Gladdy.db.castBarFontColor.a)
castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle) castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)

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

@ -12,8 +12,8 @@ local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local attributes = { local attributes = {
{ name = "Target", button = "1", modifier = "", action = "target", spell = "" }, { name = L["Target"], button = "1", modifier = "", action = "target", spell = "" },
{ name = "Focus", button = "2", modifier = "", action = "focus", spell = "" }, { name = L["Focus"], button = "2", modifier = "", action = "focus", spell = "" },
} }
for i = 3, 10 do for i = 3, 10 do
tinsert(attributes, { name = L["Action #%d"]:format(i), button = "", modifier = "", action = "disabled", spell = "" }) tinsert(attributes, { name = L["Action #%d"]:format(i), button = "", modifier = "", action = "disabled", spell = "" })
@ -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
@ -120,7 +120,7 @@ function Cooldowns:CreateFrame(unit)
icon.border:SetVertexColor(Gladdy.db.cooldownBorderColor.r, Gladdy.db.cooldownBorderColor.g, Gladdy.db.cooldownBorderColor.b, Gladdy.db.cooldownBorderColor.a) icon.border:SetVertexColor(Gladdy.db.cooldownBorderColor.r, Gladdy.db.cooldownBorderColor.g, Gladdy.db.cooldownBorderColor.b, Gladdy.db.cooldownBorderColor.a)
icon.cooldownFont = icon.cooldownFrame:CreateFontString(nil, "OVERLAY") icon.cooldownFont = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
icon.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE") icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE")
icon.cooldownFont:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a) icon.cooldownFont:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a)
icon.cooldownFont:SetAllPoints(icon) icon.cooldownFont:SetAllPoints(icon)
@ -172,7 +172,7 @@ function Cooldowns:UpdateFrame(unit)
local icon = button.spellCooldownFrame["icon" .. j] local icon = button.spellCooldownFrame["icon" .. j]
icon:SetHeight(Gladdy.db.cooldownSize) icon:SetHeight(Gladdy.db.cooldownSize)
icon:SetWidth(Gladdy.db.cooldownSize * Gladdy.db.cooldownWidthFactor) icon:SetWidth(Gladdy.db.cooldownSize * Gladdy.db.cooldownWidthFactor)
icon.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE") icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE")
icon.cooldownFont:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a) icon.cooldownFont:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a)
icon:ClearAllPoints() icon:ClearAllPoints()
if (Gladdy.db.cooldownXPos == "RIGHT") then if (Gladdy.db.cooldownXPos == "RIGHT") then
@ -220,7 +220,7 @@ function Cooldowns:UpdateFrame(unit)
icon.cooldown:SetPoint("CENTER", icon, "CENTER") icon.cooldown:SetPoint("CENTER", icon, "CENTER")
icon.cooldown:SetAlpha(Gladdy.db.cooldownCooldownAlpha) icon.cooldown:SetAlpha(Gladdy.db.cooldownCooldownAlpha)
icon.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), (icon:GetWidth()/2 - 1) * Gladdy.db.cooldownFontScale, "OUTLINE") icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), (icon:GetWidth()/2 - 1) * Gladdy.db.cooldownFontScale, "OUTLINE")
icon.cooldownFont:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a) icon.cooldownFont:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a)
icon.border:SetTexture(Gladdy.db.cooldownBorderStyle) icon.border:SetTexture(Gladdy.db.cooldownBorderStyle)
@ -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
@ -295,11 +294,11 @@ function Cooldowns:CooldownStart(button, spellId, duration)
self.timeLeft = self.timeLeft - elapsed self.timeLeft = self.timeLeft - elapsed
local timeLeft = ceil(self.timeLeft) local timeLeft = ceil(self.timeLeft)
if timeLeft >= 540 then if timeLeft >= 540 then
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 3.1 * Gladdy.db.cooldownFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 3.1 * Gladdy.db.cooldownFontScale, "OUTLINE")
elseif timeLeft < 540 and timeLeft >= 60 then elseif timeLeft < 540 and timeLeft >= 60 then
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE")
elseif timeLeft < 60 and timeLeft > 0 then elseif timeLeft < 60 and timeLeft > 0 then
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE")
end end
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 0) Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 0)
if (self.timeLeft <= 0) then if (self.timeLeft <= 0) then
@ -339,6 +338,9 @@ function Cooldowns:DetectSpec(unit, spec)
if (not button or not spec or button.spec) then if (not button or not spec or button.spec) then
return return
end end
if button.class == "PALADIN" and (spec ~= L["Holy"] or spec ~= L["Retribution"]) then
return
end
button.spec = spec button.spec = spec
if not button.test then if not button.test then
@ -353,7 +355,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 +485,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 +503,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 +520,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 +817,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 +846,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 +871,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

@ -1,14 +1,12 @@
local select = select local select = select
local pairs,ipairs,tbl_sort,tinsert,format = pairs,ipairs,table.sort,tinsert,format local pairs,ipairs,tbl_sort,tinsert,format,rand = pairs,ipairs,table.sort,tinsert,format,math.random
local drDuration = 18
local GetSpellInfo = GetSpellInfo local GetSpellInfo = GetSpellInfo
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetTime = GetTime local GetTime = GetTime
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local DRData = LibStub("DRData-1.0") local DRData = LibStub("DRData-1.0-BCC")
local L = Gladdy.L local L = Gladdy.L
local function defaultCategories() local function defaultCategories()
local categories = {} local categories = {}
@ -17,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,
@ -47,7 +45,8 @@ local Diminishings = Gladdy:NewModule("Diminishings", nil, {
drQuarterColor = {r = 1, g = 0.7, b = 0, a = 1 }, drQuarterColor = {r = 1, g = 0.7, b = 0, a = 1 },
drNullColor = {r = 1, g = 0, b = 0, a = 1 }, drNullColor = {r = 1, g = 0, b = 0, a = 1 },
drWidthFactor = 1, drWidthFactor = 1,
drCategories = defaultCategories() drCategories = defaultCategories(),
drDuration = 18
}) })
local function getDiminishColor(dr) local function getDiminishColor(dr)
@ -117,7 +116,7 @@ function Diminishings:CreateFrame(unit)
icon.text = icon.cooldownFrame:CreateFontString(nil, "OVERLAY") icon.text = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
icon.text:SetDrawLayer("OVERLAY") icon.text:SetDrawLayer("OVERLAY")
icon.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.drFont), 10, "OUTLINE") icon.text:SetFont(Gladdy:SMFetch("font", "drFont"), 10, "OUTLINE")
icon.text:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a) icon.text:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a)
icon.text:SetShadowOffset(1, -1) icon.text:SetShadowOffset(1, -1)
icon.text:SetShadowColor(0, 0, 0, 1) icon.text:SetShadowColor(0, 0, 0, 1)
@ -126,7 +125,7 @@ function Diminishings:CreateFrame(unit)
icon.timeText = icon.cooldownFrame:CreateFontString(nil, "OVERLAY") icon.timeText = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
icon.timeText:SetDrawLayer("OVERLAY") icon.timeText:SetDrawLayer("OVERLAY")
icon.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.drFont), 10, "OUTLINE") icon.timeText:SetFont(Gladdy:SMFetch("font", "drFont"), 10, "OUTLINE")
icon.timeText:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a) icon.timeText:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a)
icon.timeText:SetShadowOffset(1, -1) icon.timeText:SetShadowOffset(1, -1)
icon.timeText:SetShadowColor(0, 0, 0, 1) icon.timeText:SetShadowColor(0, 0, 0, 1)
@ -185,9 +184,9 @@ function Diminishings:UpdateFrame(unit)
icon:SetWidth(Gladdy.db.drIconSize * Gladdy.db.drWidthFactor) icon:SetWidth(Gladdy.db.drIconSize * Gladdy.db.drWidthFactor)
icon:SetHeight(Gladdy.db.drIconSize) icon:SetHeight(Gladdy.db.drIconSize)
icon.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.drFont), (Gladdy.db.drIconSize/2 - 1) * Gladdy.db.drFontScale, "OUTLINE") icon.text:SetFont(Gladdy:SMFetch("font", "drFont"), (Gladdy.db.drIconSize/2 - 1) * Gladdy.db.drFontScale, "OUTLINE")
icon.text:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a) icon.text:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a)
icon.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.drFont), (Gladdy.db.drIconSize/2 - 1) * Gladdy.db.drFontScale, "OUTLINE") icon.timeText:SetFont(Gladdy:SMFetch("font", "drFont"), (Gladdy.db.drIconSize/2 - 1) * Gladdy.db.drFontScale, "OUTLINE")
icon.timeText:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a) icon.timeText:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a)
icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16) icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16)
@ -258,17 +257,32 @@ end
function Diminishings:Test(unit) function Diminishings:Test(unit)
if Gladdy.db.drEnabled then if Gladdy.db.drEnabled then
local spells = { 33786, 118, 8643, 8983 } local enabledCategories = {}
for i = 1, 4 do for cat,val in pairs(Gladdy.db.drCategories) do
if i == 1 then if (val.enabled) then
self:AuraFade(unit, spells[i]) tinsert(enabledCategories, {cat = cat , spellIDs = {}})
elseif i == 2 then enabledCategories[cat] = #enabledCategories
self:AuraFade(unit, spells[i]) end
self:AuraFade(unit, spells[i]) end
else for spellId,cat in pairs(DRData:GetSpells()) do
self:AuraFade(unit, spells[i]) if enabledCategories[cat] then
self:AuraFade(unit, spells[i]) tinsert(enabledCategories[enabledCategories[cat]].spellIDs, spellId)
self:AuraFade(unit, spells[i]) end
end
--shuffle
for i = #enabledCategories, 2, -1 do
local j = rand(i)
enabledCategories[i], enabledCategories[j] = enabledCategories[j], enabledCategories[i]
end
--execute test
local index, amount = 0,0
for i=1, (#enabledCategories < 4 and #enabledCategories) or 4 do
amount = rand(1,3)
index = rand(1, #enabledCategories[i].spellIDs)
for _=1, amount do
self:AuraFade(unit, enabledCategories[i].spellIDs[index])
end end
end end
end end
@ -295,15 +309,16 @@ function Diminishings:AuraFade(unit, spellID)
lastIcon.diminishing = 1.0 lastIcon.diminishing = 1.0
end end
end end
if not lastIcon then return end
lastIcon.dr = drCat lastIcon.dr = drCat
lastIcon.timeLeft = drDuration lastIcon.timeLeft = Gladdy.db.drDuration
lastIcon.diminishing = DRData:NextDR(lastIcon.diminishing) lastIcon.diminishing = DRData:NextDR(lastIcon.diminishing)
if Gladdy.db.drBorderColorsEnabled then if Gladdy.db.drBorderColorsEnabled then
lastIcon.border:SetVertexColor(getDiminishColor(lastIcon.diminishing)) lastIcon.border:SetVertexColor(getDiminishColor(lastIcon.diminishing))
else else
lastIcon.border:SetVertexColor(Gladdy.db.drBorderColor.r, Gladdy.db.drBorderColor.g, Gladdy.db.drBorderColor.b, Gladdy.db.drBorderColor.a) lastIcon.border:SetVertexColor(Gladdy.db.drBorderColor.r, Gladdy.db.drBorderColor.g, Gladdy.db.drBorderColor.b, Gladdy.db.drBorderColor.a)
end end
lastIcon.cooldown:SetCooldown(GetTime(), drDuration) lastIcon.cooldown:SetCooldown(GetTime(), Gladdy.db.drDuration)
if Gladdy.db.drCategories[drCat].forceIcon then if Gladdy.db.drCategories[drCat].forceIcon then
lastIcon.texture:SetTexture(Gladdy.db.drCategories[drCat].icon) lastIcon.texture:SetTexture(Gladdy.db.drCategories[drCat].icon)
else else
@ -359,11 +374,20 @@ function Diminishings:GetOptions()
desc = L["Enabled DR module"], desc = L["Enabled DR module"],
order = 3, order = 3,
}), }),
drDuration = Gladdy:option({
type = "range",
name = L["DR Duration"],
desc = L["Change the DR Duration in seconds (DR is dynamic between 15-20s)"],
order = 4,
min = 15,
max = 20,
step = .1,
}),
group = { group = {
type = "group", type = "group",
childGroups = "tree", childGroups = "tree",
name = L["Frame"], name = L["Frame"],
order = 4, order = 5,
args = { args = {
icon = { icon = {
type = "group", type = "group",
@ -586,16 +610,39 @@ function Diminishings:GetOptions()
end end
function Diminishings:CategoryOptions() function Diminishings:CategoryOptions()
local categories = {} local categories = {
checkAll = {
order = 1,
width = "0.7",
name = L["Check All"],
type = "execute",
func = function()
for k,_ in pairs(defaultCategories()) do
Gladdy.db.drCategories[k].enabled = true
end
end,
},
uncheckAll = {
order = 2,
width = "0.7",
name = L["Uncheck All"],
type = "execute",
func = function()
for k,_ in pairs(defaultCategories()) do
Gladdy.db.drCategories[k].enabled = false
end
end,
},
}
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)
for i, k in ipairs(indexList) do for i,k in ipairs(indexList) do
categories[k] = { categories[k] = {
type = "group", type = "group",
name = DRData:GetCategoryName(k), name = L[DRData:GetCategoryName(k)],
order = i, order = i,
icon = Gladdy.db.drCategories[k].icon, icon = Gladdy.db.drCategories[k].icon,
args = { args = {
@ -603,10 +650,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,
}, },
@ -614,10 +661,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,
}, },
@ -627,10 +674,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

@ -1,4 +1,4 @@
local type, pairs = type, pairs local type, pairs, str_match = type, pairs, string.match
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local AceSerializer = LibStub("AceSerializer-3.0") local AceSerializer = LibStub("AceSerializer-3.0")
@ -6,12 +6,23 @@ local L = Gladdy.L
local AceGUI = LibStub("AceGUI-3.0") local AceGUI = LibStub("AceGUI-3.0")
local LibDeflate = LibStub:GetLibrary("LibDeflate") local LibDeflate = LibStub:GetLibrary("LibDeflate")
local function table_copy(t)
local function table_copy(t, str)
local t2 = {}; local t2 = {};
if str == nil then
str = "Gladdy.db"
end
for k,v in pairs(t) do for k,v in pairs(t) do
if type(v) == "table" then if type(v) == "table" then
t2[k] = table_copy(v); if k == "drCategories" then
for key,val in pairs(v) do
--Gladdy:Print("TableCopy", str .. "." .. key)
end
end
t2[k] = table_copy(v, str .. "." .. k);
else else
t2[k] = v; t2[k] = v;
end end
end end
@ -84,9 +95,27 @@ import:AddChild(importClearButton)
import.clearButton = importClearButton import.clearButton = importClearButton
local deletedOptions = { --TODO backward compatibility Imports on deleted options local deletedOptions = { --TODO backward compatibility Imports on deleted options
growUp = true growUp = true,
freezetrap = true,
repentance = true
} }
local function checkIsDeletedOption(k, str, msg, errorFound, errorMsg)
local isDeleted
for key, _ in pairs(deletedOptions) do
if str_match(k, key) then
isDeleted = true
Gladdy:Warn("found deleted option =", str .. "." .. k)
end
end
if errorFound then
return errorFound, errorMsg
end
if not isDeleted then
return true, msg or str .. "." .. k .. " does not exist"
end
end
function ExportImport:CheckDeserializedOptions(tbl, refTbl, str) function ExportImport:CheckDeserializedOptions(tbl, refTbl, str)
if str == nil and not tbl.version_major_num then if str == nil and not tbl.version_major_num then
return false, "Version conflict: version_major_num not seen" return false, "Version conflict: version_major_num not seen"
@ -98,17 +127,29 @@ function ExportImport:CheckDeserializedOptions(tbl, refTbl, str)
str = "Gladdy.db" str = "Gladdy.db"
tbl.version_major_num = nil tbl.version_major_num = nil
end end
for k,v in pairs(tbl) do local res, msg
if refTbl[k] == nil then local errorFound, errorMsg
--return false, str .. "." .. k .. " does not exist" if refTbl == nil then
else return false, str .. "does not exist"
if type(v) ~= type(refTbl[k]) then else
return false, str .. "." .. k .. " type error. Expected " .. type(refTbl[k]) .. " found " .. type(v) for k,v in pairs(tbl) do
if refTbl[k] == nil then
errorFound, errorMsg = checkIsDeletedOption(k, str, nil, errorFound, errorMsg)
elseif type(v) ~= type(refTbl[k]) then
errorFound = true
errorMsg = str .. "." .. k .. " type error. Expected " .. type(refTbl[k]) .. " found " .. type(v)
elseif type(v) == "table" then elseif type(v) == "table" then
ExportImport:CheckDeserializedOptions(v, refTbl[k], str .. "." .. k) res, msg = ExportImport:CheckDeserializedOptions(v, refTbl[k], str .. "." .. k)
if not res then
errorFound, errorMsg = checkIsDeletedOption(msg, str, msg, errorFound, errorMsg)
end
end end
end end
end end
if errorFound then
return false, errorMsg
end
return true return true
end end
@ -135,8 +176,8 @@ function ExportImport:GetOptions()
export.eb:HighlightText(0, export.eb.editBox:GetNumLetters()) export.eb:HighlightText(0, export.eb.editBox:GetNumLetters())
export:SetStatusText("Copy this string to share your configuration with others.") export:SetStatusText("Copy this string to share your configuration with others.")
end, end,
name = "Export", name = L["Export"],
desc = "Export your current profile to share with others or your various accounts.", desc = L["Export your current profile to share with others or your various accounts."],
order = 3, order = 3,
}, },
import = { import = {
@ -159,17 +200,25 @@ function ExportImport:GetOptions()
import.deserializedTable = deserialized import.deserializedTable = deserialized
end) end)
end, end,
name = "Import", name = L["Import"],
desc = "This will overwrite your current profile!", desc = L["This will overwrite your current profile!"],
order = 4, order = 4,
}, },
} }
end end
function ExportImport:ApplyImport(t, table) function ExportImport:ApplyImport(t, table, str)
if str == nil then
str = "Gladdy.db"
end
for k,v in pairs(t) do for k,v in pairs(t) do
if type(v) == "table" then if type(v) == "table" then
ExportImport:ApplyImport(v, table[k]) if (table[k] ~= nil) then
ExportImport:ApplyImport(v, table[k], str .. "." .. k)
else
Gladdy:Warn("ApplyImport failed for", str .. "." .. k)
end
else else
table[k] = v table[k] = v
end end

View File

@ -39,18 +39,18 @@ function Healthbar:CreateFrame(unit)
local healthBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate") local healthBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
healthBar:EnableMouse(false) healthBar:EnableMouse(false)
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.healthBarBorderStyle), healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "healthBarBorderStyle"),
edgeSize = Gladdy.db.healthBarBorderSize }) edgeSize = Gladdy.db.healthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a) healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a)
healthBar:SetFrameLevel(1) healthBar:SetFrameLevel(1)
healthBar.hp = CreateFrame("StatusBar", nil, healthBar) healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture)) healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
healthBar.hp:SetMinMaxValues(0, 100) healthBar.hp:SetMinMaxValues(0, 100)
healthBar.hp:SetFrameLevel(0) healthBar.hp:SetFrameLevel(0)
healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND") healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture)) healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
healthBar.bg:ClearAllPoints() healthBar.bg:ClearAllPoints()
healthBar.bg:SetAllPoints(healthBar.hp) healthBar.bg:SetAllPoints(healthBar.hp)
healthBar.bg:SetAlpha(1) healthBar.bg:SetAlpha(1)
@ -58,10 +58,10 @@ function Healthbar:CreateFrame(unit)
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall") healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
if (Gladdy.db.healthBarNameFontSize < 1) then if (Gladdy.db.healthBarNameFontSize < 1) then
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarNameFont), 1) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1)
healthBar.nameText:Hide() healthBar.nameText:Hide()
else else
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarNameFontSize) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarNameFontSize)
healthBar.nameText:Show() healthBar.nameText:Show()
end end
healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a) healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
@ -72,10 +72,10 @@ function Healthbar:CreateFrame(unit)
healthBar.healthText = healthBar:CreateFontString(nil, "LOW") healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
if (Gladdy.db.healthBarHealthFontSize < 1) then if (Gladdy.db.healthBarHealthFontSize < 1) then
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), 1) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1)
healthBar.healthText:Hide() healthBar.healthText:Hide()
else else
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarHealthFontSize) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarHealthFontSize)
healthBar.healthText:Hide() healthBar.healthText:Hide()
end end
healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a) healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
@ -167,35 +167,33 @@ function Healthbar:UpdateFrame(unit)
return return
end end
local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "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)
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.healthBarBorderStyle), healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "healthBarBorderStyle"),
edgeSize = Gladdy.db.healthBarBorderSize }) edgeSize = Gladdy.db.healthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a) healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a)
healthBar:ClearAllPoints() healthBar:ClearAllPoints()
healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", 0, 0) healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", 0, 0)
healthBar:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit], "BOTTOMRIGHT") healthBar:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit], "BOTTOMRIGHT")
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.healthBarTexture)) healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
healthBar.hp:ClearAllPoints() healthBar.hp:ClearAllPoints()
healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset)) healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset))
healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset)) healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.healthBarBorderSize/Gladdy.db.statusbarBorderOffset))
if (Gladdy.db.healthBarHealthFontSize < 1) then if (Gladdy.db.healthBarHealthFontSize < 1) then
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), 1) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1)
healthBar.healthText:Hide() healthBar.healthText:Hide()
else else
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarHealthFontSize) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarHealthFontSize)
healthBar.healthText:Show() healthBar.healthText:Show()
end end
if (Gladdy.db.healthBarNameFontSize < 1) then if (Gladdy.db.healthBarNameFontSize < 1) then
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarNameFont), 1) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1)
healthBar.nameText:Hide() healthBar.nameText:Hide()
else else
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.healthBarFont), Gladdy.db.healthBarNameFontSize) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), Gladdy.db.healthBarNameFontSize)
if Gladdy.db.healthName then if Gladdy.db.healthName then
healthBar.nameText:Show() healthBar.nameText:Show()
else else

View File

@ -55,17 +55,17 @@ function Highlight:CreateFrame(unit)
local healthBar = Gladdy.modules["Health Bar"].frames[unit] local healthBar = Gladdy.modules["Health Bar"].frames[unit]
local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
targetBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize }) targetBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
--targetBorder:SetFrameStrata("MEDIUM") --targetBorder:SetFrameStrata("MEDIUM")
targetBorder:Hide() targetBorder:Hide()
local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
focusBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize }) focusBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
--focusBorder:SetFrameStrata("MEDIUM") --focusBorder:SetFrameStrata("MEDIUM")
focusBorder:Hide() focusBorder:Hide()
local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
leaderBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize }) leaderBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
--leaderBorder:SetFrameStrata("MEDIUM") --leaderBorder:SetFrameStrata("MEDIUM")
leaderBorder:Hide() leaderBorder:Hide()
@ -106,7 +106,7 @@ function Highlight:UpdateFrame(unit)
button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize)) button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
end end
button.targetBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize }) button.targetBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
button.targetBorder:SetBackdropBorderColor(Gladdy.db.targetBorderColor.r, Gladdy.db.targetBorderColor.g, Gladdy.db.targetBorderColor.b, Gladdy.db.targetBorderColor.a) button.targetBorder:SetBackdropBorderColor(Gladdy.db.targetBorderColor.r, Gladdy.db.targetBorderColor.g, Gladdy.db.targetBorderColor.b, Gladdy.db.targetBorderColor.a)
button.focusBorder:SetWidth(width) button.focusBorder:SetWidth(width)
@ -119,7 +119,7 @@ function Highlight:UpdateFrame(unit)
button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize)) button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
end end
button.focusBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize }) button.focusBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
button.focusBorder:SetBackdropBorderColor(Gladdy.db.focusBorderColor.r, Gladdy.db.focusBorderColor.g, Gladdy.db.focusBorderColor.b, Gladdy.db.focusBorderColor.a) button.focusBorder:SetBackdropBorderColor(Gladdy.db.focusBorderColor.r, Gladdy.db.focusBorderColor.g, Gladdy.db.focusBorderColor.b, Gladdy.db.focusBorderColor.a)
button.leaderBorder:SetWidth(width) button.leaderBorder:SetWidth(width)
@ -132,7 +132,7 @@ function Highlight:UpdateFrame(unit)
button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize)) button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
end end
button.leaderBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize }) button.leaderBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
button.leaderBorder:SetBackdropBorderColor(Gladdy.db.leaderBorderColor.r, Gladdy.db.leaderBorderColor.g, Gladdy.db.leaderBorderColor.b, Gladdy.db.leaderBorderColor.a) button.leaderBorder:SetBackdropBorderColor(Gladdy.db.leaderBorderColor.r, Gladdy.db.leaderBorderColor.g, Gladdy.db.leaderBorderColor.b, Gladdy.db.leaderBorderColor.a)
if Gladdy.frame.testing then if Gladdy.frame.testing then
Highlight:Test(unit) Highlight:Test(unit)

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
@ -149,7 +149,7 @@ function Pets:CreateFrame(unitId)
button.secure = secure button.secure = secure
local healthBar = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate") local healthBar = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.petHealthBarBorderStyle), healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "petHealthBarBorderStyle"),
edgeSize = Gladdy.db.petHealthBarBorderSize }) edgeSize = Gladdy.db.petHealthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a) healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
healthBar:SetFrameLevel(1) healthBar:SetFrameLevel(1)
@ -167,14 +167,14 @@ function Pets:CreateFrame(unitId)
healthBar.hp = CreateFrame("StatusBar", nil, healthBar) healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture)) healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a) healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
healthBar.hp:SetMinMaxValues(0, 100) healthBar.hp:SetMinMaxValues(0, 100)
healthBar.hp:SetFrameLevel(0) healthBar.hp:SetFrameLevel(0)
healthBar.hp:SetAllPoints(healthBar) healthBar.hp:SetAllPoints(healthBar)
healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND") healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture)) healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
healthBar.bg:ClearAllPoints() healthBar.bg:ClearAllPoints()
healthBar.bg:SetAllPoints(healthBar.hp) healthBar.bg:SetAllPoints(healthBar.hp)
healthBar.bg:SetAlpha(1) healthBar.bg:SetAlpha(1)
@ -182,10 +182,10 @@ function Pets:CreateFrame(unitId)
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall") healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
if (Gladdy.db.petHealthBarFontSize < 1) then if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.nameText:Hide() healthBar.nameText:Hide()
else else
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
healthBar.nameText:Show() healthBar.nameText:Show()
end end
healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a) healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
@ -196,10 +196,10 @@ function Pets:CreateFrame(unitId)
healthBar.healthText = healthBar:CreateFontString(nil, "LOW") healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
if (Gladdy.db.petHealthBarFontSize < 1) then if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.healthText:Hide() healthBar.healthText:Hide()
else else
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
healthBar.healthText:Hide() healthBar.healthText:Hide()
end end
healthBar.healthText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a) healthBar.healthText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
@ -263,28 +263,28 @@ function Pets:UpdateFrame(unitId)
healthBar.portrait.border:SetTexture(Gladdy.db.petPortraitBorderStyle) healthBar.portrait.border:SetTexture(Gladdy.db.petPortraitBorderStyle)
healthBar.portrait.border:SetVertexColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a) healthBar.portrait.border:SetVertexColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture)) healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
healthBar.bg:SetVertexColor(Gladdy.db.petHealthBarBgColor.r, Gladdy.db.petHealthBarBgColor.g, Gladdy.db.petHealthBarBgColor.b, Gladdy.db.petHealthBarBgColor.a) healthBar.bg:SetVertexColor(Gladdy.db.petHealthBarBgColor.r, Gladdy.db.petHealthBarBgColor.g, Gladdy.db.petHealthBarBgColor.b, Gladdy.db.petHealthBarBgColor.a)
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.petHealthBarBorderStyle), healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "petHealthBarBorderStyle"),
edgeSize = Gladdy.db.petHealthBarBorderSize }) edgeSize = Gladdy.db.petHealthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a) healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture)) healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a) healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
healthBar.hp:ClearAllPoints() healthBar.hp:ClearAllPoints()
healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset)) healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset)) healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.petHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
if (Gladdy.db.petHealthBarFontSize < 1) then if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.nameText:Hide() healthBar.nameText:Hide()
healthBar.healthText:Hide() healthBar.healthText:Hide()
else else
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
healthBar.nameText:Show() healthBar.nameText:Show()
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), Gladdy.db.petHealthBarFontSize) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), Gladdy.db.petHealthBarFontSize)
healthBar.healthText:Show() healthBar.healthText:Show()
end end
healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a) healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)

View File

@ -38,24 +38,24 @@ function Powerbar:CreateFrame(unit)
local powerBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate") local powerBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
powerBar:EnableMouse(false) powerBar:EnableMouse(false)
powerBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.powerBarBorderStyle), powerBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "powerBarBorderStyle"),
edgeSize = Gladdy.db.powerBarBorderSize }) edgeSize = Gladdy.db.powerBarBorderSize })
powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a) powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a)
powerBar:SetFrameLevel(1) powerBar:SetFrameLevel(1)
powerBar.energy = CreateFrame("StatusBar", nil, powerBar) powerBar.energy = CreateFrame("StatusBar", nil, powerBar)
powerBar.energy:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture)) powerBar.energy:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
powerBar.energy:SetMinMaxValues(0, 100) powerBar.energy:SetMinMaxValues(0, 100)
powerBar.energy:SetFrameLevel(0) powerBar.energy:SetFrameLevel(0)
powerBar.bg = powerBar.energy:CreateTexture(nil, "BACKGROUND") powerBar.bg = powerBar.energy:CreateTexture(nil, "BACKGROUND")
powerBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture)) powerBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
powerBar.bg:ClearAllPoints() powerBar.bg:ClearAllPoints()
powerBar.bg:SetAllPoints(powerBar.energy) powerBar.bg:SetAllPoints(powerBar.energy)
powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a) powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a)
powerBar.raceText = powerBar:CreateFontString(nil, "LOW") powerBar.raceText = powerBar:CreateFontString(nil, "LOW")
powerBar.raceText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize) powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a) powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
powerBar.raceText:SetShadowOffset(1, -1) powerBar.raceText:SetShadowOffset(1, -1)
powerBar.raceText:SetShadowColor(0, 0, 0, 1) powerBar.raceText:SetShadowColor(0, 0, 0, 1)
@ -63,7 +63,7 @@ function Powerbar:CreateFrame(unit)
powerBar.raceText:SetPoint("LEFT", 5, 1) powerBar.raceText:SetPoint("LEFT", 5, 1)
powerBar.powerText = powerBar:CreateFontString(nil, "LOW") powerBar.powerText = powerBar:CreateFontString(nil, "LOW")
powerBar.powerText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize) powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a) powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
powerBar.powerText:SetShadowOffset(1, -1) powerBar.powerText:SetShadowOffset(1, -1)
powerBar.powerText:SetShadowColor(0, 0, 0, 1) powerBar.powerText:SetShadowColor(0, 0, 0, 1)
@ -149,7 +149,7 @@ function Powerbar:UpdateFrame(unit)
else else
powerBar:Show() powerBar:Show()
end end
powerBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture)) powerBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a) powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a)
powerBar:SetWidth(healthBar:GetWidth()) powerBar:SetWidth(healthBar:GetWidth())
@ -158,18 +158,18 @@ function Powerbar:UpdateFrame(unit)
powerBar:ClearAllPoints() powerBar:ClearAllPoints()
powerBar:SetPoint("TOPLEFT", healthBar, "BOTTOMLEFT", 0, -1) powerBar:SetPoint("TOPLEFT", healthBar, "BOTTOMLEFT", 0, -1)
powerBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.powerBarBorderStyle), powerBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "powerBarBorderStyle"),
edgeSize = Gladdy.db.powerBarBorderSize }) edgeSize = Gladdy.db.powerBarBorderSize })
powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a) powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a)
powerBar.energy:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture)) powerBar.energy:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
powerBar.energy:ClearAllPoints() powerBar.energy:ClearAllPoints()
powerBar.energy:SetPoint("TOPLEFT", powerBar, "TOPLEFT", (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset)) powerBar.energy:SetPoint("TOPLEFT", powerBar, "TOPLEFT", (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset))
powerBar.energy:SetPoint("BOTTOMRIGHT", powerBar, "BOTTOMRIGHT", -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset)) powerBar.energy:SetPoint("BOTTOMRIGHT", powerBar, "BOTTOMRIGHT", -(Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.powerBarBorderSize/Gladdy.db.statusbarBorderOffset))
powerBar.raceText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize) powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a) powerBar.raceText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
powerBar.powerText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize) powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a) powerBar.powerText:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
end end

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, {
@ -46,19 +44,19 @@ local function iconTimer(self,elapsed)
if timeLeft >= 60 then if timeLeft >= 60 then
self.cooldownFont:SetTextColor(1, 1, 0) self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 60 and timeLeft >= 30 then elseif timeLeft < 60 and timeLeft >= 30 then
self.cooldownFont:SetTextColor(1, 1, 0) self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 30 and timeLeft >= 11 then elseif timeLeft < 30 and timeLeft >= 11 then
self.cooldownFont:SetTextColor(1, 0.7, 0) self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 10 and timeLeft >= 5 then elseif timeLeft < 10 and timeLeft >= 5 then
self.cooldownFont:SetTextColor(1, 0.7, 0) self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
elseif timeLeft < 5 and timeLeft > 0 then elseif timeLeft < 5 and timeLeft > 0 then
self.cooldownFont:SetTextColor(1, 0, 0) self.cooldownFont:SetTextColor(1, 0, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
end end
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true) Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
end end
@ -82,7 +80,7 @@ function Racial:CreateFrame(unit)
racial.cooldownFrame:SetPoint("BOTTOMRIGHT", racial, "BOTTOMRIGHT") racial.cooldownFrame:SetPoint("BOTTOMRIGHT", racial, "BOTTOMRIGHT")
racial.cooldownFont = racial.cooldownFrame:CreateFontString(nil, "OVERLAY") racial.cooldownFont = racial.cooldownFrame:CreateFontString(nil, "OVERLAY")
racial.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), 20, "OUTLINE") racial.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), 20, "OUTLINE")
--trinket.cooldownFont:SetAllPoints(trinket.cooldown) --trinket.cooldownFont:SetAllPoints(trinket.cooldown)
racial.cooldownFont:SetJustifyH("CENTER") racial.cooldownFont:SetJustifyH("CENTER")
racial.cooldownFont:SetPoint("CENTER") racial.cooldownFont:SetPoint("CENTER")
@ -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)
@ -174,7 +171,7 @@ end
function Racial:ENEMY_SPOTTED(unit) function Racial:ENEMY_SPOTTED(unit)
local racial = self.frames[unit] local racial = self.frames[unit]
if (not racial) then if (not racial or not Gladdy.buttons[unit].race) then
return return
end end
racial.texture:SetTexture(Gladdy:Racials()[Gladdy.buttons[unit].race].texture) racial.texture:SetTexture(Gladdy:Racials()[Gladdy.buttons[unit].race].texture)

View File

@ -211,12 +211,12 @@ function RangeCheck.CheckRange(self)
local spell = Gladdy.db.rangeCheckDefaultSpells[RangeCheck.playerClass].min local spell = Gladdy.db.rangeCheckDefaultSpells[RangeCheck.playerClass].min
if( not UnitIsConnected(button.unit) or not UnitInPhase(button.unit) ) then if (not UnitIsConnected(button.unit) or not UnitInPhase(button.unit)) then
RangeCheck:SetRangeAlpha(button, false) RangeCheck:SetRangeAlpha(button, false)
elseif( spell ) then elseif (spell) then
RangeCheck:SetRangeAlpha(button, LSR.IsSpellInRange(spell, button.unit) == 1) RangeCheck:SetRangeAlpha(button, LSR.IsSpellInRange(spell, button.unit) == 1)
-- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally -- That didn't work, but they are grouped lets try the actual API for this, it's a bit flaky though and not that useful generally
elseif( UnitInRaid(button.unit) or UnitInParty(button.unit) ) then elseif (UnitInRaid(button.unit) or UnitInParty(button.unit)) then
RangeCheck:SetRangeAlpha(button, UnitInRange(button.unit, "player")) RangeCheck:SetRangeAlpha(button, UnitInRange(button.unit, "player"))
-- Nope, fall back to interaction :( -- Nope, fall back to interaction :(
else else
@ -349,7 +349,7 @@ function RangeCheck:GetSpells()
local group = { local group = {
description = { description = {
type = "description", type = "description",
name = "Changing the spellID only applies to your player class!\n\nExample: If you are a Paladin and wish to change your range check spell to Repentance, edit the Paladin spellID to 20066.", name = L["Changing the spellID only applies to your player class!\n\nExample: If you are a Paladin and wish to change your range check spell to Repentance, edit the Paladin spellID to 20066."],
order = 1, order = 1,
}, },
} }
@ -363,7 +363,7 @@ function RangeCheck:GetSpells()
args = { args = {
headerMin = { headerMin = {
type = "header", type = "header",
name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %dyds", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min))) name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %d" .. L["yds"], select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
or "nil", or "nil",
order = 1, order = 1,
}, },
@ -385,7 +385,7 @@ function RangeCheck:GetSpells()
Gladdy.db.rangeCheckDefaultSpells[class].min = tonumber(value) Gladdy.db.rangeCheckDefaultSpells[class].min = tonumber(value)
--Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.min.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min))) --Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.min.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
-- or "nil" -- or "nil"
Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.headerMin.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %dyds", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min))) Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.headerMin.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %d" .. L["yds"], select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
or "nil" or "nil"
end end
}, },

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")
@ -21,6 +21,7 @@ end
function ShadowsightTimer:Initialize() function ShadowsightTimer:Initialize()
self.locale = Gladdy:GetArenaTimer() self.locale = Gladdy:GetArenaTimer()
self:RegisterMessage("JOINED_ARENA") self:RegisterMessage("JOINED_ARENA")
self:RegisterMessage("AURA_GAIN")
self:CreateTimerFrame() self:CreateTimerFrame()
end end
@ -32,6 +33,12 @@ function ShadowsightTimer:JOINED_ARENA()
self.timerFrame:Show() self.timerFrame:Show()
end end
function ShadowsightTimer:AURA_GAIN(unit, auraType, spellID)
if (spellID == 34709) then
--TODO reset timer after 15s
end
end
function ShadowsightTimer:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg) function ShadowsightTimer:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
for k,v in pairs(self.locale) do for k,v in pairs(self.locale) do
if str_find(msg, v) then if str_find(msg, v) then
@ -101,7 +108,9 @@ function ShadowsightTimer:UpdateFrameOnce()
self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale) self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale)
self.timerFrame:ClearAllPoints() self.timerFrame:ClearAllPoints()
self.timerFrame:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY) self.timerFrame:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
self.timerFrame:Show() if Gladdy.frame.testing or Gladdy.curBracket then
self.timerFrame:Show()
end
else else
self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale) self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale)
self.timerFrame:ClearAllPoints() self.timerFrame:ClearAllPoints()

View File

@ -3,7 +3,7 @@ local UnitExists, UnitIsUnit, UnitName, UnitIsEnemy = UnitExists, UnitIsUnit, Un
local C_NamePlate = C_NamePlate local C_NamePlate = C_NamePlate
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local GetSpellInfo, CreateFrame, GetCVar = GetSpellInfo, CreateFrame, GetCVar local GetSpellInfo, CreateFrame = GetSpellInfo, CreateFrame
--------------------------------------------------- ---------------------------------------------------
@ -117,8 +117,8 @@ local function GetTotemColorDefaultOptions()
desc = "Enable " .. format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))), desc = "Enable " .. format("|T%s:20|t %s", indexedList[i].texture, select(1, GetSpellInfo(indexedList[i].id))),
type = "toggle", type = "toggle",
width = "full", width = "full",
get = function(info) return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled end, get = function() return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled end,
set = function(info, value) set = function(_, value)
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled = value Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled = value
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end end
@ -130,15 +130,13 @@ local function GetTotemColorDefaultOptions()
order = 3, order = 3,
hasAlpha = true, hasAlpha = true,
width = "full", width = "full",
get = function(info) get = function()
local key = info.arg or info[#info]
return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r, return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r,
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g,
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b,
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.a Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.a
end, end,
set = function(info, r, g, b, a) set = function(_, r, g, b, a)
local key = info.arg or info[#info]
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.r,
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.g,
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.b,
@ -154,10 +152,10 @@ local function GetTotemColorDefaultOptions()
max = 1, max = 1,
step = 0.1, step = 0.1,
width = "full", width = "full",
get = function(info) get = function()
return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha
end, end,
set = function(info, value) set = function(_, value)
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha = value Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha = value
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end end
@ -167,8 +165,8 @@ local function GetTotemColorDefaultOptions()
name = L["Custom totem name"], name = L["Custom totem name"],
order = 5, order = 5,
width = "full", width = "full",
get = function(info) return Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText end, get = function() return Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText end,
set = function(info, value) Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText = value Gladdy:UpdateFrame() end set = function(_, value) Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText = value Gladdy:UpdateFrame() end
}, },
} }
} }
@ -176,15 +174,6 @@ local function GetTotemColorDefaultOptions()
return defaultDB, options, indexedList return defaultDB, options, indexedList
end end
local function GetTotemOptions()
local indexedList = select(3, GetTotemColorDefaultOptions())
local colorList = {}
for i=1, #indexedList do
tinsert(colorList, Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id])
end
return colorList
end
function Gladdy:GetTotemColors() function Gladdy:GetTotemColors()
return GetTotemColorDefaultOptions() return GetTotemColorDefaultOptions()
end end
@ -280,7 +269,7 @@ function TotemPlates:UpdateFrameOnce()
Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b, Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a) Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.a)
nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset) nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE") nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy:SMFetch("font", "npTremorFont"), Gladdy.db.npTremorFontSize, "OUTLINE")
nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "") nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
self:SetTotemAlpha(nameplate.gladdyTotemFrame, k) self:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
@ -311,7 +300,7 @@ function TotemPlates:UpdateFrameOnce()
gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor) gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize) gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize)
gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle) gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE") gladdyTotemFrame.totemName:SetFont(Gladdy:SMFetch("font", "npTremorFont"), Gladdy.db.npTremorFontSize, "OUTLINE")
gladdyTotemFrame.totemName:SetPoint("TOP", gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset) gladdyTotemFrame.totemName:SetPoint("TOP", gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
end end
end end
@ -338,7 +327,7 @@ function TotemPlates:CreateTotemFrame(nameplate)
nameplate.gladdyTotemFrame.totemBorder:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT") nameplate.gladdyTotemFrame.totemBorder:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT")
nameplate.gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle) nameplate.gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
nameplate.gladdyTotemFrame.totemName = nameplate.gladdyTotemFrame:CreateFontString(nil, "OVERLAY") nameplate.gladdyTotemFrame.totemName = nameplate.gladdyTotemFrame:CreateFontString(nil, "OVERLAY")
nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE") nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy:SMFetch("font", "npTremorFont"), Gladdy.db.npTremorFontSize, "OUTLINE")
nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset) nameplate.gladdyTotemFrame.totemName:SetPoint("TOP", nameplate.gladdyTotemFrame, "BOTTOM", Gladdy.db.npTremorFontXOffset, Gladdy.db.npTremorFontYOffset)
nameplate.gladdyTotemFrame.selectionHighlight = nameplate.gladdyTotemFrame:CreateTexture(nil, "OVERLAY") nameplate.gladdyTotemFrame.selectionHighlight = nameplate.gladdyTotemFrame:CreateTexture(nil, "OVERLAY")
nameplate.gladdyTotemFrame.selectionHighlight:SetTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill") nameplate.gladdyTotemFrame.selectionHighlight:SetTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill")
@ -394,11 +383,11 @@ function TotemPlates:ToggleAddon(nameplate, show)
local addonFrames = { self:GetAddonFrame(nameplate) } local addonFrames = { self:GetAddonFrame(nameplate) }
if addonFrames and #addonFrames > 0 then if addonFrames and #addonFrames > 0 then
if show then if show then
for i,v in ipairs(addonFrames) do for _,v in ipairs(addonFrames) do
v:Show() v:Show()
end end
else else
for i,v in ipairs(addonFrames) do for _,v in ipairs(addonFrames) do
v:Hide() v:Hide()
end end
end end
@ -665,19 +654,23 @@ function TotemPlates:GetOptions()
step = 0.1, step = 0.1,
width = "full", width = "full",
order = 23, order = 23,
get = function(info) get = function()
local alphas = GetTotemOptions() local alpha, i = nil, 1
for i=2, #alphas do for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
if alphas[i].alpha ~= alphas[1].alpha then if i == 1 then
return "" alpha = v.alpha
i = i + 1
else
if v.alpha ~= alpha then
return ""
end
end end
end end
return alphas[1].alpha return alpha
end, end,
set = function(info, value) set = function(_, value)
local alphas = GetTotemOptions() for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
for i=1, #alphas do v.alpha = value
alphas[i].alpha = value
end end
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end, end,
@ -705,23 +698,27 @@ function TotemPlates:GetOptions()
name = L["All totem border color"], name = L["All totem border color"],
order = 42, order = 42,
hasAlpha = true, hasAlpha = true,
get = function(info) get = function()
local colors = GetTotemOptions() local color
local color = colors[1].color local i = 1
for i=2, #colors do for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
if colors[i].r ~= color.r or colors[i].color.r ~= color.r or colors[i].color.r ~= color.r or colors[i].color.r ~= color.r then if i == 1 then
return 0, 0, 0, 0 color = v.color
i = i + 1
else
if v.color.r ~= color.r or v.color.g ~= color.g or v.color.b ~= color.b or v.color.a ~= color.a then
return 0, 0, 0, 0
end
end end
end end
return color.r, color.g, color.b, color.a return color.r, color.g, color.b, color.a
end, end,
set = function(info, r, g, b, a) set = function(_, r, g, b, a)
local colors = GetTotemOptions() for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
for i=1, #colors do v.color.r = r
colors[i].color.r = r v.color.g = g
colors[i].color.g = g v.color.b = b
colors[i].color.b = b v.color.a = a
colors[i].color.a = a
end end
Gladdy:UpdateFrame() Gladdy:UpdateFrame()
end, end,

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
@ -40,19 +40,19 @@ local function iconTimer(self, elapsed)
if timeLeft >= 60 then if timeLeft >= 60 then
self.cooldownFont:SetTextColor(1, 1, 0) self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 0.15*self:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 0.15*self:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft < 60 and timeLeft >= 30 then elseif timeLeft < 60 and timeLeft >= 30 then
self.cooldownFont:SetTextColor(1, 1, 0) self.cooldownFont:SetTextColor(1, 1, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft < 30 and timeLeft >= 11 then elseif timeLeft < 30 and timeLeft >= 11 then
self.cooldownFont:SetTextColor(1, 0.7, 0) self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft <= 10 and timeLeft >= 5 then elseif timeLeft <= 10 and timeLeft >= 5 then
self.cooldownFont:SetTextColor(1, 0.7, 0) self.cooldownFont:SetTextColor(1, 0.7, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
elseif timeLeft < 5 and timeLeft > 0 then elseif timeLeft < 5 and timeLeft > 0 then
self.cooldownFont:SetTextColor(1, 0, 0) self.cooldownFont:SetTextColor(1, 0, 0)
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE") self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
end end
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true) Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
end end
@ -76,7 +76,7 @@ function Trinket:CreateFrame(unit)
trinket.cooldownFrame:SetPoint("BOTTOMRIGHT", trinket, "BOTTOMRIGHT") trinket.cooldownFrame:SetPoint("BOTTOMRIGHT", trinket, "BOTTOMRIGHT")
trinket.cooldownFont = trinket.cooldownFrame:CreateFontString(nil, "OVERLAY") trinket.cooldownFont = trinket.cooldownFrame:CreateFontString(nil, "OVERLAY")
trinket.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), 20, "OUTLINE") trinket.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), 20, "OUTLINE")
--trinket.cooldownFont:SetAllPoints(trinket.cooldown) --trinket.cooldownFont:SetAllPoints(trinket.cooldown)
trinket.cooldownFont:SetJustifyH("CENTER") trinket.cooldownFont:SetJustifyH("CENTER")
trinket.cooldownFont:SetPoint("CENTER") trinket.cooldownFont:SetPoint("CENTER")

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)

View File

@ -64,6 +64,16 @@ function XiconProfiles:ApplyRukk()
Gladdy:ToggleFrame(3) Gladdy:ToggleFrame(3)
end end
function XiconProfiles:ApplyMir()
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetMirProfile())
if deserialized then
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
end
Gladdy:Reset()
Gladdy:HideFrame()
Gladdy:ToggleFrame(3)
end
function XiconProfiles:GetOptions() function XiconProfiles:GetOptions()
return { return {
headerProfileBlizzard = { headerProfileBlizzard = {
@ -106,7 +116,7 @@ function XiconProfiles:GetOptions()
}, },
headerProfileClassicNoPet = { headerProfileClassicNoPet = {
type = "header", type = "header",
name = "Classic " .. L["Profile"] .. " No Pet", name = "Classic " .. L["Profile"] .. L[" No Pet"],
order = 6, order = 6,
}, },
classicProfileNoPet = { classicProfileNoPet = {
@ -116,7 +126,7 @@ function XiconProfiles:GetOptions()
XiconProfiles:ApplyClassicNoPet() XiconProfiles:ApplyClassicNoPet()
end, end,
name = " ", name = " ",
desc = "Classic " .. L["Profile"] .. " No Pet", desc = "Classic " .. L["Profile"] .. L[" No Pet"],
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic2.blp", image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic2.blp",
imageWidth = 350, imageWidth = 350,
imageHeight = 175, imageHeight = 175,
@ -180,5 +190,24 @@ function XiconProfiles:GetOptions()
width = "full", width = "full",
order = 13, order = 13,
}, },
headerProfileMir = {
type = "header",
name = "Mir's " .. L["Profile"],
order = 14,
},
mirProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyMir()
end,
name = " ",
desc = "Mir's " .. L["Profile"],
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Mir1.blp",
imageWidth = 350,
imageHeight = 175,
width = "full",
order = 15,
},
} }
end end

View File

@ -1,6 +1,7 @@
local type, pairs, tinsert, tsort = type, pairs, table.insert, table.sort local type, pairs, tinsert, tsort = type, pairs, table.insert, table.sort
local tostring, str_match, tonumber, string_format = tostring, string.match, tonumber, string.format local tostring, str_match, tonumber, string_format = tostring, string.match, tonumber, string.format
local ceil, floor = ceil, floor local ceil, floor = ceil, floor
local ReloadUI = ReloadUI
local InterfaceOptionsFrame_OpenToFrame = InterfaceOptionsFrame_OpenToFrame local InterfaceOptionsFrame_OpenToFrame = InterfaceOptionsFrame_OpenToFrame
local GetSpellInfo = GetSpellInfo local GetSpellInfo = GetSpellInfo
@ -207,18 +208,52 @@ end
function Gladdy:SetupOptions() function Gladdy:SetupOptions()
self.options = { self.options = {
type = "group", type = "group",
name = "Gladdy", name = L["Gladdy"],
plugins = {}, plugins = {},
childGroups = "tree", childGroups = "tree",
get = getOpt, get = getOpt,
set = setOpt, set = setOpt,
args = { args = {
test = {
order = 1,
width = 0.7,
name = L["Test"],
type = "execute",
func = function()
Gladdy:ToggleFrame(3)
end,
},
hide = {
order = 2,
width = 0.7,
name = L["Hide"],
type = "execute",
func = function()
Gladdy:Reset()
Gladdy:HideFrame()
end,
},
reload = {
order = 3,
width = 0.7,
name = L["ReloadUI"],
type = "execute",
func = function()
ReloadUI()
end,
},
version = {
order = 4,
width = 1,
type = "description",
name = " Gladdy v" .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType
},
general = { general = {
type = "group", type = "group",
name = L["General"], name = L["General"],
desc = L["General settings"], desc = L["General settings"],
childGroups = "tab", childGroups = "tab",
order = 1, order = 5,
args = { args = {
locked = { locked = {
type = "toggle", type = "toggle",
@ -270,7 +305,7 @@ function Gladdy:SetupOptions()
order = 4, order = 4,
min = .1, min = .1,
max = 2, max = 2,
step = .1, step = .01,
}, },
padding = { padding = {
type = "range", type = "range",
@ -699,19 +734,19 @@ function Gladdy:SetupOptions()
}, },
} }
local order = 2 local order = 6
for k, v in pairsByKeys(self.modules) do for k, v in pairsByKeys(self.modules) do
self:SetupModule(k, v, order) self:SetupModule(k, v, order)
order = order + 1 order = order + 1
end end
local options = { local options = {
name = "Gladdy", name = L["Gladdy"],
type = "group", type = "group",
args = { args = {
load = { load = {
name = "Load configuration", name = L["Load configuration"],
desc = "Load configuration options", desc = L["Load configuration options"],
type = "execute", type = "execute",
func = function() func = function()
HideUIPanel(InterfaceOptionsFrame) HideUIPanel(InterfaceOptionsFrame)
@ -738,7 +773,7 @@ function Gladdy:GetAuras(auraType)
ckeckAll = { ckeckAll = {
order = 1, order = 1,
width = "0.7", width = "0.7",
name = "Check All", name = L["Check All"],
type = "execute", type = "execute",
func = function(info) func = function(info)
if auraType == AURA_TYPE_DEBUFF then if auraType == AURA_TYPE_DEBUFF then
@ -755,7 +790,7 @@ function Gladdy:GetAuras(auraType)
uncheckAll = { uncheckAll = {
order = 2, order = 2,
width = "0.7", width = "0.7",
name = "Uncheck All", name = L["Uncheck All"],
type = "execute", type = "execute",
func = function(info) func = function(info)
if auraType == AURA_TYPE_DEBUFF then if auraType == AURA_TYPE_DEBUFF then

View File

@ -1,7 +1,7 @@
# Gladdy - TBC # Gladdy - TBC
### The most powerful arena addon for WoW TBC 2.5.1 ### The most powerful arena addon for WoW TBC 2.5.1
## [v1.19-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.19-Beta/Gladdy_TBC-Classic_v1.19-Beta.zip) ## [v1.20-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.20-Release/Gladdy_TBC-Classic_v1.20-Release.zip)
###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work ###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
@ -62,6 +62,25 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
### Changes ### Changes
### v1.20-Release
- configurable DR duration
- scale in 0.01 percent steps
- added Net-o-Matic, Nigh Invulnerablility Shield, Nigh Invulnerablility Backfire & Flee (Skull of Impending Doom) to Auras
- added Mangle, Chastise, Avenging Wrath, Rapid Fire to BuffsDebuffs
- improved testmode to only activate Auras/Buffs/Debuffs/Dr's that are actually enabled
- added Mir's profile to XiconProfiles
- added zhTW localization
- added buttons for Test, Hide & Reload in the config
- added version in config
- ArenaCountdown upgrade
- Repentance, Freezing Trap & Wyvern Sting are now disorients
- import string now ignores errors on deleted options
- added (un)checkAll button in DR-Categories in Diminishing Module
- totemplates fix option to alter all colors/alphas
- hide blizzard arena pets as well
- fix shadowsight timer showing when not in arena or testmode
- some minor refactoring / optimization
### v1.19-Beta ### v1.19-Beta
- fix gladdy frames not showing v2 - fix gladdy frames not showing v2
- minor bug fixes - minor bug fixes