Compare commits
165 Commits
entangling
...
v2.00-Rele
Author | SHA1 | Date | |
---|---|---|---|
7c145752f7 | |||
47a15bd2a1 | |||
cd64e8b481 | |||
7ce6cdd5e0 | |||
5f94e971f0 | |||
fd37f588ac | |||
038688bd5b | |||
cf485a91a1 | |||
9dbab9939f | |||
0d9e9735da | |||
83763aa016 | |||
b22756b6ab | |||
5f4bf034e5 | |||
042a8f7812 | |||
ea10481c13 | |||
99fa6c0664 | |||
61c50b3e32 | |||
e5151f1605 | |||
d24b330411 | |||
298ce642fc | |||
061bc5859c | |||
12abedfd0f | |||
22526c0386 | |||
1e926024ce | |||
1dd411fed7 | |||
242c45b8c4 | |||
2edca9b11e | |||
55860fc157 | |||
6954fb05d0 | |||
114a7b14e4 | |||
978ba56f85 | |||
61e49ffb8c | |||
b351bd9c23 | |||
2c4308712d | |||
91f7fcb998 | |||
5766484f92 | |||
035942abbe | |||
2e3fb06269 | |||
b5f67d066f | |||
c3a7c6cbc8 | |||
65daef4cd4 | |||
6b94fdc32f | |||
2571df3052 | |||
1c42523a2f | |||
114c0ac96d | |||
59da6f34c6 | |||
adb06d0c7f | |||
be292401cc | |||
8df7aae3b6 | |||
1b2311fea2 | |||
0a5176aaed | |||
f923f471d8 | |||
2dcdc9c978 | |||
7db32cceef | |||
e2a78c717b | |||
b2c8ed9c44 | |||
fed5d1c341 | |||
92322a4d9b | |||
91c25edcfe | |||
41f74f5896 | |||
69c1eca49b | |||
09a47e81f1 | |||
ebb56c4127 | |||
fabd9ae048 | |||
3f28947b05 | |||
1010d59bd3 | |||
069ca47210 | |||
d2f307fca0 | |||
033aa260f4 | |||
4925195de6 | |||
ff4799ceef | |||
548234aaaa | |||
df2721f1cf | |||
01f907f71c | |||
94efa7a112 | |||
e93f7c54c6 | |||
7a7c50e283 | |||
f29e8eff3b | |||
a0ed3be791 | |||
95106eab1e | |||
2c845547a4 | |||
b861091d44 | |||
c3a1555932 | |||
f36883df31 | |||
f9b1ac9c51 | |||
b6d243b8c0 | |||
ce5c8fc5a0 | |||
60c823fa07 | |||
f1e1ee4e0b | |||
d2884e777a | |||
b651eb39ce | |||
73b01c28d7 | |||
dd75f267f4 | |||
7108598603 | |||
6b4c35c66b | |||
75d4dfe9fe | |||
776464f551 | |||
dd8a35857d | |||
1c93e4ce4d | |||
e2d0af1e2b | |||
9e81455ec5 | |||
fad4321bf6 | |||
9c8c78bb83 | |||
bb7b820cbb | |||
890cf80531 | |||
f7f703d33a | |||
a7cdacb55d | |||
237130e3ce | |||
2c73188e15 | |||
5da6d1d7c9 | |||
8a17592842 | |||
51cd2b7311 | |||
720e5b63ec | |||
74753e327c | |||
0d5b5644a9 | |||
d53f89c6d4 | |||
79371b72b0 | |||
b73bc33630 | |||
4c239cd599 | |||
6de5a60309 | |||
31360bf695 | |||
599fde6581 | |||
382e5c3948 | |||
582ca88b59 | |||
aa53bfc241 | |||
bd2c15088d | |||
d2da0a22ae | |||
915c213eb5 | |||
0cfba040f1 | |||
2a5a0fa394 | |||
a1387f8ecd | |||
e7a83d61f3 | |||
90b146e433 | |||
61f79adda2 | |||
9b8c6a1426 | |||
d44ac29f43 | |||
751e84c61d | |||
f92b3a4964 | |||
c2fec39202 | |||
9f1bda3e80 | |||
fdeea258be | |||
960a98d244 | |||
82ec1460f8 | |||
23b9e2dfae | |||
755a3e52b5 | |||
5767bc7ae3 | |||
b1070d070a | |||
5f4ab71a5a | |||
c43228f0b9 | |||
b54ed1cda1 | |||
19d0460501 | |||
cb6e519afe | |||
d9f0c1491a | |||
17a983fad6 | |||
4e0ea70bfa | |||
da54c659bc | |||
6be94215b9 | |||
964a4b4f88 | |||
03a55395b8 | |||
8409ac1b96 | |||
d653c76e37 | |||
984c22a861 | |||
5b348b760c | |||
9dab6b7299 | |||
2c21a6e770 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,4 +5,5 @@ BuffLib
|
||||
*.psd
|
||||
Ace-Libs
|
||||
Images_Raw
|
||||
Gladdy_old
|
||||
Gladdy_old
|
||||
Gladdy_TW
|
180
Constants.lua
180
Constants.lua
@ -1,6 +1,7 @@
|
||||
local tbl_sort, select = table.sort, select
|
||||
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local GetItemInfo = GetItemInfo
|
||||
local GetLocale = GetLocale
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
@ -25,13 +26,16 @@ local specBuffs = {
|
||||
[GetSpellInfo(20895)] = L["Beast Mastery"], -- Spirit Bond
|
||||
[GetSpellInfo(34455)] = L["Beast Mastery"], -- Ferocious Inspiration
|
||||
[GetSpellInfo(27066)] = L["Marksmanship"], -- Trueshot Aura
|
||||
[GetSpellInfo(34501)] = L["Survival"], -- Expose Weakness
|
||||
|
||||
-- MAGE
|
||||
[GetSpellInfo(33405)] = L["Frost"], -- Ice Barrier
|
||||
[GetSpellInfo(11129)] = L["Fire"], -- Combustion
|
||||
[GetSpellInfo(12042)] = L["Arcane"], -- Arcane Power
|
||||
[GetSpellInfo(12043)] = L["Arcane"], -- Presence of Mind
|
||||
[GetSpellInfo(31589)] = L["Arcane"], -- Slow
|
||||
[GetSpellInfo(12472)] = L["Frost"], -- Icy Veins
|
||||
[GetSpellInfo(46989)] = L["Arcane"], -- Improved Blink
|
||||
|
||||
-- PALADIN
|
||||
[GetSpellInfo(31836)] = L["Holy"], -- Light's Grace
|
||||
@ -40,9 +44,12 @@ local specBuffs = {
|
||||
[GetSpellInfo(20375)] = L["Retribution"], -- Seal of Command
|
||||
[GetSpellInfo(20049)] = L["Retribution"], -- Vengeance
|
||||
[GetSpellInfo(20218)] = L["Retribution"], -- Sanctity Aura
|
||||
[GetSpellInfo(26018)] = L["Retribution"], -- Vindication
|
||||
[GetSpellInfo(27179)] = L["Protection"], -- Holy Shield
|
||||
|
||||
-- PRIEST
|
||||
[GetSpellInfo(15473)] = L["Shadow"], -- Shadowform
|
||||
[GetSpellInfo(15286)] = L["Shadow"], -- Vampiric Embrace
|
||||
[GetSpellInfo(45234)] = L["Discipline"], -- Focused Will
|
||||
[GetSpellInfo(27811)] = L["Discipline"], -- Blessed Recovery
|
||||
[GetSpellInfo(33142)] = L["Holy"], -- Blessed Resilience
|
||||
@ -58,11 +65,15 @@ local specBuffs = {
|
||||
[GetSpellInfo(36563)] = L["Subtlety"], -- Shadowstep DMG
|
||||
[GetSpellInfo(14278)] = L["Subtlety"], -- Ghostly Strike
|
||||
[GetSpellInfo(31233)] = L["Assassination"], -- Find Weakness
|
||||
[GetSpellInfo(13877)] = L["Combat"], -- Blade Flurry
|
||||
|
||||
--Shaman
|
||||
[GetSpellInfo(30807)] = L["Enhancement"], -- Unleashed Rage
|
||||
[GetSpellInfo(16280)] = L["Enhancement"], -- Flurry
|
||||
[GetSpellInfo(30823)] = L["Enhancement"], -- Shamanistic Rage
|
||||
[GetSpellInfo(16190)] = L["Restoration"], -- Mana Tide Totem
|
||||
[GetSpellInfo(32594)] = L["Restoration"], -- Earth Shield
|
||||
[GetSpellInfo(30823)] = L["Enhancement"], -- Shamanistic Rage
|
||||
[GetSpellInfo(29202)] = L["Restoration"], -- Healing Way
|
||||
|
||||
-- WARLOCK
|
||||
[GetSpellInfo(19028)] = L["Demonology"], -- Soul Link
|
||||
@ -121,11 +132,13 @@ local specSpells = {
|
||||
[GetSpellInfo(34861)] = L["Holy"], -- Circle of Healing
|
||||
[GetSpellInfo(15473)] = L["Shadow"], -- Shadowform
|
||||
[GetSpellInfo(34917)] = L["Shadow"], -- Vampiric Touch
|
||||
[GetSpellInfo(15286)] = L["Shadow"], -- Vampiric Embrace
|
||||
|
||||
-- ROGUE
|
||||
[GetSpellInfo(34413)] = L["Assassination"], -- Mutilate
|
||||
[GetSpellInfo(14177)] = L["Assassination"], -- Cold Blood
|
||||
[GetSpellInfo(13750)] = L["Combat"], -- Adrenaline Rush
|
||||
[GetSpellInfo(13877)] = L["Combat"], -- Blade Flurry
|
||||
[GetSpellInfo(14185)] = L["Subtlety"], -- Preparation
|
||||
[GetSpellInfo(16511)] = L["Subtlety"], -- Hemorrhage
|
||||
[GetSpellInfo(36554)] = L["Subtlety"], -- Shadowstep
|
||||
@ -134,6 +147,7 @@ local specSpells = {
|
||||
|
||||
-- SHAMAN
|
||||
[GetSpellInfo(16166)] = L["Elemental"], -- Elemental Mastery
|
||||
[GetSpellInfo(30706)] = L["Elemental"], -- Totem of Wrath
|
||||
[GetSpellInfo(30823)] = L["Enhancement"], -- Shamanistic Rage
|
||||
[GetSpellInfo(17364)] = L["Enhancement"], -- Stormstrike
|
||||
[GetSpellInfo(16190)] = L["Restoration"], -- Mana Tide Totem
|
||||
@ -142,8 +156,10 @@ local specSpells = {
|
||||
|
||||
-- WARLOCK
|
||||
[GetSpellInfo(30405)] = L["Affliction"], -- Unstable Affliction
|
||||
[GetSpellInfo(18220)] = L["Affliction"], -- Dark Pact
|
||||
--[GetSpellInfo(30911)] = L["Affliction"], -- Siphon Life
|
||||
[GetSpellInfo(30414)] = L["Destruction"], -- Shadowfury
|
||||
[GetSpellInfo(30912)] = L["Destruction"], -- Conflagrate
|
||||
|
||||
-- WARRIOR
|
||||
[GetSpellInfo(30330)] = L["Arms"], -- Mortal Strike
|
||||
@ -151,6 +167,7 @@ local specSpells = {
|
||||
[GetSpellInfo(30335)] = L["Fury"], -- Bloodthirst
|
||||
[GetSpellInfo(12809)] = L["Protection"], -- Concussion Blow
|
||||
[GetSpellInfo(30022)] = L["Protection"], -- Devastation
|
||||
[GetSpellInfo(30356)] = L["Protection"], -- Shield Slam
|
||||
}
|
||||
function Gladdy:GetSpecSpells()
|
||||
return specSpells
|
||||
@ -263,6 +280,16 @@ local importantAuras = {
|
||||
onDamage = true,
|
||||
spellID = 19503,
|
||||
},
|
||||
-- Scare Beast
|
||||
[GetSpellInfo(14327)] = {
|
||||
track = AURA_TYPE_DEBUFF,
|
||||
duration = 8,
|
||||
priority = 40,
|
||||
onDamage = true,
|
||||
fear = true,
|
||||
magic = true,
|
||||
spellID = 14327,
|
||||
},
|
||||
-- Silencing Shot
|
||||
[GetSpellInfo(34490)] = {
|
||||
track = AURA_TYPE_DEBUFF,
|
||||
@ -445,6 +472,13 @@ local importantAuras = {
|
||||
priority = 10,
|
||||
spellID = 33206,
|
||||
},
|
||||
-- Fear Ward
|
||||
[GetSpellInfo(6346)] = {
|
||||
track = AURA_TYPE_BUFF,
|
||||
duration = 180,
|
||||
priority = 9,
|
||||
spellID = 6346,
|
||||
},
|
||||
|
||||
|
||||
-- Sap
|
||||
@ -508,6 +542,13 @@ local importantAuras = {
|
||||
priority = 20,
|
||||
spellID = 31224,
|
||||
},
|
||||
-- Evasion
|
||||
[GetSpellInfo(26669)] = {
|
||||
track = AURA_TYPE_BUFF,
|
||||
duration = 15,
|
||||
priority = 10,
|
||||
spellID = 26669,
|
||||
},
|
||||
|
||||
|
||||
-- Fear
|
||||
@ -527,6 +568,13 @@ local importantAuras = {
|
||||
priority = 40,
|
||||
spellID = 27223,
|
||||
},
|
||||
--Banish
|
||||
[GetSpellInfo(710)] = {
|
||||
track = AURA_TYPE_DEBUFF,
|
||||
duration = 10,
|
||||
priority = 40,
|
||||
spellID = 710,
|
||||
},
|
||||
-- Shadowfury
|
||||
[GetSpellInfo(30283)] = {
|
||||
track = AURA_TYPE_DEBUFF,
|
||||
@ -697,6 +745,36 @@ local importantAuras = {
|
||||
magic = true,
|
||||
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()
|
||||
return importantAuras
|
||||
@ -751,7 +829,7 @@ local cooldownList = {
|
||||
["MAGE"] = {
|
||||
[1953] = 15, -- Blink
|
||||
--[122] = 22, -- Frost Nova
|
||||
--[12051] = 480, --Evocation
|
||||
[12051] = 480, --Evocation
|
||||
[2139] = 24, -- Counterspell
|
||||
[45438] = { cd = 300, [L["Frost"]] = 240, }, -- Ice Block
|
||||
[12472] = { cd = 180, spec = L["Frost"], }, -- Icy Veins
|
||||
@ -783,6 +861,8 @@ local cooldownList = {
|
||||
[10060] = { cd = 180, spec = L["Discipline"], }, -- Power Infusion
|
||||
[33206] = { cd = 120, spec = L["Discipline"], }, -- Pain Suppression
|
||||
[34433] = 300, -- Shadowfiend
|
||||
[32379] = 12, -- Shadow Word: Death
|
||||
[6346] = 180, -- Fear Ward
|
||||
},
|
||||
|
||||
-- Druid
|
||||
@ -808,6 +888,7 @@ local cooldownList = {
|
||||
[16166] = { cd = 180, spec = L["Elemental"], }, -- Elemental Mastery
|
||||
[16188] = { cd = 180, spec = L["Restoration"], }, -- Natures Swiftness
|
||||
[16190] = { cd = 300, spec = L["Restoration"], }, -- Mana Tide Totem
|
||||
[8177] = 15, -- Grounding Totem
|
||||
},
|
||||
|
||||
-- Paladin
|
||||
@ -837,7 +918,8 @@ local cooldownList = {
|
||||
["WARLOCK"] = {
|
||||
[17928] = 40, -- Howl of Terror
|
||||
[27223] = 120, -- Death Coil
|
||||
--[19647] = { cd = 24 }, -- Spell Lock; how will I handle pet spells?
|
||||
[19647] = 24, -- Spell Lock
|
||||
[27277] = 8, -- Devour Magic
|
||||
[30414] = { cd = 20, spec = L["Destruction"], }, -- Shadowfury
|
||||
[17877] = { cd = 15, spec = L["Destruction"], }, -- Shadowburn
|
||||
[18708] = { cd = 900, spec = L["Demonology"], }, -- Feldom
|
||||
@ -845,12 +927,12 @@ local cooldownList = {
|
||||
|
||||
-- Warrior
|
||||
["WARRIOR"] = {
|
||||
--[[6552] = { cd = 10, -- Pummel
|
||||
[6552] = { cd = 10, -- Pummel
|
||||
sharedCD = {
|
||||
[72] = true,
|
||||
},
|
||||
},
|
||||
[72] = { cd = 12, -- Shield Bash
|
||||
--[[72] = { cd = 12, -- Shield Bash
|
||||
sharedCD = {
|
||||
[6552] = true,
|
||||
},
|
||||
@ -862,6 +944,7 @@ local cooldownList = {
|
||||
[18499] = 30, -- Berserker Rage
|
||||
--[2565] = 60, -- Shield Block
|
||||
[12292] = { cd = 180, spec = L["Arms"], }, -- Death Wish
|
||||
[20252] = { cd = 30, [L["Arms"]] = 20 }, -- Intercept
|
||||
[12975] = { cd = 180, spec = L["Protection"], }, -- Last Stand
|
||||
[12809] = { cd = 30, spec = L["Protection"], }, -- Concussion Blow
|
||||
|
||||
@ -870,6 +953,7 @@ local cooldownList = {
|
||||
-- Hunter
|
||||
["HUNTER"] = {
|
||||
[19503] = 30, -- Scatter Shot
|
||||
[14327] = 30, -- Scare Beast
|
||||
[19263] = 300, -- Deterrence; not on BM but can't do 2 specs
|
||||
[14311] = { cd = 30, -- Freezing Trap
|
||||
sharedCD = {
|
||||
@ -893,6 +977,9 @@ local cooldownList = {
|
||||
[19386] = { cd = 60, spec = L["Survival"], }, -- Wyvern Sting
|
||||
[19577] = { cd = 60, spec = L["Beast Mastery"], }, -- Intimidation
|
||||
[38373] = { cd = 120, spec = L["Beast Mastery"], }, -- The Beast Within
|
||||
[5384] = 30, -- Feign Death
|
||||
[3034] = 15, -- Viper Sting
|
||||
[1543] = 20, -- Flare
|
||||
},
|
||||
|
||||
-- Rogue
|
||||
@ -1049,9 +1136,9 @@ local arenaTimer = {
|
||||
[0] = "Der Arenakampf hat begonnen!",
|
||||
},
|
||||
["frFR"] = {
|
||||
[60] = "Le combat d'arène commence dans une minute\194\160!",
|
||||
[30] = "Le combat d'arène commence dans trente secondes\194\160!",
|
||||
[15] = "Le combat d'arène commence dans quinze secondes\194\160!",
|
||||
[61] = "Le combat d'arène commence dans une minute\194\160!",
|
||||
[31] = "Le combat d'arène commence dans trente secondes\194\160!",
|
||||
[16] = "Le combat d'arène commence dans quinze secondes\194\160!",
|
||||
[0] = "Le combat d'arène commence\194\160!",
|
||||
},
|
||||
["ruRU"] = {
|
||||
@ -1093,3 +1180,80 @@ function Gladdy:GetArenaTimer()
|
||||
end
|
||||
end
|
||||
|
||||
Gladdy.legacy = {
|
||||
castBarPos = "LEFT",
|
||||
buffsCooldownPos = "TOP",
|
||||
buffsBuffsCooldownPos = "BOTTOM",
|
||||
classIconPos = "LEFT",
|
||||
ciAnchor = "healthBar",
|
||||
ciPos = "TOP",
|
||||
cooldownYPos = "TOP",
|
||||
cooldownXPos = "LEFT",
|
||||
drCooldownPos = "RIGHT",
|
||||
racialAnchor = "trinket",
|
||||
racialPos = "RIGHT",
|
||||
trinketPos = "RIGHT",
|
||||
padding = 1,
|
||||
growUp = false,
|
||||
}
|
||||
|
||||
Gladdy.newDefaults = {
|
||||
["bottomMargin"] = 94.99996948242188,
|
||||
["newLayout"] = true,
|
||||
Pets = {
|
||||
["petYOffset"] = -81.99993896484375,
|
||||
["petXOffset"] = 181,
|
||||
},
|
||||
ClassIcon = {
|
||||
["classIconXOffset"] = -74.90008544921875,
|
||||
},
|
||||
Racial = {
|
||||
["racialXOffset"] = 255.9000244140625,
|
||||
},
|
||||
Trinket = {
|
||||
["trinketXOffset"] = 182,
|
||||
},
|
||||
["Combat Indicator"] = {
|
||||
["ciXOffset"] = 79.99993896484375,
|
||||
["ciYOffset"] = -10.99993896484375,
|
||||
},
|
||||
Cooldowns = {
|
||||
["cooldownYOffset"] = 31,
|
||||
},
|
||||
["Buffs and Debuffs"] = {
|
||||
["buffsBuffsXOffset"] = 29,
|
||||
["buffsBuffsYOffset"] = -82.99993896484375,
|
||||
["buffsXOffset"] = 29,
|
||||
["buffsYOffset"] = 62.00006103515625,
|
||||
},
|
||||
Diminishings = {
|
||||
["drXOffset"] = 329.7999877929688,
|
||||
["drYOffset"] = -22.5,
|
||||
},
|
||||
["Cast Bar"] = {
|
||||
["castBarXOffset"] = -235.900146484375,
|
||||
["castBarYOffset"] = -30.5,
|
||||
},
|
||||
}
|
||||
|
||||
Gladdy.frameStrata = {
|
||||
BACKGROUND = L["Background"] .. "(0)",
|
||||
LOW = L["Low"] .. "(1)",
|
||||
MEDIUM = L["Medium"] .. "(2)",
|
||||
HIGH = L["High"] .. "(3)",
|
||||
DIALOG = L["Dialog"] .. "(4)",
|
||||
FULLSCREEN = L["Fullscreen"] .. "(5)",
|
||||
FULLSCREEN_DIALOG = L["Fullscreen Dialog"] .. "(6)",
|
||||
TOOLTIP = L["Tooltip"] .. "(7)",
|
||||
}
|
||||
|
||||
Gladdy.frameStrataSorting = {
|
||||
[1] = "BACKGROUND",
|
||||
[2] = "LOW",
|
||||
[3] = "MEDIUM",
|
||||
[4] = "HIGH",
|
||||
[5] = "DIALOG",
|
||||
[6] = "FULLSCREEN",
|
||||
[7] = "FULLSCREEN_DIALOG",
|
||||
[8] = "TOOLTIP",
|
||||
}
|
@ -1,13 +1,14 @@
|
||||
local select, string_gsub, tostring = select, string.gsub, tostring
|
||||
local select, string_gsub, tostring, pairs = select, string.gsub, tostring, pairs
|
||||
|
||||
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
|
||||
local AURA_TYPE_DEBUFF = AURA_TYPE_DEBUFF
|
||||
local AURA_TYPE_BUFF = AURA_TYPE_BUFF
|
||||
|
||||
local UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit = UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit
|
||||
local UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit, UnitExists = UnitName, UnitAura, UnitRace, UnitClass, UnitGUID, UnitIsUnit, UnitExists
|
||||
local UnitCastingInfo, UnitChannelInfo = UnitCastingInfo, UnitChannelInfo
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local FindAuraByName = AuraUtil.FindAuraByName
|
||||
local GetTime = GetTime
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local Cooldowns = Gladdy.modules["Cooldowns"]
|
||||
@ -33,6 +34,16 @@ function EventListener:JOINED_ARENA()
|
||||
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
|
||||
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
|
||||
self:SetScript("OnEvent", EventListener.OnEvent)
|
||||
|
||||
-- in case arena has started already we check for units
|
||||
for i=1,Gladdy.curBracket do
|
||||
if UnitExists("arena" .. i) then
|
||||
Gladdy:SpotEnemy("arena" .. i, true)
|
||||
end
|
||||
if UnitExists("arenapet" .. i) then
|
||||
Gladdy:SendMessage("PET_SPOTTED", "arenapet" .. i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function EventListener:Reset()
|
||||
@ -40,14 +51,17 @@ function EventListener:Reset()
|
||||
self:SetScript("OnEvent", nil)
|
||||
end
|
||||
|
||||
function Gladdy:DetectSpec(unit, specSpell)
|
||||
if specSpell then
|
||||
self.modules["Cooldowns"]:DetectSpec(unit, specSpell)
|
||||
function Gladdy:DetectSpec(unit, spec)
|
||||
if spec then
|
||||
self.modules["Cooldowns"]:DetectSpec(unit, spec)
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:SpotEnemy(unit, auraScan)
|
||||
local button = self.buttons[unit]
|
||||
if not unit or not button then
|
||||
return
|
||||
end
|
||||
button.raceLoc = UnitRace(unit)
|
||||
button.race = select(2, UnitRace(unit))
|
||||
button.classLoc = select(1, UnitClass(unit))
|
||||
@ -55,14 +69,24 @@ function Gladdy:SpotEnemy(unit, auraScan)
|
||||
button.name = UnitName(unit)
|
||||
button.stealthed = false
|
||||
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
|
||||
for n = 1, 30 do
|
||||
local spellName,_,_,_,_,_,unitCaster = UnitAura(unit, n, "HELPFUL")
|
||||
local spellName,_,_,_,_,expirationTime,unitCaster = UnitAura(unit, n, "HELPFUL")
|
||||
if ( not spellName ) then
|
||||
break
|
||||
end
|
||||
if Gladdy.specBuffs[spellName] then
|
||||
if Gladdy.cooldownBuffs[spellName] then -- Check for auras that detect used CDs (like Fear Ward)
|
||||
for arenaUnit,v in pairs(self.buttons) do
|
||||
if (UnitIsUnit(arenaUnit, unitCaster)) then
|
||||
Cooldowns:CooldownUsed(arenaUnit, v.class, Gladdy.cooldownBuffs[spellName].spellId, expirationTime - GetTime())
|
||||
-- /run LibStub("Gladdy").modules["Cooldowns"]:CooldownUsed("arena5", "PRIEST", 6346, 10)
|
||||
end
|
||||
end
|
||||
end
|
||||
if Gladdy.specBuffs[spellName] then -- Check for auras that detect a spec
|
||||
local unitPet = string_gsub(unit, "%d$", "pet%1")
|
||||
if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then
|
||||
Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName])
|
||||
@ -75,28 +99,35 @@ end
|
||||
function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
||||
-- timestamp,eventType,hideCaster,sourceGUID,sourceName,sourceFlags,sourceRaidFlags,destGUID,destName,destFlags,destRaidFlags,spellId,spellName,spellSchool
|
||||
local _,eventType,_,sourceGUID,_,_,_,destGUID,_,_,_,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool = CombatLogGetCurrentEventInfo()
|
||||
local srcUnit = Gladdy.guids[sourceGUID]
|
||||
local destUnit = Gladdy.guids[destGUID]
|
||||
local srcUnit = Gladdy.guids[sourceGUID] -- can be a PET
|
||||
local destUnit = Gladdy.guids[destGUID] -- can be a PET
|
||||
if (Gladdy.db.shadowsightTimerEnabled and eventType == "SPELL_AURA_APPLIED" and spellID == 34709) then
|
||||
Gladdy.modules["Shadowsight Timer"]:AURA_GAIN(nil, nil, 34709)
|
||||
end
|
||||
|
||||
if destUnit then
|
||||
-- diminish tracker
|
||||
if (Gladdy.db.drEnabled and (eventType == "SPELL_AURA_REMOVED" or eventType == "SPELL_AURA_REFRESH")) then
|
||||
if Gladdy.buttons[destUnit] and (Gladdy.db.drEnabled and (eventType == "SPELL_AURA_REMOVED" or eventType == "SPELL_AURA_REFRESH")) then
|
||||
Diminishings:AuraFade(destUnit, spellID)
|
||||
end
|
||||
-- death detection
|
||||
if (eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then
|
||||
if (Gladdy.buttons[destUnit] and eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then
|
||||
Gladdy:SendMessage("UNIT_DEATH", destUnit)
|
||||
end
|
||||
-- spec detection
|
||||
if not Gladdy.buttons[destUnit].class then
|
||||
if Gladdy.buttons[destUnit] and (not Gladdy.buttons[destUnit].class or not Gladdy.buttons[destUnit].race) then
|
||||
Gladdy:SpotEnemy(destUnit, true)
|
||||
end
|
||||
--interrupt detection
|
||||
if eventType == "SPELL_INTERRUPT" then
|
||||
if Gladdy.buttons[destUnit] and eventType == "SPELL_INTERRUPT" then
|
||||
Gladdy:SendMessage("SPELL_INTERRUPT", destUnit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
|
||||
end
|
||||
end
|
||||
if srcUnit then
|
||||
srcUnit = string_gsub(srcUnit, "pet", "")
|
||||
if (not UnitExists(srcUnit)) then
|
||||
return
|
||||
end
|
||||
if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED") then
|
||||
local unitRace = Gladdy.buttons[srcUnit].race
|
||||
-- cooldown tracker
|
||||
@ -109,7 +140,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
||||
else
|
||||
unitClass = Gladdy.buttons[srcUnit].race
|
||||
end
|
||||
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName)
|
||||
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
|
||||
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
|
||||
end
|
||||
end
|
||||
@ -119,7 +150,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
||||
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)
|
||||
end
|
||||
if not Gladdy.buttons[srcUnit].spec then
|
||||
@ -138,7 +169,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
|
||||
-- ENEMY_SPOTTED
|
||||
if button then
|
||||
Gladdy:SendMessage("ENEMY_STEALTH", unit, false)
|
||||
if not button.class then
|
||||
if not button.class or not button.race then
|
||||
Gladdy:SpotEnemy(unit, true)
|
||||
end
|
||||
end
|
||||
@ -167,7 +198,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
|
||||
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
|
||||
[43523] = GetSpellInfo(30405) .. " Silence",
|
||||
[24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot
|
||||
@ -183,13 +214,17 @@ local exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
|
||||
[27010] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
|
||||
}
|
||||
|
||||
Gladdy.cooldownBuffs = {
|
||||
[GetSpellInfo(6346)] = { cd = 180, spellId = 6346 }, -- Fear Ward
|
||||
}
|
||||
|
||||
function EventListener:UNIT_AURA(unit)
|
||||
local button = Gladdy.buttons[unit]
|
||||
if not button then
|
||||
return
|
||||
end
|
||||
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)
|
||||
end
|
||||
local filter = (i == 1 and "HELPFUL" or "HARMFUL")
|
||||
@ -201,14 +236,21 @@ function EventListener:UNIT_AURA(unit)
|
||||
Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, auraType, n - 1)
|
||||
break
|
||||
end
|
||||
if Gladdy.cooldownBuffs[spellName] then -- Check for auras that hint used CDs (like Fear Ward)
|
||||
for arenaUnit,v in pairs(Gladdy.buttons) do
|
||||
if (UnitIsUnit(arenaUnit, unitCaster)) then
|
||||
Cooldowns:CooldownUsed(arenaUnit, v.class, Gladdy.cooldownBuffs[spellName].spellId, expirationTime - GetTime())
|
||||
end
|
||||
end
|
||||
end
|
||||
if not button.spec and Gladdy.specBuffs[spellName] then
|
||||
local unitPet = string_gsub(unit, "%d$", "pet%1")
|
||||
if unitCaster and (UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster)) then
|
||||
Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName])
|
||||
end
|
||||
end
|
||||
if exceptionNames[spellID] then
|
||||
spellName = exceptionNames[spellID]
|
||||
if Gladdy.exceptionNames[spellID] then
|
||||
spellName = Gladdy.exceptionNames[spellID]
|
||||
end
|
||||
Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, debuffType, i)
|
||||
Gladdy:Call("Announcements", "CheckDrink", unit, spellName)
|
||||
|
322
Frame.lua
322
Frame.lua
@ -1,6 +1,9 @@
|
||||
local CreateFrame = CreateFrame
|
||||
local UIParent = UIParent
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local math_abs = math.abs
|
||||
local pairs = pairs
|
||||
local LibStub = LibStub
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
@ -32,6 +35,12 @@ Gladdy.BUTTON_DEFAULTS = {
|
||||
|
||||
function Gladdy:CreateFrame()
|
||||
self.frame = CreateFrame("Frame", "GladdyFrame", UIParent)
|
||||
|
||||
self.frame.background = CreateFrame("Frame", nil, self.frame, BackdropTemplateMixin and "BackdropTemplate")
|
||||
self.frame.background:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = false, tileSize = 16})
|
||||
self.frame.background:SetFrameStrata("BACKGROUND")
|
||||
self.frame.background:SetBackdropColor(Gladdy:SetColor(self.db.backgroundColor))
|
||||
self.frame.background:SetAllPoints(self.frame)
|
||||
--self.frame.texture = self.frame:CreateTexture(nil, "OVERLAY")
|
||||
--self.frame.texture:SetAllPoints(self.frame)
|
||||
--self.frame.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
|
||||
@ -39,7 +48,7 @@ function Gladdy:CreateFrame()
|
||||
self.frame:SetClampedToScreen(true)
|
||||
self.frame:EnableMouse(false)
|
||||
self.frame:SetMovable(true)
|
||||
self.frame:RegisterForDrag("LeftButton")
|
||||
--self.frame:RegisterForDrag("LeftButton")
|
||||
|
||||
self.frame:SetScript("OnDragStart", function(f)
|
||||
if (not InCombatLockdown() and not self.db.locked) then
|
||||
@ -52,7 +61,7 @@ function Gladdy:CreateFrame()
|
||||
|
||||
local scale = f:GetEffectiveScale()
|
||||
self.db.x = f:GetLeft() * scale
|
||||
self.db.y = (self.db.growUp and f:GetBottom() or f:GetTop()) * scale
|
||||
self.db.y = (self.db.growDirection == "TOP" and f:GetBottom() or f:GetTop()) * scale
|
||||
end
|
||||
end)
|
||||
|
||||
@ -76,7 +85,7 @@ function Gladdy:CreateFrame()
|
||||
|
||||
local scale = self.frame:GetEffectiveScale()
|
||||
self.db.x = self.frame:GetLeft() * scale
|
||||
self.db.y = (self.db.growUp and self.frame:GetBottom() or self.frame:GetTop()) * scale
|
||||
self.db.y = (self.db.growDirection == "TOP" and self.frame:GetBottom() or self.frame:GetTop()) * scale
|
||||
end
|
||||
end)
|
||||
self.anchor:SetScript("OnClick", function()
|
||||
@ -120,73 +129,27 @@ function Gladdy:UpdateFrame()
|
||||
|
||||
local highlightBorderSize = (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2)
|
||||
local powerBarHeight = self.db.powerBarEnabled and (self.db.powerBarHeight + 1) or 0
|
||||
local leftSize = 0
|
||||
local rightSize = 0
|
||||
--Trinket + Racial
|
||||
if self.db.trinketEnabled and self.db.trinketPos == "LEFT" then
|
||||
leftSize = leftSize + self.db.trinketSize * self.db.trinketWidthFactor + self.db.padding
|
||||
if self.db.racialEnabled and self.db.racialAnchor == "trinket" and self.db.racialPos == "LEFT" then
|
||||
leftSize = leftSize + self.db.racialSize * self.db.racialWidthFactor + self.db.padding
|
||||
end
|
||||
end
|
||||
if self.db.trinketEnabled and self.db.trinketPos == "RIGHT" then
|
||||
rightSize = rightSize + self.db.trinketSize * self.db.trinketWidthFactor + self.db.padding
|
||||
if self.db.racialEnabled and self.db.racialAnchor == "trinket" and self.db.racialPos == "RIGHT" then
|
||||
rightSize = rightSize + self.db.racialSize * self.db.racialWidthFactor + self.db.padding
|
||||
end
|
||||
end
|
||||
--ClassIcon
|
||||
if self.db.classIconPos == "LEFT" then
|
||||
leftSize = leftSize + self.db.classIconSize * self.db.classIconWidthFactor + self.db.padding
|
||||
else
|
||||
rightSize = rightSize + self.db.classIconSize * self.db.classIconWidthFactor + self.db.padding
|
||||
end
|
||||
--Highlight
|
||||
if not self.db.highlightInset then
|
||||
leftSize = leftSize + self.db.highlightBorderSize
|
||||
rightSize = rightSize + self.db.highlightBorderSize
|
||||
end
|
||||
|
||||
local margin = powerBarHeight
|
||||
local width = self.db.barWidth + leftSize + rightSize
|
||||
local height = (self.db.healthBarHeight + powerBarHeight) * teamSize
|
||||
+ (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2 * teamSize)
|
||||
+ self.db.bottomMargin * (teamSize - 1)
|
||||
|
||||
-- Highlight
|
||||
margin = margin + highlightBorderSize
|
||||
|
||||
if (self.db.cooldownYPos == "TOP" or self.db.cooldownYPos == "BOTTOM") and self.db.cooldown then
|
||||
margin = margin + self.db.cooldownSize
|
||||
height = height + self.db.cooldownSize * (teamSize - 1)
|
||||
end
|
||||
if (self.db.buffsCooldownPos == "TOP" or self.db.buffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
|
||||
margin = margin + self.db.buffsIconSize
|
||||
height = height + self.db.buffsIconSize * (teamSize - 1)
|
||||
end
|
||||
if (self.db.buffsBuffsCooldownPos == "TOP" or self.db.buffsBuffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
|
||||
margin = margin + self.db.buffsBuffsIconSize
|
||||
height = height + self.db.buffsBuffsIconSize * (teamSize - 1)
|
||||
end
|
||||
if self.db.buffsCooldownPos == "TOP" and self.db.cooldownYPos == "TOP" and self.db.cooldown and self.db.buffsEnabled then
|
||||
margin = margin + 1
|
||||
height = height + (teamSize - 1)
|
||||
end
|
||||
if self.db.buffsCooldownPos == "BOTTOM" and self.db.cooldownYPos == "BOTTOM" and self.db.cooldown and self.db.buffsEnabled then
|
||||
margin = margin + 1
|
||||
height = height + (teamSize - 1)
|
||||
end
|
||||
margin, height = Gladdy:LegacyPositioning(margin, height, teamSize)
|
||||
|
||||
-- GrowDirection
|
||||
if (self.db.growDirection == "LEFT" or self.db.growDirection == "RIGHT") then
|
||||
width = self.db.barWidth * teamSize + (leftSize + rightSize) * teamSize + self.db.bottomMargin * (teamSize - 1)
|
||||
height = self.db.healthBarHeight + powerBarHeight
|
||||
end
|
||||
|
||||
self.frame:SetScale(self.db.frameScale)
|
||||
self.frame:SetWidth(width)
|
||||
self:PixelPerfectScale(false)
|
||||
self.frame:SetWidth(self.db.barWidth + highlightBorderSize)
|
||||
self.frame:SetHeight(height)
|
||||
--self.frame:SetBackdropColor(self.db.frameColor.r, self.db.frameColor.g, self.db.frameColor.b, self.db.frameColor.a)
|
||||
self.frame:ClearAllPoints()
|
||||
self.frame.background:SetBackdropColor(Gladdy:SetColor(self.db.backgroundColor))
|
||||
self.frame:ClearAllPoints()
|
||||
if (self.db.x == 0 and self.db.y == 0) then
|
||||
self.frame:SetPoint("CENTER")
|
||||
@ -200,14 +163,14 @@ function Gladdy:UpdateFrame()
|
||||
end
|
||||
|
||||
--Anchor
|
||||
self.anchor:SetWidth(width)
|
||||
self.anchor:SetWidth(self.db.barWidth * 2 + highlightBorderSize)
|
||||
self.anchor:ClearAllPoints()
|
||||
if (self.db.growDirection == "TOP") then
|
||||
self.anchor:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
|
||||
self.anchor:SetPoint("TOP", self.frame, "BOTTOM")
|
||||
elseif self.growDirection == "BOTTOM" or self.growDirection == "RIGHT" then
|
||||
self.anchor:SetPoint("BOTTOMLEFT", self.frame, "TOPLEFT")
|
||||
self.anchor:SetPoint("BOTTOM", self.frame, "TOP")
|
||||
else
|
||||
self.anchor:SetPoint("BOTTOMRIGHT", self.frame, "TOPRIGHT")
|
||||
self.anchor:SetPoint("BOTTOM", self.frame, "TOP")
|
||||
end
|
||||
|
||||
if (self.db.locked) then
|
||||
@ -227,7 +190,7 @@ function Gladdy:UpdateFrame()
|
||||
button.secure:ClearAllPoints()
|
||||
if (self.db.growDirection == "TOP") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", leftSize, powerBarHeight)
|
||||
button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, powerBarHeight)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
|
||||
@ -235,7 +198,7 @@ function Gladdy:UpdateFrame()
|
||||
end
|
||||
elseif (self.db.growDirection == "BOTTOM") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
|
||||
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 0, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
|
||||
@ -243,18 +206,18 @@ function Gladdy:UpdateFrame()
|
||||
end
|
||||
elseif (self.db.growDirection == "LEFT") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -rightSize, 0)
|
||||
button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -0, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("TOPRIGHT", self.buttons["arena" .. (i - 1)], "TOPLEFT", -rightSize - leftSize - self.db.bottomMargin, 0)
|
||||
button:SetPoint("TOPRIGHT", self.buttons["arena" .. (i - 1)], "TOPLEFT", - self.db.bottomMargin, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
end
|
||||
elseif (self.db.growDirection == "RIGHT") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
|
||||
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 0, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "TOPRIGHT", leftSize + rightSize + self.db.bottomMargin, 0)
|
||||
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "TOPRIGHT", self.db.bottomMargin, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
end
|
||||
end
|
||||
@ -267,11 +230,50 @@ function Gladdy:UpdateFrame()
|
||||
for _, v in self:IterModules() do
|
||||
self:Call(v, "UpdateFrameOnce")
|
||||
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
|
||||
if (not Gladdy.db.newLayout) then
|
||||
Gladdy.db.newLayout = true
|
||||
--get margin
|
||||
local arena1Bottom
|
||||
local arena2Top
|
||||
if (self.db.growDirection == "BOTTOM") then
|
||||
arena1Bottom = self.buttons["arena1"].secure:GetBottom()
|
||||
arena2Top = self.buttons["arena2"].secure:GetTop()
|
||||
elseif (self.db.growDirection == "TOP") then
|
||||
arena1Bottom = self.buttons["arena1"].secure:GetTop()
|
||||
arena2Top = self.buttons["arena2"].secure:GetBottom()
|
||||
elseif (self.db.growDirection == "LEFT") then
|
||||
arena1Bottom = self.buttons["arena1"].secure:GetLeft()
|
||||
arena2Top = self.buttons["arena2"].secure:GetRight()
|
||||
elseif (self.db.growDirection == "RIGHT") then
|
||||
arena1Bottom = self.buttons["arena1"].secure:GetRight()
|
||||
arena2Top = self.buttons["arena2"].secure:GetLeft()
|
||||
end
|
||||
Gladdy.db.bottomMargin = math_abs(arena1Bottom - arena2Top)
|
||||
Gladdy:UpdateFrame()
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:HideFrame()
|
||||
if (self.frame) then
|
||||
self.frame:Hide()
|
||||
if InCombatLockdown() then
|
||||
self.startTest = nil
|
||||
self.hideFrame = true
|
||||
else
|
||||
self:Reset()
|
||||
self.frame:Hide()
|
||||
end
|
||||
|
||||
self.frame.testing = nil
|
||||
end
|
||||
end
|
||||
@ -279,6 +281,7 @@ end
|
||||
function Gladdy:ToggleFrame(i)
|
||||
self:Reset()
|
||||
if (self.frame and self.frame:IsShown() and i == self.curBracket) then
|
||||
self.frame.testing = nil
|
||||
self:HideFrame()
|
||||
else
|
||||
self.curBracket = i
|
||||
@ -286,6 +289,7 @@ function Gladdy:ToggleFrame(i)
|
||||
if (not self.frame) then
|
||||
self:CreateFrame()
|
||||
end
|
||||
self.frame.testing = true
|
||||
|
||||
for o = 1, self.curBracket do
|
||||
local unit = "arena" .. o
|
||||
@ -296,8 +300,14 @@ function Gladdy:ToggleFrame(i)
|
||||
self:Reset()
|
||||
self.curBracket = i
|
||||
self:UpdateFrame()
|
||||
self:Test()
|
||||
self.frame:Show()
|
||||
if InCombatLockdown() then
|
||||
Gladdy:Print("Gladdy frames show as soon as you leave combat")
|
||||
self.showFrame = true
|
||||
self.startTest = true
|
||||
else
|
||||
self:Test()
|
||||
self.frame:Show()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -347,6 +357,184 @@ function Gladdy:CreateButton(i)
|
||||
self:ResetButton("arena" .. i)
|
||||
end
|
||||
|
||||
|
||||
|
||||
function Gladdy:SetPosition(frame, unit, xOffsetDB, yOffsetDB, newLayout, module)
|
||||
local button = self.buttons[unit]
|
||||
if not button or not frame or not xOffsetDB or not yOffsetDB then
|
||||
return
|
||||
end
|
||||
|
||||
if (not newLayout) then
|
||||
--Gladdy:Debug("INFO", name, "old X/Y:", frame:GetCenter())
|
||||
local xOffset, yOffset = frame:GetLeft(), frame:GetTop()
|
||||
local x,y = button.healthBar:GetLeft(), button.healthBar:GetTop()
|
||||
local newXOffset = math_abs(x - xOffset) * (x > xOffset and -1 or 1)
|
||||
local newYOffset = math_abs(y - yOffset) * (y > yOffset and -1 or 1)
|
||||
frame:ClearAllPoints()
|
||||
frame:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", newXOffset, newYOffset)
|
||||
--Gladdy:Debug("INFO", name, "new X/Y:", frame:GetCenter())
|
||||
if unit == "arena1" then
|
||||
Gladdy.db[xOffsetDB] = newXOffset
|
||||
Gladdy.db[yOffsetDB] = newYOffset
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
end
|
||||
else
|
||||
frame:ClearAllPoints()
|
||||
frame:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT", Gladdy.db[xOffsetDB], Gladdy.db[yOffsetDB])
|
||||
end
|
||||
if (self.newDefaults[module.name]) then
|
||||
for k,v in pairs(self.newDefaults[module.name]) do
|
||||
module.defaults[k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:CreateMover(frame, xConfig, yConfig, name, points, width, height, xOffset, yOffset, activated)
|
||||
if not frame.mover then
|
||||
frame:EnableMouse(false)
|
||||
frame:SetMovable(true)
|
||||
frame.mover = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate")
|
||||
frame.mover:SetFrameStrata("TOOLTIP")
|
||||
frame.mover:SetPoint(points[1], frame, points[2], xOffset or 0, yOffset or 0)
|
||||
frame.mover:SetHeight(height or frame:GetHeight())
|
||||
frame.mover:SetWidth(width or frame:GetWidth())
|
||||
|
||||
local backdrop = {
|
||||
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
||||
edgeFile = "",
|
||||
tile = true, tileSize = 16, edgeSize = 10,
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0}
|
||||
}
|
||||
frame.mover:SetBackdrop(backdrop)
|
||||
frame.mover:SetBackdropColor(0,1,0,0.5)
|
||||
frame.mover.border = CreateFrame("Frame", nil, frame.mover, BackdropTemplateMixin and "BackdropTemplate")
|
||||
frame.mover.border:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = 2 })
|
||||
frame.mover.border:SetAllPoints(frame.mover)
|
||||
frame.mover.border:SetBackdropBorderColor(0,1,0,1)
|
||||
frame.mover.border:SetFrameStrata("TOOLTIP")
|
||||
|
||||
frame.mover.text = frame.mover.border:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||
frame.mover.text:SetText(name)
|
||||
frame.mover.text:SetPoint("CENTER")
|
||||
|
||||
frame.mover:SetMovable(true)
|
||||
frame.mover:EnableMouse(true)
|
||||
|
||||
frame.mover:SetScript("OnMouseDown", function(self)
|
||||
self.point = { frame:GetPoint() }
|
||||
self.start = { frame:GetCenter() }
|
||||
frame:StartMoving()
|
||||
self:StartMoving()
|
||||
end)
|
||||
frame.mover:SetScript("OnMouseUp", function(self)
|
||||
frame:StopMovingOrSizing()
|
||||
self:StopMovingOrSizing()
|
||||
self.stop = { frame:GetCenter() }
|
||||
local diffX = math_abs(self.start[1] - self.stop[1])
|
||||
diffX = self.start[1] > self.stop[1] and -diffX or diffX
|
||||
local diffY = math_abs(self.start[2] - self.stop[2])
|
||||
diffY = self.start[2] > self.stop[2] and -diffY or diffY
|
||||
frame:ClearAllPoints()
|
||||
frame:SetPoint(self.point[1], self.point[2], self.point[3], self.point[4] + diffX, self.point[5] + diffY)
|
||||
Gladdy.db[xConfig] = self.point[4] + diffX
|
||||
Gladdy.db[yConfig] = self.point[5] + diffY
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
Gladdy:UpdateFrame()
|
||||
end)
|
||||
else
|
||||
frame.mover:ClearAllPoints()
|
||||
frame.mover:SetPoint(points[1], frame, points[2], xOffset or 0, yOffset or 0)
|
||||
frame.mover:SetHeight(height or frame:GetHeight())
|
||||
frame.mover:SetWidth(width or frame:GetWidth())
|
||||
end
|
||||
if self.frame and self.frame.testing and self.db.showMover then
|
||||
if (activated ~= nil and not Gladdy.db[activated]) then
|
||||
frame.mover:Hide()
|
||||
else
|
||||
frame.mover:Show()
|
||||
end
|
||||
else
|
||||
frame.mover:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY SUPPORT
|
||||
|
||||
---------------------------
|
||||
|
||||
function Gladdy:LegacyPositioning(margin, height, teamSize)
|
||||
if not Gladdy.db.newLayout then
|
||||
for k,v in pairs(Gladdy.legacy) do
|
||||
if Gladdy.db[k] == nil then
|
||||
Gladdy:Debug("INFO", "Gladdy:LegacyPositioning write", k,v)
|
||||
Gladdy.db[k] = v
|
||||
else
|
||||
Gladdy:Debug("INFO", "Gladdy:LegacyPositioning found", k,v)
|
||||
end
|
||||
end
|
||||
if (self.db.cooldownYPos == "TOP" or self.db.cooldownYPos == "BOTTOM") and self.db.cooldown then
|
||||
margin = margin + self.db.cooldownSize
|
||||
height = height + self.db.cooldownSize * (teamSize - 1)
|
||||
end
|
||||
if (self.db.buffsCooldownPos == "TOP" or self.db.buffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
|
||||
margin = margin + self.db.buffsIconSize
|
||||
height = height + self.db.buffsIconSize * (teamSize - 1)
|
||||
end
|
||||
if (self.db.buffsBuffsCooldownPos == "TOP" or self.db.buffsBuffsCooldownPos == "BOTTOM") and self.db.buffsEnabled then
|
||||
margin = margin + self.db.buffsBuffsIconSize
|
||||
height = height + self.db.buffsBuffsIconSize * (teamSize - 1)
|
||||
end
|
||||
if self.db.buffsCooldownPos == "TOP" and self.db.cooldownYPos == "TOP" and self.db.cooldown and self.db.buffsEnabled then
|
||||
margin = margin + 1
|
||||
height = height + (teamSize - 1)
|
||||
end
|
||||
if self.db.buffsCooldownPos == "BOTTOM" and self.db.cooldownYPos == "BOTTOM" and self.db.cooldown and self.db.buffsEnabled then
|
||||
margin = margin + 1
|
||||
height = height + (teamSize - 1)
|
||||
end
|
||||
end
|
||||
return margin, height
|
||||
end
|
||||
|
||||
function Gladdy:PositionButton(button, i, leftSize, rightSize, powerBarHeight, margin)
|
||||
if (self.db.growDirection == "TOP") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", leftSize, powerBarHeight)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
end
|
||||
elseif (self.db.growDirection == "BOTTOM") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
end
|
||||
elseif (self.db.growDirection == "LEFT") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -rightSize, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("TOPRIGHT", self.buttons["arena" .. (i - 1)], "TOPLEFT", -rightSize - leftSize - self.db.bottomMargin, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
end
|
||||
elseif (self.db.growDirection == "RIGHT") then
|
||||
if (i == 1) then
|
||||
button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", leftSize, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
else
|
||||
button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "TOPRIGHT", leftSize + rightSize + self.db.bottomMargin, 0)
|
||||
button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:GetAnchor(unit, position)
|
||||
local anchor = "healthBar"
|
||||
if Gladdy.db.classIconPos == position then
|
||||
|
269
Gladdy.lua
269
Gladdy.lua
@ -5,15 +5,21 @@ local select = select
|
||||
local pairs = pairs
|
||||
local tinsert = table.insert
|
||||
local tsort = table.sort
|
||||
local str_lower = string.lower
|
||||
local GetTime = GetTime
|
||||
local GetPhysicalScreenSize = GetPhysicalScreenSize
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local CreateFrame = CreateFrame
|
||||
local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
|
||||
local IsAddOnLoaded = IsAddOnLoaded
|
||||
local IsInInstance = IsInInstance
|
||||
local GetBattlefieldStatus = GetBattlefieldStatus
|
||||
local IsActiveBattlefieldArena = IsActiveBattlefieldArena
|
||||
local IsInInstance = IsInInstance
|
||||
local GetNumArenaOpponents = GetNumArenaOpponents
|
||||
local RELEASE_TYPES = { alpha = "Alpha", beta = "Beta", release = "Release"}
|
||||
local PREFIX = "TBC-Classic_v"
|
||||
local VERSION_REGEX = PREFIX .. "(%d+%.%d+)%-(%a)"
|
||||
local LibStub = LibStub
|
||||
|
||||
---------------------------
|
||||
|
||||
@ -21,16 +27,18 @@ local VERSION_REGEX = PREFIX .. "(%d+%.%d+)%-(%a)"
|
||||
|
||||
---------------------------
|
||||
|
||||
local MAJOR, MINOR = "Gladdy", 4
|
||||
local MAJOR, MINOR = "Gladdy", 5
|
||||
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
local L
|
||||
Gladdy.version_major_num = 1
|
||||
Gladdy.version_minor_num = 0.15
|
||||
Gladdy.version_major_num = 2
|
||||
Gladdy.version_minor_num = 0.00
|
||||
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_REGEX = VERSION_REGEX
|
||||
|
||||
Gladdy.debug = false
|
||||
|
||||
LibStub("AceTimer-3.0"):Embed(Gladdy)
|
||||
LibStub("AceComm-3.0"):Embed(Gladdy)
|
||||
Gladdy.modules = {}
|
||||
@ -52,6 +60,17 @@ function Gladdy:Print(...)
|
||||
end
|
||||
|
||||
function Gladdy:Warn(...)
|
||||
local text = "|cfff29f05Gladdy|r:"
|
||||
local val
|
||||
for i = 1, select("#", ...) do
|
||||
val = select(i, ...)
|
||||
if (type(val) == 'boolean') then val = val and "true" or false end
|
||||
text = text .. " " .. tostring(val)
|
||||
end
|
||||
DEFAULT_CHAT_FRAME:AddMessage(text)
|
||||
end
|
||||
|
||||
function Gladdy:Error(...)
|
||||
local text = "|cfffc0303Gladdy|r:"
|
||||
local val
|
||||
for i = 1, select("#", ...) do
|
||||
@ -62,13 +81,38 @@ function Gladdy:Warn(...)
|
||||
DEFAULT_CHAT_FRAME:AddMessage(text)
|
||||
end
|
||||
|
||||
function Gladdy:Debug(lvl, ...)
|
||||
if Gladdy.debug then
|
||||
if lvl == "INFO" then
|
||||
Gladdy:Print(...)
|
||||
elseif lvl == "WARN" then
|
||||
Gladdy:Warn(...)
|
||||
elseif lvl == "ERROR" then
|
||||
Gladdy:Error(...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Gladdy.events = CreateFrame("Frame")
|
||||
Gladdy.events.registered = {}
|
||||
Gladdy.events:RegisterEvent("PLAYER_LOGIN")
|
||||
Gladdy.events:RegisterEvent("PLAYER_LOGOUT")
|
||||
Gladdy.events:RegisterEvent("CVAR_UPDATE")
|
||||
hooksecurefunc("VideoOptionsFrameOkay_OnClick", function(self, button, down, apply)
|
||||
if (self:GetName() == "VideoOptionsFrameApply") then
|
||||
Gladdy:PixelPerfectScale(true)
|
||||
end
|
||||
end)
|
||||
Gladdy.events:SetScript("OnEvent", function(self, event, ...)
|
||||
if (event == "PLAYER_LOGIN") then
|
||||
Gladdy:OnInitialize()
|
||||
Gladdy:OnEnable()
|
||||
elseif (event == "CVAR_UPDATE") then
|
||||
if (str_lower(select(1, ...)) == "uiscale") then
|
||||
Gladdy:PixelPerfectScale(true)
|
||||
end
|
||||
elseif (event == "PLAYER_LOGOUT") then
|
||||
Gladdy:DeleteUnknownOptions(Gladdy.db, Gladdy.defaults.profile)
|
||||
else
|
||||
local func = self.registered[event]
|
||||
|
||||
@ -131,8 +175,8 @@ function Gladdy:Call(module, func, ...)
|
||||
end
|
||||
end
|
||||
function Gladdy:SendMessage(message, ...)
|
||||
for k, v in self:IterModules() do
|
||||
self:Call(v, v.messages[message], ...)
|
||||
for _, module in self:IterModules() do
|
||||
self:Call(module, module.messages[message], ...)
|
||||
end
|
||||
end
|
||||
|
||||
@ -147,6 +191,16 @@ function Gladdy:NewModule(name, priority, defaults)
|
||||
self.messages[message] = func or message
|
||||
end
|
||||
|
||||
module.UnregisterMessage = function(self, message)
|
||||
self.messages[message] = nil
|
||||
end
|
||||
|
||||
module.UnregisterAllMessages = function(self)
|
||||
for msg,_ in pairs(self.messages) do
|
||||
self.messages[msg] = nil
|
||||
end
|
||||
end
|
||||
|
||||
module.GetOptions = function()
|
||||
return nil
|
||||
end
|
||||
@ -172,11 +226,11 @@ function Gladdy:DeleteUnknownOptions(tbl, refTbl, str)
|
||||
end
|
||||
for k,v in pairs(tbl) do
|
||||
if refTbl[k] == nil then
|
||||
--Gladdy:Print("SavedVariable deleted:", str .. "." .. k, "not found!")
|
||||
Gladdy:Debug("INFO", "SavedVariable deleted:", str .. "." .. k, "not found!")
|
||||
tbl[k] = nil
|
||||
else
|
||||
if type(v) ~= type(refTbl[k]) then
|
||||
--Gladdy:Print("SavedVariable deleted:", str .. "." .. k, "type error!", "Expected", type(refTbl[k]), "but found", type(v))
|
||||
Gladdy:Debug("INFO", "SavedVariable deleted:", str .. "." .. k, "type error!", "Expected", type(refTbl[k]), "but found", type(v))
|
||||
tbl[k] = nil
|
||||
elseif type(v) == "table" then
|
||||
Gladdy:DeleteUnknownOptions(v, refTbl[k], str .. "." .. k)
|
||||
@ -185,11 +239,28 @@ function Gladdy:DeleteUnknownOptions(tbl, refTbl, str)
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:PixelPerfectScale(update)
|
||||
local physicalWidth, physicalHeight = GetPhysicalScreenSize()
|
||||
local perfectUIScale = 768.0/physicalHeight--768/select(2, strsplit("x",({ GetScreenResolutions()})[GetCurrentResolution()]))
|
||||
if self.db and self.db.pixelPerfect and self.frame then
|
||||
self.frame:SetIgnoreParentScale(true)
|
||||
self.frame:SetScale(perfectUIScale)
|
||||
--local adaptiveScale = (GetCVar("useUiScale") == "1" and 1.0 + perfectUIScale - GetCVar("UIScale") or perfectUIScale)
|
||||
--self.frame:SetScale(adaptiveScale)
|
||||
if update then
|
||||
self:UpdateFrame()
|
||||
end
|
||||
elseif self.frame then
|
||||
self.frame:SetScale(self.db.frameScale)
|
||||
self.frame:SetIgnoreParentScale(false)
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:OnInitialize()
|
||||
self.dbi = LibStub("AceDB-3.0"):New("GladdyXZ", self.defaults)
|
||||
self.dbi.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged")
|
||||
self.dbi.RegisterCallback(self, "OnProfileCopied", "OnProfileChanged")
|
||||
self.dbi.RegisterCallback(self, "OnProfileReset", "OnProfileChanged")
|
||||
self.dbi.RegisterCallback(self, "OnProfileReset", "OnProfileReset")
|
||||
self.db = self.dbi.profile
|
||||
|
||||
self.LSM = LibStub("LibSharedMedia-3.0")
|
||||
@ -205,7 +276,7 @@ function Gladdy:OnInitialize()
|
||||
L = self.L
|
||||
|
||||
self.testData = {
|
||||
["arena1"] = { name = "Swift", raceLoc = L["Tauren"], classLoc = L["Warrior"], class = "WARRIOR", health = 9635, healthMax = 14207, power = 76, powerMax = 100, powerType = 1, testSpec = L["Arms"], race = "Tauren" },
|
||||
["arena1"] = { name = "Swift", raceLoc = L["NightElf"], classLoc = L["Warrior"], class = "WARRIOR", health = 9635, healthMax = 14207, power = 76, powerMax = 100, powerType = 1, testSpec = L["Arms"], race = "NightElf" },
|
||||
["arena2"] = { name = "Vilden", raceLoc = L["Undead"], classLoc = L["Mage"], class = "MAGE", health = 10969, healthMax = 11023, power = 7833, powerMax = 10460, powerType = 0, testSpec = L["Frost"], race = "Scourge" },
|
||||
["arena3"] = { name = "Krymu", raceLoc = L["Human"], classLoc = L["Rogue"], class = "ROGUE", health = 1592, healthMax = 11740, power = 45, powerMax = 110, powerType = 3, testSpec = L["Subtlety"], race = "Human" },
|
||||
["arena4"] = { name = "Talmon", raceLoc = L["Human"], classLoc = L["Warlock"], class = "WARLOCK", health = 10221, healthMax = 14960, power = 9855, powerMax = 9855, powerType = 0, testSpec = L["Demonology"], race = "Human" },
|
||||
@ -220,30 +291,44 @@ function Gladdy:OnInitialize()
|
||||
self.guids = {}
|
||||
self.curBracket = nil
|
||||
self.curUnit = 1
|
||||
self.lastInstance = nil
|
||||
|
||||
self:SetupOptions()
|
||||
|
||||
for k, v in self:IterModules() do
|
||||
self:Call(v, "Initialize") -- B.E > A.E :D
|
||||
for _, module in self:IterModules() do
|
||||
self:Call(module, "Initialize") -- B.E > A.E :D
|
||||
end
|
||||
self:DeleteUnknownOptions(self.db, self.defaults.profile)
|
||||
if Gladdy.db.hideBlizzard == "always" then
|
||||
SetCVar("showArenaEnemyFrames", 0)
|
||||
Gladdy:BlizzArenaSetAlpha(0)
|
||||
end
|
||||
if not self.db.newLayout then
|
||||
self:ToggleFrame(3)
|
||||
self:HideFrame()
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:OnProfileReset()
|
||||
self.db = self.dbi.profile
|
||||
Gladdy:Debug("INFO", "OnProfileReset")
|
||||
self:HideFrame()
|
||||
self:ToggleFrame(3)
|
||||
Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
|
||||
Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
end
|
||||
|
||||
function Gladdy:OnProfileChanged()
|
||||
self.db = self.dbi.profile
|
||||
self:DeleteUnknownOptions(self.db, self.defaults.profile)
|
||||
|
||||
self:HideFrame()
|
||||
self:ToggleFrame(3)
|
||||
Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
|
||||
Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
end
|
||||
|
||||
function Gladdy:OnEnable()
|
||||
self:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")
|
||||
self:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED")
|
||||
|
||||
if (IsAddOnLoaded("Clique")) then
|
||||
for i = 1, 5 do
|
||||
@ -291,22 +376,24 @@ end
|
||||
|
||||
function Gladdy:Test()
|
||||
self.frame.testing = true
|
||||
for i = 1, self.curBracket do
|
||||
local unit = "arena" .. i
|
||||
if (not self.buttons[unit]) then
|
||||
self:CreateButton(i)
|
||||
end
|
||||
local button = self.buttons[unit]
|
||||
if self.curBracket then
|
||||
for i = 1, self.curBracket do
|
||||
local unit = "arena" .. i
|
||||
if (not self.buttons[unit]) then
|
||||
self:CreateButton(i)
|
||||
end
|
||||
local button = self.buttons[unit]
|
||||
|
||||
for k, v in pairs(self.testData[unit]) do
|
||||
button[k] = v
|
||||
end
|
||||
for k, v in pairs(self.testData[unit]) do
|
||||
button[k] = v
|
||||
end
|
||||
|
||||
for k, v in self:IterModules() do
|
||||
self:Call(v, "Test", unit)
|
||||
end
|
||||
for _, module in self:IterModules() do
|
||||
self:Call(module, "Test", unit)
|
||||
end
|
||||
|
||||
button:SetAlpha(1)
|
||||
button:SetAlpha(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -321,26 +408,40 @@ function Gladdy:PLAYER_ENTERING_WORLD()
|
||||
LibStub("AceConfigDialog-3.0"):Open("Gladdy", nil, LibStub("AceConfigDialog-3.0"):SelectGroup("Gladdy", "XiconProfiles"))
|
||||
self.showConfig = nil
|
||||
end
|
||||
local instance = select(2, IsInInstance())
|
||||
if (instance ~= "arena" and self.frame and self.frame:IsVisible() and not self.frame.testing) then
|
||||
if (self.frame and self.frame:IsVisible()) then
|
||||
self:Reset()
|
||||
self:HideFrame()
|
||||
end
|
||||
if (instance == "arena") then
|
||||
self:Reset()
|
||||
self:HideFrame()
|
||||
end
|
||||
self.lastInstance = instance
|
||||
end
|
||||
|
||||
function Gladdy:UPDATE_BATTLEFIELD_STATUS(_, index)
|
||||
local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, isRankedArena, suspendedQueue, bool, queueType = GetBattlefieldStatus(index)
|
||||
if (status == "active" and teamSize > 0 and IsActiveBattlefieldArena()) then
|
||||
local instanceType = select(2, IsInInstance())
|
||||
Gladdy:Debug("INFO", "UPDATE_BATTLEFIELD_STATUS", instanceType, status, teamSize)
|
||||
if ((instanceType == "arena" or GetNumArenaOpponents() > 0) and status == "active" and teamSize > 0) then
|
||||
self.curBracket = teamSize
|
||||
self:JoinedArena()
|
||||
end
|
||||
end
|
||||
|
||||
function Gladdy:PLAYER_REGEN_ENABLED()
|
||||
if self.showFrame then
|
||||
self:UpdateFrame()
|
||||
if self.startTest then
|
||||
self:Test()
|
||||
self.startTest = nil
|
||||
end
|
||||
self.frame:Show()
|
||||
self:SendMessage("JOINED_ARENA")
|
||||
self.showFrame = nil
|
||||
end
|
||||
if self.hideFrame then
|
||||
self:Reset()
|
||||
self.frame:Hide()
|
||||
self.hideFrame = nil
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- RESET FUNCTIONS (ARENA LEAVE)
|
||||
@ -349,7 +450,7 @@ end
|
||||
|
||||
function Gladdy:Reset()
|
||||
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
|
||||
end
|
||||
end
|
||||
@ -357,15 +458,15 @@ function Gladdy:Reset()
|
||||
self.curBracket = nil
|
||||
self.curUnit = 1
|
||||
|
||||
for k1, v1 in self:IterModules() do
|
||||
self:Call(v1, "Reset")
|
||||
for _, module in self:IterModules() do
|
||||
self:Call(module, "Reset")
|
||||
end
|
||||
|
||||
for unit in pairs(self.buttons) do
|
||||
self:ResetUnit(unit)
|
||||
end
|
||||
if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then
|
||||
SetCVar("showArenaEnemyFrames", 1)
|
||||
Gladdy:BlizzArenaSetAlpha(1)
|
||||
end
|
||||
end
|
||||
|
||||
@ -378,8 +479,8 @@ function Gladdy:ResetUnit(unit)
|
||||
button:SetAlpha(0)
|
||||
self:ResetButton(unit)
|
||||
|
||||
for k2, v2 in self:IterModules() do
|
||||
self:Call(v2, "ResetUnit", unit)
|
||||
for _, module in self:IterModules() do
|
||||
self:Call(module, "ResetUnit", unit)
|
||||
end
|
||||
end
|
||||
|
||||
@ -418,13 +519,83 @@ function Gladdy:JoinedArena()
|
||||
end
|
||||
end
|
||||
|
||||
self:SendMessage("JOINED_ARENA")
|
||||
self:UpdateFrame()
|
||||
self.frame:Show()
|
||||
if InCombatLockdown() then
|
||||
Gladdy:Print("Gladdy frames show as soon as you leave combat")
|
||||
self.showFrame = true
|
||||
else
|
||||
self:UpdateFrame()
|
||||
self.frame:Show()
|
||||
self:SendMessage("JOINED_ARENA")
|
||||
end
|
||||
for i=1, self.curBracket do
|
||||
self.buttons["arena" .. i]:SetAlpha(1)
|
||||
end
|
||||
if Gladdy.db.hideBlizzard == "arena" or Gladdy.db.hideBlizzard == "always" then
|
||||
SetCVar("showArenaEnemyFrames", 0)
|
||||
Gladdy:BlizzArenaSetAlpha(0)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- BLIZZARD FRAMES
|
||||
|
||||
---------------------------
|
||||
|
||||
function Gladdy:BlizzArenaSetAlpha(alpha)
|
||||
if IsAddOnLoaded("Blizzard_ArenaUI") then
|
||||
if (ArenaEnemyFrames) then
|
||||
ArenaEnemyFrames:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame1 then
|
||||
ArenaEnemyFrame1:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame1PetFrame then
|
||||
ArenaEnemyFrame1PetFrame:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame2 then
|
||||
ArenaEnemyFrame2:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame2PetFrame then
|
||||
ArenaEnemyFrame2PetFrame:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame3 then
|
||||
ArenaEnemyFrame3:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame3PetFrame then
|
||||
ArenaEnemyFrame3PetFrame:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame4 then
|
||||
ArenaEnemyFrame4:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame4PetFrame then
|
||||
ArenaEnemyFrame4PetFrame:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame5 then
|
||||
ArenaEnemyFrame5:SetAlpha(alpha)
|
||||
end
|
||||
if ArenaEnemyFrame5PetFrame then
|
||||
ArenaEnemyFrame5PetFrame:SetAlpha(alpha)
|
||||
end
|
||||
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
|
@ -1,7 +1,7 @@
|
||||
## Interface: 20501
|
||||
## Interface: 20503
|
||||
## Title: Gladdy - TBC
|
||||
## Version: 1.15-Beta
|
||||
## Notes: The most powerful arena AddOn for WoW 2.5.1
|
||||
## Version: 2.00-Release
|
||||
## Notes: The most powerful arena AddOn for WoW 2.5.3
|
||||
## Author: XiconQoo, DnB_Junkee, Knall
|
||||
## X-Email: contact me on discord Knall#1751
|
||||
## SavedVariables: GladdyXZ
|
||||
|
Binary file not shown.
BIN
Images/BasicProfiles/Mir1.blp
Normal file
BIN
Images/BasicProfiles/Mir1.blp
Normal file
Binary file not shown.
BIN
Images/BasicProfiles/Mir1_edited.blp
Normal file
BIN
Images/BasicProfiles/Mir1_edited.blp
Normal file
Binary file not shown.
BIN
Images/BasicProfiles/Rukk1.blp
Normal file
BIN
Images/BasicProfiles/Rukk1.blp
Normal file
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/Alliance.blp
Normal file
BIN
Images/Countdown/Alliance.blp
Normal file
Binary file not shown.
BIN
Images/Countdown/Horde.blp
Normal file
BIN
Images/Countdown/Horde.blp
Normal file
Binary file not shown.
BIN
Images/trinket.blp
Normal file
BIN
Images/trinket.blp
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
860
Lang.lua
860
Lang.lua
@ -406,6 +406,8 @@ elseif GetLocale() == "deDE" then
|
||||
L["Categories"] = "Kategorien"
|
||||
L["Force Icon"] = "Erzwinge Symbol"
|
||||
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
|
||||
L["Export Import"] = "Exportieren Importieren"
|
||||
@ -427,7 +429,7 @@ elseif GetLocale() == "deDE" then
|
||||
L["Show name text"] = "Namen zeigen"
|
||||
L["Show the units name"] = "Zeige den Namen des Gegners"
|
||||
L["Show ArenaX"] = "ArenaX zeigen"
|
||||
L["Show Arena1-5 as name instead"] = "Zeigt Arena1-5 anstatt des Namens"
|
||||
L["Show 1-5 as name instead"] = "Zeigt 1-5 anstatt des Namens"
|
||||
L["Show the actual health"] = "Zeige die momentane Gesundheit"
|
||||
L["Show the actual health on the health bar"] = "Zeigt die momentane Gesundheit"
|
||||
L["Show max health"] = "Zeige maximale Gesundheit"
|
||||
@ -555,6 +557,862 @@ 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["Statusbar border color"] = "Balken Rahmenfarbe"
|
||||
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
|
||||
elseif GetLocale() == "zhCN" 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"] = "通用字体"
|
||||
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
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
||||
assert(LibStub, string.format("%s requires LibStub.", major))
|
||||
@ -139,6 +139,9 @@ Data.spells = {
|
||||
|
||||
-- Revenge Stun
|
||||
[12798] = "rndstun",
|
||||
|
||||
-- Pyroclasm
|
||||
[18093] = "rndstun",
|
||||
|
||||
--[[ CYCLONE ]]--
|
||||
-- Blind
|
||||
@ -167,6 +170,15 @@ Data.spells = {
|
||||
[9853] = "root",
|
||||
[26989] = "root",
|
||||
|
||||
-- Nature's Grasp
|
||||
[19975] = "root",
|
||||
[19974] = "root",
|
||||
[19973] = "root",
|
||||
[19972] = "root",
|
||||
[19971] = "root",
|
||||
[19970] = "root",
|
||||
[27010] = "root",
|
||||
|
||||
--[[ RANDOM ROOTS ]]--
|
||||
-- Improved Hamstring
|
||||
[23694] = "rndroot",
|
||||
@ -176,45 +188,45 @@ Data.spells = {
|
||||
|
||||
--[[ SLEEPS ]]--
|
||||
-- Hibernate
|
||||
[2637] = "sleep",
|
||||
[18657] = "sleep",
|
||||
[18658] = "sleep",
|
||||
[2637] = "disorient",
|
||||
[18657] = "disorient",
|
||||
[18658] = "disorient",
|
||||
|
||||
-- Wyvern Sting
|
||||
[19386] = "sleep",
|
||||
[24132] = "sleep",
|
||||
[24133] = "sleep",
|
||||
[27068] = "sleep",
|
||||
[19386] = "disorient",
|
||||
[24132] = "disorient",
|
||||
[24133] = "disorient",
|
||||
[27068] = "disorient",
|
||||
|
||||
--[[ MISC ]]--
|
||||
-- Chastise (Maybe this shares DR with Imp HS?)
|
||||
[44041] = "root",
|
||||
[44043] = "root",
|
||||
[44044] = "root",
|
||||
[44045] = "root",
|
||||
[44046] = "root",
|
||||
[44047] = "root",
|
||||
-- Chastise
|
||||
[44041] = "chastise",
|
||||
[44043] = "chastise",
|
||||
[44044] = "chastise",
|
||||
[44045] = "chastise",
|
||||
[44046] = "chastise",
|
||||
[44047] = "chastise",
|
||||
|
||||
-- Dragon's Breath
|
||||
[31661] = "dragonsbreath", -- Dragon's Breath
|
||||
[33041] = "dragonsbreath", -- Dragon's Breath
|
||||
[33042] = "dragonsbreath", -- Dragon's Breath
|
||||
[33043] = "dragonsbreath", -- Dragon's Breath
|
||||
[31661] = "scatters", -- Dragon's Breath
|
||||
[33041] = "scatters", -- Dragon's Breath
|
||||
[33042] = "scatters", -- Dragon's Breath
|
||||
[33043] = "scatters", -- Dragon's Breath
|
||||
-- Repentance
|
||||
[20066] = "repentance",
|
||||
[20066] = "disorient",
|
||||
|
||||
-- Scatter Shot
|
||||
[19503] = "scatters",
|
||||
|
||||
-- Freezing Trap
|
||||
[3355] = "freezetrap",
|
||||
[14308] = "freezetrap",
|
||||
[14309] = "freezetrap",
|
||||
[3355] = "disorient",
|
||||
[14308] = "disorient",
|
||||
[14309] = "disorient",
|
||||
|
||||
-- Improved Conc Shot
|
||||
[19410] = "impconc",
|
||||
[22915] = "impconc",
|
||||
[28445] = "impconc",
|
||||
[19410] = "rndstun",
|
||||
[22915] = "rndstun",
|
||||
[28445] = "rndstun",
|
||||
|
||||
-- Death Coil
|
||||
[6789] = "dc",
|
||||
@ -230,6 +242,9 @@ Data.spells = {
|
||||
[605] = "charm",
|
||||
[10911] = "charm",
|
||||
[10912] = "charm",
|
||||
|
||||
-- Counterattack
|
||||
[19306] = "counterattack"
|
||||
}
|
||||
|
||||
-- DR Category names
|
||||
@ -252,6 +267,7 @@ Data.typeNames = {
|
||||
["repentance"] = "Repentance",
|
||||
["dragonsbreath"] = "Dragon's Breath",
|
||||
["ua"] = "Unstable Affliction Silence",
|
||||
["counterattack"] = "Counterattack Immobilize"
|
||||
}
|
||||
|
||||
-- Categories that have DR in PvE as well as PvP
|
||||
|
@ -140,7 +140,8 @@ Buff( { 25782 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Might
|
||||
Buff( { 25895 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Salvation
|
||||
Buff( { 25899 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Sanctuary
|
||||
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
|
||||
Buff( { 465, 10290, 643, 10291, 1032, 10292, 10293, 27149 }, { buffType = "aura"}, "PALADIN") -- Devotion 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( { 19263 }, { buffType = "physical"}, "HUNTER") -- Deterrence
|
||||
Buff( { 3045 }, { buffType = "physical"}, "HUNTER") -- Rapid Fire
|
||||
--local FEIGN_DEATH = GetSpellInfo(5384) -- Localized name for Feign Death
|
||||
|
||||
|
||||
|
@ -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({ 605, 10911, 10912 }, { buffType = "magic" }, "PRIEST") -- Mind Control
|
||||
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
|
||||
@ -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({ 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({ 33878, 33986, 33987 }, { buffType = "physical" }, "DRUID") -- Mangle (Bear)
|
||||
Debuff({ 33876, 33982, 33983 }, { buffType = "physical" }, "DRUID") -- Mangle (Cat)
|
||||
|
||||
-------------
|
||||
-- WARRIOR
|
||||
|
@ -7,6 +7,7 @@ LibClassAuras.debuffs = {}
|
||||
LibClassAuras.debuffToId = {}
|
||||
LibClassAuras.buffs = {}
|
||||
LibClassAuras.buffToId = {}
|
||||
LibClassAuras.altNames = {}
|
||||
|
||||
local function Spell(id, opts, class, spellTable, idTable)
|
||||
if not opts or not class then
|
||||
@ -26,9 +27,20 @@ local function Spell(id, opts, class, spellTable, idTable)
|
||||
return
|
||||
end
|
||||
if opts.altName then
|
||||
idTable[opts.altName] = {id = id , class = class}
|
||||
for _,v in ipairs(id) do
|
||||
LibClassAuras.altNames[v] = opts.altName
|
||||
end
|
||||
if idTable[opts.altName] then
|
||||
tinsert(idTable[opts.altName], {id = id , class = class})
|
||||
else
|
||||
idTable[opts.altName] = {[1] = {id = id , class = class}}
|
||||
end
|
||||
else
|
||||
idTable[spellName] = {id = id , class = class}
|
||||
if idTable[spellName] then
|
||||
tinsert(idTable[spellName], {id = id , class = class})
|
||||
else
|
||||
idTable[spellName] = {[1] = {id = id , class = class}}
|
||||
end
|
||||
end
|
||||
|
||||
if type(id) == "table" then
|
||||
@ -54,9 +66,11 @@ LibClassAuras.Buff = Buff
|
||||
|
||||
local function getClassDebuffs(class)
|
||||
local classSpells = {}
|
||||
for k,v in pairs(LibClassAuras.debuffToId) do
|
||||
if v.class == class then
|
||||
tinsert(classSpells, {name = k, id = v.id})
|
||||
for name, spells in pairs(LibClassAuras.debuffToId) do
|
||||
for _, spellInfo in ipairs(spells) do
|
||||
if spellInfo.class == class then
|
||||
tinsert(classSpells, {name = name, id = spellInfo.id})
|
||||
end
|
||||
end
|
||||
end
|
||||
return classSpells
|
||||
@ -65,9 +79,11 @@ LibClassAuras.GetClassDebuffs = getClassDebuffs
|
||||
|
||||
local function getClassBuffs(class)
|
||||
local classSpells = {}
|
||||
for k,v in pairs(LibClassAuras.buffToId) do
|
||||
if v.class == class then
|
||||
tinsert(classSpells, {name = k, id = v.id})
|
||||
for name, spells in pairs(LibClassAuras.buffToId) do
|
||||
for _, spellInfo in ipairs(spells) do
|
||||
if spellInfo.class == class then
|
||||
tinsert(classSpells, {name = name, id = spellInfo.id})
|
||||
end
|
||||
end
|
||||
end
|
||||
return classSpells
|
||||
@ -82,4 +98,9 @@ local function getSpellNameToId(auraType)
|
||||
end
|
||||
end
|
||||
|
||||
LibClassAuras.GetSpellNameToId = getSpellNameToId
|
||||
LibClassAuras.GetSpellNameToId = getSpellNameToId
|
||||
|
||||
local function getAltName(spellID)
|
||||
return LibClassAuras.altNames[spellID]
|
||||
end
|
||||
LibClassAuras.GetAltName = getAltName
|
@ -26,6 +26,7 @@ local Announcements = Gladdy:NewModule("Announcements", nil, {
|
||||
healthThreshold = 20,
|
||||
trinketUsed = true,
|
||||
trinketReady = false,
|
||||
spellInterrupt = true,
|
||||
dest = "party",
|
||||
},
|
||||
})
|
||||
@ -48,9 +49,11 @@ function Announcements:Initialize()
|
||||
self:RegisterMessage("TRINKET_USED")
|
||||
self:RegisterMessage("TRINKET_READY")
|
||||
self:RegisterMessage("SHADOWSIGHT")
|
||||
self:RegisterMessage("SPELL_INTERRUPT")
|
||||
end
|
||||
|
||||
function Announcements:Reset()
|
||||
self:UnregisterAllMessages()
|
||||
self.enemy = {}
|
||||
self.throttled = {}
|
||||
end
|
||||
@ -138,6 +141,14 @@ function Announcements:TRINKET_READY(unit)
|
||||
self:Send(L["TRINKET READY: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
|
||||
end
|
||||
|
||||
function Announcements:SPELL_INTERRUPT(destUnit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
|
||||
local button = Gladdy.buttons[destUnit]
|
||||
if (not button or not Gladdy.db.announcements.spellInterrupt) then
|
||||
return
|
||||
end
|
||||
self:Send(L["INTERRUPTED: %s (%s)"]:format(extraSpellName, button.name or ""), nil, RAID_CLASS_COLORS[button.class])
|
||||
end
|
||||
|
||||
function Announcements:CheckDrink(unit, aura)
|
||||
local button = Gladdy.buttons[unit]
|
||||
if (not button or not Gladdy.db.announcements.drinks) then
|
||||
@ -157,9 +168,12 @@ function Announcements:Send(msg, throttle, color)
|
||||
if (throttle and throttle > 0) then
|
||||
if (not self.throttled[msg]) then
|
||||
self.throttled[msg] = GetTime() + throttle
|
||||
Gladdy:Debug("INFO", msg, "- NOT THROTTLED -", self.throttled[msg])
|
||||
elseif (self.throttled[msg] < GetTime()) then
|
||||
self.throttled[msg] = nil
|
||||
Gladdy:Debug("INFO", msg, "- THROTTLED OVER -", self.throttled[msg])
|
||||
self.throttled[msg] = GetTime() + throttle
|
||||
else
|
||||
Gladdy:Debug("INFO", msg, "- THROTTLED -", self.throttled[msg])
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -177,9 +191,9 @@ function Announcements:Send(msg, throttle, color)
|
||||
RaidNotice_AddMessage(RaidBossEmoteFrame, msg, color)
|
||||
elseif (dest == "fct" and IsAddOnLoaded("Blizzard_CombatText")) then
|
||||
CombatText_AddMessage(msg, nil, color.r, color.g, color.b, "crit", 1)
|
||||
--[[elseif (dest == "msbt" and IsAddOnLoaded("MikScrollingBattleText")) then
|
||||
MikSBT.DisplayMessage(msg, MikSBT.DISPLAYTYPE_NOTIFICATION, true, color.r * 255, color.g * 255, color.b * 255)
|
||||
elseif (dest == "sct" and IsAddOnLoaded("sct")) then
|
||||
elseif (dest == "msbt" and IsAddOnLoaded("MikScrollingBattleText")) then
|
||||
MikSBT.Animations.DisplayMessage(msg, MikSBT.DISPLAYTYPE_NOTIFICATION, true, color.r * 255, color.g * 255, color.b * 255)
|
||||
--[[elseif (dest == "sct" and IsAddOnLoaded("sct")) then
|
||||
SCT:DisplayText(msg, color, true, "event", 1)
|
||||
elseif (dest == "parrot" and IsAddOnLoaded("parrot")) then
|
||||
Parrot:ShowMessage(msg, "Notification", true, color.r, color.g, color.b)--]]
|
||||
@ -210,9 +224,15 @@ function Announcements:GetOptions()
|
||||
["self"] = L["Self"],
|
||||
["party"] = L["Party"],
|
||||
["rw"] = L["Raid Warning"],
|
||||
["fct"] = L["Blizzard's Floating Combat Text"],
|
||||
}
|
||||
|
||||
if IsAddOnLoaded("Blizzard_CombatText") then
|
||||
destValues["fct"] = L["Blizzard's Floating Combat Text"]
|
||||
end
|
||||
if IsAddOnLoaded("MikScrollingBattleText") then
|
||||
destValues["msbt"] = L["MikScrollingBattleText"]
|
||||
end
|
||||
|
||||
return {
|
||||
headerAnnouncements = {
|
||||
type = "header",
|
||||
@ -231,41 +251,47 @@ function Announcements:GetOptions()
|
||||
desc = L["Announce when an enemy's trinket is ready again"],
|
||||
order = 4,
|
||||
}),
|
||||
spellInterrupt = option({
|
||||
type = "toggle",
|
||||
name = L["Interrupts"],
|
||||
desc = L["Announces when enemies' spells are interrupted"],
|
||||
order = 5,
|
||||
}),
|
||||
drinks = option({
|
||||
type = "toggle",
|
||||
name = L["Drinking"],
|
||||
desc = L["Announces when enemies sit down to drink"],
|
||||
order = 5,
|
||||
order = 6,
|
||||
}),
|
||||
resurrections = option({
|
||||
type = "toggle",
|
||||
name = L["Resurrection"],
|
||||
desc = L["Announces when an enemy tries to resurrect a teammate"],
|
||||
order = 6,
|
||||
order = 7,
|
||||
}),
|
||||
enemy = option({
|
||||
type = "toggle",
|
||||
name = L["New enemies"],
|
||||
desc = L["Announces when new enemies are discovered"],
|
||||
order = 7,
|
||||
order = 8,
|
||||
}),
|
||||
spec = option({
|
||||
type = "toggle",
|
||||
name = L["Spec Detection"],
|
||||
desc = L["Announces when the spec of an enemy was detected"],
|
||||
order = 8,
|
||||
order = 9,
|
||||
}),
|
||||
health = option({
|
||||
type = "toggle",
|
||||
name = L["Low health"],
|
||||
desc = L["Announces when an enemy drops below a certain health threshold"],
|
||||
order = 9,
|
||||
order = 10,
|
||||
}),
|
||||
healthThreshold = option({
|
||||
type = "range",
|
||||
name = L["Low health threshold"],
|
||||
desc = L["Choose how low an enemy must be before low health is announced"],
|
||||
order = 10,
|
||||
order = 11,
|
||||
min = 1,
|
||||
max = 100,
|
||||
step = 1,
|
||||
@ -277,7 +303,7 @@ function Announcements:GetOptions()
|
||||
type = "select",
|
||||
name = L["Destination"],
|
||||
desc = L["Choose how your announcements are displayed"],
|
||||
order = 11,
|
||||
order = 12,
|
||||
values = destValues,
|
||||
}),
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
local floor, str_len, tostring, str_sub, str_find, pairs = math.floor, string.len, tostring, string.sub, string.find, pairs
|
||||
local CreateFrame = CreateFrame
|
||||
local GetLocale = GetLocale
|
||||
local GetTime = GetTime
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
local ACDFrame = Gladdy:NewModule("Arena Countdown", nil, {
|
||||
countdown = true,
|
||||
arenaCountdownSize = 256
|
||||
arenaCountdownSize = 256,
|
||||
arenaCountdownFrameStrata = "HIGH",
|
||||
arenaCountdownFrameLevel = 50,
|
||||
})
|
||||
|
||||
function ACDFrame:OnEvent(event, ...)
|
||||
@ -22,33 +23,39 @@ function ACDFrame:Initialize()
|
||||
|
||||
local ACDNumFrame = CreateFrame("Frame", "ACDNumFrame", UIParent)
|
||||
ACDNumFrame:EnableMouse(false)
|
||||
ACDNumFrame:SetHeight(256)
|
||||
ACDNumFrame:SetWidth(256)
|
||||
ACDNumFrame:SetPoint("CENTER", 0, 128)
|
||||
ACDNumFrame:SetHeight(512)
|
||||
ACDNumFrame:SetWidth(512)
|
||||
ACDNumFrame:SetPoint("CENTER", 0, 256)
|
||||
ACDNumFrame:Show()
|
||||
self.ACDNumFrame = ACDNumFrame
|
||||
|
||||
local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH")
|
||||
ACDNumTens:SetWidth(256)
|
||||
ACDNumTens:SetHeight(128)
|
||||
ACDNumTens:SetPoint("CENTER", ACDNumFrame, "CENTER", -48, 0)
|
||||
ACDNumTens:SetHeight(256)
|
||||
ACDNumTens:SetPoint("CENTER", ACDNumFrame, "CENTER", -50, 0)
|
||||
self.ACDNumTens = ACDNumTens
|
||||
|
||||
local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH")
|
||||
ACDNumOnes:SetWidth(256)
|
||||
ACDNumOnes:SetHeight(128)
|
||||
ACDNumOnes:SetPoint("CENTER", ACDNumFrame, "CENTER", 48, 0)
|
||||
ACDNumOnes:SetHeight(256)
|
||||
ACDNumOnes:SetPoint("CENTER", ACDNumFrame, "CENTER", 50, 0)
|
||||
self.ACDNumOnes = ACDNumOnes
|
||||
|
||||
local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH")
|
||||
ACDNumOne:SetWidth(256)
|
||||
ACDNumOne:SetHeight(128)
|
||||
ACDNumOne:SetHeight(256)
|
||||
ACDNumOne:SetPoint("CENTER", ACDNumFrame, "CENTER", 0, 0)
|
||||
self.ACDNumOne = ACDNumOne
|
||||
|
||||
self:RegisterMessage("JOINED_ARENA")
|
||||
self:RegisterMessage("ENEMY_SPOTTED")
|
||||
self:RegisterMessage("UNIT_SPEC")
|
||||
self.faction = UnitFactionGroup("player")
|
||||
end
|
||||
|
||||
function ACDFrame:UpdateFrameOnce()
|
||||
self.ACDNumFrame:SetFrameStrata(Gladdy.db.arenaCountdownFrameStrata)
|
||||
self.ACDNumFrame:SetFrameLevel(Gladdy.db.arenaCountdownFrameLevel)
|
||||
end
|
||||
|
||||
function ACDFrame.OnUpdate(self, elapse)
|
||||
@ -58,11 +65,7 @@ function ACDFrame.OnUpdate(self, elapse)
|
||||
if ((floor(self.countdown) ~= floor(self.countdown - elapse)) and (floor(self.countdown - elapse) >= 0)) then
|
||||
local str = tostring(floor(self.countdown - elapse));
|
||||
|
||||
if (floor(self.countdown - elapse) == 0) then
|
||||
self.ACDNumTens:Hide();
|
||||
self.ACDNumOnes:Hide();
|
||||
self.ACDNumOne:Hide();
|
||||
elseif (str_len(str) == 2) then
|
||||
if (str_len(str) == 2) then
|
||||
-- Display has 2 digits
|
||||
self.ACDNumOne:Hide();
|
||||
self.ACDNumTens:Show();
|
||||
@ -73,8 +76,10 @@ function ACDFrame.OnUpdate(self, elapse)
|
||||
self.ACDNumFrame:SetScale(0.7)
|
||||
elseif (str_len(str) == 1) then
|
||||
-- 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:SetTexture(self.texturePath .. str_sub(str, 0, 1));
|
||||
self.ACDNumOne:SetTexture(self.texturePath .. path);
|
||||
self.ACDNumOnes:Hide();
|
||||
self.ACDNumTens:Hide();
|
||||
self.ACDNumFrame:SetScale(1.0)
|
||||
@ -93,18 +98,25 @@ function ACDFrame.OnUpdate(self, elapse)
|
||||
end
|
||||
|
||||
function ACDFrame:JOINED_ARENA()
|
||||
self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
|
||||
self:SetScript("OnEvent", ACDFrame.OnEvent)
|
||||
self.endTime = GetTime() + 70
|
||||
self:SetScript("OnUpdate", ACDFrame.OnUpdate)
|
||||
if Gladdy.db.countdown then
|
||||
self.ACDNumFrame:Show()
|
||||
self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
|
||||
self:SetScript("OnEvent", ACDFrame.OnEvent)
|
||||
self.endTime = GetTime() + 70
|
||||
self:SetScript("OnUpdate", ACDFrame.OnUpdate)
|
||||
end
|
||||
end
|
||||
|
||||
function ACDFrame:ENEMY_SPOTTED()
|
||||
ACDFrame:Reset()
|
||||
if not Gladdy.frame.testing then
|
||||
ACDFrame:Reset()
|
||||
end
|
||||
end
|
||||
|
||||
function ACDFrame:UNIT_SPEC()
|
||||
ACDFrame:Reset()
|
||||
if not Gladdy.frame.testing then
|
||||
ACDFrame:Reset()
|
||||
end
|
||||
end
|
||||
|
||||
function ACDFrame:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
|
||||
@ -125,15 +137,15 @@ function ACDFrame:UpdateFrame()
|
||||
self.ACDNumFrame:SetPoint("CENTER", 0, 128)
|
||||
|
||||
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.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.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)
|
||||
end
|
||||
|
||||
@ -148,6 +160,7 @@ function ACDFrame:Reset()
|
||||
self:UnregisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
|
||||
self:SetScript("OnUpdate", nil)
|
||||
self.hidden = true;
|
||||
self.ACDNumFrame:Hide()
|
||||
self.ACDNumTens:Hide();
|
||||
self.ACDNumOnes:Hide();
|
||||
self.ACDNumOne:Hide();
|
||||
@ -176,5 +189,26 @@ function ACDFrame:GetOptions()
|
||||
step = 16,
|
||||
width = "full",
|
||||
}),
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 5,
|
||||
},
|
||||
arenaCountdownFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 6,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
}),
|
||||
arenaCountdownFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 7,
|
||||
width = "full",
|
||||
}),
|
||||
}
|
||||
end
|
||||
|
@ -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 GetSpellDescription = GetSpellDescription
|
||||
local CreateFrame, GetTime = CreateFrame, GetTime
|
||||
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 function defaultSpells(auraType)
|
||||
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
|
||||
spells[tostring(v.spellID)] = {}
|
||||
spells[tostring(v.spellID)].enabled = true
|
||||
@ -20,7 +21,7 @@ local function defaultSpells(auraType)
|
||||
end
|
||||
local function defaultInterrupts()
|
||||
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)].enabled = true
|
||||
spells[tostring(v.spellID)].priority = v.priority
|
||||
@ -40,7 +41,21 @@ local Auras = Gladdy:NewModule("Auras", nil, {
|
||||
auraListDefault = defaultSpells(),
|
||||
auraListInterrupts = defaultInterrupts(),
|
||||
auraInterruptColorsEnabled = true,
|
||||
auraInterruptColors = Gladdy:GetSpellSchoolColors()
|
||||
auraInterruptColors = Gladdy:GetSpellSchoolColors(),
|
||||
auraDetached = false,
|
||||
auraXOffset = 0,
|
||||
auraYOffset = 0,
|
||||
auraSize = 60 + 20 + 1,
|
||||
auraWidthFactor = 0.9,
|
||||
auraInterruptDetached = false,
|
||||
auraInterruptXOffset = 0,
|
||||
auraInterruptYOffset = 0,
|
||||
auraInterruptSize = 60 + 20 + 1,
|
||||
auraInterruptWidthFactor = 0.9,
|
||||
auraFrameStrata = "MEDIUM",
|
||||
auraFrameLevel = 5,
|
||||
auraInterruptFrameStrata = "MEDIUM",
|
||||
auraInterruptFrameLevel = 5,
|
||||
})
|
||||
|
||||
function Auras:Initialize()
|
||||
@ -56,25 +71,30 @@ function Auras:Initialize()
|
||||
end
|
||||
|
||||
function Auras:CreateFrame(unit)
|
||||
local auraFrame = CreateFrame("Frame", nil, Gladdy.modules["Class Icon"].frames[unit])
|
||||
local auraFrame = CreateFrame("Frame", nil, Gladdy.buttons[unit])
|
||||
auraFrame:EnableMouse(false)
|
||||
auraFrame:SetFrameStrata("MEDIUM")
|
||||
auraFrame:SetFrameLevel(3)
|
||||
auraFrame.frame = CreateFrame("Frame", nil, auraFrame)
|
||||
auraFrame.frame:SetPoint("TOPLEFT", auraFrame, "TOPLEFT")
|
||||
auraFrame.frame:EnableMouse(false)
|
||||
auraFrame.frame:SetFrameStrata("MEDIUM")
|
||||
auraFrame.frame:SetFrameLevel(3)
|
||||
|
||||
auraFrame.cooldown = CreateFrame("Cooldown", nil, auraFrame, "CooldownFrameTemplate")
|
||||
auraFrame.cooldown = CreateFrame("Cooldown", nil, auraFrame.frame, "CooldownFrameTemplate")
|
||||
auraFrame.cooldown.noCooldownCount = true
|
||||
auraFrame.cooldown:SetFrameStrata("MEDIUM")
|
||||
auraFrame.cooldown:SetFrameLevel(4)
|
||||
auraFrame.cooldown:SetReverse(true)
|
||||
auraFrame.cooldown:SetHideCountdownNumbers(true)
|
||||
|
||||
auraFrame.cooldownFrame = CreateFrame("Frame", nil, auraFrame)
|
||||
auraFrame.cooldownFrame = CreateFrame("Frame", nil, auraFrame.frame)
|
||||
auraFrame.cooldownFrame:ClearAllPoints()
|
||||
auraFrame.cooldownFrame:SetAllPoints(auraFrame)
|
||||
auraFrame.cooldownFrame:SetAllPoints(auraFrame.frame)
|
||||
auraFrame.cooldownFrame:SetFrameStrata("MEDIUM")
|
||||
auraFrame.cooldownFrame:SetFrameLevel(5)
|
||||
|
||||
auraFrame.icon = auraFrame:CreateTexture(nil, "BACKGROUND")
|
||||
auraFrame.icon = auraFrame.frame:CreateTexture(nil, "BACKGROUND")
|
||||
auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
auraFrame.icon:SetAllPoints(auraFrame)
|
||||
|
||||
@ -87,8 +107,8 @@ function Auras:CreateFrame(unit)
|
||||
auraFrame:SetAllPoints(classIcon)
|
||||
|
||||
auraFrame.text = auraFrame.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
||||
auraFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE")
|
||||
auraFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
|
||||
auraFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), 10, "OUTLINE")
|
||||
auraFrame.text:SetTextColor(Gladdy:SetColor(Gladdy.db.auraFontColor))
|
||||
--auraFrame.text:SetShadowOffset(1, -1)
|
||||
--auraFrame.text:SetShadowColor(0, 0, 0, 1)
|
||||
auraFrame.text:SetJustifyH("CENTER")
|
||||
@ -97,19 +117,23 @@ function Auras:CreateFrame(unit)
|
||||
|
||||
auraFrame:SetScript("OnUpdate", function(self, elapsed)
|
||||
if (self.active) then
|
||||
if (self.interruptFrame.priority and self.priority < self.interruptFrame.priority) then
|
||||
self:SetAlpha(0.01)
|
||||
if (not Gladdy.db.auraInterruptDetached and not Gladdy.db.auraDetached and self.interruptFrame.priority and self.priority < self.interruptFrame.priority) then
|
||||
self.frame:SetAlpha(0.001)
|
||||
else
|
||||
self:SetAlpha(1)
|
||||
self.frame:SetAlpha(1)
|
||||
end
|
||||
if (self.timeLeft <= 0) then
|
||||
Auras:AURA_FADE(self.unit, self.track)
|
||||
else
|
||||
if self.spellID == 8178 then
|
||||
self.text:SetText("")
|
||||
else
|
||||
Gladdy:FormatTimer(self.text, self.timeLeft, self.timeLeft < 10)
|
||||
end
|
||||
self.timeLeft = self.timeLeft - elapsed
|
||||
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||
end
|
||||
else
|
||||
self:SetAlpha(0.01)
|
||||
self.frame:SetAlpha(0.001)
|
||||
end
|
||||
end)
|
||||
|
||||
@ -120,30 +144,35 @@ function Auras:CreateFrame(unit)
|
||||
end
|
||||
|
||||
function Auras:CreateInterrupt(unit)
|
||||
local interruptFrame = CreateFrame("Frame", nil, Gladdy.modules["Class Icon"].frames[unit])
|
||||
local interruptFrame = CreateFrame("Frame", nil, Gladdy.buttons[unit])
|
||||
interruptFrame:EnableMouse(false)
|
||||
interruptFrame:SetFrameStrata("MEDIUM")
|
||||
interruptFrame:SetFrameLevel(3)
|
||||
interruptFrame.frame = CreateFrame("Frame", nil, interruptFrame)
|
||||
interruptFrame.frame:SetPoint("TOPLEFT", interruptFrame, "TOPLEFT")
|
||||
interruptFrame.frame:EnableMouse(false)
|
||||
interruptFrame.frame:SetFrameStrata("MEDIUM")
|
||||
interruptFrame.frame:SetFrameLevel(3)
|
||||
|
||||
interruptFrame.cooldown = CreateFrame("Cooldown", nil, interruptFrame, "CooldownFrameTemplate")
|
||||
interruptFrame.cooldown = CreateFrame("Cooldown", nil, interruptFrame.frame, "CooldownFrameTemplate")
|
||||
interruptFrame.cooldown.noCooldownCount = true
|
||||
interruptFrame.cooldown:SetFrameStrata("MEDIUM")
|
||||
interruptFrame.cooldown:SetFrameLevel(4)
|
||||
interruptFrame.cooldown:SetReverse(true)
|
||||
interruptFrame.cooldown:SetHideCountdownNumbers(true)
|
||||
|
||||
interruptFrame.cooldownFrame = CreateFrame("Frame", nil, interruptFrame)
|
||||
interruptFrame.cooldownFrame = CreateFrame("Frame", nil, interruptFrame.frame)
|
||||
interruptFrame.cooldownFrame:ClearAllPoints()
|
||||
interruptFrame.cooldownFrame:SetAllPoints(interruptFrame)
|
||||
interruptFrame.cooldownFrame:SetAllPoints(interruptFrame.frame)
|
||||
interruptFrame.cooldownFrame:SetFrameStrata("MEDIUM")
|
||||
interruptFrame.cooldownFrame:SetFrameLevel(5)
|
||||
|
||||
interruptFrame.icon = interruptFrame:CreateTexture(nil, "BACKGROUND")
|
||||
interruptFrame.icon = interruptFrame.frame:CreateTexture(nil, "BACKGROUND")
|
||||
interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
interruptFrame.icon:SetAllPoints(interruptFrame)
|
||||
interruptFrame.icon:SetAllPoints(interruptFrame.frame)
|
||||
|
||||
interruptFrame.icon.overlay = interruptFrame.cooldownFrame:CreateTexture(nil, "OVERLAY")
|
||||
interruptFrame.icon.overlay:SetAllPoints(interruptFrame)
|
||||
interruptFrame.icon.overlay:SetAllPoints(interruptFrame.frame)
|
||||
interruptFrame.icon.overlay:SetTexture(Gladdy.db.buttonBorderStyle)
|
||||
|
||||
local classIcon = Gladdy.modules["Class Icon"].frames[unit]
|
||||
@ -151,8 +180,8 @@ function Auras:CreateInterrupt(unit)
|
||||
interruptFrame:SetAllPoints(classIcon)
|
||||
|
||||
interruptFrame.text = interruptFrame.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
||||
interruptFrame.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.auraFont), 10, "OUTLINE")
|
||||
interruptFrame.text:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
|
||||
interruptFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), 10, "OUTLINE")
|
||||
interruptFrame.text:SetTextColor(Gladdy:SetColor(Gladdy.db.auraFontColor))
|
||||
--auraFrame.text:SetShadowOffset(1, -1)
|
||||
--auraFrame.text:SetShadowColor(0, 0, 0, 1)
|
||||
interruptFrame.text:SetJustifyH("CENTER")
|
||||
@ -161,23 +190,25 @@ function Auras:CreateInterrupt(unit)
|
||||
|
||||
interruptFrame:SetScript("OnUpdate", function(self, elapsed)
|
||||
if (self.active) then
|
||||
if (Auras.frames[self.unit].priority and self.priority <= Auras.frames[self.unit].priority) then
|
||||
self:SetAlpha(0.01)
|
||||
if (not Gladdy.db.auraInterruptDetached and Auras.frames[self.unit].priority and self.priority <= Auras.frames[self.unit].priority) then
|
||||
self.frame:SetAlpha(0.001)
|
||||
else
|
||||
self:SetAlpha(1)
|
||||
self.frame:SetAlpha(1)
|
||||
end
|
||||
if (self.timeLeft <= 0) then
|
||||
self.active = false
|
||||
self.priority = nil
|
||||
self.spellSchool = nil
|
||||
self.cooldown:SetCooldown(GetTime(), 0)
|
||||
self:SetAlpha(0.01)
|
||||
self.cooldown:Clear()
|
||||
self.frame:SetAlpha(0.001)
|
||||
else
|
||||
self.timeLeft = self.timeLeft - elapsed
|
||||
self.text:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||
Gladdy:FormatTimer(self.text, self.timeLeft, self.timeLeft < 10)
|
||||
end
|
||||
else
|
||||
self:SetAlpha(0.01)
|
||||
self.priority = nil
|
||||
self.spellSchool = nil
|
||||
self.frame:SetAlpha(0.001)
|
||||
end
|
||||
end)
|
||||
|
||||
@ -192,26 +223,70 @@ function Auras:UpdateFrame(unit)
|
||||
return
|
||||
end
|
||||
|
||||
local width, height = Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor, Gladdy.db.classIconSize
|
||||
local width, height
|
||||
|
||||
if Gladdy.db.auraDetached then
|
||||
width, height = Gladdy.db.auraSize * Gladdy.db.auraWidthFactor, Gladdy.db.auraSize
|
||||
|
||||
auraFrame:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
auraFrame:SetFrameLevel(Gladdy.db.auraFrameLevel)
|
||||
auraFrame.frame:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
auraFrame.frame:SetFrameLevel(Gladdy.db.auraFrameLevel)
|
||||
auraFrame.cooldown:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
auraFrame.cooldown:SetFrameLevel(Gladdy.db.auraFrameLevel + 1)
|
||||
auraFrame.cooldownFrame:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
auraFrame.cooldownFrame:SetFrameLevel(Gladdy.db.auraFrameLevel + 2)
|
||||
|
||||
auraFrame:ClearAllPoints()
|
||||
Gladdy:SetPosition(auraFrame, unit, "auraXOffset", "auraYOffset", true, Auras)
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(auraFrame, "auraXOffset", "auraYOffset", L["Auras"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
width,
|
||||
height,
|
||||
0,
|
||||
0)
|
||||
end
|
||||
else
|
||||
width, height = Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor, Gladdy.db.classIconSize
|
||||
|
||||
auraFrame:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
auraFrame:SetFrameLevel(Gladdy.db.classIconFrameLevel + 1)
|
||||
auraFrame.frame:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
auraFrame.frame:SetFrameLevel(Gladdy.db.classIconFrameLevel + 1)
|
||||
auraFrame.cooldown:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
auraFrame.cooldown:SetFrameLevel(Gladdy.db.classIconFrameLevel + 2)
|
||||
auraFrame.cooldownFrame:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
auraFrame.cooldownFrame:SetFrameLevel(Gladdy.db.classIconFrameLevel + 3)
|
||||
|
||||
auraFrame:ClearAllPoints()
|
||||
auraFrame:SetPoint("TOPLEFT", Gladdy.modules["Class Icon"].frames[unit], "TOPLEFT")
|
||||
if auraFrame.mover then
|
||||
auraFrame.mover:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
auraFrame:SetWidth(width)
|
||||
auraFrame:SetHeight(height)
|
||||
auraFrame:SetAllPoints(Gladdy.modules["Class Icon"].frames[unit])
|
||||
auraFrame.frame:SetWidth(height)
|
||||
auraFrame.frame:SetHeight(height)
|
||||
auraFrame.cooldownFrame:ClearAllPoints()
|
||||
auraFrame.cooldownFrame:SetAllPoints(auraFrame)
|
||||
|
||||
auraFrame.cooldown:SetWidth(width - width/16)
|
||||
auraFrame.cooldown:SetHeight(height - height/16)
|
||||
auraFrame.cooldown:ClearAllPoints()
|
||||
auraFrame.cooldown:SetPoint("CENTER", auraFrame, "CENTER")
|
||||
auraFrame.cooldown:SetWidth(width - width/16)
|
||||
auraFrame.cooldown:SetHeight(height - height/16)
|
||||
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:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
|
||||
auraFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
|
||||
auraFrame.text:SetTextColor(Gladdy:SetColor(Gladdy.db.auraFontColor))
|
||||
|
||||
auraFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle)
|
||||
if auraFrame.track and auraFrame.track == AURA_TYPE_DEBUFF then
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraDebuffBorderColor.r, Gladdy.db.auraDebuffBorderColor.g, Gladdy.db.auraDebuffBorderColor.b, Gladdy.db.auraDebuffBorderColor.a)
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.auraDebuffBorderColor))
|
||||
elseif auraFrame.track and auraFrame.track == AURA_TYPE_BUFF then
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraBuffBorderColor.r, Gladdy.db.auraBuffBorderColor.g, Gladdy.db.auraBuffBorderColor.b, Gladdy.db.auraBuffBorderColor.a)
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.auraBuffBorderColor))
|
||||
else
|
||||
auraFrame.icon.overlay:SetVertexColor(0, 0, 0, 1)
|
||||
end
|
||||
@ -230,20 +305,83 @@ function Auras:UpdateInterruptFrame(unit)
|
||||
return
|
||||
end
|
||||
|
||||
local width, height = Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor, Gladdy.db.classIconSize
|
||||
local width, height
|
||||
|
||||
if Gladdy.db.auraInterruptDetached then
|
||||
width, height = Gladdy.db.auraInterruptSize * Gladdy.db.auraInterruptWidthFactor, Gladdy.db.auraInterruptSize
|
||||
|
||||
interruptFrame:SetFrameStrata(Gladdy.db.auraInterruptFrameStrata)
|
||||
interruptFrame:SetFrameLevel(Gladdy.db.auraInterruptFrameLevel)
|
||||
interruptFrame.frame:SetFrameStrata(Gladdy.db.auraInterruptFrameStrata)
|
||||
interruptFrame.frame:SetFrameLevel(Gladdy.db.auraInterruptFrameLevel)
|
||||
interruptFrame.cooldown:SetFrameStrata(Gladdy.db.auraInterruptFrameStrata)
|
||||
interruptFrame.cooldown:SetFrameLevel(Gladdy.db.auraInterruptFrameLevel + 1)
|
||||
interruptFrame.cooldownFrame:SetFrameStrata(Gladdy.db.auraInterruptFrameStrata)
|
||||
interruptFrame.cooldownFrame:SetFrameLevel(Gladdy.db.auraInterruptFrameLevel + 2)
|
||||
|
||||
interruptFrame:ClearAllPoints()
|
||||
Gladdy:SetPosition(interruptFrame, unit, "auraInterruptXOffset", "auraInterruptYOffset", true, Auras)
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(interruptFrame, "auraInterruptXOffset", "auraInterruptYOffset", L["Interrupts"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
width,
|
||||
height,
|
||||
0,
|
||||
0)
|
||||
end
|
||||
else
|
||||
if Gladdy.db.auraDetached then
|
||||
width, height = Gladdy.db.auraSize * Gladdy.db.auraWidthFactor, Gladdy.db.auraSize
|
||||
|
||||
interruptFrame:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
interruptFrame:SetFrameLevel(Gladdy.db.auraFrameLevel)
|
||||
interruptFrame.frame:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
interruptFrame.frame:SetFrameLevel(Gladdy.db.auraFrameLevel)
|
||||
interruptFrame.cooldown:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
interruptFrame.cooldown:SetFrameLevel(Gladdy.db.auraFrameLevel + 1)
|
||||
interruptFrame.cooldownFrame:SetFrameStrata(Gladdy.db.auraFrameStrata)
|
||||
interruptFrame.cooldownFrame:SetFrameLevel(Gladdy.db.auraFrameLevel + 2)
|
||||
|
||||
interruptFrame:ClearAllPoints()
|
||||
interruptFrame:SetAllPoints(self.frames[unit])
|
||||
if interruptFrame.mover then
|
||||
interruptFrame.mover:Hide()
|
||||
end
|
||||
else
|
||||
width, height = Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor, Gladdy.db.classIconSize
|
||||
|
||||
interruptFrame:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
interruptFrame:SetFrameLevel(Gladdy.db.classIconFrameLevel + 1)
|
||||
interruptFrame.frame:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
interruptFrame.frame:SetFrameLevel(Gladdy.db.classIconFrameLevel + 1)
|
||||
interruptFrame.cooldown:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
interruptFrame.cooldown:SetFrameLevel(Gladdy.db.classIconFrameLevel + 2)
|
||||
interruptFrame.cooldownFrame:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
interruptFrame.cooldownFrame:SetFrameLevel(Gladdy.db.classIconFrameLevel + 3)
|
||||
|
||||
interruptFrame:ClearAllPoints()
|
||||
interruptFrame:SetPoint("TOPLEFT", Gladdy.modules["Class Icon"].frames[unit], "TOPLEFT")
|
||||
if interruptFrame.mover then
|
||||
interruptFrame.mover:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
interruptFrame:SetWidth(width)
|
||||
interruptFrame:SetHeight(height)
|
||||
interruptFrame:SetAllPoints(Gladdy.modules["Class Icon"].frames[unit])
|
||||
interruptFrame.frame:SetWidth(width)
|
||||
interruptFrame.frame:SetHeight(height)
|
||||
interruptFrame.cooldownFrame:ClearAllPoints()
|
||||
interruptFrame.cooldownFrame:SetAllPoints(interruptFrame.frame)
|
||||
|
||||
interruptFrame.cooldown:SetWidth(width - width/16)
|
||||
interruptFrame.cooldown:SetHeight(height - height/16)
|
||||
interruptFrame.cooldown:ClearAllPoints()
|
||||
interruptFrame.cooldown:SetPoint("CENTER", interruptFrame, "CENTER")
|
||||
interruptFrame.cooldown:SetWidth(width - width/16)
|
||||
interruptFrame.cooldown:SetHeight(height - height/16)
|
||||
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:SetTextColor(Gladdy.db.auraFontColor.r, Gladdy.db.auraFontColor.g, Gladdy.db.auraFontColor.b, Gladdy.db.auraFontColor.a)
|
||||
interruptFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
|
||||
interruptFrame.text:SetTextColor(Gladdy:SetColor(Gladdy.db.auraFontColor))
|
||||
|
||||
interruptFrame.icon.overlay:SetTexture(Gladdy.db.auraBorderStyle)
|
||||
if interruptFrame.spellSchool then
|
||||
@ -260,41 +398,94 @@ function Auras:UpdateInterruptFrame(unit)
|
||||
end
|
||||
|
||||
function Auras:ResetUnit(unit)
|
||||
self.frames[unit]:UnregisterAllEvents()
|
||||
self.frames[unit].interruptFrame.active = false
|
||||
self.frames[unit].active = false
|
||||
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
self.frames[unit]:UnregisterAllEvents()
|
||||
self.frames[unit]:Hide()
|
||||
self.frames[unit].interruptFrame:Hide()
|
||||
self.frames[unit].interruptFrame.priority = nil
|
||||
self.frames[unit].interruptFrame.spellSchool = nil
|
||||
end
|
||||
|
||||
function Auras:Test(unit)
|
||||
local spellName, _, icon
|
||||
local spellName, spellid, icon, limit
|
||||
|
||||
if (unit == "arena1") then
|
||||
spellName, _, icon = GetSpellInfo(7922)
|
||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 7922, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
||||
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64)
|
||||
elseif (unit == "arena2") then
|
||||
spellName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))
|
||||
_, _, icon = GetSpellInfo(27010)
|
||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
self:AURA_FADE(unit,AURA_TYPE_DEBUFF)
|
||||
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 27010, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
||||
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64)
|
||||
elseif (unit == "arena3") then
|
||||
spellName, _, icon = GetSpellInfo(31224)
|
||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
self:AURA_GAIN(unit,AURA_TYPE_BUFF, 31224, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
||||
spellName, _, icon = GetSpellInfo(18425)
|
||||
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 18425, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
|
||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
if not self.frames[unit]:IsShown() then
|
||||
self.frames[unit]:Show()
|
||||
self.frames[unit].interruptFrame:Show()
|
||||
end
|
||||
|
||||
--Auras
|
||||
local enabledDebuffs, enabledBuffs, testauras = {}, {}
|
||||
for spellIdStr,value in pairs(Gladdy.db.auraListDefault) do
|
||||
if value.enabled then
|
||||
if value.track == AURA_TYPE_BUFF then
|
||||
tinsert(enabledBuffs, {value = value, spellIdStr = spellIdStr})
|
||||
else
|
||||
tinsert(enabledDebuffs, {value = value, spellIdStr = spellIdStr})
|
||||
end
|
||||
end
|
||||
end
|
||||
if unit == "arena2" then
|
||||
testauras = enabledBuffs
|
||||
else
|
||||
testauras = enabledDebuffs
|
||||
end
|
||||
|
||||
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
|
||||
-- /run LibStub("Gladdy").modules["Auras"]:Test("arena1")
|
||||
-- /run LibStub("Gladdy"):JoinedArena()
|
||||
|
||||
--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
|
||||
|
||||
function Auras:JOINED_ARENA()
|
||||
for i=1, Gladdy.curBracket do
|
||||
--self.frames["arena" .. i]:RegisterUnitEvent("UNIT_AURA", "arena" .. i)
|
||||
--self.frames["arena" .. i]:SetScript("OnEvent", Auras.OnEvent)
|
||||
local unit = "arena" .. i
|
||||
self.frames[unit].interruptFrame.active = false
|
||||
self.frames[unit].active = false
|
||||
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
self:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
self.frames[unit]:Show()
|
||||
self.frames[unit].interruptFrame:Show()
|
||||
end
|
||||
end
|
||||
|
||||
@ -322,7 +513,8 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
|
||||
auraFrame.startTime = expirationTime - duration
|
||||
auraFrame.endTime = expirationTime
|
||||
auraFrame.name = spellName
|
||||
auraFrame.timeLeft = expirationTime - GetTime()
|
||||
auraFrame.spellID = spellID
|
||||
auraFrame.timeLeft = spellID == 8178 and 45 or expirationTime - GetTime()
|
||||
auraFrame.priority = Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].priority
|
||||
auraFrame.icon:SetTexture(Gladdy:GetImportantAuras()[GetSpellInfo(self.auras[spellName].spellID)] and Gladdy:GetImportantAuras()[GetSpellInfo(self.auras[spellName].spellID)].texture or icon)
|
||||
auraFrame.track = auraType
|
||||
@ -330,15 +522,17 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
|
||||
auraFrame.icon.overlay:Show()
|
||||
auraFrame.cooldownFrame:Show()
|
||||
if auraType == AURA_TYPE_DEBUFF then
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraDebuffBorderColor.r, Gladdy.db.auraDebuffBorderColor.g, Gladdy.db.auraDebuffBorderColor.b, Gladdy.db.auraDebuffBorderColor.a)
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.auraDebuffBorderColor))
|
||||
elseif auraType == AURA_TYPE_BUFF then
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.auraBuffBorderColor.r, Gladdy.db.auraBuffBorderColor.g, Gladdy.db.auraBuffBorderColor.b, Gladdy.db.auraBuffBorderColor.a)
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.auraBuffBorderColor))
|
||||
else
|
||||
auraFrame.icon.overlay:SetVertexColor(Gladdy.db.frameBorderColor.r, Gladdy.db.frameBorderColor.g, Gladdy.db.frameBorderColor.b, Gladdy.db.frameBorderColor.a)
|
||||
end
|
||||
if not Gladdy.db.auraDisableCircle then
|
||||
if not Gladdy.db.auraDisableCircle and spellID ~= 8178 then
|
||||
auraFrame.cooldown:Show()
|
||||
auraFrame.cooldown:SetCooldown(auraFrame.startTime, duration)
|
||||
else
|
||||
auraFrame.cooldown:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
@ -348,7 +542,7 @@ function Auras:AURA_FADE(unit, auraType)
|
||||
return
|
||||
end
|
||||
if auraFrame.active then
|
||||
auraFrame.cooldown:SetCooldown(GetTime(), 0)
|
||||
auraFrame.cooldown:Clear()
|
||||
end
|
||||
--auraFrame.cooldown:Hide()
|
||||
auraFrame.active = false
|
||||
@ -365,7 +559,7 @@ end
|
||||
|
||||
function Auras:GetInterruptColor(extraSpellSchool)
|
||||
if not Gladdy.db.auraInterruptColorsEnabled then
|
||||
return Gladdy.db.auraDebuffBorderColor.r, Gladdy.db.auraDebuffBorderColor.g, Gladdy.db.auraDebuffBorderColor.b, Gladdy.db.auraDebuffBorderColor.a
|
||||
return Gladdy:SetColor(Gladdy.db.auraDebuffBorderColor)
|
||||
else
|
||||
local color = Gladdy.db.auraInterruptColors[extraSpellSchool] or Gladdy.db.auraInterruptColors["unknown"]
|
||||
return color.r, color.g, color.b, color.a
|
||||
@ -374,7 +568,7 @@ end
|
||||
|
||||
function Auras:SPELL_INTERRUPT(unit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
|
||||
local auraFrame = self.frames[unit]
|
||||
local interruptFrame = auraFrame and auraFrame.interruptFrame
|
||||
local interruptFrame = auraFrame ~= nil and auraFrame.interruptFrame
|
||||
local button = Gladdy.buttons[unit]
|
||||
if (not interruptFrame) then
|
||||
return
|
||||
@ -459,11 +653,11 @@ function Auras:GetOptions()
|
||||
for i,v in ipairs(list) do
|
||||
borderArgs["auraSpellSchool" .. v.key] = {
|
||||
type = "color",
|
||||
name = v.val.type,
|
||||
name = L[v.val.type],
|
||||
order = i + 13,
|
||||
hasAlpha = true,
|
||||
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].g = g
|
||||
Gladdy.db.auraInterruptColors[v.key].b = b
|
||||
@ -488,6 +682,214 @@ function Auras:GetOptions()
|
||||
name = L["Frame"],
|
||||
order = 3,
|
||||
args = {
|
||||
detachedAuraMode = {
|
||||
type = "group",
|
||||
name = L["Detached Aura"],
|
||||
order = 4,
|
||||
args = {
|
||||
headerDetachedMode = {
|
||||
type = "header",
|
||||
name = L["Detached Mode"],
|
||||
order = 1,
|
||||
},
|
||||
auraDetached = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Aura Detached"],
|
||||
order = 2,
|
||||
width = "full"
|
||||
}),
|
||||
headerAuraSize = {
|
||||
type = "header",
|
||||
name = L["Size"],
|
||||
order = 10,
|
||||
},
|
||||
auraSize = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Aura size"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
min = 3,
|
||||
max = 100,
|
||||
step = 0.1,
|
||||
order = 11,
|
||||
width = "full",
|
||||
}),
|
||||
auraWidthFactor = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Aura width factor"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
min = 0.5,
|
||||
max = 2,
|
||||
step = 0.05,
|
||||
order = 12,
|
||||
width = "full",
|
||||
}),
|
||||
headerAuraPosition = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 20,
|
||||
},
|
||||
auraXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Aura X Offset"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
min = -1000,
|
||||
max = 1000,
|
||||
step = 0.01,
|
||||
order = 21,
|
||||
width = "full",
|
||||
}),
|
||||
auraYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Aura Y Offset"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
min = -1000,
|
||||
max = 1000,
|
||||
step = 0.01,
|
||||
order = 22,
|
||||
width = "full",
|
||||
}),
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 30,
|
||||
},
|
||||
auraFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
order = 32,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
auraFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 33,
|
||||
width = "full",
|
||||
}),
|
||||
}
|
||||
},
|
||||
detachedInterruptMode = {
|
||||
type = "group",
|
||||
name = L["Detached Interrupt"],
|
||||
order = 5,
|
||||
args = {
|
||||
headerDetachedMode = {
|
||||
type = "header",
|
||||
name = L["Detached Mode"],
|
||||
order = 1,
|
||||
},
|
||||
auraInterruptDetached = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Interrupt Detached"],
|
||||
order = 2,
|
||||
width = "full"
|
||||
}),
|
||||
headerAuraSize = {
|
||||
type = "header",
|
||||
name = L["Size"],
|
||||
order = 10,
|
||||
},
|
||||
auraInterruptSize = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Interrupt size"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraInterruptDetached
|
||||
end,
|
||||
min = 3,
|
||||
max = 100,
|
||||
step = 0.1,
|
||||
order = 11,
|
||||
width = "full",
|
||||
}),
|
||||
auraInterruptWidthFactor = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Interrupt width factor"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraInterruptDetached
|
||||
end,
|
||||
min = 0.5,
|
||||
max = 2,
|
||||
step = 0.05,
|
||||
order = 12,
|
||||
width = "full",
|
||||
}),
|
||||
headerAuraPosition = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 20,
|
||||
},
|
||||
auraInterruptXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Interrupt X Offset"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraInterruptDetached
|
||||
end,
|
||||
min = -1000,
|
||||
max = 1000,
|
||||
step = 0.01,
|
||||
order = 21,
|
||||
width = "full",
|
||||
}),
|
||||
auraInterruptYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Interrupt Y Offset"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraInterruptDetached
|
||||
end,
|
||||
min = -1000,
|
||||
max = 1000,
|
||||
step = 0.01,
|
||||
order = 22,
|
||||
width = "full",
|
||||
}),
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 30,
|
||||
},
|
||||
auraInterruptFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
order = 32,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
auraInterruptFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
disabled = function()
|
||||
return not Gladdy.db.auraDetached
|
||||
end,
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 33,
|
||||
width = "full",
|
||||
}),
|
||||
}
|
||||
},
|
||||
cooldown = {
|
||||
type = "group",
|
||||
name = L["Cooldown"],
|
||||
@ -513,6 +915,22 @@ function Auras:GetOptions()
|
||||
order = 4,
|
||||
width = "full",
|
||||
}),
|
||||
auraCooldownNumberAlpha = {
|
||||
type = "range",
|
||||
name = L["Cooldown number alpha"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
order = 5,
|
||||
width = "full",
|
||||
set = function(info, value)
|
||||
Gladdy.db.auraFontColor.a = value
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
get = function(info)
|
||||
return Gladdy.db.auraFontColor.a
|
||||
end,
|
||||
},
|
||||
}
|
||||
},
|
||||
font = {
|
||||
@ -563,21 +981,21 @@ function Auras:GetOptions()
|
||||
debuffList = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = "Debuffs",
|
||||
name = L["Debuffs"],
|
||||
order = 4,
|
||||
args = Auras:GetAuraOptions(AURA_TYPE_DEBUFF)
|
||||
},
|
||||
buffList = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = "Buffs",
|
||||
name = L["Buffs"],
|
||||
order = 5,
|
||||
args = Auras:GetAuraOptions(AURA_TYPE_BUFF)
|
||||
},
|
||||
interruptList = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = "Interrupts",
|
||||
name = L["Interrupts"],
|
||||
order = 6,
|
||||
args = Auras:GetInterruptOptions()
|
||||
}
|
||||
@ -591,8 +1009,8 @@ function Auras:GetAuraOptions(auraType)
|
||||
width = "0.7",
|
||||
name = L["Check All"],
|
||||
type = "execute",
|
||||
func = function(info)
|
||||
for k,v in pairs(defaultSpells(auraType)) do
|
||||
func = function()
|
||||
for k,_ in pairs(defaultSpells(auraType)) do
|
||||
Gladdy.db.auraListDefault[k].enabled = true
|
||||
end
|
||||
end,
|
||||
@ -602,15 +1020,15 @@ function Auras:GetAuraOptions(auraType)
|
||||
width = "0.7",
|
||||
name = L["Uncheck All"],
|
||||
type = "execute",
|
||||
func = function(info)
|
||||
for k,v in pairs(defaultSpells(auraType)) do
|
||||
func = function()
|
||||
for k,_ in pairs(defaultSpells(auraType)) do
|
||||
Gladdy.db.auraListDefault[k].enabled = false
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
local auras = {}
|
||||
for k,v in pairs(Gladdy:GetImportantAuras()) do
|
||||
for _,v in pairs(Gladdy:GetImportantAuras()) do
|
||||
if v.track == auraType then
|
||||
tinsert(auras, v.spellID)
|
||||
end
|
||||
@ -625,6 +1043,7 @@ function Auras:GetAuraOptions(auraType)
|
||||
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))].altName)
|
||||
or Gladdy:GetImportantAuras()[GetSpellInfo(k)].altName
|
||||
or GetSpellInfo(k),
|
||||
order = i+2,
|
||||
icon = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
|
||||
@ -632,13 +1051,14 @@ function Auras:GetAuraOptions(auraType)
|
||||
enabled = {
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = GetSpellDescription(k),
|
||||
type = "toggle",
|
||||
image = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
|
||||
width = "2",
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.auraListDefault[tostring(k)].enabled = value
|
||||
end,
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.auraListDefault[tostring(k)].enabled
|
||||
end
|
||||
},
|
||||
@ -650,10 +1070,10 @@ function Auras:GetAuraOptions(auraType)
|
||||
max = 50,
|
||||
width = "2",
|
||||
step = 1,
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.auraListDefault[tostring(k)].priority
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.auraListDefault[tostring(k)].priority = value
|
||||
end,
|
||||
width = "full",
|
||||
@ -666,13 +1086,13 @@ end
|
||||
|
||||
function Auras:GetInterruptOptions()
|
||||
local options = {
|
||||
ckeckAll = {
|
||||
checkAll = {
|
||||
order = 1,
|
||||
width = "0.7",
|
||||
name = L["Check All"],
|
||||
type = "execute",
|
||||
func = function(info)
|
||||
for k,v in pairs(defaultInterrupts()) do
|
||||
func = function()
|
||||
for k,_ in pairs(defaultInterrupts()) do
|
||||
Gladdy.db.auraListInterrupts[k].enabled = true
|
||||
end
|
||||
end,
|
||||
@ -682,15 +1102,15 @@ function Auras:GetInterruptOptions()
|
||||
width = "0.7",
|
||||
name = L["Uncheck All"],
|
||||
type = "execute",
|
||||
func = function(info)
|
||||
for k,v in pairs(defaultInterrupts()) do
|
||||
func = function()
|
||||
for k,_ in pairs(defaultInterrupts()) do
|
||||
Gladdy.db.auraListInterrupts[k].enabled = false
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
local auras = {}
|
||||
for k,v in pairs(Gladdy:GetInterrupts()) do
|
||||
for _,v in pairs(Gladdy:GetInterrupts()) do
|
||||
tinsert(auras, v.spellID)
|
||||
end
|
||||
tbl_sort(auras, function(a, b) return GetSpellInfo(a) < GetSpellInfo(b) end)
|
||||
@ -710,10 +1130,10 @@ function Auras:GetInterruptOptions()
|
||||
type = "toggle",
|
||||
image = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
|
||||
width = "2",
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.auraListInterrupts[tostring(k)].enabled = value
|
||||
end,
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.auraListInterrupts[tostring(k)].enabled
|
||||
end
|
||||
},
|
||||
@ -725,10 +1145,10 @@ function Auras:GetInterruptOptions()
|
||||
max = 50,
|
||||
width = "2",
|
||||
step = 1,
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.auraListInterrupts[tostring(k)].priority
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.auraListInterrupts[tostring(k)].priority = value
|
||||
end,
|
||||
width = "full",
|
||||
|
@ -1,7 +1,7 @@
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local CreateFrame = CreateFrame
|
||||
local GetTime = GetTime
|
||||
local select, lower, ceil, tremove, tinsert, pairs, ipairs, tostring = select, string.lower, ceil, tremove, tinsert, pairs, ipairs, tostring
|
||||
local select, lower, ceil, tremove, tinsert, pairs, ipairs, tostring, random = select, string.lower, ceil, tremove, tinsert, pairs, ipairs, tostring, math.random
|
||||
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
|
||||
local auraTypes = {AURA_TYPE_BUFF, AURA_TYPE_DEBUFF}
|
||||
|
||||
@ -31,11 +31,9 @@ local BuffsDebuffs = Gladdy:NewModule("Buffs and Debuffs", nil, {
|
||||
buffsFontScale = 1,
|
||||
buffsFontColor = {r = 1, g = 1, b = 0, a = 1},
|
||||
buffsDynamicColor = true,
|
||||
buffsCooldownPos = "TOP",
|
||||
buffsCooldownGrowDirection = "RIGHT",
|
||||
buffsXOffset = 0,
|
||||
buffsYOffset = 0,
|
||||
buffsBuffsCooldownPos = "BOTTOM",
|
||||
buffsBuffsCooldownGrowDirection = "RIGHT",
|
||||
buffsBuffsXOffset = 0,
|
||||
buffsBuffsYOffset = 0,
|
||||
@ -51,7 +49,9 @@ local BuffsDebuffs = Gladdy:NewModule("Buffs and Debuffs", nil, {
|
||||
buffsBorderColorImmune = Gladdy:GetAuraTypeColor()["immune"],
|
||||
buffsBorderColorDisease = Gladdy:GetAuraTypeColor()["disease"],
|
||||
buffsBorderColorForm = Gladdy:GetAuraTypeColor()["form"],
|
||||
buffsBorderColorAura = Gladdy:GetAuraTypeColor()["aura"]
|
||||
buffsBorderColorAura = Gladdy:GetAuraTypeColor()["aura"],
|
||||
buffFrameStrata = "MEDIUM",
|
||||
buffsFrameLevel = 9,
|
||||
})
|
||||
|
||||
local spellSchoolToOptionValueTable
|
||||
@ -62,7 +62,7 @@ local function spellSchoolToOptionValue(spellSchool)
|
||||
spellSchoolToOptionValueTable[spellSchool].b,
|
||||
spellSchoolToOptionValueTable[spellSchool].a
|
||||
else
|
||||
return Gladdy.db.buffsBorderColor.r,Gladdy.db.buffsBorderColor.g,Gladdy.db.buffsBorderColor.b,Gladdy.db.buffsBorderColor.a
|
||||
return Gladdy:SetColor(Gladdy.db.buffsBorderColor)
|
||||
end
|
||||
end
|
||||
|
||||
@ -134,27 +134,31 @@ end
|
||||
|
||||
function BuffsDebuffs:Test(unit)
|
||||
if Gladdy.db.buffsEnabled then
|
||||
if unit == "arena1" or unit == "arena3" then
|
||||
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
local spellSchools = { "physical", "magic", "curse", "poison", "disease", "immune" }
|
||||
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 1943, AURA_TYPE_DEBUFF, 12, 12, 1, "physical", select(3, GetSpellInfo(1943)), 1)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 18647, AURA_TYPE_DEBUFF, 10, 10, 1, "immune", select(3, GetSpellInfo(18647)), 2)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 27218, AURA_TYPE_DEBUFF, 9, 9, 1, "curse", select(3, GetSpellInfo(27218)), 3)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 27216, AURA_TYPE_DEBUFF, 9, 9, 1, "magic", select(3, GetSpellInfo(27216)), 4)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 27189, AURA_TYPE_DEBUFF, 9, 9, 5, "poison", select(3, GetSpellInfo(27189)), 5)
|
||||
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 33076, AURA_TYPE_BUFF, 15, 15, 1, "magic", select(3, GetSpellInfo(33076)), 1)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 26980, AURA_TYPE_BUFF, 12, 12, 5, "magic", select(3, GetSpellInfo(26980)), 2)
|
||||
else
|
||||
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 1, AURA_TYPE_BUFF, 12, 12, 1, "poison", select(3, GetSpellInfo(1943)), 1)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 1, AURA_TYPE_BUFF, 10, 10, 2, "magic", select(3, GetSpellInfo(1)), 2)
|
||||
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 5, AURA_TYPE_DEBUFF, 12, 12, 3, "physical", select(3, GetSpellInfo(27009)), 1)
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, 5, AURA_TYPE_DEBUFF, 11, 11, 4, "disease", select(3, GetSpellInfo(11426)), 2)
|
||||
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_DEBUFF)
|
||||
BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_BUFF)
|
||||
--BuffsDebuffs:AURA_GAIN(unit, AURA_TYPE_BUFF, 1243, select(1, GetSpellInfo(1243)), select(3, GetSpellInfo(1243)), 10, GetTime() + 10, 1, "physical")
|
||||
--self:AURA_GAIN(unit, AURA_TYPE_DEBUFF, 31117, select(1, GetSpellInfo(31117)), select(3, GetSpellInfo(31117)), 10, GetTime() + 10, 1, "physical")
|
||||
local i = 1
|
||||
for spellID, enabled in pairs(Gladdy.db.trackedDebuffs) do
|
||||
if i > 4 then
|
||||
break
|
||||
end
|
||||
if enabled then
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, spellID, AURA_TYPE_DEBUFF, 15, 15, random(1,5), spellSchools[random(1,6)], select(3, GetSpellInfo(spellID)), i)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
i = 1
|
||||
for spellID, enabled in pairs(Gladdy.db.trackedBuffs) do
|
||||
if i > 4 then
|
||||
break
|
||||
end
|
||||
if enabled then
|
||||
BuffsDebuffs:AddOrRefreshAura(unit, spellID, AURA_TYPE_BUFF, 15, 15, random(1,5), spellSchools[random(1,6)], select(3, GetSpellInfo(spellID)), i)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -194,13 +198,24 @@ function BuffsDebuffs:AURA_GAIN(unit, auraType, spellID, spellName, texture, dur
|
||||
return
|
||||
end
|
||||
local auraFrame = self.frames[unit]
|
||||
spellName = LibClassAuras.GetAltName(spellID) or spellName
|
||||
local aura = Gladdy:GetImportantAuras()[spellName] and Gladdy.db.auraListDefault[tostring(Gladdy:GetImportantAuras()[spellName].spellID)].enabled
|
||||
if aura and Gladdy.db.buffsShowAuraDebuffs then
|
||||
aura = false
|
||||
end
|
||||
local auraNames = LibClassAuras.GetSpellNameToId(auraType)
|
||||
local spellId = auraNames[spellName] and auraNames[spellName].id[1]
|
||||
if not aura and spellID and spellId and expirationTime and (Gladdy.db.trackedBuffs[tostring(spellId)] or Gladdy.db.trackedDebuffs[tostring(spellId)]) then
|
||||
local spellId
|
||||
local isTracked = false
|
||||
if auraNames[spellName] then
|
||||
for _, spellInfo in ipairs(auraNames[spellName]) do
|
||||
spellId = spellInfo.id[1]
|
||||
if (Gladdy.db.trackedBuffs[tostring(spellId)] or Gladdy.db.trackedDebuffs[tostring(spellId)]) then
|
||||
isTracked = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not aura and spellID and expirationTime and isTracked then
|
||||
local index
|
||||
if auraType == AURA_TYPE_DEBUFF then
|
||||
auraFrame.numDebuffs = auraFrame.numDebuffs + 1
|
||||
@ -218,16 +233,19 @@ end
|
||||
---------------------------
|
||||
|
||||
function BuffsDebuffs:CreateFrame(unit)
|
||||
local verticalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
local debuffFrame = CreateFrame("Frame", "GladdyDebuffs" .. unit, Gladdy.buttons[unit])
|
||||
debuffFrame:SetFrameStrata(Gladdy.db.buffFrameStrata)
|
||||
debuffFrame:SetFrameLevel(Gladdy.db.buffsFrameLevel)
|
||||
debuffFrame:SetMovable(true)
|
||||
debuffFrame:SetHeight(Gladdy.db.buffsIconSize)
|
||||
debuffFrame:SetWidth(1)
|
||||
debuffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPLEFT", 0, verticalMargin)
|
||||
debuffFrame.unit = unit
|
||||
local buffFrame = CreateFrame("Frame", "GladdyBuffs" .. unit, Gladdy.buttons[unit])
|
||||
buffFrame:SetFrameStrata(Gladdy.db.buffFrameStrata)
|
||||
buffFrame:SetFrameLevel(Gladdy.db.buffsFrameLevel)
|
||||
buffFrame:SetMovable(true)
|
||||
buffFrame:SetHeight(Gladdy.db.buffsIconSize)
|
||||
buffFrame:SetWidth(1)
|
||||
buffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPLEFT", 0, verticalMargin)
|
||||
buffFrame.unit = unit
|
||||
self.frames[unit] = {}
|
||||
self.frames[unit].buffFrame = buffFrame
|
||||
@ -259,154 +277,40 @@ local function styleIcon(aura, auraType)
|
||||
aura.cooldowncircle:SetAlpha(Gladdy.db.buffsCooldownAlpha)
|
||||
end
|
||||
|
||||
aura:SetFrameStrata(Gladdy.db.buffFrameStrata)
|
||||
aura:SetFrameLevel(Gladdy.db.buffsFrameLevel)
|
||||
aura.cooldowncircle:SetFrameLevel(Gladdy.db.buffsFrameLevel + 1)
|
||||
aura.overlay:SetFrameLevel(Gladdy.db.buffsFrameLevel + 2)
|
||||
|
||||
aura.border:SetTexture(Gladdy.db.buffsBorderStyle)
|
||||
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.stacks:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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: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, 1)
|
||||
end
|
||||
|
||||
function BuffsDebuffs:UpdateFrame(unit)
|
||||
self.frames[unit].debuffFrame:SetHeight(Gladdy.db.buffsIconSize)
|
||||
self.frames[unit].debuffFrame:ClearAllPoints()
|
||||
|
||||
--DEBUFFS
|
||||
local powerBarHeight = Gladdy.db.powerBarEnabled and (Gladdy.db.powerBarHeight + 1) or 0
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
|
||||
local verticalMargin = -(Gladdy.db.powerBarHeight)/2
|
||||
if Gladdy.db.buffsCooldownPos == "TOP" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "TOP" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].debuffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset + verticalMargin)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset + verticalMargin)
|
||||
end
|
||||
elseif Gladdy.db.buffsCooldownPos == "BOTTOM" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "BOTTOM" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].debuffFrame:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "BOTTOMRIGHT", Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset -verticalMargin - powerBarHeight)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "BOTTOMLEFT", Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset -verticalMargin - powerBarHeight)
|
||||
end
|
||||
elseif Gladdy.db.buffsCooldownPos == "LEFT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].debuffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset)
|
||||
end
|
||||
|
||||
elseif Gladdy.db.buffsCooldownPos == "RIGHT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].debuffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsXOffset, Gladdy.db.buffsYOffset)
|
||||
end
|
||||
self.frames[unit].debuffFrame:SetHeight(Gladdy.db.buffsIconSize)
|
||||
Gladdy:SetPosition(self.frames[unit].debuffFrame, unit, "buffsXOffset", "buffsYOffset", BuffsDebuffs:LegacySetPositionDebuffs(unit), BuffsDebuffs)
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(self.frames[unit].debuffFrame, "buffsXOffset", "buffsYOffset", L["Debuffs"],
|
||||
{"TOPRIGHT", "TOPRIGHT"},
|
||||
Gladdy.db.buffsIconSize * Gladdy.db.buffsWidthFactor, Gladdy.db.buffsIconSize,
|
||||
0, 0, "buffsEnabled")
|
||||
end
|
||||
|
||||
--BUFFS
|
||||
self.frames[unit].buffFrame:SetHeight(Gladdy.db.buffsBuffsIconSize)
|
||||
self.frames[unit].buffFrame:ClearAllPoints()
|
||||
horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
|
||||
verticalMargin = -(Gladdy.db.powerBarHeight)/2
|
||||
if Gladdy.db.buffsBuffsCooldownPos == "TOP" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "TOP" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsBuffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].buffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", Gladdy.db.buffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", Gladdy.db.buffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
end
|
||||
elseif Gladdy.db.buffsBuffsCooldownPos == "BOTTOM" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "BOTTOM" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsBuffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].buffFrame:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "BOTTOMRIGHT", Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset -verticalMargin - powerBarHeight)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "BOTTOMLEFT", Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset -verticalMargin - powerBarHeight)
|
||||
end
|
||||
elseif Gladdy.db.buffsBuffsCooldownPos == "LEFT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "LEFT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
elseif (Gladdy.db.classIconPos == "LEFT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.drCooldownPos == "LEFT" and Gladdy.db.drEnabled) then
|
||||
verticalMargin = verticalMargin + Gladdy.db.drIconSize/2 + Gladdy.db.padding/2
|
||||
end
|
||||
if (Gladdy.db.castBarPos == "LEFT") then
|
||||
verticalMargin = verticalMargin -
|
||||
(((Gladdy.db.castBarHeight < Gladdy.db.castBarIconSize) and Gladdy.db.castBarIconSize
|
||||
or Gladdy.db.castBarHeight)/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
if (Gladdy.db.cooldownYPos == "LEFT" and Gladdy.db.cooldown) then
|
||||
verticalMargin = verticalMargin + (Gladdy.db.buffsBuffsIconSize/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
--self.frames[unit].buffFrame:SetPoint("RIGHT", Gladdy.buttons[unit].healthBar, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) - 1 + Gladdy.db.padding
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].buffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset)
|
||||
end
|
||||
|
||||
elseif Gladdy.db.buffsBuffsCooldownPos == "RIGHT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "RIGHT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "RIGHT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
elseif (Gladdy.db.classIconPos == "RIGHT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "RIGHT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.drCooldownPos == "RIGHT" and Gladdy.db.drEnabled) then
|
||||
verticalMargin = verticalMargin + Gladdy.db.drIconSize/2 + Gladdy.db.padding/2
|
||||
end
|
||||
if (Gladdy.db.castBarPos == "RIGHT") then
|
||||
verticalMargin = verticalMargin -
|
||||
(((Gladdy.db.castBarHeight < Gladdy.db.castBarIconSize) and Gladdy.db.castBarIconSize
|
||||
or Gladdy.db.castBarHeight)/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
if (Gladdy.db.cooldownYPos == "RIGHT" and Gladdy.db.cooldown) then
|
||||
verticalMargin = verticalMargin + (Gladdy.db.buffsBuffsIconSize/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
--self.frames[unit].buffFrame:SetPoint("LEFT", Gladdy.buttons[unit].healthBar, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) - 1 + Gladdy.db.padding
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].buffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset)
|
||||
end
|
||||
Gladdy:SetPosition(self.frames[unit].buffFrame, unit, "buffsBuffsXOffset", "buffsBuffsYOffset", BuffsDebuffs:LegacySetPositionBuffs(unit), BuffsDebuffs)
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(self.frames[unit].buffFrame, "buffsBuffsXOffset", "buffsBuffsYOffset", L["Buffs"],
|
||||
{"TOPRIGHT", "TOPRIGHT"},
|
||||
Gladdy.db.buffsBuffsIconSize * Gladdy.db.buffsBuffsWidthFactor, Gladdy.db.buffsBuffsIconSize,
|
||||
0, 0, "buffsEnabled")
|
||||
end
|
||||
|
||||
for i=1, #self.frames[unit].auras[AURA_TYPE_BUFF] do
|
||||
styleIcon(self.frames[unit].auras[AURA_TYPE_BUFF][i], AURA_TYPE_BUFF)
|
||||
end
|
||||
@ -426,13 +330,8 @@ end
|
||||
function BuffsDebuffs:UpdateAurasOnUnit(unit)
|
||||
for i=1, #self.frames[unit].auras[AURA_TYPE_BUFF] do
|
||||
if i == 1 then
|
||||
if Gladdy.db.buffsBuffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:ClearAllPoints()
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:SetPoint("RIGHT", self.frames[unit].buffFrame, "LEFT")
|
||||
else
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:ClearAllPoints()
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:SetPoint("LEFT", self.frames[unit].buffFrame, "RIGHT")
|
||||
end
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:ClearAllPoints()
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:SetPoint("RIGHT", self.frames[unit].buffFrame, "LEFT")
|
||||
else
|
||||
if Gladdy.db.buffsBuffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].auras[AURA_TYPE_BUFF][i]:ClearAllPoints()
|
||||
@ -445,13 +344,8 @@ function BuffsDebuffs:UpdateAurasOnUnit(unit)
|
||||
end
|
||||
for i=1, #self.frames[unit].auras[AURA_TYPE_DEBUFF] do
|
||||
if i == 1 then
|
||||
if Gladdy.db.buffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:ClearAllPoints()
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:SetPoint("RIGHT", self.frames[unit].debuffFrame, "LEFT")
|
||||
else
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:ClearAllPoints()
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:SetPoint("LEFT", self.frames[unit].debuffFrame, "RIGHT")
|
||||
end
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:ClearAllPoints()
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:SetPoint("RIGHT", self.frames[unit].debuffFrame, "LEFT")
|
||||
else
|
||||
if Gladdy.db.buffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].auras[AURA_TYPE_DEBUFF][i]:ClearAllPoints()
|
||||
@ -469,28 +363,23 @@ local function iconTimer(auraFrame, elapsed)
|
||||
local timeLeftMilliSec = auraFrame.endtime - GetTime()
|
||||
local timeLeftSec = ceil(timeLeftMilliSec)
|
||||
auraFrame.timeLeft = timeLeftMilliSec
|
||||
--auraFrame.cooldowncircle:SetCooldown(auraFrame.startTime, auraFrame.endtime)
|
||||
if timeLeftSec >= 60 then
|
||||
if Gladdy.db.buffsDynamicColor then auraFrame.cooldown:SetTextColor(0.7, 1, 0) end
|
||||
auraFrame.cooldown:SetFormattedText("%dm", ceil(timeLeftSec / 60))
|
||||
elseif timeLeftSec < 60 and timeLeftSec >= 11 then
|
||||
--if it's less than 60s
|
||||
if Gladdy.db.buffsDynamicColor then auraFrame.cooldown:SetTextColor(0.7, 1, 0) end
|
||||
auraFrame.cooldown:SetFormattedText("%d", timeLeftSec)
|
||||
elseif timeLeftSec <= 10 and timeLeftSec >= 5 then
|
||||
if Gladdy.db.buffsDynamicColor then auraFrame.cooldown:SetTextColor(1, 0.7, 0) end
|
||||
auraFrame.cooldown:SetFormattedText("%d", timeLeftSec)
|
||||
elseif timeLeftSec <= 4 and timeLeftSec >= 3 then
|
||||
if Gladdy.db.buffsDynamicColor then auraFrame.cooldown:SetTextColor(1, 0, 0) end
|
||||
auraFrame.cooldown:SetFormattedText("%d", timeLeftSec)
|
||||
elseif timeLeftMilliSec <= 3 and timeLeftMilliSec > 0 then
|
||||
if Gladdy.db.buffsDynamicColor then auraFrame.cooldown:SetTextColor(1, 0, 0) end
|
||||
auraFrame.cooldown:SetFormattedText("%.1f", timeLeftMilliSec >= 0.0 and timeLeftMilliSec or 0.0)
|
||||
elseif timeLeftMilliSec <= 0 and timeLeftMilliSec > -0.05 then -- 50ms ping max wait for SPELL_AURA_REMOVED event
|
||||
auraFrame.cooldown:SetText("")
|
||||
else -- fallback in case SPELL_AURA_REMOVED is not fired
|
||||
if Gladdy.db.buffsDynamicColor then
|
||||
if timeLeftSec >= 60 then
|
||||
auraFrame.cooldown:SetTextColor(0.7, 1, 0, Gladdy.db.buffsFontColor.a)
|
||||
elseif timeLeftSec < 60 and timeLeftSec >= 11 then
|
||||
auraFrame.cooldown:SetTextColor(0.7, 1, 0, Gladdy.db.buffsFontColor.a)
|
||||
elseif timeLeftSec <= 10 and timeLeftSec >= 5 then
|
||||
auraFrame.cooldown:SetTextColor(1, 0.7, 0, Gladdy.db.buffsFontColor.a)
|
||||
elseif timeLeftSec <= 4 and timeLeftSec >= 3 then
|
||||
auraFrame.cooldown:SetTextColor(1, 0, 0, Gladdy.db.buffsFontColor.a)
|
||||
elseif timeLeftMilliSec <= 3 and timeLeftMilliSec > 0 then
|
||||
auraFrame.cooldown:SetTextColor(1, 0, 0, Gladdy.db.buffsFontColor.a)
|
||||
end
|
||||
end
|
||||
if timeLeftMilliSec < 0 then
|
||||
auraFrame:Hide()
|
||||
end
|
||||
Gladdy:FormatTimer(auraFrame.cooldown, timeLeftMilliSec, timeLeftMilliSec <= 3)
|
||||
else
|
||||
auraFrame.cooldown:SetText("")
|
||||
end
|
||||
@ -504,18 +393,19 @@ function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stack
|
||||
else
|
||||
aura = CreateFrame("Frame")
|
||||
aura:EnableMouse(false)
|
||||
aura:SetFrameLevel(3)
|
||||
aura:SetFrameStrata(Gladdy.db.buffFrameStrata)
|
||||
aura:SetFrameLevel(Gladdy.db.buffsFrameLevel)
|
||||
aura.texture = aura:CreateTexture(nil, "BACKGROUND")
|
||||
aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
aura.texture:SetAllPoints(aura)
|
||||
aura.cooldowncircle = CreateFrame("Cooldown", nil, aura, "CooldownFrameTemplate")
|
||||
aura.cooldowncircle:SetFrameLevel(4)
|
||||
aura.cooldowncircle:SetFrameLevel(Gladdy.db.buffsFrameLevel + 1)
|
||||
aura.cooldowncircle.noCooldownCount = true -- disable OmniCC
|
||||
aura.cooldowncircle:SetAllPoints(aura)
|
||||
aura.cooldowncircle:SetReverse(true)
|
||||
aura.cooldowncircle:SetHideCountdownNumbers(true)
|
||||
aura.overlay = CreateFrame("Frame", nil, aura)
|
||||
aura.overlay:SetFrameLevel(5)
|
||||
aura.overlay:SetFrameLevel(Gladdy.db.buffsFrameLevel + 2)
|
||||
aura.overlay:SetAllPoints(aura)
|
||||
aura.border = aura.overlay:CreateTexture(nil, "OVERLAY")
|
||||
aura.border:SetAllPoints(aura)
|
||||
@ -577,36 +467,6 @@ end
|
||||
-- OPTIONS
|
||||
------------
|
||||
|
||||
local function option(params)
|
||||
local defaults = {
|
||||
get = function(info)
|
||||
local key = info.arg or info[#info]
|
||||
return Gladdy.dbi.profile[key]
|
||||
end,
|
||||
set = function(info, value)
|
||||
local key = info.arg or info[#info]
|
||||
Gladdy.dbi.profile[key] = value
|
||||
if Gladdy.db.buffsCooldownPos == "LEFT" then
|
||||
Gladdy.db.buffsCooldownGrowDirection = "LEFT"
|
||||
elseif Gladdy.db.buffsCooldownPos == "RIGHT" then
|
||||
Gladdy.db.buffsCooldownGrowDirection = "RIGHT"
|
||||
end
|
||||
if Gladdy.db.buffsBuffsCooldownPos == "LEFT" then
|
||||
Gladdy.db.buffsBuffsCooldownGrowDirection = "LEFT"
|
||||
elseif Gladdy.db.buffsBuffsCooldownPos == "RIGHT" then
|
||||
Gladdy.db.buffsBuffsCooldownGrowDirection = "RIGHT"
|
||||
end
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
}
|
||||
|
||||
for k, v in pairs(params) do
|
||||
defaults[k] = v
|
||||
end
|
||||
|
||||
return defaults
|
||||
end
|
||||
|
||||
function BuffsDebuffs:GetOptions()
|
||||
return {
|
||||
headerBuffs = {
|
||||
@ -689,18 +549,6 @@ function BuffsDebuffs:GetOptions()
|
||||
name = L["Position"],
|
||||
order = 5,
|
||||
},
|
||||
buffsBuffsCooldownPos = option({
|
||||
type = "select",
|
||||
name = L["Aura Position"],
|
||||
desc = L["Position of the aura icons"],
|
||||
order = 21,
|
||||
values = {
|
||||
["TOP"] = L["Top"],
|
||||
["BOTTOM"] = L["Bottom"],
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
}),
|
||||
buffsBuffsCooldownGrowDirection = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Grow Direction"],
|
||||
@ -811,18 +659,6 @@ function BuffsDebuffs:GetOptions()
|
||||
name = L["Position"],
|
||||
order = 5,
|
||||
},
|
||||
buffsCooldownPos = option({
|
||||
type = "select",
|
||||
name = L["Aura Position"],
|
||||
desc = L["Position of the aura icons"],
|
||||
order = 21,
|
||||
values = {
|
||||
["TOP"] = L["Top"],
|
||||
["BOTTOM"] = L["Bottom"],
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
}),
|
||||
buffsCooldownGrowDirection = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Grow Direction"],
|
||||
@ -901,11 +737,27 @@ function BuffsDebuffs:GetOptions()
|
||||
order = 10,
|
||||
width = "full",
|
||||
}),
|
||||
buffsCooldownNumberAlpha = {
|
||||
type = "range",
|
||||
name = L["Cooldown number alpha"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
order = 11,
|
||||
width = "full",
|
||||
set = function(info, value)
|
||||
Gladdy.db.buffsFontColor.a = value
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
get = function(info)
|
||||
return Gladdy.db.buffsFontColor.a
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
font = {
|
||||
type = "group",
|
||||
name = "Font",
|
||||
name = L["Font"],
|
||||
order = 4,
|
||||
args = {
|
||||
header = {
|
||||
@ -948,7 +800,7 @@ function BuffsDebuffs:GetOptions()
|
||||
},
|
||||
border = {
|
||||
type = "group",
|
||||
name = "Border",
|
||||
name = L["Border"],
|
||||
order = 5,
|
||||
args = {
|
||||
header = {
|
||||
@ -1032,10 +884,39 @@ function BuffsDebuffs:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
buffFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
buffsFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
debuffList = {
|
||||
name = "Debuff Lists",
|
||||
name = L["Debuff Lists"],
|
||||
type = "group",
|
||||
order = 11,
|
||||
childGroups = "tree",
|
||||
@ -1050,7 +931,7 @@ function BuffsDebuffs:GetOptions()
|
||||
end,
|
||||
},
|
||||
buffList = {
|
||||
name = "Buff Lists",
|
||||
name = L["Buff Lists"],
|
||||
type = "group",
|
||||
order = 12,
|
||||
childGroups = "tree",
|
||||
@ -1067,3 +948,168 @@ function BuffsDebuffs:GetOptions()
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function BuffsDebuffs:LegacySetPositionDebuffs(unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
self.frames[unit].debuffFrame:ClearAllPoints()
|
||||
local powerBarHeight = Gladdy.db.powerBarEnabled and (Gladdy.db.powerBarHeight + 1) or 0
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
|
||||
local verticalMargin = -(Gladdy.db.powerBarHeight)/2
|
||||
local offset = 0
|
||||
if (Gladdy.db.buffsCooldownGrowDirection == "RIGHT") then
|
||||
offset = Gladdy.db.buffsIconSize * Gladdy.db.buffsWidthFactor
|
||||
end
|
||||
local pos = Gladdy.db.buffsCooldownPos
|
||||
|
||||
if pos == "TOP" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "TOP" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].debuffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset + verticalMargin)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset + verticalMargin)
|
||||
end
|
||||
elseif pos == "BOTTOM" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "BOTTOM" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].debuffFrame:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "BOTTOMRIGHT", Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset -verticalMargin - powerBarHeight)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "BOTTOMLEFT", Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset -verticalMargin - powerBarHeight)
|
||||
end
|
||||
elseif pos == "LEFT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].debuffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset)
|
||||
end
|
||||
elseif pos == "RIGHT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].debuffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset)
|
||||
else
|
||||
self.frames[unit].debuffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsYOffset)
|
||||
end
|
||||
end
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
|
||||
function BuffsDebuffs:LegacySetPositionBuffs(unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
self.frames[unit].buffFrame:ClearAllPoints()
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
|
||||
local verticalMargin = -(Gladdy.db.powerBarHeight)/2
|
||||
local powerBarHeight = Gladdy.db.powerBarEnabled and (Gladdy.db.powerBarHeight + 1) or 0
|
||||
local offset = 0
|
||||
if (Gladdy.db.buffsBuffsCooldownGrowDirection == "RIGHT") then
|
||||
offset = Gladdy.db.buffsBuffsIconSize * Gladdy.db.buffsBuffsWidthFactor
|
||||
end
|
||||
|
||||
local pos = Gladdy.db.buffsBuffsCooldownPos
|
||||
|
||||
if pos == "TOP" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "TOP" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsBuffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].buffFrame:SetPoint("BOTTOMLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("BOTTOMRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", Gladdy.db.buffsXOffset + offset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
end
|
||||
elseif pos == "BOTTOM" then
|
||||
verticalMargin = horizontalMargin + 1
|
||||
if Gladdy.db.cooldownYPos == "BOTTOM" and Gladdy.db.cooldown then
|
||||
verticalMargin = verticalMargin + Gladdy.db.cooldownSize
|
||||
end
|
||||
if Gladdy.db.buffsBuffsCooldownGrowDirection == "LEFT" then
|
||||
self.frames[unit].buffFrame:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "BOTTOMRIGHT", Gladdy.db.buffsBuffsXOffset + offset, Gladdy.db.buffsBuffsYOffset -verticalMargin - powerBarHeight)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "BOTTOMLEFT", Gladdy.db.buffsBuffsXOffset + offset, Gladdy.db.buffsBuffsYOffset -verticalMargin - powerBarHeight)
|
||||
end
|
||||
elseif pos == "LEFT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "LEFT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
elseif (Gladdy.db.classIconPos == "LEFT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "LEFT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.drCooldownPos == "LEFT" and Gladdy.db.drEnabled) then
|
||||
verticalMargin = verticalMargin + Gladdy.db.drIconSize/2 + Gladdy.db.padding/2
|
||||
end
|
||||
if (Gladdy.db.castBarPos == "LEFT") then
|
||||
verticalMargin = verticalMargin -
|
||||
(((Gladdy.db.castBarHeight < Gladdy.db.castBarIconSize) and Gladdy.db.castBarIconSize
|
||||
or Gladdy.db.castBarHeight)/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
if (Gladdy.db.cooldownYPos == "LEFT" and Gladdy.db.cooldown) then
|
||||
verticalMargin = verticalMargin + (Gladdy.db.buffsBuffsIconSize/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
--self.frames[unit].buffFrame:SetPoint("RIGHT", Gladdy.buttons[unit].healthBar, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) - 1 + Gladdy.db.padding
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].buffFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.buffsBuffsXOffset + offset, Gladdy.db.buffsBuffsYOffset)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.buffsBuffsXOffset + offset, Gladdy.db.buffsBuffsYOffset)
|
||||
end
|
||||
|
||||
elseif pos == "RIGHT" then
|
||||
horizontalMargin = horizontalMargin - 1 + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "RIGHT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "RIGHT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
elseif (Gladdy.db.classIconPos == "RIGHT") then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor) + Gladdy.db.padding
|
||||
if (Gladdy.db.trinketPos == "RIGHT" and Gladdy.db.trinketEnabled) then
|
||||
horizontalMargin = horizontalMargin + (Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor) + Gladdy.db.padding
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.drCooldownPos == "RIGHT" and Gladdy.db.drEnabled) then
|
||||
verticalMargin = verticalMargin + Gladdy.db.drIconSize/2 + Gladdy.db.padding/2
|
||||
end
|
||||
if (Gladdy.db.castBarPos == "RIGHT") then
|
||||
verticalMargin = verticalMargin -
|
||||
(((Gladdy.db.castBarHeight < Gladdy.db.castBarIconSize) and Gladdy.db.castBarIconSize
|
||||
or Gladdy.db.castBarHeight)/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
if (Gladdy.db.cooldownYPos == "RIGHT" and Gladdy.db.cooldown) then
|
||||
verticalMargin = verticalMargin + (Gladdy.db.buffsBuffsIconSize/2 + Gladdy.db.padding/2)
|
||||
end
|
||||
--self.frames[unit].buffFrame:SetPoint("LEFT", Gladdy.buttons[unit].healthBar, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset, Gladdy.db.buffsBuffsYOffset + verticalMargin)
|
||||
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) - 1 + Gladdy.db.padding
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
self.frames[unit].buffFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.buffsBuffsXOffset + offset, Gladdy.db.buffsBuffsYOffset)
|
||||
else
|
||||
self.frames[unit].buffFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.buffsBuffsXOffset + offset, Gladdy.db.buffsBuffsYOffset)
|
||||
end
|
||||
end
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -33,8 +33,8 @@ local Castbar = Gladdy:NewModule("Cast Bar", 70, {
|
||||
castBarIconColor = { r = 0, g = 0, b = 0, a = 1 },
|
||||
castBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
|
||||
castBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
|
||||
castBarIconEnabled = true,
|
||||
castBarGuesses = true,
|
||||
castBarPos = "LEFT",
|
||||
castBarXOffset = 0,
|
||||
castBarYOffset = 0,
|
||||
castBarIconPos = "LEFT",
|
||||
@ -42,6 +42,8 @@ local Castbar = Gladdy:NewModule("Cast Bar", 70, {
|
||||
castBarTimerFormat = "LEFT",
|
||||
castBarSparkEnabled = true,
|
||||
castBarSparkColor = { r = 1, g = 1, b = 1, a = 1 },
|
||||
castBarFrameStrata = "MEDIUM",
|
||||
castBarFrameLevel = 5,
|
||||
})
|
||||
|
||||
function Castbar:Initialize()
|
||||
@ -57,20 +59,28 @@ end
|
||||
---------------------------
|
||||
|
||||
function Castbar:CreateFrame(unit)
|
||||
local castBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
|
||||
local castBar = CreateFrame("Frame", nil, Gladdy.buttons[unit])
|
||||
castBar:EnableMouse(false)
|
||||
castBar:SetMovable(true)
|
||||
castBar.unit = unit
|
||||
castBar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
|
||||
|
||||
castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle),
|
||||
castBar.backdrop = CreateFrame("Frame", nil, castBar, BackdropTemplateMixin and "BackdropTemplate")
|
||||
castBar.backdrop:SetAllPoints(castBar)
|
||||
castBar.backdrop:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "castBarBorderStyle"),
|
||||
edgeSize = Gladdy.db.castBarBorderSize })
|
||||
castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a)
|
||||
castBar:SetFrameLevel(1)
|
||||
castBar.backdrop:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.castBarBorderColor))
|
||||
castBar.backdrop:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar.backdrop:SetFrameLevel(Gladdy.db.castBarFrameLevel - 1)
|
||||
|
||||
castBar.bar = CreateFrame("StatusBar", nil, castBar)
|
||||
castBar.bar:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
|
||||
castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
|
||||
castBar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
|
||||
castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
|
||||
castBar.bar:SetMinMaxValues(0, 100)
|
||||
castBar.bar:SetFrameLevel(0)
|
||||
castBar.bar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar.bar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
|
||||
|
||||
castBar.spark = castBar:CreateTexture(nil, "OVERLAY")
|
||||
castBar.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
|
||||
@ -81,11 +91,13 @@ function Castbar:CreateFrame(unit)
|
||||
|
||||
castBar.bg = castBar.bar:CreateTexture(nil, "BACKGROUND")
|
||||
castBar.bg:SetAlpha(1)
|
||||
castBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
|
||||
castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a)
|
||||
castBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
|
||||
castBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarBgColor))
|
||||
castBar.bg:SetAllPoints(castBar.bar)
|
||||
|
||||
castBar.icon = CreateFrame("Frame", nil, castBar)
|
||||
castBar.icon:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar.icon:SetFrameLevel(Gladdy.db.castBarFrameLevel)
|
||||
castBar.icon.texture = castBar.icon:CreateTexture(nil, "BACKGROUND")
|
||||
castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
castBar.icon.texture:SetAllPoints(castBar.icon)
|
||||
@ -101,16 +113,16 @@ function Castbar:CreateFrame(unit)
|
||||
end
|
||||
|
||||
castBar.spellText = castBar:CreateFontString(nil, "LOW")
|
||||
castBar.spellText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize)
|
||||
castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
|
||||
castBar.spellText:SetShadowOffset(1, -1)
|
||||
castBar.spellText:SetShadowColor(0, 0, 0, 1)
|
||||
castBar.spellText:SetJustifyH("CENTER")
|
||||
castBar.spellText:SetPoint("LEFT", 7, 0) -- Text of the spell
|
||||
|
||||
castBar.timeText = castBar:CreateFontString(nil, "LOW")
|
||||
castBar.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize)
|
||||
castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
|
||||
castBar.timeText:SetShadowOffset(1, -1)
|
||||
castBar.timeText:SetShadowColor(0, 0, 0, 1)
|
||||
castBar.timeText:SetJustifyH("CENTER")
|
||||
@ -122,30 +134,38 @@ function Castbar:CreateFrame(unit)
|
||||
end
|
||||
|
||||
function Castbar:UpdateFrame(unit)
|
||||
local button = Gladdy.buttons[unit]
|
||||
local castBar = self.frames[unit]
|
||||
if (not castBar) then
|
||||
return
|
||||
end
|
||||
|
||||
castBar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
|
||||
castBar.backdrop:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar.backdrop:SetFrameLevel(Gladdy.db.castBarFrameLevel - 1)
|
||||
castBar.bar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar.bar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
|
||||
castBar.icon:SetFrameStrata(Gladdy.db.castBarFrameStrata)
|
||||
castBar.icon:SetFrameLevel(Gladdy.db.castBarFrameLevel)
|
||||
|
||||
castBar:SetWidth(Gladdy.db.castBarWidth)
|
||||
castBar:SetHeight(Gladdy.db.castBarHeight)
|
||||
castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle),
|
||||
castBar.backdrop:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "castBarBorderStyle"),
|
||||
edgeSize = Gladdy.db.castBarBorderSize })
|
||||
castBar:SetBackdropBorderColor(Gladdy.db.castBarBorderColor.r, Gladdy.db.castBarBorderColor.g, Gladdy.db.castBarBorderColor.b, Gladdy.db.castBarBorderColor.a)
|
||||
castBar.backdrop:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.castBarBorderColor))
|
||||
|
||||
castBar.bar:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
|
||||
castBar.bar:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
|
||||
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:SetColor(Gladdy.db.castBarColor))
|
||||
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.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.castBarTexture))
|
||||
castBar.bg:SetVertexColor(Gladdy.db.castBarBgColor.r, Gladdy.db.castBarBgColor.g, Gladdy.db.castBarBgColor.b, Gladdy.db.castBarBgColor.a)
|
||||
castBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "castBarTexture"))
|
||||
castBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarBgColor))
|
||||
|
||||
if Gladdy.db.castBarSparkEnabled then
|
||||
castBar.spark:SetHeight(Gladdy.db.castBarHeight * 1.8)
|
||||
castBar.spark:SetVertexColor(Gladdy.db.castBarSparkColor.r, Gladdy.db.castBarSparkColor.g, Gladdy.db.castBarSparkColor.b, Gladdy.db.castBarSparkColor.a)
|
||||
castBar.spark:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarSparkColor))
|
||||
else
|
||||
castBar.spark:SetAlpha(0)
|
||||
end
|
||||
@ -154,6 +174,11 @@ function Castbar:UpdateFrame(unit)
|
||||
castBar.icon:SetHeight(Gladdy.db.castBarIconSize)
|
||||
castBar.icon.texture:SetAllPoints(castBar.icon)
|
||||
castBar.icon:ClearAllPoints()
|
||||
if Gladdy.db.castBarIconEnabled then
|
||||
castBar.icon:Show()
|
||||
else
|
||||
castBar.icon:Hide()
|
||||
end
|
||||
|
||||
local rightMargin = 0
|
||||
local leftMargin = 0
|
||||
@ -165,33 +190,25 @@ function Castbar:UpdateFrame(unit)
|
||||
leftMargin = Gladdy.db.castBarIconSize + 1
|
||||
end
|
||||
|
||||
castBar:ClearAllPoints()
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.castBarPos == "LEFT") then
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
castBar:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
else
|
||||
castBar:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.castBarPos == "RIGHT") then
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
castBar:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
else
|
||||
castBar:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
end
|
||||
end
|
||||
Gladdy:SetPosition(castBar, unit, "castBarXOffset", "castBarYOffset", Castbar:LegacySetPosition(castBar, unit, leftMargin, rightMargin), Castbar)
|
||||
|
||||
castBar.spellText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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:SetFont(Gladdy:SMFetch("font", "castBarFont"), Gladdy.db.castBarFontSize)
|
||||
castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
|
||||
|
||||
castBar.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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:SetFont(Gladdy:SMFetch("font", "castBarFont"), Gladdy.db.castBarFontSize)
|
||||
castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
|
||||
|
||||
castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)
|
||||
castBar.icon.texture.overlay:SetVertexColor(Gladdy.db.castBarIconColor.r, Gladdy.db.castBarIconColor.g, Gladdy.db.castBarIconColor.b, Gladdy.db.castBarIconColor.a)
|
||||
castBar.icon.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.castBarIconColor))
|
||||
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(castBar, "castBarXOffset", "castBarYOffset", L["Cast Bar"],
|
||||
{"TOPLEFT", "TOPLEFT"}, Gladdy.db.castBarWidth, Gladdy.db.castBarHeight,
|
||||
0, 0, "castBarEnabled")
|
||||
end
|
||||
if not Gladdy.db.castBarEnabled then
|
||||
self:CAST_STOP(unit)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
@ -232,7 +249,7 @@ function Castbar.OnUpdate(castBar, elapsed)
|
||||
castBar.spark:SetPoint("CENTER", castBar.bar, "LEFT", castBar.spark.position, 0)
|
||||
castBar.spark:Show()
|
||||
end
|
||||
elseif ( GetTime() < castBar.holdTime ) then
|
||||
elseif ( castBar.holdTime and GetTime() < castBar.holdTime ) then
|
||||
castBar.timeText:Hide()
|
||||
castBar.spark:Hide()
|
||||
return
|
||||
@ -244,7 +261,7 @@ function Castbar.OnUpdate(castBar, elapsed)
|
||||
castBar.fadeOut = nil;
|
||||
castBar.timeText:Show()
|
||||
castBar.spark:Show()
|
||||
castBar:Hide();
|
||||
castBar:SetAlpha(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -253,7 +270,7 @@ Castbar.CastEventsFunc = {}
|
||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_START"] = function(castBar, event, ...)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, castID = UnitCastingInfo(castBar.unit)
|
||||
if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
|
||||
castBar:Hide()
|
||||
castBar:SetAlpha(0)
|
||||
return
|
||||
end
|
||||
|
||||
@ -284,7 +301,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_SUCCEEDED"] = function(castBar, event, ..
|
||||
end
|
||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_STOP"] = function(castBar, event, ...)
|
||||
if ( not castBar:IsVisible() ) then
|
||||
castBar:Hide()
|
||||
castBar:SetAlpha(0)
|
||||
end
|
||||
if ( (castBar.casting and event == "UNIT_SPELLCAST_STOP" and select(2, ...) == castBar.castID) or
|
||||
(castBar.channeling and event == "UNIT_SPELLCAST_CHANNEL_STOP") ) then
|
||||
@ -332,7 +349,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_DELAYED"] = function(castBar, event, ...)
|
||||
|
||||
if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
|
||||
-- if there is no name, there is no bar
|
||||
castBar:Hide()
|
||||
castBar:SetAlpha(0)
|
||||
return
|
||||
end
|
||||
castBar.value = (GetTime() - (startTime / 1000))
|
||||
@ -350,7 +367,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_CHANNEL_START"] = function(castBar, event
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, spellID = UnitChannelInfo(castBar.unit)
|
||||
|
||||
if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
|
||||
castBar:Hide()
|
||||
castBar:SetAlpha(0)
|
||||
return
|
||||
end
|
||||
if ( castBar.spark ) then
|
||||
@ -368,7 +385,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_CHANNEL_UPDATE"] = function(castBar, even
|
||||
if ( castBar:IsShown() ) then
|
||||
local name, text, texture, startTime, endTime, isTradeSkill = UnitChannelInfo(castBar.unit)
|
||||
if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
|
||||
castBar:Hide()
|
||||
castBar:SetAlpha(0)
|
||||
return
|
||||
end
|
||||
castBar.value = ((endTime / 1000) - GetTime())
|
||||
@ -397,18 +414,26 @@ function Castbar:CAST_START(unit, spell, icon, value, maxValue, test)
|
||||
castBar.channeling = test == "channel"
|
||||
end
|
||||
|
||||
castBar.bar:SetStatusBarColor(Gladdy.db.castBarColor.r, Gladdy.db.castBarColor.g, Gladdy.db.castBarColor.b, Gladdy.db.castBarColor.a)
|
||||
castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
|
||||
castBar.value = value
|
||||
castBar.maxValue = maxValue
|
||||
castBar.bar:SetMinMaxValues(0, maxValue)
|
||||
castBar.bar:SetValue(value)
|
||||
castBar.icon:SetAlpha(1)
|
||||
castBar.icon.texture:SetTexture(icon)
|
||||
castBar.spellText:SetText(spell)
|
||||
castBar.timeText:SetText(maxValue)
|
||||
castBar.bg:Show()
|
||||
castBar:Show()
|
||||
castBar.backdrop:Show()
|
||||
if Gladdy.db.castBarSparkEnabled then
|
||||
castBar.spark:Show()
|
||||
end
|
||||
castBar:SetAlpha(1)
|
||||
castBar.icon:Show()
|
||||
if Gladdy.db.castBarIconEnabled then
|
||||
castBar.icon:Show()
|
||||
else
|
||||
castBar.icon:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function Castbar:CAST_STOP(unit, ...)
|
||||
@ -421,12 +446,14 @@ function Castbar:CAST_STOP(unit, ...)
|
||||
castBar.channeling = nil
|
||||
castBar.value = 0
|
||||
castBar.maxValue = 0
|
||||
castBar.icon:SetAlpha(0)
|
||||
castBar.icon.texture:SetTexture("")
|
||||
castBar.spellText:SetText("")
|
||||
castBar.timeText:SetText("")
|
||||
castBar.bar:SetValue(0)
|
||||
castBar.bg:Hide()
|
||||
castBar:Hide()
|
||||
castBar.backdrop:Hide()
|
||||
castBar.spark:Hide()
|
||||
castBar.icon:Hide()
|
||||
else
|
||||
castBar.bar:SetStatusBarColor(...)
|
||||
@ -574,7 +601,7 @@ function Castbar:GetOptions()
|
||||
desc = L["Height of the bar"],
|
||||
order = 3,
|
||||
min = 0,
|
||||
max = 50,
|
||||
max = 200,
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
@ -584,7 +611,7 @@ function Castbar:GetOptions()
|
||||
desc = L["Width of the bars"],
|
||||
order = 4,
|
||||
min = 0,
|
||||
max = 300,
|
||||
max = 600,
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
@ -654,6 +681,12 @@ function Castbar:GetOptions()
|
||||
name = L["Icon Size"],
|
||||
order = 1,
|
||||
},
|
||||
castBarIconEnabled = option({
|
||||
type = "toggle",
|
||||
name = L["Icon Enabled"],
|
||||
order = 2,
|
||||
width = "full",
|
||||
}),
|
||||
castBarIconSize = option({
|
||||
type = "range",
|
||||
name = L["Icon size"],
|
||||
@ -767,15 +800,6 @@ function Castbar:GetOptions()
|
||||
name = L["Position"],
|
||||
order = 1,
|
||||
},
|
||||
castBarPos = option({
|
||||
type = "select",
|
||||
name = L["Castbar position"],
|
||||
order = 2,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
}),
|
||||
castBarIconPos = option( {
|
||||
type = "select",
|
||||
name = L["Icon position"],
|
||||
@ -810,7 +834,67 @@ function Castbar:GetOptions()
|
||||
}),
|
||||
}
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
castBarFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
castBarFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 1,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Castbar:LegacySetPosition(castBar, unit, leftMargin, rightMargin)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
castBar:ClearAllPoints()
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.castBarPos == "LEFT") then
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
castBar:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
else
|
||||
castBar:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding - leftMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.castBarPos == "RIGHT") then
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
castBar:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
else
|
||||
castBar:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + rightMargin + Gladdy.db.castBarXOffset, Gladdy.db.castBarYOffset)
|
||||
end
|
||||
end
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -4,13 +4,17 @@ local Gladdy = LibStub("Gladdy")
|
||||
local CreateFrame = CreateFrame
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local L = Gladdy.L
|
||||
local Classicon = Gladdy:NewModule("Class Icon", 80, {
|
||||
classIconPos = "LEFT",
|
||||
local Classicon = Gladdy:NewModule("Class Icon", 81, {
|
||||
classIconEnabled = true,
|
||||
classIconSize = 60 + 20 + 1,
|
||||
classIconWidthFactor = 0.9,
|
||||
classIconBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
|
||||
classIconBorderColor = { r = 0, g = 0, b = 0, a = 1 },
|
||||
classIconSpecIcon = false,
|
||||
classIconXOffset = 0,
|
||||
classIconYOffset = 0,
|
||||
classIconFrameStrata = "MEDIUM",
|
||||
classIconFrameLevel = 5,
|
||||
})
|
||||
|
||||
local classIconPath = "Interface\\Addons\\Gladdy\\Images\\Classes\\"
|
||||
@ -99,13 +103,6 @@ function Classicon:CreateFrame(unit)
|
||||
classIcon:SetFrameStrata("MEDIUM")
|
||||
classIcon:SetFrameLevel(2)
|
||||
|
||||
classIcon:ClearAllPoints()
|
||||
if (Gladdy.db.classIconPos == "RIGHT") then
|
||||
classIcon:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", 2, 2)
|
||||
else
|
||||
classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -2, 2)
|
||||
end
|
||||
|
||||
Gladdy.buttons[unit].classIcon = classIcon
|
||||
self.frames[unit] = classIcon
|
||||
end
|
||||
@ -116,22 +113,33 @@ function Classicon:UpdateFrame(unit)
|
||||
return
|
||||
end
|
||||
|
||||
classIcon:SetFrameStrata(Gladdy.db.classIconFrameStrata)
|
||||
classIcon:SetFrameLevel(Gladdy.db.classIconFrameLevel)
|
||||
|
||||
classIcon:SetWidth(Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor)
|
||||
classIcon:SetHeight(Gladdy.db.classIconSize)
|
||||
|
||||
classIcon:ClearAllPoints()
|
||||
local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "LEFT") then
|
||||
classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
|
||||
else
|
||||
classIcon:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPRIGHT", margin, 0)
|
||||
Gladdy:SetPosition(classIcon, unit, "classIconXOffset", "classIconYOffset", Classicon:LegacySetPosition(classIcon, unit), Classicon)
|
||||
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(classIcon, "classIconXOffset", "classIconYOffset", L["Class Icon"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor,
|
||||
Gladdy.db.classIconSize,
|
||||
0,
|
||||
0, "classIconEnabled")
|
||||
end
|
||||
|
||||
classIcon.texture:ClearAllPoints()
|
||||
classIcon.texture:SetAllPoints(classIcon)
|
||||
|
||||
classIcon.texture.overlay:SetTexture(Gladdy.db.classIconBorderStyle)
|
||||
classIcon.texture.overlay:SetVertexColor(Gladdy.db.classIconBorderColor.r, Gladdy.db.classIconBorderColor.g, Gladdy.db.classIconBorderColor.b, Gladdy.db.classIconBorderColor.a)
|
||||
classIcon.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.classIconBorderColor))
|
||||
if Gladdy.db.classIconEnabled then
|
||||
classIcon:Show()
|
||||
else
|
||||
classIcon:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function Classicon:ENEMY_SPOTTED(unit)
|
||||
@ -173,13 +181,18 @@ function Classicon:GetOptions()
|
||||
name = L["Class Icon"],
|
||||
order = 2,
|
||||
},
|
||||
classIconEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Class Icon Enabled"],
|
||||
order = 3,
|
||||
}),
|
||||
classIconSpecIcon = {
|
||||
type = "toggle",
|
||||
name = L["Show Spec Icon"],
|
||||
desc = L["Shows Spec Icon once spec is detected"],
|
||||
order = 3,
|
||||
get = function(info) return Gladdy.db.classIconSpecIcon end,
|
||||
set = function(info, value)
|
||||
order = 4,
|
||||
get = function() return Gladdy.db.classIconSpecIcon end,
|
||||
set = function(_, value)
|
||||
Gladdy.db.classIconSpecIcon = value
|
||||
if Gladdy.curBracket and Gladdy.curBracket > 0 then
|
||||
for i=1,Gladdy.curBracket do
|
||||
@ -211,9 +224,9 @@ function Classicon:GetOptions()
|
||||
classIconSize = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Icon size"],
|
||||
min = 1,
|
||||
min = 3,
|
||||
max = 100,
|
||||
step = 1,
|
||||
step = .1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
@ -231,29 +244,37 @@ function Classicon:GetOptions()
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
order = 1,
|
||||
order = 3,
|
||||
args = {
|
||||
headerPosition = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 5,
|
||||
},
|
||||
classIconPos = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Icon position"],
|
||||
desc = L["This changes positions with trinket"],
|
||||
order = 6,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
classIconXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
order = 11,
|
||||
min = -800,
|
||||
max = 800,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
classIconYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Vertical offset"],
|
||||
order = 12,
|
||||
min = -800,
|
||||
max = 800,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
border = {
|
||||
type = "group",
|
||||
name = L["Border"],
|
||||
order = 1,
|
||||
order = 2,
|
||||
args = {
|
||||
headerBorder = {
|
||||
type = "header",
|
||||
@ -275,7 +296,55 @@ function Classicon:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 4,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
classIconFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
classIconFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Classicon:LegacySetPosition(classIcon, unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
classIcon:ClearAllPoints()
|
||||
local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "LEFT") then
|
||||
classIcon:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
|
||||
else
|
||||
classIcon:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPRIGHT", margin, 0)
|
||||
end
|
||||
end
|
@ -12,8 +12,8 @@ local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
|
||||
local attributes = {
|
||||
{ name = "Target", button = "1", modifier = "", action = "target", spell = "" },
|
||||
{ name = "Focus", button = "2", modifier = "", action = "focus", spell = "" },
|
||||
{ name = L["Target"], button = "1", modifier = "", action = "target", spell = "" },
|
||||
{ name = L["Focus"], button = "2", modifier = "", action = "focus", spell = "" },
|
||||
}
|
||||
for i = 3, 10 do
|
||||
tinsert(attributes, { name = L["Action #%d"]:format(i), button = "", modifier = "", action = "disabled", spell = "" })
|
||||
@ -53,8 +53,8 @@ BINDING_NAME_GLADDYBUTTON3_BUTTON5 = L["Button5 Click Enemy 3"]
|
||||
BINDING_NAME_GLADDYBUTTON4_BUTTON5 = L["Button5 Click Enemy 4"]
|
||||
BINDING_NAME_GLADDYBUTTON5_BUTTON5 = L["Button5 Click Enemy 5"]
|
||||
|
||||
function Clicks:Initialise()
|
||||
self:RegisterMessage("JOINED_ARENA")
|
||||
function Clicks:Initialize()
|
||||
--
|
||||
end
|
||||
|
||||
function Clicks:Reset()
|
||||
@ -62,22 +62,15 @@ function Clicks:Reset()
|
||||
end
|
||||
|
||||
function Clicks:ResetUnit(unit)
|
||||
local button = Gladdy.buttons[unit]
|
||||
if (not button) then
|
||||
return
|
||||
end
|
||||
|
||||
for k, v in pairs(Gladdy.db.attributes) do
|
||||
button.secure:SetAttribute(v.modifier .. "macrotext" .. v.button, "")
|
||||
end
|
||||
--
|
||||
end
|
||||
|
||||
function Clicks:Test()
|
||||
Clicks:JOINED_ARENA()
|
||||
function Clicks:UpdateFrame(unit)
|
||||
self:SetupAttributes(unit)
|
||||
end
|
||||
|
||||
function Clicks:JOINED_ARENA()
|
||||
for k, v in pairs(Gladdy.buttons) do
|
||||
function Clicks:UpdateFrameOnce()
|
||||
for _, v in pairs(Gladdy.buttons) do
|
||||
local left = GetBindingKey(("GLADDYBUTTON%d_LEFT"):format(v.id))
|
||||
local right = GetBindingKey(("GLADDYBUTTON%d_RIGHT"):format(v.id))
|
||||
local middle = GetBindingKey(("GLADDYBUTTON%d_MIDDLE"):format(v.id))
|
||||
@ -114,7 +107,7 @@ function Clicks:SetupAttributes(unit)
|
||||
return
|
||||
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)
|
||||
end
|
||||
end
|
||||
@ -145,7 +138,7 @@ function Clicks:SetupAttribute(button, key, mod, action, spell)
|
||||
end
|
||||
|
||||
local buttons = { ["1"] = L["Left button"], ["2"] = L["Right button"], ["3"] = L["Middle button"], ["4"] = L["Button 4"], ["5"] = L["Button 5"] }
|
||||
local modifiers = { [""] = L["None"], ["ctrl-"] = L["CTRL"], ["shift-"] = L["SHIFT"], ["alt-"] = L["ALT"] }
|
||||
local modifiers = { [""] = L["None"], ["*"] = L["All"], ["ctrl-"] = L["CTRL"], ["shift-"] = L["SHIFT"], ["alt-"] = L["ALT"] }
|
||||
local clickValues = { ["macro"] = MACRO, ["target"] = TARGET, ["focus"] = FOCUS, ["spell"] = L["Cast Spell"], ["disabled"] = ADDON_DISABLED }
|
||||
|
||||
local function SetupAttributeOption(i)
|
||||
@ -221,9 +214,4 @@ function Clicks:GetOptions()
|
||||
options[tostring(i)] = SetupAttributeOption(i)
|
||||
end
|
||||
return options
|
||||
end
|
||||
|
||||
function Clicks:UpdateFrame(unit)
|
||||
self:SetupAttributes(unit)
|
||||
self:JOINED_ARENA()
|
||||
end
|
@ -1,7 +1,6 @@
|
||||
local select = select
|
||||
local UnitExists, UnitAffectingCombat, GetSpellInfo = UnitExists, UnitAffectingCombat, GetSpellInfo
|
||||
local CreateFrame = CreateFrame
|
||||
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
@ -11,12 +10,12 @@ local CombatIndicator = Gladdy:NewModule("Combat Indicator", nil, {
|
||||
ciSize = 20,
|
||||
ciAlpha = 1,
|
||||
ciWidthFactor = 1,
|
||||
ciAnchor = "healthBar",
|
||||
ciPos = "TOP",
|
||||
ciXOffset = 0,
|
||||
ciYOffset = -31,
|
||||
ciBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
|
||||
ciBorderColor = { r = 0, g = 0, b = 0, a = 1 },
|
||||
ciFrameStrata = "HIGH",
|
||||
ciFrameLevel = 5,
|
||||
})
|
||||
|
||||
function CombatIndicator:Initialize()
|
||||
@ -38,7 +37,9 @@ function CombatIndicator:CreateFrame(unit)
|
||||
end
|
||||
local ciFrame = CreateFrame("Frame", "GladdyCombatindicator" .. unit, button)
|
||||
ciFrame:EnableMouse(false)
|
||||
ciFrame:SetFrameStrata("HIGH")
|
||||
ciFrame:SetMovable(true)
|
||||
ciFrame:SetFrameStrata(Gladdy.db.ciFrameStrata)
|
||||
ciFrame:SetFrameLevel(Gladdy.db.ciFrameLevel)
|
||||
ciFrame:SetHeight(Gladdy.db.ciSize)
|
||||
ciFrame:SetWidth(Gladdy.db.ciSize * Gladdy.db.ciWidthFactor)
|
||||
|
||||
@ -50,7 +51,7 @@ function CombatIndicator:CreateFrame(unit)
|
||||
ciFrame.border = ciFrame:CreateTexture(nil, "OVERLAY")
|
||||
ciFrame.border:SetAllPoints(ciFrame)
|
||||
ciFrame.border:SetTexture(Gladdy.db.ciBorderStyle)
|
||||
ciFrame.border:SetVertexColor(Gladdy.db.ciBorderColor.r, Gladdy.db.ciBorderColor.g, Gladdy.db.ciBorderColor.b, Gladdy.db.ciBorderColor.a)
|
||||
ciFrame.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.ciBorderColor))
|
||||
|
||||
self.frames[unit] = ciFrame
|
||||
button.ciFrame = ciFrame
|
||||
@ -62,13 +63,16 @@ function CombatIndicator:UpdateFrame(unit)
|
||||
if (not button or not ciFrame) then
|
||||
return
|
||||
end
|
||||
|
||||
ciFrame:SetFrameStrata(Gladdy.db.ciFrameStrata)
|
||||
ciFrame:SetFrameLevel(Gladdy.db.ciFrameLevel)
|
||||
|
||||
ciFrame:SetHeight(Gladdy.db.ciSize)
|
||||
ciFrame:SetWidth(Gladdy.db.ciSize * Gladdy.db.ciWidthFactor)
|
||||
ciFrame.border:SetTexture(Gladdy.db.ciBorderStyle)
|
||||
ciFrame.border:SetVertexColor(Gladdy.db.ciBorderColor.r, Gladdy.db.ciBorderColor.g, Gladdy.db.ciBorderColor.b, Gladdy.db.ciBorderColor.a)
|
||||
ciFrame.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.ciBorderColor))
|
||||
|
||||
ciFrame:ClearAllPoints()
|
||||
ciFrame:SetPoint(ANCHORS[Gladdy.db.ciPos], Gladdy.buttons[unit][Gladdy.db.ciAnchor], Gladdy.db.ciPos, Gladdy.db.ciXOffset, Gladdy.db.ciYOffset)
|
||||
Gladdy:SetPosition(ciFrame, unit, "ciXOffset", "ciYOffset", CombatIndicator:LegacySetPosition(ciFrame, unit), CombatIndicator)
|
||||
|
||||
ciFrame:SetAlpha(Gladdy.db.ciAlpha)
|
||||
|
||||
@ -77,6 +81,12 @@ function CombatIndicator:UpdateFrame(unit)
|
||||
else
|
||||
ciFrame:Show()
|
||||
end
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(ciFrame, "ciXOffset", "ciYOffset", L["Combat Indicator"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
Gladdy.db.ciSize * Gladdy.db.ciWidthFactor, Gladdy.db.ciSize,
|
||||
0, 0, "ciEnabled")
|
||||
end
|
||||
end
|
||||
|
||||
function CombatIndicator:Test()
|
||||
@ -95,7 +105,7 @@ function CombatIndicator.OnEvent(self, elapsed)
|
||||
if (self.lastTimeUpdated > self.updateInterval) then
|
||||
for i=1,Gladdy.curBracket do
|
||||
local unit = "arena" .. i
|
||||
if CombatIndicator.test or (UnitExists(unit) and UnitAffectingCombat(unit)) then
|
||||
if Gladdy.db.ciEnabled and (CombatIndicator.test or (UnitExists(unit) and UnitAffectingCombat(unit))) then
|
||||
CombatIndicator.frames[unit]:Show()
|
||||
else
|
||||
CombatIndicator.frames[unit]:Hide()
|
||||
@ -166,37 +176,13 @@ function CombatIndicator:GetOptions()
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
order = 4,
|
||||
order = 3,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 4,
|
||||
},
|
||||
ciAnchor = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Anchor"],
|
||||
desc = L["This changes the anchor of the ci icon"],
|
||||
order = 20,
|
||||
values = {
|
||||
["trinket"] = L["Trinket"],
|
||||
["classIcon"] = L["Class Icon"],
|
||||
["healthBar"] = L["Health Bar"],
|
||||
["powerBar"] = L["Power Bar"],
|
||||
},
|
||||
}),
|
||||
ciPos = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Position"],
|
||||
desc = L["This changes position relative to its anchor of the ci icon"],
|
||||
order = 21,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
["TOP"] = L["Top"],
|
||||
["BOTTOM"] = L["Bottom"],
|
||||
},
|
||||
}),
|
||||
ciXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
@ -220,7 +206,7 @@ function CombatIndicator:GetOptions()
|
||||
border = {
|
||||
type = "group",
|
||||
name = L["Border"],
|
||||
order = 4,
|
||||
order = 2,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
@ -242,7 +228,56 @@ function CombatIndicator:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 5,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
ciFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
ciFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function CombatIndicator:LegacySetPosition(ciFrame, unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
-- LEGACY options
|
||||
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
|
||||
local ciAnchor = Gladdy.db.ciAnchor or Gladdy.legacy.ciAnchor
|
||||
local ciPos = Gladdy.db.ciPos
|
||||
|
||||
ciFrame:ClearAllPoints()
|
||||
ciFrame:SetPoint(ANCHORS[ciPos], Gladdy.buttons[unit][ciAnchor], ciPos, Gladdy.db.ciXOffset, Gladdy.db.ciYOffset)
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
local type, pairs, ceil, tonumber, mod, tostring, upper, select = type, pairs, ceil, tonumber, mod, tostring, string.upper, select
|
||||
local type, pairs, ipairs, ceil, tonumber, mod, tostring, upper, select = type, pairs, ipairs, ceil, tonumber, mod, tostring, string.upper, select
|
||||
local GetTime = GetTime
|
||||
local CreateFrame = CreateFrame
|
||||
local RACE_ICON_TCOORDS = {
|
||||
@ -36,13 +36,13 @@ local L = Gladdy.L
|
||||
|
||||
local function getDefaultCooldown()
|
||||
local cooldowns = {}
|
||||
for class, t in pairs(Gladdy:GetCooldownList()) do
|
||||
for spellId, v in pairs(t) do
|
||||
local spellName, _, texture = GetSpellInfo(spellId)
|
||||
for _,spellTable in pairs(Gladdy:GetCooldownList()) do
|
||||
for spellId,_ in pairs(spellTable) do
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
if spellName then
|
||||
cooldowns[tostring(spellId)] = true
|
||||
else
|
||||
Gladdy:Print("spellid does not exist " .. spellId)
|
||||
Gladdy:Debug("ERROR", "spellid does not exist " .. spellId)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -54,8 +54,8 @@ local Cooldowns = Gladdy:NewModule("Cooldowns", nil, {
|
||||
cooldownFontScale = 1,
|
||||
cooldownFontColor = { r = 1, g = 1, b = 0, a = 1 },
|
||||
cooldown = true,
|
||||
cooldownYPos = "TOP",
|
||||
cooldownXPos = "LEFT",
|
||||
cooldownYGrowDirection = "UP",
|
||||
cooldownXGrowDirection = "RIGHT",
|
||||
cooldownYOffset = 0,
|
||||
cooldownXOffset = 0,
|
||||
cooldownSize = 30,
|
||||
@ -66,20 +66,22 @@ local Cooldowns = Gladdy:NewModule("Cooldowns", nil, {
|
||||
cooldownBorderColor = { r = 1, g = 1, b = 1, a = 1 },
|
||||
cooldownDisableCircle = false,
|
||||
cooldownCooldownAlpha = 1,
|
||||
cooldownCooldowns = getDefaultCooldown()
|
||||
cooldownCooldowns = getDefaultCooldown(),
|
||||
cooldownFrameStrata = "MEDIUM",
|
||||
cooldownFrameLevel = 3,
|
||||
})
|
||||
|
||||
function Cooldowns:Initialize()
|
||||
self.cooldownSpellIds = {}
|
||||
self.spellTextures = {}
|
||||
for class, t in pairs(Gladdy:GetCooldownList()) do
|
||||
for k, v in pairs(t) do
|
||||
local spellName, _, texture = GetSpellInfo(k)
|
||||
for _,spellTable in pairs(Gladdy:GetCooldownList()) do
|
||||
for spellId,_ in pairs(spellTable) do
|
||||
local spellName, _, texture = GetSpellInfo(spellId)
|
||||
if spellName then
|
||||
self.cooldownSpellIds[spellName] = k
|
||||
self.spellTextures[k] = texture
|
||||
self.cooldownSpellIds[spellName] = spellId
|
||||
self.spellTextures[spellId] = texture
|
||||
else
|
||||
Gladdy:Print("spellid does not exist " .. k)
|
||||
Gladdy:Debug("ERROR", "spellid does not exist " .. spellId)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -94,10 +96,14 @@ function Cooldowns:CreateFrame(unit)
|
||||
-- Cooldown frame
|
||||
local spellCooldownFrame = CreateFrame("Frame", nil, button)
|
||||
spellCooldownFrame:EnableMouse(false)
|
||||
spellCooldownFrame:SetMovable(true)
|
||||
spellCooldownFrame:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
spellCooldownFrame:SetFrameLevel(Gladdy.db.cooldownFrameLevel)
|
||||
for x = 1, 14 do
|
||||
local icon = CreateFrame("Frame", nil, spellCooldownFrame)
|
||||
icon:EnableMouse(false)
|
||||
icon:SetFrameLevel(3)
|
||||
icon:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
icon:SetFrameLevel(Gladdy.db.cooldownFrameLevel)
|
||||
icon.texture = icon:CreateTexture(nil, "BACKGROUND")
|
||||
icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
icon.texture:SetAllPoints(icon)
|
||||
@ -105,23 +111,25 @@ function Cooldowns:CreateFrame(unit)
|
||||
icon.cooldown = CreateFrame("Cooldown", nil, icon, "CooldownFrameTemplate")
|
||||
icon.cooldown.noCooldownCount = true
|
||||
|
||||
icon.cooldown:SetFrameLevel(4)
|
||||
icon.cooldown:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
icon.cooldown:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 1)
|
||||
icon.cooldown:SetReverse(false)
|
||||
icon.cooldown:SetHideCountdownNumbers(true)
|
||||
|
||||
icon.cooldownFrame = CreateFrame("Frame", nil, icon)
|
||||
icon.cooldownFrame:ClearAllPoints()
|
||||
icon.cooldownFrame:SetAllPoints(icon)
|
||||
icon.cooldownFrame:SetFrameLevel(5)
|
||||
icon.cooldownFrame:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
icon.cooldownFrame:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 2)
|
||||
|
||||
icon.border = icon.cooldownFrame:CreateTexture(nil, "OVERLAY")
|
||||
icon.border:SetAllPoints(icon)
|
||||
icon.border:SetTexture(Gladdy.db.cooldownBorderStyle)
|
||||
icon.border:SetVertexColor(Gladdy.db.cooldownBorderColor.r, Gladdy.db.cooldownBorderColor.g, Gladdy.db.cooldownBorderColor.b, Gladdy.db.cooldownBorderColor.a)
|
||||
icon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.cooldownBorderColor))
|
||||
|
||||
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:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a)
|
||||
icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE")
|
||||
icon.cooldownFont:SetTextColor(Gladdy:SetColor(Gladdy.db.cooldownFontColor))
|
||||
icon.cooldownFont:SetAllPoints(icon)
|
||||
|
||||
spellCooldownFrame["icon" .. x] = icon
|
||||
@ -133,53 +141,41 @@ function Cooldowns:UpdateFrame(unit)
|
||||
local button = Gladdy.buttons[unit]
|
||||
-- Cooldown frame
|
||||
if (Gladdy.db.cooldown) then
|
||||
button.spellCooldownFrame:ClearAllPoints()
|
||||
local powerBarHeight = Gladdy.db.powerBarEnabled and (Gladdy.db.powerBarHeight + 1) or 0
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
|
||||
if Gladdy.db.cooldownYPos == "TOP" then
|
||||
if Gladdy.db.cooldownXPos == "RIGHT" then
|
||||
button.spellCooldownFrame:SetPoint("BOTTOMRIGHT", button.healthBar, "TOPRIGHT", Gladdy.db.cooldownXOffset, horizontalMargin + Gladdy.db.cooldownYOffset)
|
||||
else
|
||||
button.spellCooldownFrame:SetPoint("BOTTOMLEFT", button.healthBar, "TOPLEFT", Gladdy.db.cooldownXOffset, horizontalMargin + Gladdy.db.cooldownYOffset)
|
||||
end
|
||||
elseif Gladdy.db.cooldownYPos == "BOTTOM" then
|
||||
if Gladdy.db.cooldownXPos == "RIGHT" then
|
||||
button.spellCooldownFrame:SetPoint("TOPRIGHT", button.healthBar, "BOTTOMRIGHT", Gladdy.db.cooldownXOffset, -horizontalMargin + Gladdy.db.cooldownYOffset - powerBarHeight)
|
||||
else
|
||||
button.spellCooldownFrame:SetPoint("TOPLEFT", button.healthBar, "BOTTOMLEFT", Gladdy.db.cooldownXOffset, -horizontalMargin + Gladdy.db.cooldownYOffset - powerBarHeight)
|
||||
end
|
||||
elseif Gladdy.db.cooldownYPos == "LEFT" then
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -(horizontalMargin + Gladdy.db.padding) + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
|
||||
else
|
||||
button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
|
||||
end
|
||||
elseif Gladdy.db.cooldownYPos == "RIGHT" then
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
|
||||
else
|
||||
button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.cooldownXOffset, Gladdy.db.cooldownYOffset)
|
||||
end
|
||||
end
|
||||
button.spellCooldownFrame:SetHeight(Gladdy.db.cooldownSize)
|
||||
button.spellCooldownFrame:SetWidth(1)
|
||||
button.spellCooldownFrame:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
button.spellCooldownFrame:SetFrameLevel(Gladdy.db.cooldownFrameLevel)
|
||||
button.spellCooldownFrame:Show()
|
||||
|
||||
Gladdy:SetPosition(button.spellCooldownFrame, unit, "cooldownXOffset", "cooldownYOffset", Cooldowns:LegacySetPosition(button, unit), Cooldowns)
|
||||
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(button.spellCooldownFrame,"cooldownXOffset", "cooldownYOffset", L["Cooldown"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
Gladdy.db.cooldownSize * Gladdy.db.cooldownWidthFactor, Gladdy.db.cooldownSize, 0, 0, "cooldown")
|
||||
end
|
||||
-- Update each cooldown icon
|
||||
local o = 1
|
||||
for j = 1, 14 do
|
||||
local icon = button.spellCooldownFrame["icon" .. j]
|
||||
|
||||
icon:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
icon:SetFrameLevel(Gladdy.db.cooldownFrameLevel)
|
||||
icon.cooldown:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
icon.cooldown:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 1)
|
||||
icon.cooldownFrame:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
|
||||
icon.cooldownFrame:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 2)
|
||||
|
||||
icon:SetHeight(Gladdy.db.cooldownSize)
|
||||
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:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a)
|
||||
icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE")
|
||||
icon.cooldownFont:SetTextColor(Gladdy:SetColor(Gladdy.db.cooldownFontColor))
|
||||
icon:ClearAllPoints()
|
||||
if (Gladdy.db.cooldownXPos == "RIGHT") then
|
||||
if (Gladdy.db.cooldownXGrowDirection == "LEFT") then
|
||||
if (j == 1) then
|
||||
icon:SetPoint("RIGHT", button.spellCooldownFrame, "RIGHT", 0, 0)
|
||||
icon:SetPoint("LEFT", button.spellCooldownFrame, "LEFT", 0, 0)
|
||||
elseif (mod(j-1,Gladdy.db.cooldownMaxIconsPerLine) == 0) then
|
||||
if (Gladdy.db.cooldownYPos == "BOTTOM" or Gladdy.db.cooldownYPos == "LEFT" or Gladdy.db.cooldownYPos == "RIGHT") then
|
||||
if (Gladdy.db.cooldownYGrowDirection == "DOWN") then
|
||||
icon:SetPoint("TOP", button.spellCooldownFrame["icon" .. o], "BOTTOM", 0, -Gladdy.db.cooldownIconPadding)
|
||||
else
|
||||
icon:SetPoint("BOTTOM", button.spellCooldownFrame["icon" .. o], "TOP", 0, Gladdy.db.cooldownIconPadding)
|
||||
@ -189,11 +185,11 @@ function Cooldowns:UpdateFrame(unit)
|
||||
icon:SetPoint("RIGHT", button.spellCooldownFrame["icon" .. j - 1], "LEFT", -Gladdy.db.cooldownIconPadding, 0)
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.cooldownXPos == "LEFT") then
|
||||
if (Gladdy.db.cooldownXGrowDirection == "RIGHT") then
|
||||
if (j == 1) then
|
||||
icon:SetPoint("LEFT", button.spellCooldownFrame, "LEFT", 0, 0)
|
||||
elseif (mod(j-1,Gladdy.db.cooldownMaxIconsPerLine) == 0) then
|
||||
if (Gladdy.db.cooldownYPos == "BOTTOM" or Gladdy.db.cooldownYPos == "LEFT" or Gladdy.db.cooldownYPos == "RIGHT") then
|
||||
if (Gladdy.db.cooldownYGrowDirection == "DOWN") then
|
||||
icon:SetPoint("TOP", button.spellCooldownFrame["icon" .. o], "BOTTOM", 0, -Gladdy.db.cooldownIconPadding)
|
||||
else
|
||||
icon:SetPoint("BOTTOM", button.spellCooldownFrame["icon" .. o], "TOP", 0, Gladdy.db.cooldownIconPadding)
|
||||
@ -220,11 +216,11 @@ function Cooldowns:UpdateFrame(unit)
|
||||
icon.cooldown:SetPoint("CENTER", icon, "CENTER")
|
||||
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:SetTextColor(Gladdy.db.cooldownFontColor.r, Gladdy.db.cooldownFontColor.g, Gladdy.db.cooldownFontColor.b, Gladdy.db.cooldownFontColor.a)
|
||||
icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), (icon:GetWidth()/2 - 1) * Gladdy.db.cooldownFontScale, "OUTLINE")
|
||||
icon.cooldownFont:SetTextColor(Gladdy:SetColor(Gladdy.db.cooldownFontColor))
|
||||
|
||||
icon.border:SetTexture(Gladdy.db.cooldownBorderStyle)
|
||||
icon.border:SetVertexColor(Gladdy.db.cooldownBorderColor.r, Gladdy.db.cooldownBorderColor.g, Gladdy.db.cooldownBorderColor.b, Gladdy.db.cooldownBorderColor.a)
|
||||
icon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.cooldownBorderColor))
|
||||
icon:Hide()
|
||||
end
|
||||
button.spellCooldownFrame:Show()
|
||||
@ -261,13 +257,12 @@ function Cooldowns:UpdateTestCooldowns(unit)
|
||||
button.test = true
|
||||
|
||||
-- use class spells
|
||||
for k, v in pairs(Gladdy:GetCooldownList()[button.class]) do
|
||||
--k is spellId
|
||||
self:CooldownUsed(unit, button.class, k, nil)
|
||||
for spellId,_ in pairs(Gladdy:GetCooldownList()[button.class]) do
|
||||
self:CooldownUsed(unit, button.class, spellId)
|
||||
end
|
||||
-- use race spells
|
||||
for k, v in pairs(Gladdy:GetCooldownList()[button.race]) do
|
||||
self:CooldownUsed(unit, button.race, k, nil)
|
||||
for spellId,_ in pairs(Gladdy:GetCooldownList()[button.race]) do
|
||||
self:CooldownUsed(unit, button.race, spellId)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -280,7 +275,7 @@ function Cooldowns:SPEC_DETECTED(unit, spec)
|
||||
self:DetectSpec(unit, spec)
|
||||
end
|
||||
|
||||
function Cooldowns:CooldownStart(button, spellId, duration)
|
||||
function Cooldowns:CooldownStart(button, spellId, duration, start)
|
||||
-- starts timer frame
|
||||
if not duration or duration == nil or type(duration) ~= "number" then
|
||||
return
|
||||
@ -289,25 +284,19 @@ function Cooldowns:CooldownStart(button, spellId, duration)
|
||||
if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then
|
||||
local frame = button.spellCooldownFrame["icon" .. i]
|
||||
frame.active = true
|
||||
frame.timeLeft = duration
|
||||
if (not Gladdy.db.cooldownDisableCircle) then frame.cooldown:SetCooldown(GetTime(), duration) end
|
||||
frame.timeLeft = start and start - GetTime() + duration or duration
|
||||
if (not Gladdy.db.cooldownDisableCircle) then frame.cooldown:SetCooldown(start or GetTime(), duration) end
|
||||
frame:SetScript("OnUpdate", function(self, elapsed)
|
||||
self.timeLeft = self.timeLeft - elapsed
|
||||
local timeLeft = ceil(self.timeLeft)
|
||||
if timeLeft >= 540 then
|
||||
self.cooldownFont:SetText(ceil(timeLeft / 60) .. "m")
|
||||
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
|
||||
-- more than 1 minute
|
||||
self.cooldownFont:SetText(ceil(timeLeft / 60) .. "m")
|
||||
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
|
||||
-- between 60s and 21s (green)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE")
|
||||
self.cooldownFont:SetText(timeLeft)
|
||||
else
|
||||
self.cooldownFont:SetText("")
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE")
|
||||
end
|
||||
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 0)
|
||||
if (self.timeLeft <= 0) then
|
||||
Cooldowns:CooldownReady(button, spellId, frame)
|
||||
end
|
||||
@ -339,12 +328,26 @@ function Cooldowns:CooldownReady(button, spellId, frame)
|
||||
end
|
||||
end
|
||||
|
||||
local function notIn(spec, list)
|
||||
for _,v in ipairs(list) do
|
||||
if spec == v then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function Cooldowns:DetectSpec(unit, spec)
|
||||
|
||||
local button = Gladdy.buttons[unit]
|
||||
if (not button or not spec or button.spec) then
|
||||
return
|
||||
end
|
||||
if button.class == "PALADIN" and notIn(spec, {L["Holy"], L["Retribution"], L["Protection"]})
|
||||
or button.class == "SHAMAN" and notIn(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]})
|
||||
or button.class == "WARRIOR" and notIn(spec, {L["Arms"], L["Protection"], L["Fury"]}) then
|
||||
return
|
||||
end
|
||||
|
||||
button.spec = spec
|
||||
if not button.test then
|
||||
@ -359,7 +362,6 @@ function Cooldowns:DetectSpec(unit, spec)
|
||||
]]
|
||||
if (Gladdy.db.cooldown) then
|
||||
local class = Gladdy.buttons[unit].class
|
||||
local race = Gladdy.buttons[unit].race
|
||||
for k, v in pairs(Gladdy:GetCooldownList()[class]) do
|
||||
if Gladdy.db.cooldownCooldowns[tostring(k)] then
|
||||
--if (self.db.cooldownList[k] ~= false and self.db.cooldownList[class] ~= false) then
|
||||
@ -388,7 +390,6 @@ function Cooldowns:DetectSpec(unit, spec)
|
||||
end
|
||||
end
|
||||
end
|
||||
--end
|
||||
end
|
||||
----------------------
|
||||
--- RACE FUNCTIONALITY
|
||||
@ -490,7 +491,7 @@ function Cooldowns:UpdateCooldowns(button)
|
||||
end
|
||||
end
|
||||
|
||||
function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
|
||||
function Cooldowns:CooldownUsed(unit, unitClass, spellId, expirationTimeInSeconds)
|
||||
local button = Gladdy.buttons[unit]
|
||||
if not button then
|
||||
return
|
||||
@ -508,8 +509,8 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
|
||||
|
||||
-- check if we need to reset other cooldowns because of this spell
|
||||
if (cooldown.resetCD ~= nil) then
|
||||
for k, v in pairs(cooldown.resetCD) do
|
||||
self:CooldownReady(button, k, false)
|
||||
for spellID,_ in pairs(cooldown.resetCD) do
|
||||
self:CooldownReady(button, spellID, false)
|
||||
end
|
||||
end
|
||||
|
||||
@ -525,9 +526,9 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
|
||||
if (cooldown.sharedCD ~= nil) then
|
||||
local sharedCD = cooldown.sharedCD.cd and cooldown.sharedCD.cd or cd
|
||||
|
||||
for k, v in pairs(cooldown.sharedCD) do
|
||||
if (k ~= "cd") then
|
||||
self:CooldownStart(button, k, sharedCD)
|
||||
for spellID,_ in pairs(cooldown.sharedCD) do
|
||||
if (spellID ~= "cd") then
|
||||
self:CooldownStart(button, spellID, sharedCD)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -535,7 +536,7 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
|
||||
|
||||
if (Gladdy.db.cooldown) then
|
||||
-- start cooldown
|
||||
self:CooldownStart(button, spellId, cd)
|
||||
self:CooldownStart(button, spellId, cd, expirationTimeInSeconds and (GetTime() + expirationTimeInSeconds - cd) or nil)
|
||||
end
|
||||
|
||||
--[[ announcement
|
||||
@ -549,31 +550,6 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, spellName)
|
||||
end ]]
|
||||
end
|
||||
|
||||
local function option(params)
|
||||
local defaults = {
|
||||
get = function(info)
|
||||
local key = info.arg or info[#info]
|
||||
return Gladdy.dbi.profile[key]
|
||||
end,
|
||||
set = function(info, value)
|
||||
local key = info.arg or info[#info]
|
||||
Gladdy.dbi.profile[key] = value
|
||||
if Gladdy.db.cooldownYPos == "LEFT" then
|
||||
Gladdy.db.cooldownXPos = "RIGHT"
|
||||
elseif Gladdy.db.cooldownYPos == "RIGHT" then
|
||||
Gladdy.db.cooldownXPos = "LEFT"
|
||||
end
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
}
|
||||
|
||||
for k, v in pairs(params) do
|
||||
defaults[k] = v
|
||||
end
|
||||
|
||||
return defaults
|
||||
end
|
||||
|
||||
function Cooldowns:GetOptions()
|
||||
return {
|
||||
headerCooldown = {
|
||||
@ -632,15 +608,6 @@ function Cooldowns:GetOptions()
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
cooldownMaxIconsPerLine = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Max Icons per row"],
|
||||
order = 7,
|
||||
min = 3,
|
||||
max = 14,
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
cooldown = {
|
||||
@ -668,6 +635,22 @@ function Cooldowns:GetOptions()
|
||||
order = 9,
|
||||
width = "full",
|
||||
}),
|
||||
cooldownCooldownNumberAlpha = {
|
||||
type = "range",
|
||||
name = L["Cooldown number alpha"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
order = 10,
|
||||
width = "full",
|
||||
set = function(info, value)
|
||||
Gladdy.db.cooldownFontColor.a = value
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
get = function(info)
|
||||
return Gladdy.db.cooldownFontColor.a
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
font = {
|
||||
@ -710,44 +693,51 @@ function Cooldowns:GetOptions()
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 2,
|
||||
},
|
||||
cooldownYPos = option({
|
||||
cooldownYGrowDirection = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Anchor"],
|
||||
desc = L["Anchor of the cooldown icons"],
|
||||
name = L["Vertical Grow Direction"],
|
||||
desc = L["Vertical Grow Direction of the cooldown icons"],
|
||||
order = 3,
|
||||
values = {
|
||||
["TOP"] = L["Top"],
|
||||
["BOTTOM"] = L["Bottom"],
|
||||
["UP"] = L["Up"],
|
||||
["DOWN"] = L["Down"],
|
||||
},
|
||||
}),
|
||||
cooldownXGrowDirection = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Horizontal Grow Direction"],
|
||||
desc = L["Horizontal Grow Direction of the cooldown icons"],
|
||||
order = 4,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
}),
|
||||
cooldownXPos = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Grow Direction"],
|
||||
desc = L["Grow Direction of the cooldown icons"],
|
||||
order = 4,
|
||||
values = {
|
||||
["LEFT"] = L["Right"],
|
||||
["RIGHT"] = L["Left"],
|
||||
},
|
||||
cooldownMaxIconsPerLine = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Max Icons per row"],
|
||||
order = 5,
|
||||
min = 3,
|
||||
max = 14,
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
headerOffset = {
|
||||
type = "header",
|
||||
name = L["Offset"],
|
||||
order = 5,
|
||||
order = 10,
|
||||
},
|
||||
cooldownXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
order = 6,
|
||||
order = 11,
|
||||
min = -400,
|
||||
max = 400,
|
||||
step = 0.1,
|
||||
@ -756,7 +746,7 @@ function Cooldowns:GetOptions()
|
||||
cooldownYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Vertical offset"],
|
||||
order = 7,
|
||||
order = 12,
|
||||
min = -400,
|
||||
max = 400,
|
||||
step = 0.1,
|
||||
@ -767,7 +757,7 @@ function Cooldowns:GetOptions()
|
||||
border = {
|
||||
type = "group",
|
||||
name = L["Border"],
|
||||
order = 5,
|
||||
order = 4,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
@ -789,6 +779,35 @@ function Cooldowns:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
cooldownFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
cooldownFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cooldowns = {
|
||||
@ -822,10 +841,10 @@ function Cooldowns:GetCooldownOptions()
|
||||
order = o,
|
||||
width = "full",
|
||||
image = select(3, GetSpellInfo(spellId)),
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.cooldownCooldowns[tostring(spellId)]
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.cooldownCooldowns[tostring(spellId)] = value
|
||||
Gladdy:UpdateFrame()
|
||||
end
|
||||
@ -851,10 +870,10 @@ function Cooldowns:GetCooldownOptions()
|
||||
order = o,
|
||||
width = "full",
|
||||
image = select(3, GetSpellInfo(spellId)),
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.cooldownCooldowns[tostring(spellId)]
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.cooldownCooldowns[tostring(spellId)] = value
|
||||
Gladdy:UpdateFrame()
|
||||
end
|
||||
@ -876,13 +895,76 @@ function Gladdy:UpdateTestCooldowns(i)
|
||||
Cooldowns:DetectSpec(unit, button.testSpec)
|
||||
|
||||
-- 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
|
||||
Cooldowns:CooldownUsed(unit, button.class, k, nil)
|
||||
Cooldowns:CooldownUsed(unit, button.class, spellID)
|
||||
end
|
||||
-- use race spells
|
||||
for k, v in pairs(Gladdy:GetCooldownList()[button.race]) do
|
||||
Cooldowns:CooldownUsed(unit, button.race, k, nil)
|
||||
for spellID,_ in pairs(Gladdy:GetCooldownList()[button.race]) do
|
||||
Cooldowns:CooldownUsed(unit, button.race, spellID)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Cooldowns:LegacySetPosition(button, unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
button.spellCooldownFrame:ClearAllPoints()
|
||||
local powerBarHeight = Gladdy.db.powerBarEnabled and (Gladdy.db.powerBarHeight + 1) or 0
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize)
|
||||
|
||||
local offset = 0
|
||||
if (Gladdy.db.cooldownXPos == "RIGHT") then
|
||||
offset = -(Gladdy.db.cooldownSize * Gladdy.db.cooldownWidthFactor)
|
||||
end
|
||||
|
||||
if Gladdy.db.cooldownYPos == "TOP" then
|
||||
Gladdy.db.cooldownYGrowDirection = "UP"
|
||||
if Gladdy.db.cooldownXPos == "RIGHT" then
|
||||
Gladdy.db.cooldownXGrowDirection = "LEFT"
|
||||
button.spellCooldownFrame:SetPoint("BOTTOMRIGHT", button.healthBar, "TOPRIGHT", Gladdy.db.cooldownXOffset + offset, horizontalMargin + Gladdy.db.cooldownYOffset)
|
||||
else
|
||||
Gladdy.db.cooldownXGrowDirection = "RIGHT"
|
||||
button.spellCooldownFrame:SetPoint("BOTTOMLEFT", button.healthBar, "TOPLEFT", Gladdy.db.cooldownXOffset + offset, horizontalMargin + Gladdy.db.cooldownYOffset)
|
||||
end
|
||||
elseif Gladdy.db.cooldownYPos == "BOTTOM" then
|
||||
Gladdy.db.cooldownYGrowDirection = "DOWN"
|
||||
if Gladdy.db.cooldownXPos == "RIGHT" then
|
||||
Gladdy.db.cooldownXGrowDirection = "LEFT"
|
||||
button.spellCooldownFrame:SetPoint("TOPRIGHT", button.healthBar, "BOTTOMRIGHT", Gladdy.db.cooldownXOffset + offset, -horizontalMargin + Gladdy.db.cooldownYOffset - powerBarHeight)
|
||||
else
|
||||
Gladdy.db.cooldownXGrowDirection = "RIGHT"
|
||||
button.spellCooldownFrame:SetPoint("TOPLEFT", button.healthBar, "BOTTOMLEFT", Gladdy.db.cooldownXOffset + offset, -horizontalMargin + Gladdy.db.cooldownYOffset - powerBarHeight)
|
||||
end
|
||||
elseif Gladdy.db.cooldownYPos == "LEFT" then
|
||||
Gladdy.db.cooldownYGrowDirection = "DOWN"
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
Gladdy.db.cooldownXGrowDirection = "LEFT"
|
||||
button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -(horizontalMargin + Gladdy.db.padding) + Gladdy.db.cooldownXOffset + offset, Gladdy.db.cooldownYOffset)
|
||||
else
|
||||
Gladdy.db.cooldownXGrowDirection = "LEFT"
|
||||
button.spellCooldownFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.cooldownXOffset + offset, Gladdy.db.cooldownYOffset)
|
||||
end
|
||||
elseif Gladdy.db.cooldownYPos == "RIGHT" then
|
||||
Gladdy.db.cooldownYGrowDirection = "DOWN"
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
Gladdy.db.cooldownXGrowDirection = "RIGHT"
|
||||
button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.padding + Gladdy.db.cooldownXOffset + offset, Gladdy.db.cooldownYOffset)
|
||||
else
|
||||
Gladdy.db.cooldownXGrowDirection = "RIGHT"
|
||||
button.spellCooldownFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.cooldownXOffset + offset, Gladdy.db.cooldownYOffset)
|
||||
end
|
||||
end
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -1,14 +1,12 @@
|
||||
local select = select
|
||||
local pairs,ipairs,tbl_sort,tinsert,format = pairs,ipairs,table.sort,tinsert,format
|
||||
|
||||
local drDuration = 18
|
||||
local pairs,ipairs,tbl_sort,tinsert,format,rand = pairs,ipairs,table.sort,tinsert,format,math.random
|
||||
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local CreateFrame = CreateFrame
|
||||
local GetTime = GetTime
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local DRData = LibStub("DRData-1.0")
|
||||
local DRData = LibStub("DRData-1.0-BCC")
|
||||
local L = Gladdy.L
|
||||
local function defaultCategories()
|
||||
local categories = {}
|
||||
@ -17,7 +15,7 @@ local function defaultCategories()
|
||||
tinsert(indexList, {spellID = k, category = v})
|
||||
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
|
||||
categories[v.category] = {
|
||||
enabled = true,
|
||||
@ -30,9 +28,10 @@ local function defaultCategories()
|
||||
end
|
||||
local Diminishings = Gladdy:NewModule("Diminishings", nil, {
|
||||
drFont = "DorisPP",
|
||||
drFontColorsEnabled = false,
|
||||
drFontColor = { r = 1, g = 1, b = 0, a = 1 },
|
||||
drFontScale = 1,
|
||||
drCooldownPos = "RIGHT",
|
||||
drGrowDirection = "RIGHT",
|
||||
drXOffset = 0,
|
||||
drYOffset = 0,
|
||||
drIconSize = 36,
|
||||
@ -46,17 +45,35 @@ local Diminishings = Gladdy:NewModule("Diminishings", nil, {
|
||||
drHalfColor = {r = 1, g = 1, b = 0, a = 1 },
|
||||
drQuarterColor = {r = 1, g = 0.7, b = 0, a = 1 },
|
||||
drNullColor = {r = 1, g = 0, b = 0, a = 1 },
|
||||
drLevelTextEnabled = true,
|
||||
drLevelTextFont = "DorisPP",
|
||||
drLevelTextScale = 0.8,
|
||||
drLevelTextColor = { r = 1, g = 1, b = 0, a = 1 },
|
||||
drLevelTextColorsEnabled = true,
|
||||
drWidthFactor = 1,
|
||||
drCategories = defaultCategories()
|
||||
drCategories = defaultCategories(),
|
||||
drDuration = 18,
|
||||
drFrameStrata = "MEDIUM",
|
||||
drFrameLevel = 3,
|
||||
})
|
||||
|
||||
local function getDiminishColor(dr)
|
||||
if dr == 0.5 then
|
||||
return Gladdy.db.drHalfColor.r, Gladdy.db.drHalfColor.g, Gladdy.db.drHalfColor.b, Gladdy.db.drHalfColor.a
|
||||
return Gladdy:SetColor(Gladdy.db.drHalfColor)
|
||||
elseif dr == 0.25 then
|
||||
return Gladdy.db.drQuarterColor.r, Gladdy.db.drQuarterColor.g, Gladdy.db.drQuarterColor.b, Gladdy.db.drQuarterColor.a
|
||||
return Gladdy:SetColor(Gladdy.db.drQuarterColor)
|
||||
else
|
||||
return Gladdy.db.drNullColor.r, Gladdy.db.drNullColor.g, Gladdy.db.drNullColor.b, Gladdy.db.drNullColor.a
|
||||
return Gladdy:SetColor(Gladdy.db.drNullColor)
|
||||
end
|
||||
end
|
||||
|
||||
local function getDiminishText(dr)
|
||||
if dr == 0.5 then
|
||||
return "½"
|
||||
elseif dr == 0.25 then
|
||||
return "¼"
|
||||
else
|
||||
return "ø"
|
||||
end
|
||||
end
|
||||
|
||||
@ -68,12 +85,16 @@ end
|
||||
function Diminishings:CreateFrame(unit)
|
||||
local drFrame = CreateFrame("Frame", nil, Gladdy.buttons[unit])
|
||||
drFrame:EnableMouse(false)
|
||||
drFrame:SetMovable(true)
|
||||
drFrame:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
drFrame:SetFrameLevel(Gladdy.db.drFrameLevel)
|
||||
|
||||
for i = 1, 16 do
|
||||
local icon = CreateFrame("Frame", "GladdyDr" .. unit .. "Icon" .. i, drFrame)
|
||||
icon:Hide()
|
||||
icon:EnableMouse(false)
|
||||
icon:SetFrameLevel(3)
|
||||
icon:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
icon:SetFrameLevel(Gladdy.db.drFrameLevel)
|
||||
icon.texture = icon:CreateTexture(nil, "BACKGROUND")
|
||||
icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
icon.texture:SetAllPoints(icon)
|
||||
@ -88,16 +109,12 @@ function Diminishings:CreateFrame(unit)
|
||||
self.dr = nil
|
||||
self.diminishing = 1.0
|
||||
self.texture:SetTexture("")
|
||||
self.text:SetText("")
|
||||
self.timeText:SetText("")
|
||||
self:Hide()
|
||||
Diminishings:Positionate(unit)
|
||||
else
|
||||
self.timeLeft = self.timeLeft - elapsed
|
||||
if self.timeLeft >=5 then
|
||||
self.timeText:SetFormattedText("%d", self.timeLeft)
|
||||
else
|
||||
self.timeText:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||
end
|
||||
Gladdy:FormatTimer(self.timeText, self.timeLeft, self.timeLeft < 5)
|
||||
end
|
||||
end
|
||||
end)
|
||||
@ -105,13 +122,15 @@ function Diminishings:CreateFrame(unit)
|
||||
icon.cooldown = CreateFrame("Cooldown", nil, icon, "CooldownFrameTemplate")
|
||||
icon.cooldown.noCooldownCount = true --Gladdy.db.trinketDisableOmniCC
|
||||
icon.cooldown:SetHideCountdownNumbers(true)
|
||||
icon.cooldown:SetFrameLevel(4)
|
||||
icon.cooldown:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
icon.cooldown:SetFrameLevel(Gladdy.db.drFrameLevel + 1)
|
||||
|
||||
icon.cooldownFrame = CreateFrame("Frame", nil, icon)
|
||||
icon.cooldownFrame:ClearAllPoints()
|
||||
icon.cooldownFrame:SetPoint("TOPLEFT", icon, "TOPLEFT")
|
||||
icon.cooldownFrame:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT")
|
||||
icon.cooldownFrame:SetFrameLevel(5)
|
||||
icon.cooldownFrame:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
icon.cooldownFrame:SetFrameLevel(Gladdy.db.drFrameLevel + 2)
|
||||
|
||||
--icon.overlay = CreateFrame("Frame", nil, icon)
|
||||
--icon.overlay:SetAllPoints(icon)
|
||||
@ -119,24 +138,24 @@ function Diminishings:CreateFrame(unit)
|
||||
icon.border:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
|
||||
icon.border:SetAllPoints(icon)
|
||||
|
||||
icon.text = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
||||
icon.text:SetDrawLayer("OVERLAY")
|
||||
icon.text:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.drFont), 10, "OUTLINE")
|
||||
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:SetShadowColor(0, 0, 0, 1)
|
||||
icon.text:SetJustifyH("CENTER")
|
||||
icon.text:SetPoint("CENTER")
|
||||
|
||||
icon.timeText = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
||||
icon.timeText:SetDrawLayer("OVERLAY")
|
||||
icon.timeText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.drFont), 10, "OUTLINE")
|
||||
icon.timeText:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a)
|
||||
icon.timeText:SetFont(Gladdy:SMFetch("font", "drFont"), 10, "OUTLINE")
|
||||
icon.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.drFontColor))
|
||||
icon.timeText:SetShadowOffset(1, -1)
|
||||
icon.timeText:SetShadowColor(0, 0, 0, 1)
|
||||
icon.timeText:SetJustifyH("CENTER")
|
||||
icon.timeText:SetPoint("CENTER", icon, "CENTER", 0, 1)
|
||||
|
||||
icon.drLevelText = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
|
||||
icon.drLevelText:SetDrawLayer("OVERLAY")
|
||||
icon.drLevelText:SetFont(Gladdy:SMFetch("font", "drLevelTextFont"), 10, "OUTLINE")
|
||||
icon.drLevelText:SetTextColor(getDiminishColor(1))
|
||||
icon.drLevelText:SetShadowOffset(1, -1)
|
||||
icon.drLevelText:SetShadowColor(0, 0, 0, 1)
|
||||
icon.drLevelText:SetJustifyH("CENTER")
|
||||
icon.drLevelText:SetPoint("BOTTOM", icon, "BOTTOM", 0, 0)
|
||||
|
||||
icon.diminishing = 1
|
||||
|
||||
drFrame["icon" .. i] = icon
|
||||
@ -161,27 +180,21 @@ function Diminishings:UpdateFrame(unit)
|
||||
drFrame:Show()
|
||||
end
|
||||
|
||||
drFrame:ClearAllPoints()
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.drCooldownPos == "LEFT") then
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
drFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
else
|
||||
drFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.drCooldownPos == "RIGHT") then
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
drFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
else
|
||||
drFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
end
|
||||
end
|
||||
|
||||
drFrame:SetWidth(Gladdy.db.drIconSize * 16)
|
||||
drFrame:SetWidth(Gladdy.db.drIconSize)
|
||||
drFrame:SetHeight(Gladdy.db.drIconSize)
|
||||
drFrame:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
drFrame:SetFrameLevel(Gladdy.db.drFrameLevel)
|
||||
|
||||
Gladdy:SetPosition(drFrame, unit, "drXOffset", "drYOffset", Diminishings:LegacySetPosition(drFrame, unit), Diminishings)
|
||||
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(drFrame,"drXOffset", "drYOffset", L["Diminishings"],
|
||||
Gladdy.db.drGrowDirection == "RIGHT" and {"TOPLEFT", "TOPLEFT"} or {"TOPRIGHT", "TOPRIGHT"},
|
||||
Gladdy.db.drIconSize * Gladdy.db.drWidthFactor,
|
||||
Gladdy.db.drIconSize,
|
||||
0,
|
||||
0, "drEnabled")
|
||||
end
|
||||
|
||||
for i = 1, 16 do
|
||||
local icon = drFrame["icon" .. i]
|
||||
@ -189,10 +202,26 @@ function Diminishings:UpdateFrame(unit)
|
||||
icon:SetWidth(Gladdy.db.drIconSize * Gladdy.db.drWidthFactor)
|
||||
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: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:SetTextColor(Gladdy.db.drFontColor.r, Gladdy.db.drFontColor.g, Gladdy.db.drFontColor.b, Gladdy.db.drFontColor.a)
|
||||
icon:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
icon:SetFrameLevel(Gladdy.db.drFrameLevel)
|
||||
icon.cooldown:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
icon.cooldown:SetFrameLevel(Gladdy.db.drFrameLevel + 1)
|
||||
icon.cooldownFrame:SetFrameStrata(Gladdy.db.drFrameStrata)
|
||||
icon.cooldownFrame:SetFrameLevel(Gladdy.db.drFrameLevel + 2)
|
||||
|
||||
icon.timeText:SetFont(Gladdy:SMFetch("font", "drFont"), (Gladdy.db.drIconSize/2 - 1) * Gladdy.db.drFontScale, "OUTLINE")
|
||||
if Gladdy.db.drFontColorsEnabled then
|
||||
icon.timeText:SetTextColor(getDiminishColor(icon.diminishing))
|
||||
else
|
||||
icon.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.drFontColor))
|
||||
end
|
||||
|
||||
icon.drLevelText:SetFont(Gladdy:SMFetch("font", "drLevelTextFont"), (Gladdy.db.drIconSize/2 - 1) * Gladdy.db.drLevelTextScale, "OUTLINE")
|
||||
if Gladdy.db.drLevelTextColorsEnabled then
|
||||
icon.drLevelText:SetTextColor(getDiminishColor(icon.diminishing))
|
||||
else
|
||||
icon.drLevelText:SetTextColor(Gladdy:SetColor(Gladdy.db.drLevelTextColor))
|
||||
end
|
||||
|
||||
icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16)
|
||||
icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16)
|
||||
@ -207,19 +236,25 @@ function Diminishings:UpdateFrame(unit)
|
||||
if Gladdy.db.drBorderColorsEnabled then
|
||||
icon.border:SetVertexColor(getDiminishColor(icon.diminishing))
|
||||
else
|
||||
icon.border:SetVertexColor(Gladdy.db.drBorderColor.r, Gladdy.db.drBorderColor.g, Gladdy.db.drBorderColor.b, Gladdy.db.drBorderColor.a)
|
||||
icon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.drBorderColor))
|
||||
end
|
||||
|
||||
if Gladdy.db.drLevelTextEnabled then
|
||||
icon.drLevelText:Show()
|
||||
else
|
||||
icon.drLevelText:Hide()
|
||||
end
|
||||
|
||||
icon:ClearAllPoints()
|
||||
if (Gladdy.db.drCooldownPos == "LEFT") then
|
||||
if (Gladdy.db.drGrowDirection == "LEFT") then
|
||||
if (i == 1) then
|
||||
icon:SetPoint("TOPRIGHT")
|
||||
icon:SetPoint("TOPRIGHT", drFrame, "TOPRIGHT")
|
||||
else
|
||||
icon:SetPoint("RIGHT", drFrame["icon" .. (i - 1)], "LEFT", -Gladdy.db.drIconPadding, 0)
|
||||
end
|
||||
else
|
||||
if (i == 1) then
|
||||
icon:SetPoint("TOPLEFT")
|
||||
icon:SetPoint("TOPLEFT", drFrame, "TOPLEFT")
|
||||
else
|
||||
icon:SetPoint("LEFT", drFrame["icon" .. (i - 1)], "RIGHT", Gladdy.db.drIconPadding, 0)
|
||||
end
|
||||
@ -250,7 +285,6 @@ function Diminishings:ResetUnit(unit)
|
||||
icon.active = false
|
||||
icon.timeLeft = 0
|
||||
icon.texture:SetTexture("")
|
||||
icon.text:SetText("")
|
||||
icon.timeText:SetText("")
|
||||
icon:Hide()
|
||||
end
|
||||
@ -262,17 +296,32 @@ end
|
||||
|
||||
function Diminishings:Test(unit)
|
||||
if Gladdy.db.drEnabled then
|
||||
local spells = { 33786, 118, 8643, 8983 }
|
||||
for i = 1, 4 do
|
||||
if i == 1 then
|
||||
self:AuraFade(unit, spells[i])
|
||||
elseif i == 2 then
|
||||
self:AuraFade(unit, spells[i])
|
||||
self:AuraFade(unit, spells[i])
|
||||
else
|
||||
self:AuraFade(unit, spells[i])
|
||||
self:AuraFade(unit, spells[i])
|
||||
self:AuraFade(unit, spells[i])
|
||||
local enabledCategories = {}
|
||||
for cat,val in pairs(Gladdy.db.drCategories) do
|
||||
if (val.enabled) then
|
||||
tinsert(enabledCategories, {cat = cat , spellIDs = {}})
|
||||
enabledCategories[cat] = #enabledCategories
|
||||
end
|
||||
end
|
||||
for spellId,cat in pairs(DRData:GetSpells()) do
|
||||
if enabledCategories[cat] then
|
||||
tinsert(enabledCategories[enabledCategories[cat]].spellIDs, spellId)
|
||||
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
|
||||
@ -299,20 +348,35 @@ function Diminishings:AuraFade(unit, spellID)
|
||||
lastIcon.diminishing = 1.0
|
||||
end
|
||||
end
|
||||
if not lastIcon then return end
|
||||
lastIcon.dr = drCat
|
||||
lastIcon.timeLeft = drDuration
|
||||
lastIcon.timeLeft = Gladdy.db.drDuration
|
||||
lastIcon.diminishing = DRData:NextDR(lastIcon.diminishing)
|
||||
if Gladdy.db.drBorderColorsEnabled then
|
||||
lastIcon.border:SetVertexColor(getDiminishColor(lastIcon.diminishing))
|
||||
else
|
||||
lastIcon.border:SetVertexColor(Gladdy.db.drBorderColor.r, Gladdy.db.drBorderColor.g, Gladdy.db.drBorderColor.b, Gladdy.db.drBorderColor.a)
|
||||
lastIcon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.drBorderColor))
|
||||
end
|
||||
lastIcon.cooldown:SetCooldown(GetTime(), drDuration)
|
||||
lastIcon.cooldown:SetCooldown(GetTime(), Gladdy.db.drDuration)
|
||||
if Gladdy.db.drCategories[drCat].forceIcon then
|
||||
lastIcon.texture:SetTexture(Gladdy.db.drCategories[drCat].icon)
|
||||
else
|
||||
lastIcon.texture:SetTexture(select(3, GetSpellInfo(spellID)))
|
||||
end
|
||||
|
||||
if Gladdy.db.drFontColorsEnabled then
|
||||
lastIcon.timeText:SetTextColor(getDiminishColor(lastIcon.diminishing))
|
||||
else
|
||||
lastIcon.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.drFontColor))
|
||||
end
|
||||
|
||||
lastIcon.drLevelText:SetText(getDiminishText(lastIcon.diminishing))
|
||||
if Gladdy.db.drLevelTextColorsEnabled then
|
||||
lastIcon.drLevelText:SetTextColor(getDiminishColor(lastIcon.diminishing))
|
||||
else
|
||||
lastIcon.drLevelText:SetTextColor(Gladdy:SetColor(Gladdy.db.drLevelTextColor))
|
||||
end
|
||||
|
||||
lastIcon.active = true
|
||||
self:Positionate(unit)
|
||||
lastIcon:Show()
|
||||
@ -331,13 +395,15 @@ function Diminishings:Positionate(unit)
|
||||
|
||||
if (icon.active) then
|
||||
icon:ClearAllPoints()
|
||||
if (Gladdy.db.drCooldownPos == "LEFT") then
|
||||
if (Gladdy.db.newLayout and Gladdy.db.drGrowDirection == "LEFT"
|
||||
or not Gladdy.db.newLayout and Gladdy.db.drCooldownPos == "LEFT") then
|
||||
if (not lastIcon) then
|
||||
icon:SetPoint("TOPRIGHT")
|
||||
else
|
||||
icon:SetPoint("RIGHT", lastIcon, "LEFT", -Gladdy.db.drIconPadding, 0)
|
||||
end
|
||||
else
|
||||
elseif (Gladdy.db.newLayout and Gladdy.db.drGrowDirection == "RIGHT"
|
||||
or not Gladdy.db.newLayout and Gladdy.db.drCooldownPos == "RIGHT") then
|
||||
if (not lastIcon) then
|
||||
icon:SetPoint("TOPLEFT")
|
||||
else
|
||||
@ -363,11 +429,20 @@ function Diminishings:GetOptions()
|
||||
desc = L["Enabled DR module"],
|
||||
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 = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = L["Frame"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
icon = {
|
||||
type = "group",
|
||||
@ -436,38 +511,62 @@ function Diminishings:GetOptions()
|
||||
order = 9,
|
||||
width = "full",
|
||||
}),
|
||||
drCooldownNumberAlpha = {
|
||||
type = "range",
|
||||
name = L["Cooldown number alpha"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
order = 10,
|
||||
width = "full",
|
||||
set = function(info, value)
|
||||
Gladdy.db.drFontColor.a = value
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
get = function(info)
|
||||
return Gladdy.db.drFontColor.a
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
font = {
|
||||
type = "group",
|
||||
name = L["Font"],
|
||||
name = L["Cooldown Font"],
|
||||
order = 3,
|
||||
args = {
|
||||
headerFont = {
|
||||
type = "header",
|
||||
name = L["Font"],
|
||||
order = 10,
|
||||
name = L["Cooldown Font"],
|
||||
order = 1,
|
||||
},
|
||||
drFont = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Font"],
|
||||
desc = L["Font of the cooldown"],
|
||||
order = 11,
|
||||
dialogControl = "LSM30_Font",
|
||||
values = AceGUIWidgetLSMlists.font,
|
||||
drFontColorsEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Enable DR Colors as Font Color"],
|
||||
desc = L["Shows the current DR Level on the DR icon."],
|
||||
order = 2,
|
||||
width = "full",
|
||||
}),
|
||||
drFontColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Font color"],
|
||||
desc = L["Color of the text"],
|
||||
order = 13,
|
||||
order = 3,
|
||||
hasAlpha = true,
|
||||
width = "full",
|
||||
}),
|
||||
drFont = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Font"],
|
||||
desc = L["Font of the cooldown"],
|
||||
order = 4,
|
||||
dialogControl = "LSM30_Font",
|
||||
values = AceGUIWidgetLSMlists.font,
|
||||
}),
|
||||
drFontScale = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Font scale"],
|
||||
desc = L["Scale of the text"],
|
||||
order = 12,
|
||||
order = 5,
|
||||
min = 0.1,
|
||||
max = 2,
|
||||
step = 0.1,
|
||||
@ -475,48 +574,67 @@ function Diminishings:GetOptions()
|
||||
}),
|
||||
}
|
||||
},
|
||||
position = {
|
||||
levelText = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
name = L["DR Font"],
|
||||
order = 4,
|
||||
args = {
|
||||
headerPosition = {
|
||||
headerBorder = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 20,
|
||||
name = L["DR Font"],
|
||||
order = 1,
|
||||
},
|
||||
drCooldownPos = Gladdy:option({
|
||||
drLevelTextEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Enable DR Font"],
|
||||
desc = L["Shows the current DR Level on the DR icon."],
|
||||
order = 2,
|
||||
width = "full",
|
||||
}),
|
||||
drLevelTextColorsEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Enable DR Colors as Font Color"],
|
||||
desc = L["Shows the current DR Level on the DR icon."],
|
||||
order = 3,
|
||||
width = "full",
|
||||
disabled = function()
|
||||
return not Gladdy.db.drLevelTextEnabled
|
||||
end,
|
||||
}),
|
||||
drLevelTextColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["DR Font color"],
|
||||
desc = L["Color of the font"],
|
||||
order = 4,
|
||||
hasAlpha = true,
|
||||
disabled = function()
|
||||
return not Gladdy.db.drLevelTextEnabled
|
||||
end,
|
||||
}),
|
||||
drLevelTextFont = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["DR Cooldown position"],
|
||||
desc = L["Position of the cooldown icons"],
|
||||
order = 21,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
name = L["Font"],
|
||||
desc = L["Font of the DR Font"],
|
||||
order = 5,
|
||||
dialogControl = "LSM30_Font",
|
||||
values = AceGUIWidgetLSMlists.font,
|
||||
width = "full",
|
||||
disabled = function()
|
||||
return not Gladdy.db.drLevelTextEnabled
|
||||
end,
|
||||
}),
|
||||
headerOffset = {
|
||||
type = "header",
|
||||
name = L["Offset"],
|
||||
order = 22,
|
||||
},
|
||||
drXOffset = Gladdy:option({
|
||||
drLevelTextScale = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
order = 23,
|
||||
min = -400,
|
||||
max = 400,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
drYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Vertical offset"],
|
||||
order = 24,
|
||||
min = -400,
|
||||
max = 400,
|
||||
name = L["Font scale"],
|
||||
desc = L["Scale of the text"],
|
||||
order = 6,
|
||||
min = 0.1,
|
||||
max = 2,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
disabled = function()
|
||||
return not Gladdy.db.drLevelTextEnabled
|
||||
end,
|
||||
}),
|
||||
},
|
||||
},
|
||||
@ -528,33 +646,43 @@ function Diminishings:GetOptions()
|
||||
headerBorder = {
|
||||
type = "header",
|
||||
name = L["Border"],
|
||||
order = 30,
|
||||
order = 1,
|
||||
},
|
||||
drBorderStyle = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Border style"],
|
||||
order = 31,
|
||||
values = Gladdy:GetIconStyles()
|
||||
drBorderColorsEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Enable DR Colors as Border Color"],
|
||||
desc = L["Colors borders of DRs in respective DR Colors"],
|
||||
order = 2,
|
||||
width = "full",
|
||||
}),
|
||||
drBorderColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Border color"],
|
||||
desc = L["Color of the border"],
|
||||
order = 32,
|
||||
order = 3,
|
||||
disabled = function()
|
||||
return Gladdy.db.drBorderColorsEnabled
|
||||
end,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
headerBorderColors = {
|
||||
type = "header",
|
||||
name = L["DR Border Colors"],
|
||||
order = 40,
|
||||
},
|
||||
drBorderColorsEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Dr Border Colors Enabled"],
|
||||
desc = L["Colors borders of DRs in respective DR-color below"],
|
||||
order = 41,
|
||||
width = "full",
|
||||
drBorderStyle = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Border style"],
|
||||
order = 4,
|
||||
values = Gladdy:GetIconStyles()
|
||||
}),
|
||||
}
|
||||
},
|
||||
levelColors = {
|
||||
type = "group",
|
||||
name = L["DR Colors"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerColors = {
|
||||
type = "header",
|
||||
name = L["DR Colors"],
|
||||
order = 10,
|
||||
},
|
||||
drHalfColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Half"],
|
||||
@ -576,7 +704,76 @@ function Diminishings:GetOptions()
|
||||
order = 44,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
}
|
||||
},
|
||||
},
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
order = 7,
|
||||
args = {
|
||||
headerPosition = {
|
||||
type = "header",
|
||||
name = L["Position"],
|
||||
order = 20,
|
||||
},
|
||||
drGrowDirection = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["DR Grow Direction"],
|
||||
desc = L["Grow Direction of the dr icons"],
|
||||
order = 21,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
}),
|
||||
drXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
order = 23,
|
||||
min = -400,
|
||||
max = 400,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
drYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Vertical offset"],
|
||||
order = 24,
|
||||
min = -400,
|
||||
max = 400,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 8,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
drFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
drFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -590,16 +787,39 @@ function Diminishings:GetOptions()
|
||||
end
|
||||
|
||||
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 = {}
|
||||
for k,v in pairs(DRData:GetCategories()) do
|
||||
for k,_ in pairs(DRData:GetCategories()) do
|
||||
tinsert(indexList, k)
|
||||
end
|
||||
tbl_sort(indexList)
|
||||
for i, k in ipairs(indexList) do
|
||||
for i,k in ipairs(indexList) do
|
||||
categories[k] = {
|
||||
type = "group",
|
||||
name = DRData:GetCategoryName(k),
|
||||
name = L[DRData:GetCategoryName(k)],
|
||||
order = i,
|
||||
icon = Gladdy.db.drCategories[k].icon,
|
||||
args = {
|
||||
@ -607,10 +827,10 @@ function Diminishings:CategoryOptions()
|
||||
type = "toggle",
|
||||
name = L["Enabled"],
|
||||
order = 1,
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.drCategories[k].enabled
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.drCategories[k].enabled = value
|
||||
end,
|
||||
},
|
||||
@ -618,10 +838,10 @@ function Diminishings:CategoryOptions()
|
||||
type = "toggle",
|
||||
name = L["Force Icon"],
|
||||
order = 2,
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.drCategories[k].forceIcon
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.drCategories[k].forceIcon = value
|
||||
end,
|
||||
},
|
||||
@ -631,10 +851,10 @@ function Diminishings:CategoryOptions()
|
||||
desc = L["Icon of the DR"],
|
||||
order = 4,
|
||||
values = Diminishings:GetDRIcons(k),
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.db.drCategories[k].icon
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.db.drCategories[k].icon = value
|
||||
Gladdy.options.args.Diminishings.args.categories.args[k].icon = value
|
||||
end,
|
||||
@ -654,3 +874,36 @@ function Diminishings:GetDRIcons(category)
|
||||
end
|
||||
return icons
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Diminishings:LegacySetPosition(drFrame, unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
drFrame:ClearAllPoints()
|
||||
local horizontalMargin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.drCooldownPos == "LEFT") then
|
||||
Gladdy.db.drGrowDirection = "LEFT"
|
||||
local anchor = Gladdy:GetAnchor(unit, "LEFT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
drFrame:SetPoint("RIGHT", anchor, "LEFT", -horizontalMargin + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
else
|
||||
drFrame:SetPoint("RIGHT", anchor, "LEFT", -Gladdy.db.padding + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
end
|
||||
end
|
||||
if (Gladdy.db.drCooldownPos == "RIGHT") then
|
||||
Gladdy.db.drGrowDirection = "RIGHT"
|
||||
local anchor = Gladdy:GetAnchor(unit, "RIGHT")
|
||||
if anchor == Gladdy.buttons[unit].healthBar then
|
||||
drFrame:SetPoint("LEFT", anchor, "RIGHT", horizontalMargin + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
else
|
||||
drFrame:SetPoint("LEFT", anchor, "RIGHT", Gladdy.db.padding + Gladdy.db.drXOffset, Gladdy.db.drYOffset)
|
||||
end
|
||||
end
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
local type, pairs = type, pairs
|
||||
local type, pairs, str_match = type, pairs, string.match
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local AceSerializer = LibStub("AceSerializer-3.0")
|
||||
@ -6,12 +6,17 @@ local L = Gladdy.L
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
local LibDeflate = LibStub:GetLibrary("LibDeflate")
|
||||
|
||||
local function table_copy(t)
|
||||
|
||||
local function table_copy(t, str)
|
||||
local t2 = {};
|
||||
if str == nil then
|
||||
str = "Gladdy.db"
|
||||
end
|
||||
for k,v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
t2[k] = table_copy(v);
|
||||
t2[k] = table_copy(v, str .. "." .. k);
|
||||
else
|
||||
|
||||
t2[k] = v;
|
||||
end
|
||||
end
|
||||
@ -67,6 +72,7 @@ importButton:SetCallback("OnClick", function(widget)
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
Gladdy:ToggleFrame(3)
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
end)
|
||||
import:AddChild(importButton)
|
||||
import.button = importButton
|
||||
@ -83,32 +89,80 @@ end)
|
||||
import:AddChild(importClearButton)
|
||||
import.clearButton = importClearButton
|
||||
|
||||
local deletedOptions = { --TODO backward compatibility Imports on deleted options
|
||||
growUp = true
|
||||
local deletedOptions = { -- backwards compatibility
|
||||
--deleted DR-categories
|
||||
repentance = true,
|
||||
sleep = true,
|
||||
impconc = true,
|
||||
dragonsbreath = true,
|
||||
freezetrap = true,
|
||||
--deleted db options
|
||||
castBarPos = true,
|
||||
buffsCooldownPos = true,
|
||||
buffsBuffsCooldownPos = true,
|
||||
classIconPos = true,
|
||||
ciAnchor = true,
|
||||
ciPos = true,
|
||||
cooldownYPos = true,
|
||||
cooldownXPos = true,
|
||||
drCooldownPos = true,
|
||||
racialAnchor = true,
|
||||
racialPos = true,
|
||||
trinketPos = true,
|
||||
padding = true,
|
||||
growUp = 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:Debug("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)
|
||||
if str == nil and not tbl.version_major_num then
|
||||
return false, "Version conflict: version_major_num not seen"
|
||||
end
|
||||
if str == nil and tbl.version_major_num ~= Gladdy.version_major_num then
|
||||
return false, "Version conflict: " .. tbl.version_major_num .. " ~= " .. Gladdy.version_major_num
|
||||
if str == nil and tbl.version_major_num > Gladdy.version_major_num then
|
||||
return false, "Version conflict: Major v" .. tbl.version_major_num .. " ~= v" .. Gladdy.version_major_num
|
||||
end
|
||||
if str == nil then
|
||||
str = "Gladdy.db"
|
||||
tbl.version_major_num = nil
|
||||
end
|
||||
for k,v in pairs(tbl) do
|
||||
if refTbl[k] == nil then
|
||||
return false, str .. "." .. k .. " does not exist"
|
||||
else
|
||||
if type(v) ~= type(refTbl[k]) then
|
||||
return false, str .. "." .. k .. " type error. Expected " .. type(refTbl[k]) .. " found " .. type(v)
|
||||
local res, msg
|
||||
local errorFound, errorMsg
|
||||
if refTbl == nil then
|
||||
return false, str .. "does not exist"
|
||||
else
|
||||
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
|
||||
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
|
||||
|
||||
if errorFound then
|
||||
return false, errorMsg
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@ -135,8 +189,8 @@ function ExportImport:GetOptions()
|
||||
export.eb:HighlightText(0, export.eb.editBox:GetNumLetters())
|
||||
export:SetStatusText("Copy this string to share your configuration with others.")
|
||||
end,
|
||||
name = "Export",
|
||||
desc = "Export your current profile to share with others or your various accounts.",
|
||||
name = L["Export"],
|
||||
desc = L["Export your current profile to share with others or your various accounts."],
|
||||
order = 3,
|
||||
},
|
||||
import = {
|
||||
@ -159,17 +213,28 @@ function ExportImport:GetOptions()
|
||||
import.deserializedTable = deserialized
|
||||
end)
|
||||
end,
|
||||
name = "Import",
|
||||
desc = "This will overwrite your current profile!",
|
||||
name = L["Import"],
|
||||
desc = L["This will overwrite your current profile!"],
|
||||
order = 4,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
function ExportImport:ApplyImport(t, table)
|
||||
function ExportImport:ApplyImport(t, table, str)
|
||||
if str == nil then
|
||||
str = "Gladdy.db"
|
||||
if (not t.newLayout) then
|
||||
table.newLayout = false
|
||||
end
|
||||
end
|
||||
for k,v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
ExportImport:ApplyImport(v, table[k])
|
||||
if (table[k] ~= nil) then
|
||||
ExportImport:ApplyImport(v, table[k], str .. "." .. k)
|
||||
else
|
||||
Gladdy:Debug("ERROR", "ApplyImport failed for", str .. "." .. k)
|
||||
end
|
||||
|
||||
else
|
||||
table[k] = v
|
||||
end
|
||||
|
@ -24,6 +24,8 @@ local Healthbar = Gladdy:NewModule("Health Bar", 100, {
|
||||
healthActual = false,
|
||||
healthMax = true,
|
||||
healthPercentage = true,
|
||||
healthFrameStrata = "MEDIUM",
|
||||
healthFrameLevel = 1,
|
||||
})
|
||||
|
||||
function Healthbar:Initialize()
|
||||
@ -39,32 +41,34 @@ function Healthbar:CreateFrame(unit)
|
||||
|
||||
local healthBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
|
||||
healthBar:EnableMouse(false)
|
||||
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.healthBarBorderStyle),
|
||||
healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "healthBarBorderStyle"),
|
||||
edgeSize = Gladdy.db.healthBarBorderSize })
|
||||
healthBar:SetBackdropBorderColor(Gladdy.db.healthBarBorderColor.r, Gladdy.db.healthBarBorderColor.g, Gladdy.db.healthBarBorderColor.b, Gladdy.db.healthBarBorderColor.a)
|
||||
healthBar:SetFrameLevel(1)
|
||||
healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.healthBarBorderColor))
|
||||
healthBar:SetFrameStrata(Gladdy.db.healthFrameStrata)
|
||||
healthBar:SetFrameLevel(Gladdy.db.healthFrameLevel)
|
||||
|
||||
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:SetFrameLevel(0)
|
||||
healthBar.hp:SetFrameStrata(Gladdy.db.healthFrameStrata)
|
||||
healthBar.hp:SetFrameLevel(Gladdy.db.healthFrameLevel - 1)
|
||||
|
||||
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:SetAllPoints(healthBar.hp)
|
||||
healthBar.bg:SetAlpha(1)
|
||||
healthBar.bg:SetVertexColor(Gladdy.db.healthBarBgColor.r, Gladdy.db.healthBarBgColor.g, Gladdy.db.healthBarBgColor.b, Gladdy.db.healthBarBgColor.a)
|
||||
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
|
||||
|
||||
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
|
||||
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()
|
||||
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()
|
||||
end
|
||||
healthBar.nameText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
|
||||
healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
|
||||
healthBar.nameText:SetShadowOffset(1, -1)
|
||||
healthBar.nameText:SetShadowColor(0, 0, 0, 1)
|
||||
healthBar.nameText:SetJustifyH("CENTER")
|
||||
@ -72,13 +76,13 @@ function Healthbar:CreateFrame(unit)
|
||||
|
||||
healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
|
||||
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()
|
||||
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()
|
||||
end
|
||||
healthBar.healthText:SetTextColor(Gladdy.db.healthBarFontColor.r, Gladdy.db.healthBarFontColor.g, Gladdy.db.healthBarFontColor.b, Gladdy.db.healthBarFontColor.a)
|
||||
healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
|
||||
healthBar.healthText:SetShadowOffset(1, -1)
|
||||
healthBar.healthText:SetShadowColor(0, 0, 0, 1)
|
||||
healthBar.healthText:SetJustifyH("CENTER")
|
||||
@ -129,33 +133,16 @@ function Healthbar.OnEvent(self, event, unit)
|
||||
end
|
||||
|
||||
function Healthbar:SetHealthText(healthBar, health, healthMax)
|
||||
local healthText
|
||||
local healthText = ""
|
||||
local healthPercentage = floor(health * 100 / healthMax)
|
||||
|
||||
if health == 0 then
|
||||
if health == 0 and UnitExists(healthBar.unit) and UnitIsDeadOrGhost(healthBar.unit) then
|
||||
self:UNIT_DEATH(healthBar.unit)
|
||||
return
|
||||
end
|
||||
|
||||
if (Gladdy.db.healthActual) then
|
||||
healthText = healthMax > 999 and ("%.1fk"):format(health / 1000) or health
|
||||
end
|
||||
|
||||
if (Gladdy.db.healthMax) then
|
||||
local text = healthMax > 999 and ("%.1fk"):format(healthMax / 1000) or healthMax
|
||||
if (healthText) then
|
||||
healthText = ("%s/%s"):format(healthText, text)
|
||||
else
|
||||
healthText = text
|
||||
end
|
||||
end
|
||||
|
||||
if (Gladdy.db.healthPercentage) then
|
||||
if (healthText) then
|
||||
healthText = ("%s (%d%%)"):format(healthText, healthPercentage)
|
||||
else
|
||||
healthText = ("%d%%"):format(healthPercentage)
|
||||
end
|
||||
healthText = ("%d%%"):format(healthPercentage)
|
||||
end
|
||||
|
||||
healthBar.healthText:SetText(healthText)
|
||||
@ -167,43 +154,46 @@ function Healthbar:UpdateFrame(unit)
|
||||
return
|
||||
end
|
||||
|
||||
local iconSize = Gladdy.db.healthBarHeight + Gladdy.db.powerBarHeight
|
||||
healthBar:SetFrameStrata(Gladdy.db.healthFrameStrata)
|
||||
healthBar:SetFrameLevel(Gladdy.db.healthFrameLevel)
|
||||
healthBar.hp:SetFrameStrata(Gladdy.db.healthFrameStrata)
|
||||
healthBar.hp:SetFrameLevel(Gladdy.db.healthFrameLevel - 1)
|
||||
|
||||
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:SetTexture(Gladdy:SMFetch("statusbar", "healthBarTexture"))
|
||||
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
|
||||
|
||||
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.healthBarBorderStyle),
|
||||
healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "healthBarBorderStyle"),
|
||||
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:SetColor(Gladdy.db.healthBarBorderColor))
|
||||
healthBar:ClearAllPoints()
|
||||
healthBar:SetPoint("TOPLEFT", Gladdy.buttons[unit], "TOPLEFT", 0, 0)
|
||||
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: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))
|
||||
|
||||
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()
|
||||
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()
|
||||
end
|
||||
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()
|
||||
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
|
||||
healthBar.nameText:Show()
|
||||
else
|
||||
healthBar.nameText:Hide()
|
||||
end
|
||||
end
|
||||
healthBar.nameText: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)
|
||||
healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
|
||||
healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.healthBarFontColor))
|
||||
end
|
||||
|
||||
function Healthbar:ResetUnit(unit)
|
||||
@ -234,7 +224,7 @@ function Healthbar:JOINED_ARENA()
|
||||
if Gladdy.db.healthNameToArenaId and Gladdy.db.healthName then
|
||||
for i=1,Gladdy.curBracket do
|
||||
local healthBar = self.frames["arena" .. i]
|
||||
healthBar.nameText:SetText("Arena" .. i)
|
||||
healthBar.nameText:SetText(i)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -253,11 +243,13 @@ function Healthbar:ENEMY_SPOTTED(unit)
|
||||
healthBar.hp:SetValue(health)
|
||||
Healthbar:SetHealthText(healthBar, health, healthMax)
|
||||
end
|
||||
if Gladdy.db.healthName and not Gladdy.db.healthNameToArenaId then
|
||||
if button.name and Gladdy.db.healthName and not Gladdy.db.healthNameToArenaId then
|
||||
healthBar.nameText:SetText(button.name)
|
||||
end
|
||||
|
||||
healthBar.hp:SetStatusBarColor(RAID_CLASS_COLORS[button.class].r, RAID_CLASS_COLORS[button.class].g, RAID_CLASS_COLORS[button.class].b, 1)
|
||||
if button.class then
|
||||
healthBar.hp:SetStatusBarColor(RAID_CLASS_COLORS[button.class].r, RAID_CLASS_COLORS[button.class].g, RAID_CLASS_COLORS[button.class].b, 1)
|
||||
end
|
||||
end
|
||||
|
||||
function Healthbar:UNIT_HEALTH(unit, health, healthMax)
|
||||
@ -271,27 +263,10 @@ function Healthbar:UNIT_HEALTH(unit, health, healthMax)
|
||||
Gladdy:SendMessage("UNIT_HEALTH", unit, health, healthMax)
|
||||
|
||||
local healthPercentage = floor(health * 100 / healthMax)
|
||||
local healthText
|
||||
|
||||
if (Gladdy.db.healthActual) then
|
||||
healthText = healthMax > 999 and ("%.1fk"):format(health / 1000) or health
|
||||
end
|
||||
|
||||
if (Gladdy.db.healthMax) then
|
||||
local text = healthMax > 999 and ("%.1fk"):format(healthMax / 1000) or healthMax
|
||||
if (healthText) then
|
||||
healthText = ("%s/%s"):format(healthText, text)
|
||||
else
|
||||
healthText = text
|
||||
end
|
||||
end
|
||||
local healthText = ""
|
||||
|
||||
if (Gladdy.db.healthPercentage) then
|
||||
if (healthText) then
|
||||
healthText = ("%s (%d%%)"):format(healthText, healthPercentage)
|
||||
else
|
||||
healthText = ("%d%%"):format(healthPercentage)
|
||||
end
|
||||
healthText = ("%d%%"):format(healthPercentage)
|
||||
end
|
||||
|
||||
healthBar.healthText:SetText(healthText)
|
||||
@ -479,10 +454,39 @@ function Healthbar:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 4,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
healthFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
healthFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 1,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
healthValues = {
|
||||
type = "group",
|
||||
name = L["Health Bar Text"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
@ -499,25 +503,11 @@ function Healthbar:GetOptions()
|
||||
healthNameToArenaId = option({
|
||||
type = "toggle",
|
||||
name = L["Show ArenaX"],
|
||||
desc = L["Show Arena1-5 as name instead"],
|
||||
desc = L["Show 1-5 as name instead"],
|
||||
order = 3,
|
||||
width = "full",
|
||||
disabled = function() return not Gladdy.db.healthName end
|
||||
}),
|
||||
healthActual = option({
|
||||
type = "toggle",
|
||||
name = L["Show the actual health"],
|
||||
desc = L["Show the actual health on the health bar"],
|
||||
order = 4,
|
||||
width = "full",
|
||||
}),
|
||||
healthMax = option({
|
||||
type = "toggle",
|
||||
name = L["Show max health"],
|
||||
desc = L["Show max health on the health bar"],
|
||||
order = 5,
|
||||
width = "full",
|
||||
}),
|
||||
healthPercentage = option({
|
||||
type = "toggle",
|
||||
name = L["Show health percentage"],
|
||||
|
@ -13,6 +13,8 @@ local Highlight = Gladdy:NewModule("Highlight", nil, {
|
||||
targetBorder = true,
|
||||
focusBorder = true,
|
||||
leaderBorder = true,
|
||||
highlightFrameStrata = "MEDIUM",
|
||||
highlightFrameLevel = 20,
|
||||
})
|
||||
|
||||
function Highlight:Initialize()
|
||||
@ -55,18 +57,21 @@ function Highlight:CreateFrame(unit)
|
||||
local healthBar = Gladdy.modules["Health Bar"].frames[unit]
|
||||
|
||||
local targetBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
|
||||
targetBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize })
|
||||
--targetBorder:SetFrameStrata("MEDIUM")
|
||||
targetBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
|
||||
targetBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
|
||||
targetBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
|
||||
targetBorder:Hide()
|
||||
|
||||
local focusBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
|
||||
focusBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize })
|
||||
--focusBorder:SetFrameStrata("MEDIUM")
|
||||
focusBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
|
||||
focusBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
|
||||
focusBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
|
||||
focusBorder:Hide()
|
||||
|
||||
local leaderBorder = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
|
||||
leaderBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = Gladdy.db.highlightBorderSize })
|
||||
--leaderBorder:SetFrameStrata("MEDIUM")
|
||||
leaderBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = Gladdy.db.highlightBorderSize })
|
||||
leaderBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
|
||||
leaderBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
|
||||
leaderBorder:Hide()
|
||||
|
||||
local highlight = healthBar:CreateTexture(nil, "OVERLAY")
|
||||
@ -96,6 +101,13 @@ function Highlight:UpdateFrame(unit)
|
||||
local width = Gladdy.db.barWidth + (Gladdy.db.highlightInset and 0 or borderSize * 2)
|
||||
local height = hpAndPowerHeight + (Gladdy.db.highlightInset and 0 or borderSize * 2)
|
||||
|
||||
button.targetBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
|
||||
button.targetBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
|
||||
button.focusBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
|
||||
button.focusBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
|
||||
button.leaderBorder:SetFrameStrata(Gladdy.db.highlightFrameStrata)
|
||||
button.leaderBorder:SetFrameLevel(Gladdy.db.highlightFrameLevel)
|
||||
|
||||
button.targetBorder:SetWidth(width)
|
||||
button.targetBorder:SetHeight(height)
|
||||
button.targetBorder:ClearAllPoints()
|
||||
@ -106,8 +118,8 @@ function Highlight:UpdateFrame(unit)
|
||||
button.targetBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
|
||||
end
|
||||
|
||||
button.targetBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize })
|
||||
button.targetBorder:SetBackdropBorderColor(Gladdy.db.targetBorderColor.r, Gladdy.db.targetBorderColor.g, Gladdy.db.targetBorderColor.b, Gladdy.db.targetBorderColor.a)
|
||||
button.targetBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
|
||||
button.targetBorder:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.targetBorderColor))
|
||||
|
||||
button.focusBorder:SetWidth(width)
|
||||
button.focusBorder:SetHeight(height)
|
||||
@ -119,8 +131,8 @@ function Highlight:UpdateFrame(unit)
|
||||
button.focusBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
|
||||
end
|
||||
|
||||
button.focusBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize })
|
||||
button.focusBorder:SetBackdropBorderColor(Gladdy.db.focusBorderColor.r, Gladdy.db.focusBorderColor.g, Gladdy.db.focusBorderColor.b, Gladdy.db.focusBorderColor.a)
|
||||
button.focusBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
|
||||
button.focusBorder:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.focusBorderColor))
|
||||
|
||||
button.leaderBorder:SetWidth(width)
|
||||
button.leaderBorder:SetHeight(height)
|
||||
@ -132,8 +144,8 @@ function Highlight:UpdateFrame(unit)
|
||||
button.leaderBorder:SetPoint("TOP", button.healthBar, "TOP", 0, (Gladdy.db.highlightInset and 0 or borderSize))
|
||||
end
|
||||
|
||||
button.leaderBorder:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.highlightBorderStyle), edgeSize = borderSize })
|
||||
button.leaderBorder:SetBackdropBorderColor(Gladdy.db.leaderBorderColor.r, Gladdy.db.leaderBorderColor.g, Gladdy.db.leaderBorderColor.b, Gladdy.db.leaderBorderColor.a)
|
||||
button.leaderBorder:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "highlightBorderStyle"), edgeSize = borderSize })
|
||||
button.leaderBorder:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.leaderBorderColor))
|
||||
if Gladdy.frame.testing then
|
||||
Highlight:Test(unit)
|
||||
end
|
||||
@ -207,67 +219,130 @@ function Highlight:GetOptions()
|
||||
desc = L["Show Highlight border inside of frame"],
|
||||
order = 3,
|
||||
}),
|
||||
highlightBorderSize = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Border size"],
|
||||
desc = L["Border size"],
|
||||
order = 4,
|
||||
min = 1,
|
||||
max = 20,
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
highlightBorderStyle = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Border style"],
|
||||
order = 5,
|
||||
dialogControl = "LSM30_Border",
|
||||
values = AceGUIWidgetLSMlists.border,
|
||||
}),
|
||||
headerColor = {
|
||||
type = "header",
|
||||
name = L["Colors"],
|
||||
order = 6,
|
||||
group = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = L["Frame"],
|
||||
order = 3,
|
||||
args = {
|
||||
enabled = {
|
||||
type = "group",
|
||||
name = L["Enabled"],
|
||||
order = 1,
|
||||
args = {
|
||||
headerEnable = {
|
||||
type = "header",
|
||||
name = L["Enabled"],
|
||||
order = 10,
|
||||
},
|
||||
highlight = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Highlight target"],
|
||||
desc = L["Toggle if the selected target should be highlighted"],
|
||||
order = 11,
|
||||
width = "full",
|
||||
}),
|
||||
targetBorder = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Show border around target"],
|
||||
desc = L["Toggle if a border should be shown around the selected target"],
|
||||
order = 12,
|
||||
width = "full",
|
||||
}),
|
||||
focusBorder = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Show border around focus"],
|
||||
desc = L["Toggle of a border should be shown around the current focus"],
|
||||
order = 13,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
border = {
|
||||
type = "group",
|
||||
name = L["Border"],
|
||||
order = 2,
|
||||
args = {
|
||||
headerHighlight = {
|
||||
type = "header",
|
||||
name = L["Border"],
|
||||
order = 2,
|
||||
},
|
||||
highlightBorderSize = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Border size"],
|
||||
desc = L["Border size"],
|
||||
order = 4,
|
||||
min = 1,
|
||||
max = 20,
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
highlightBorderStyle = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Border style"],
|
||||
order = 5,
|
||||
dialogControl = "LSM30_Border",
|
||||
values = AceGUIWidgetLSMlists.border,
|
||||
}),
|
||||
},
|
||||
},
|
||||
color = {
|
||||
type = "group",
|
||||
name = L["Color"],
|
||||
order = 3,
|
||||
args = {
|
||||
headerColor = {
|
||||
type = "header",
|
||||
name = L["Colors"],
|
||||
order = 6,
|
||||
},
|
||||
targetBorderColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Target border color"],
|
||||
desc = L["Color of the selected targets border"],
|
||||
order = 7,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
focusBorderColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Focus border color"],
|
||||
desc = L["Color of the focus border"],
|
||||
order = 8,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 4,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
highlightFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
highlightFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 1,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
targetBorderColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Target border color"],
|
||||
desc = L["Color of the selected targets border"],
|
||||
order = 7,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
focusBorderColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Focus border color"],
|
||||
desc = L["Color of the focus border"],
|
||||
order = 8,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
headerEnable = {
|
||||
type = "header",
|
||||
name = L["Enabled"],
|
||||
order = 10,
|
||||
},
|
||||
highlight = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Highlight target"],
|
||||
desc = L["Toggle if the selected target should be highlighted"],
|
||||
order = 11,
|
||||
width = "full",
|
||||
}),
|
||||
targetBorder = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Show border around target"],
|
||||
desc = L["Toggle if a border should be shown around the selected target"],
|
||||
order = 12,
|
||||
width = "full",
|
||||
}),
|
||||
focusBorder = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Show border around focus"],
|
||||
desc = L["Toggle of a border should be shown around the current focus"],
|
||||
order = 13,
|
||||
width = "full",
|
||||
}),
|
||||
}
|
||||
end
|
176
Modules/Pets.lua
176
Modules/Pets.lua
@ -23,6 +23,10 @@ local Pets = Gladdy:NewModule("Pets", nil, {
|
||||
petHealthPercentage = true,
|
||||
petXOffset = 1,
|
||||
petYOffset = -62,
|
||||
petGroup = false,
|
||||
petMargin = 1,
|
||||
petFrameStrata = "MEDIUM",
|
||||
petFrameLevel = 5,
|
||||
})
|
||||
|
||||
function Pets:Initialize()
|
||||
@ -35,12 +39,12 @@ function Pets:Initialize()
|
||||
end
|
||||
|
||||
function Pets:JOINED_ARENA()
|
||||
for k,v in pairs(self.frames) do
|
||||
for _,v in pairs(self.frames) do
|
||||
v.healthBar:SetAlpha(0)
|
||||
end
|
||||
if Gladdy.db.petEnabled then
|
||||
self:RegisterEvent("UNIT_PET")
|
||||
self:SetScript("OnEvent", function(self, event, unitId)
|
||||
self:SetScript("OnEvent", function(_, event, unitId)
|
||||
if event == "UNIT_PET" then
|
||||
local unit = Gladdy.guids[UnitGUID(unitId)]
|
||||
if unit then
|
||||
@ -63,9 +67,10 @@ function Pets:ResetUnit(unitId)
|
||||
end
|
||||
|
||||
function Pets:PET_SPOTTED(unit)
|
||||
Gladdy.guids[UnitGUID(unit)] = unit
|
||||
if Gladdy.db.petEnabled then
|
||||
self.frames[unit].healthBar:SetAlpha(1)
|
||||
self.frames[unit].healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
|
||||
self.frames[unit].healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.petHealthBarColor))
|
||||
self.frames[unit].healthBar:SetScript("OnUpdate", function(self)
|
||||
self.hp:SetValue(UnitHealth(self.unit))
|
||||
Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit))
|
||||
@ -134,6 +139,7 @@ function Pets:CreateFrame(unitId)
|
||||
return
|
||||
end
|
||||
local button = CreateFrame("Frame", "GladdyButtonFramePet" .. unit, Gladdy.frame)
|
||||
button:SetMovable(true)
|
||||
--button:SetAlpha(0)
|
||||
button:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
|
||||
@ -149,10 +155,11 @@ function Pets:CreateFrame(unitId)
|
||||
button.secure = secure
|
||||
|
||||
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 })
|
||||
healthBar:SetBackdropBorderColor(Gladdy.db.petHealthBarBorderColor.r, Gladdy.db.petHealthBarBorderColor.g, Gladdy.db.petHealthBarBorderColor.b, Gladdy.db.petHealthBarBorderColor.a)
|
||||
healthBar:SetFrameLevel(1)
|
||||
healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.petHealthBarBorderColor))
|
||||
healthBar:SetFrameStrata(Gladdy.db.petFrameStrata)
|
||||
healthBar:SetFrameLevel(Gladdy.db.petFrameLevel)
|
||||
healthBar:SetAllPoints(button)
|
||||
healthBar:SetAlpha(0)
|
||||
|
||||
@ -163,32 +170,33 @@ function Pets:CreateFrame(unitId)
|
||||
healthBar.portrait.border = healthBar:CreateTexture(nil, "OVERLAY")
|
||||
healthBar.portrait.border:SetAllPoints(healthBar.portrait)
|
||||
healthBar.portrait.border:SetTexture(Gladdy.db.classIconBorderStyle)
|
||||
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:SetColor(Gladdy.db.petHealthBarBorderColor))
|
||||
|
||||
|
||||
healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
|
||||
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
|
||||
healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
|
||||
healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
|
||||
healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.petHealthBarColor))
|
||||
healthBar.hp:SetMinMaxValues(0, 100)
|
||||
healthBar.hp:SetFrameLevel(0)
|
||||
healthBar.hp:SetFrameStrata(Gladdy.db.petFrameStrata)
|
||||
healthBar.hp:SetFrameLevel(Gladdy.db.petFrameLevel - 1)
|
||||
healthBar.hp:SetAllPoints(healthBar)
|
||||
|
||||
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:SetAllPoints(healthBar.hp)
|
||||
healthBar.bg:SetAlpha(1)
|
||||
healthBar.bg:SetVertexColor(Gladdy.db.petHealthBarBgColor.r, Gladdy.db.petHealthBarBgColor.g, Gladdy.db.petHealthBarBgColor.b, Gladdy.db.petHealthBarBgColor.a)
|
||||
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor))
|
||||
|
||||
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
|
||||
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()
|
||||
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()
|
||||
end
|
||||
healthBar.nameText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
|
||||
healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
|
||||
healthBar.nameText:SetShadowOffset(1, -1)
|
||||
healthBar.nameText:SetShadowColor(0, 0, 0, 1)
|
||||
healthBar.nameText:SetJustifyH("CENTER")
|
||||
@ -196,13 +204,13 @@ function Pets:CreateFrame(unitId)
|
||||
|
||||
healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
|
||||
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()
|
||||
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()
|
||||
end
|
||||
healthBar.healthText:SetTextColor(Gladdy.db.petHealthBarFontColor.r, Gladdy.db.petHealthBarFontColor.g, Gladdy.db.petHealthBarFontColor.b, Gladdy.db.petHealthBarFontColor.a)
|
||||
healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
|
||||
healthBar.healthText:SetShadowOffset(1, -1)
|
||||
healthBar.healthText:SetShadowColor(0, 0, 0, 1)
|
||||
healthBar.healthText:SetJustifyH("CENTER")
|
||||
@ -241,6 +249,11 @@ function Pets:UpdateFrame(unitId)
|
||||
return
|
||||
end
|
||||
|
||||
healthBar:SetFrameStrata(Gladdy.db.petFrameStrata)
|
||||
healthBar:SetFrameLevel(Gladdy.db.petFrameLevel)
|
||||
healthBar.hp:SetFrameStrata(Gladdy.db.petFrameStrata)
|
||||
healthBar.hp:SetFrameLevel(Gladdy.db.petFrameLevel - 1)
|
||||
|
||||
if not Gladdy.db.petEnabled then
|
||||
self.frames[unit]:Hide()
|
||||
else
|
||||
@ -249,7 +262,22 @@ function Pets:UpdateFrame(unitId)
|
||||
|
||||
self.frames[unit]:SetWidth(Gladdy.db.petWidth)
|
||||
self.frames[unit]:SetHeight(Gladdy.db.petHeight)
|
||||
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
|
||||
Gladdy:SetPosition(self.frames[unit], unitId, "petXOffset", "petYOffset", Pets:LegacySetPosition(unit, unitId), Pets)
|
||||
|
||||
if (Gladdy.db.petGroup) then
|
||||
if (unit == "arenapet1") then
|
||||
self.frames[unit]:ClearAllPoints()
|
||||
self.frames[unit]:SetPoint("TOPLEFT", Gladdy.buttons[unitId].healthBar, "TOPLEFT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
else
|
||||
local previousPet = "arenapet" .. string_gsub(unit, "arenapet", "") - 1
|
||||
self.frames[unit]:ClearAllPoints()
|
||||
self.frames[unit]:SetPoint("TOPLEFT", self.frames[previousPet], "BOTTOMLEFT", 0, - Gladdy.db.petMargin)
|
||||
end
|
||||
else
|
||||
self.frames[unit]:ClearAllPoints()
|
||||
self.frames[unit]:SetPoint("TOPLEFT", Gladdy.buttons[unitId].healthBar, "TOPLEFT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
end
|
||||
|
||||
healthBar.portrait:SetHeight(Gladdy.db.petHeight)
|
||||
healthBar.portrait:SetWidth(Gladdy.db.petHeight)
|
||||
@ -261,34 +289,37 @@ function Pets:UpdateFrame(unitId)
|
||||
healthBar.portrait.border:Show()
|
||||
end
|
||||
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:SetColor(Gladdy.db.petHealthBarBorderColor))
|
||||
|
||||
healthBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
|
||||
healthBar.bg:SetVertexColor(Gladdy.db.petHealthBarBgColor.r, Gladdy.db.petHealthBarBgColor.g, Gladdy.db.petHealthBarBgColor.b, Gladdy.db.petHealthBarBgColor.a)
|
||||
healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
|
||||
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor))
|
||||
|
||||
healthBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.petHealthBarBorderStyle),
|
||||
healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "petHealthBarBorderStyle"),
|
||||
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:SetColor(Gladdy.db.petHealthBarBorderColor))
|
||||
|
||||
healthBar.hp:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.petHealthBarTexture))
|
||||
healthBar.hp:SetStatusBarColor(Gladdy.db.petHealthBarColor.r, Gladdy.db.petHealthBarColor.g, Gladdy.db.petHealthBarColor.b, Gladdy.db.petHealthBarColor.a)
|
||||
healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "petHealthBarTexture"))
|
||||
healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.petHealthBarColor))
|
||||
healthBar.hp:ClearAllPoints()
|
||||
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))
|
||||
|
||||
if (Gladdy.db.petHealthBarFontSize < 1) then
|
||||
healthBar.nameText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1)
|
||||
healthBar.healthText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.petHealthBarFont), 1)
|
||||
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
|
||||
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
|
||||
healthBar.nameText:Hide()
|
||||
healthBar.healthText:Hide()
|
||||
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.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()
|
||||
end
|
||||
healthBar.nameText: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)
|
||||
healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
|
||||
healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.petHealthBarFontColor))
|
||||
if (unit == "arenapet1") then
|
||||
Gladdy:CreateMover(self.frames[unit], "petXOffset", "petYOffset", L["Pets"], {"TOPLEFT", "TOPLEFT"})
|
||||
end
|
||||
end
|
||||
|
||||
function Pets:SetHealthText(healthBar, health, healthMax)
|
||||
@ -380,11 +411,28 @@ function Pets:GetOptions()
|
||||
step = 1,
|
||||
width = "full",
|
||||
}),
|
||||
petGroup = option({
|
||||
type = "toggle",
|
||||
name = L["Group Pets"],
|
||||
order = 5,
|
||||
}),
|
||||
petMargin = option({
|
||||
type = "range",
|
||||
name = L["Margin"],
|
||||
desc = L["Height of the bar"],
|
||||
order = 6,
|
||||
disabled = function()
|
||||
return not Gladdy.db.petGroup
|
||||
end,
|
||||
min = 0,
|
||||
max = 50,
|
||||
step = .1,
|
||||
}),
|
||||
petHealthBarTexture = option({
|
||||
type = "select",
|
||||
name = L["Bar texture"],
|
||||
desc = L["Texture of the bar"],
|
||||
order = 5,
|
||||
order = 7,
|
||||
dialogControl = "LSM30_Statusbar",
|
||||
values = AceGUIWidgetLSMlists.statusbar,
|
||||
}),
|
||||
@ -392,14 +440,14 @@ function Pets:GetOptions()
|
||||
type = "color",
|
||||
name = L["Health color"],
|
||||
desc = L["Color of the status bar"],
|
||||
order = 6,
|
||||
order = 8,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
petHealthBarBgColor = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Background color"],
|
||||
desc = L["Color of the status bar background"],
|
||||
order = 7,
|
||||
order = 9,
|
||||
hasAlpha = true,
|
||||
}),
|
||||
},
|
||||
@ -530,10 +578,39 @@ function Pets:GetOptions()
|
||||
}),
|
||||
}
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
petFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
petFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 1,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
healthValues = {
|
||||
type = "group",
|
||||
name = L["Health Values"],
|
||||
order = 6,
|
||||
order = 7,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
@ -551,4 +628,31 @@ function Pets:GetOptions()
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Pets:LegacySetPosition(unit, unitId)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
self.frames[unit]:ClearAllPoints()
|
||||
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
if (Gladdy.db.petGroup) then
|
||||
if (unit == "arenapet1") then
|
||||
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
else
|
||||
local previousPet = "arenapet" .. string_gsub(unit, "arenapet", "") - 1
|
||||
self.frames[unit]:ClearAllPoints()
|
||||
self.frames[unit]:SetPoint("TOPLEFT", self.frames[previousPet], "BOTTOMLEFT", 0, - Gladdy.db.petMargin)
|
||||
end
|
||||
else
|
||||
self.frames[unit]:ClearAllPoints()
|
||||
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.petXOffset, Gladdy.db.petYOffset)
|
||||
end
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -22,6 +22,8 @@ local Powerbar = Gladdy:NewModule("Power Bar", 90, {
|
||||
powerActual = true,
|
||||
powerMax = true,
|
||||
powerPercentage = false,
|
||||
powerFrameStrata = "MEDIUM",
|
||||
powerFrameLevel = 1,
|
||||
})
|
||||
|
||||
function Powerbar:Initialize()
|
||||
@ -38,33 +40,35 @@ function Powerbar:CreateFrame(unit)
|
||||
|
||||
local powerBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
|
||||
powerBar:EnableMouse(false)
|
||||
powerBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.powerBarBorderStyle),
|
||||
powerBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "powerBarBorderStyle"),
|
||||
edgeSize = Gladdy.db.powerBarBorderSize })
|
||||
powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a)
|
||||
powerBar:SetFrameLevel(1)
|
||||
powerBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.powerBarBorderColor))
|
||||
powerBar:SetFrameStrata(Gladdy.db.powerFrameStrata)
|
||||
powerBar:SetFrameLevel(Gladdy.db.powerFrameLevel)
|
||||
|
||||
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:SetFrameLevel(0)
|
||||
powerBar.energy:SetFrameStrata(Gladdy.db.powerFrameStrata)
|
||||
powerBar.energy:SetFrameLevel(Gladdy.db.powerFrameLevel - 1)
|
||||
|
||||
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: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:SetColor(Gladdy.db.powerBarBgColor))
|
||||
|
||||
powerBar.raceText = powerBar:CreateFontString(nil, "LOW")
|
||||
powerBar.raceText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
|
||||
powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
|
||||
powerBar.raceText:SetShadowOffset(1, -1)
|
||||
powerBar.raceText:SetShadowColor(0, 0, 0, 1)
|
||||
powerBar.raceText:SetJustifyH("CENTER")
|
||||
powerBar.raceText:SetPoint("LEFT", 5, 1)
|
||||
|
||||
powerBar.powerText = powerBar:CreateFontString(nil, "LOW")
|
||||
powerBar.powerText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.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:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
|
||||
powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
|
||||
powerBar.powerText:SetShadowOffset(1, -1)
|
||||
powerBar.powerText:SetShadowColor(0, 0, 0, 1)
|
||||
powerBar.powerText:SetJustifyH("CENTER")
|
||||
@ -139,18 +143,16 @@ function Powerbar:UpdateFrame(unit)
|
||||
if (not powerBar) then
|
||||
return
|
||||
end
|
||||
|
||||
local healthBar = Gladdy.modules["Health Bar"].frames[unit]
|
||||
|
||||
|
||||
if not Gladdy.db.powerBarEnabled then
|
||||
powerBar:Hide()
|
||||
return
|
||||
else
|
||||
powerBar:Show()
|
||||
end
|
||||
powerBar.bg:SetTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture))
|
||||
powerBar.bg:SetVertexColor(Gladdy.db.powerBarBgColor.r, Gladdy.db.powerBarBgColor.g, Gladdy.db.powerBarBgColor.b, Gladdy.db.powerBarBgColor.a)
|
||||
powerBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
|
||||
powerBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.powerBarBgColor))
|
||||
|
||||
powerBar:SetWidth(healthBar:GetWidth())
|
||||
powerBar:SetHeight(Gladdy.db.powerBarHeight)
|
||||
@ -158,19 +160,24 @@ function Powerbar:UpdateFrame(unit)
|
||||
powerBar:ClearAllPoints()
|
||||
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 })
|
||||
powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a)
|
||||
powerBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.powerBarBorderColor))
|
||||
|
||||
powerBar.energy:SetStatusBarTexture(Gladdy.LSM:Fetch("statusbar", Gladdy.db.powerBarTexture))
|
||||
powerBar.energy:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "powerBarTexture"))
|
||||
powerBar.energy:ClearAllPoints()
|
||||
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.raceText:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.powerBarFont), Gladdy.db.powerBarFontSize)
|
||||
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:SetTextColor(Gladdy.db.powerBarFontColor.r, Gladdy.db.powerBarFontColor.g, Gladdy.db.powerBarFontColor.b, Gladdy.db.powerBarFontColor.a)
|
||||
powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
|
||||
powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
|
||||
powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarFontSize)
|
||||
powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
|
||||
|
||||
powerBar:SetFrameStrata(Gladdy.db.powerFrameStrata)
|
||||
powerBar:SetFrameLevel(Gladdy.db.powerFrameLevel)
|
||||
powerBar.energy:SetFrameStrata(Gladdy.db.powerFrameStrata)
|
||||
powerBar.energy:SetFrameLevel(Gladdy.db.powerFrameLevel - 1)
|
||||
end
|
||||
|
||||
function Powerbar:ResetUnit(unit)
|
||||
@ -455,10 +462,39 @@ function Powerbar:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 4,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
powerFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
powerFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 1,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
powerValues = {
|
||||
type = "group",
|
||||
name = L["Power Bar Text"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
|
@ -1,29 +1,27 @@
|
||||
local ceil, floor, string_format, tonumber = ceil, floor, string.format, tonumber
|
||||
local ceil = ceil
|
||||
|
||||
local CreateFrame = CreateFrame
|
||||
local GetTime = GetTime
|
||||
|
||||
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
local Racial = Gladdy:NewModule("Racial", nil, {
|
||||
local Racial = Gladdy:NewModule("Racial", 79, {
|
||||
racialFont = "DorisPP",
|
||||
racialFontScale = 1,
|
||||
racialEnabled = true,
|
||||
racialSize = 60 + 20 + 1,
|
||||
racialWidthFactor = 0.9,
|
||||
racialAnchor = "trinket",
|
||||
racialPos = "RIGHT",
|
||||
racialXOffset = 0,
|
||||
racialYOffset = 0,
|
||||
racialBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
|
||||
racialBorderColor = { r = 0, g = 0, b = 0, a = 1 },
|
||||
racialDisableCircle = false,
|
||||
racialCooldownAlpha = 1,
|
||||
racialCooldownNumberAlpha = 1,
|
||||
racialFrameStrata = "MEDIUM",
|
||||
racialFrameLevel = 5,
|
||||
})
|
||||
|
||||
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
|
||||
|
||||
function Racial:Initialize()
|
||||
self.frames = {}
|
||||
@ -45,39 +43,31 @@ local function iconTimer(self,elapsed)
|
||||
local timeLeft = ceil(self.timeLeft)
|
||||
|
||||
if timeLeft >= 60 then
|
||||
-- more than 1 minute
|
||||
self.cooldownFont:SetTextColor(1, 1, 0)
|
||||
self.cooldownFont:SetText(floor(timeLeft / 60) .. ":" .. string_format("%02.f", floor(timeLeft - floor(timeLeft / 60) * 60)))
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
elseif timeLeft < 60 and timeLeft >= 21 then
|
||||
-- between 60s and 21s (green)
|
||||
self.cooldownFont:SetTextColor(0.7, 1, 0)
|
||||
self.cooldownFont:SetText(timeLeft)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
elseif timeLeft < 20.9 and timeLeft >= 11 then
|
||||
-- between 20s and 11s (green)
|
||||
self.cooldownFont:SetTextColor(0, 1, 0)
|
||||
self.cooldownFont:SetText(timeLeft)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
elseif timeLeft <= 10 and timeLeft >= 5 then
|
||||
-- between 10s and 5s (orange)
|
||||
self.cooldownFont:SetTextColor(1, 0.7, 0)
|
||||
self.cooldownFont:SetFormattedText("%.1f", self.timeLeft)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
|
||||
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
|
||||
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
elseif timeLeft < 30 and timeLeft >= 11 then
|
||||
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
elseif timeLeft < 10 and timeLeft >= 5 then
|
||||
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
elseif timeLeft < 5 and timeLeft > 0 then
|
||||
-- between 5s and 1s (red)
|
||||
self.cooldownFont:SetTextColor(1, 0, 0)
|
||||
self.cooldownFont:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.racialFont), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
else
|
||||
self.cooldownFont:SetText("")
|
||||
self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.racialCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
|
||||
end
|
||||
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
|
||||
end
|
||||
end
|
||||
|
||||
function Racial:CreateFrame(unit)
|
||||
local racial = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit])
|
||||
racial:EnableMouse(false)
|
||||
racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial:SetFrameLevel(Gladdy.db.racialFrameLevel)
|
||||
|
||||
racial.texture = racial:CreateTexture(nil, "BACKGROUND")
|
||||
racial.texture:SetAllPoints(racial)
|
||||
racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
|
||||
@ -86,20 +76,27 @@ function Racial:CreateFrame(unit)
|
||||
racial.cooldown = CreateFrame("Cooldown", nil, racial, "CooldownFrameTemplate")
|
||||
racial.cooldown.noCooldownCount = true --Gladdy.db.racialDisableOmniCC
|
||||
racial.cooldown:SetHideCountdownNumbers(true)
|
||||
racial.cooldown:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial.cooldown:SetFrameLevel(Gladdy.db.racialFrameLevel + 1)
|
||||
|
||||
racial.cooldownFrame = CreateFrame("Frame", nil, racial)
|
||||
racial.cooldownFrame:ClearAllPoints()
|
||||
racial.cooldownFrame:SetPoint("TOPLEFT", racial, "TOPLEFT")
|
||||
racial.cooldownFrame:SetPoint("BOTTOMRIGHT", racial, "BOTTOMRIGHT")
|
||||
racial.cooldownFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial.cooldownFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 2)
|
||||
|
||||
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)
|
||||
racial.cooldownFont:SetJustifyH("CENTER")
|
||||
racial.cooldownFont:SetPoint("CENTER")
|
||||
|
||||
racial.borderFrame = CreateFrame("Frame", nil, racial)
|
||||
racial.borderFrame:SetAllPoints(racial)
|
||||
racial.borderFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial.borderFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 3)
|
||||
|
||||
racial.texture.overlay = racial.borderFrame:CreateTexture(nil, "OVERLAY")
|
||||
racial.texture.overlay:SetAllPoints(racial)
|
||||
racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
|
||||
@ -118,6 +115,15 @@ function Racial:UpdateFrame(unit)
|
||||
|
||||
local width, height = Gladdy.db.racialSize * Gladdy.db.racialWidthFactor, Gladdy.db.racialSize
|
||||
|
||||
racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial:SetFrameLevel(Gladdy.db.racialFrameLevel)
|
||||
racial.cooldown:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial.cooldown:SetFrameLevel(Gladdy.db.racialFrameLevel + 1)
|
||||
racial.cooldownFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial.cooldownFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 2)
|
||||
racial.borderFrame:SetFrameStrata(Gladdy.db.racialFrameStrata)
|
||||
racial.borderFrame:SetFrameLevel(Gladdy.db.racialFrameLevel + 3)
|
||||
|
||||
racial:SetWidth(width)
|
||||
racial:SetHeight(height)
|
||||
racial.cooldown:SetWidth(width - width/16)
|
||||
@ -131,19 +137,16 @@ function Racial:UpdateFrame(unit)
|
||||
racial.texture:SetAllPoints(racial)
|
||||
|
||||
racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
|
||||
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:SetColor(Gladdy.db.racialBorderColor))
|
||||
|
||||
racial:ClearAllPoints()
|
||||
local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor]
|
||||
if (Gladdy.db.racialPos == "RIGHT") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
|
||||
elseif (Gladdy.db.racialPos == "LEFT") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, -Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
|
||||
elseif (Gladdy.db.racialPos == "TOP") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, Gladdy.db.padding + Gladdy.db.racialYOffset)
|
||||
elseif (Gladdy.db.racialPos == "BOTTOM") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, -Gladdy.db.padding + Gladdy.db.racialYOffset)
|
||||
Gladdy:SetPosition(racial, unit, "racialXOffset", "racialYOffset", Racial:LegacySetPosition(racial, unit), Racial)
|
||||
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(racial,"racialXOffset", "racialYOffset", L["Racial"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
Gladdy.db.racialSize * Gladdy.db.racialWidthFactor,
|
||||
Gladdy.db.racialSize,
|
||||
0, 0, "racialEnabled")
|
||||
end
|
||||
|
||||
if (Gladdy.db.racialEnabled == false) then
|
||||
@ -178,14 +181,14 @@ function Racial:Used(unit, startTime, duration)
|
||||
end
|
||||
if not racial.active then
|
||||
racial.timeLeft = duration
|
||||
if not Gladdy.db.trinketDisableCircle then racial.cooldown:SetCooldown(startTime, duration) end
|
||||
if not Gladdy.db.racialDisableCircle then racial.cooldown:SetCooldown(startTime, duration) end
|
||||
racial.active = true
|
||||
end
|
||||
end
|
||||
|
||||
function Racial:ENEMY_SPOTTED(unit)
|
||||
local racial = self.frames[unit]
|
||||
if (not racial) then
|
||||
if (not racial or not Gladdy.buttons[unit].race) then
|
||||
return
|
||||
end
|
||||
racial.texture:SetTexture(Gladdy:Racials()[Gladdy.buttons[unit].race].texture)
|
||||
@ -284,6 +287,15 @@ function Racial:GetOptions()
|
||||
order = 8,
|
||||
width = "full",
|
||||
}),
|
||||
racialCooldownNumberAlpha = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Cooldown number alpha"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
order = 9,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
font = {
|
||||
@ -319,37 +331,13 @@ function Racial:GetOptions()
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Icon position"],
|
||||
order = 4,
|
||||
},
|
||||
racialAnchor = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Anchor"],
|
||||
desc = L["This changes the anchor of the racial icon"],
|
||||
order = 20,
|
||||
values = {
|
||||
["trinket"] = L["Trinket"],
|
||||
["classIcon"] = L["Class Icon"],
|
||||
["healthBar"] = L["Health Bar"],
|
||||
["powerBar"] = L["Power Bar"],
|
||||
},
|
||||
}),
|
||||
racialPos = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Icon position"],
|
||||
desc = L["This changes position relative to its anchor of the racial icon"],
|
||||
order = 21,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
["TOP"] = L["Top"],
|
||||
["BOTTOM"] = L["Bottom"],
|
||||
},
|
||||
}),
|
||||
racialXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
@ -395,7 +383,62 @@ function Racial:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
racialFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
racialFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Racial:LegacySetPosition(racial, unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
|
||||
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
|
||||
racial:ClearAllPoints()
|
||||
local parent = Gladdy.buttons[unit][Gladdy.db.racialAnchor]
|
||||
if (Gladdy.db.racialPos == "RIGHT") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
|
||||
elseif (Gladdy.db.racialPos == "LEFT") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, -Gladdy.db.padding + Gladdy.db.racialXOffset, Gladdy.db.racialYOffset)
|
||||
elseif (Gladdy.db.racialPos == "TOP") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, Gladdy.db.padding + Gladdy.db.racialYOffset)
|
||||
elseif (Gladdy.db.racialPos == "BOTTOM") then
|
||||
racial:SetPoint(ANCHORS[Gladdy.db.racialPos], parent, Gladdy.db.racialPos, Gladdy.db.racialXOffset, -Gladdy.db.padding + Gladdy.db.racialYOffset)
|
||||
end
|
||||
return Gladdy.db.newLayout
|
||||
end
|
@ -25,7 +25,7 @@ local classSpells = {
|
||||
["SHAMAN"] = 10414,
|
||||
["PALADIN"] = 10308,
|
||||
["WARLOCK"] = 5782,
|
||||
["WARRIOR"] = 20252,
|
||||
["WARRIOR"] = 25275,
|
||||
["HUNTER"] = 27018,
|
||||
["ROGUE"] = 36554,
|
||||
}
|
||||
@ -185,9 +185,15 @@ function RangeCheck:ENEMY_STEALTH(unit, stealth)
|
||||
button.lastState = 0
|
||||
if stealth then
|
||||
button.classColors = { r = 0.66, g = 0.66, b = 0.66 }
|
||||
if not Gladdy.db.rangeCheckEnabled then
|
||||
button.healthBar.hp:SetStatusBarColor(0.66, 0.66, 0.66, 1)
|
||||
end
|
||||
else
|
||||
if button.class then
|
||||
button.classColors = { r = RAID_CLASS_COLORS[button.class].r, g = RAID_CLASS_COLORS[button.class].g, b = RAID_CLASS_COLORS[button.class].b }
|
||||
if not Gladdy.db.rangeCheckEnabled then
|
||||
button.healthBar.hp:SetStatusBarColor(RAID_CLASS_COLORS[button.class].r, RAID_CLASS_COLORS[button.class].g, RAID_CLASS_COLORS[button.class].b, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -205,12 +211,12 @@ function RangeCheck.CheckRange(self)
|
||||
|
||||
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)
|
||||
elseif( spell ) then
|
||||
elseif (spell) then
|
||||
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
|
||||
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"))
|
||||
-- Nope, fall back to interaction :(
|
||||
else
|
||||
@ -343,7 +349,7 @@ function RangeCheck:GetSpells()
|
||||
local group = {
|
||||
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,
|
||||
},
|
||||
}
|
||||
@ -357,7 +363,7 @@ function RangeCheck:GetSpells()
|
||||
args = {
|
||||
headerMin = {
|
||||
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",
|
||||
order = 1,
|
||||
},
|
||||
@ -379,7 +385,7 @@ function RangeCheck:GetSpells()
|
||||
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)))
|
||||
-- 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"
|
||||
end
|
||||
},
|
||||
|
@ -1,18 +1,33 @@
|
||||
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
|
||||
|
||||
---------------------------
|
||||
|
||||
-- CORE
|
||||
|
||||
---------------------------
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
local ShadowsightTimer = Gladdy:NewModule("Shadowsight Timer", nil, {
|
||||
shadowsightTimerEnabled = true,
|
||||
shadowsightTimerLocked = false,
|
||||
shadowsightTimerScale = 1,
|
||||
shadowsightTimerRelPoint1 = "CENTER",
|
||||
shadowsightTimerRelPoint2 = "CENTER",
|
||||
shadowsightTimerX = 0,
|
||||
shadowsightTimerY = 0,
|
||||
shadowsightAnnounce = true,
|
||||
shadowsightTimerStartTime = 91,
|
||||
shadowsightTimerResetTime = 120,
|
||||
shadowsightTimerShowTwoTimer = false,
|
||||
shadowsightTimerFrameStrata = "HIGH",
|
||||
shadowsightTimerFrameLevel = 20,
|
||||
})
|
||||
|
||||
-- /run LibStub("Gladdy").modules["Shadowsight Timer"]:AURA_GAIN(nil, nil, 34709)
|
||||
-- /run LibStub("Gladdy").modules["Shadowsight Timer"].timerFrame1:SetAlpha(0)
|
||||
|
||||
function ShadowsightTimer:OnEvent(event, ...)
|
||||
self[event](self, ...)
|
||||
end
|
||||
@ -20,108 +35,185 @@ end
|
||||
function ShadowsightTimer:Initialize()
|
||||
self.locale = Gladdy:GetArenaTimer()
|
||||
self:RegisterMessage("JOINED_ARENA")
|
||||
self:CreateTimerFrame()
|
||||
end
|
||||
|
||||
function ShadowsightTimer:JOINED_ARENA()
|
||||
self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
|
||||
self:SetScript("OnEvent", ShadowsightTimer.OnEvent)
|
||||
self.timerFrame.font:SetText("1:30")
|
||||
self.timerFrame.font:SetTextColor(1, 0.8, 0)
|
||||
self.timerFrame:Show()
|
||||
end
|
||||
|
||||
function ShadowsightTimer:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
|
||||
for k,v in pairs(self.locale) do
|
||||
if str_find(msg, v) then
|
||||
if k == 0 then
|
||||
self:Start()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ShadowsightTimer:Test()
|
||||
if Gladdy.db.shadowsightTimerEnabled then
|
||||
self.timerFrame:Show()
|
||||
self:Start()
|
||||
end
|
||||
self:CreateAnchor()
|
||||
end
|
||||
|
||||
function ShadowsightTimer:Reset()
|
||||
self.timerFrame:Hide()
|
||||
self.timerFrame:SetScript("OnUpdate", nil)
|
||||
self.timerFrame.font:SetTextColor(1, 0.8, 0)
|
||||
self.anchor:Hide()
|
||||
for i=1,2 do
|
||||
self["timerFrame" .. i].active = false
|
||||
self["timerFrame" .. i]:SetScript("OnUpdate", nil)
|
||||
self["timerFrame" .. i].font:SetTextColor(1, 0.8, 0)
|
||||
end
|
||||
self:UnregisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
|
||||
self:SetScript("OnEvent", nil)
|
||||
end
|
||||
|
||||
function ShadowsightTimer:CreateTimerFrame()
|
||||
self.timerFrame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate")
|
||||
self.timerFrame:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
|
||||
---------------------------
|
||||
|
||||
-- FRAME SETUP
|
||||
|
||||
---------------------------
|
||||
|
||||
function ShadowsightTimer:CreateTimerFrame(anchor, name, points)
|
||||
local backdrop = {
|
||||
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
||||
edgeFile = "",
|
||||
tile = true, tileSize = 16, edgeSize = 10,
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0}
|
||||
}
|
||||
self[name] = CreateFrame("Frame", nil, anchor, BackdropTemplateMixin and "BackdropTemplate")
|
||||
self[name]:SetPoint(points[1], anchor, points[2])
|
||||
self[name]:SetBackdrop(backdrop)
|
||||
self[name]:SetBackdropColor(0,0,0,0.8)
|
||||
self[name]:SetHeight(17)
|
||||
self[name]:SetWidth(35)
|
||||
|
||||
self.timerFrame:SetBackdrop(backdrop)
|
||||
self.timerFrame:SetBackdropColor(0,0,0,0.8)
|
||||
self.timerFrame:SetHeight(17)
|
||||
self.timerFrame:SetWidth(35)
|
||||
self[name].texture = self[name]:CreateTexture(nil,"OVERLAY")
|
||||
self[name].texture:SetWidth(16)
|
||||
self[name].texture:SetHeight(16)
|
||||
self[name].texture:SetTexture("Interface\\Icons\\Spell_Shadow_EvilEye")
|
||||
self[name].texture:SetTexCoord(0.125,0.875,0.125,0.875)
|
||||
self[name].texture:SetPoint("RIGHT", self[name], "LEFT")
|
||||
|
||||
self.timerFrame:SetMovable(true)
|
||||
self.timerFrame:EnableMouse(true)
|
||||
self[name].font = self[name]:CreateFontString(nil,"OVERLAY","GameFontNormal")
|
||||
self[name].font:SetPoint("LEFT", 5, 0)
|
||||
self[name].font:SetJustifyH("LEFT")
|
||||
self[name].font:SetTextColor(1, 0.8, 0)
|
||||
|
||||
self.timerFrame.texture = self.timerFrame:CreateTexture(nil,"OVERLAY")
|
||||
self.timerFrame.texture:SetWidth(16)
|
||||
self.timerFrame.texture:SetHeight(16)
|
||||
self.timerFrame.texture:SetTexture("Interface\\Icons\\Spell_Shadow_EvilEye")
|
||||
self.timerFrame.texture:SetTexCoord(0.125,0.875,0.125,0.875)
|
||||
self.timerFrame.texture:SetPoint("RIGHT", self.timerFrame, "LEFT")
|
||||
self[name]:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
|
||||
self[name]:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
|
||||
end
|
||||
|
||||
self.timerFrame.font = self.timerFrame:CreateFontString(nil,"OVERLAY","GameFontNormal")
|
||||
self.timerFrame.font:SetPoint("LEFT", 5, 0)
|
||||
self.timerFrame.font:SetJustifyH("LEFT")
|
||||
self.timerFrame.font:SetTextColor(1, 0.8, 0)
|
||||
|
||||
self.timerFrame:SetScript("OnMouseDown",function(self) self:StartMoving() end)
|
||||
self.timerFrame:SetScript("OnMouseUp",function(self)
|
||||
function ShadowsightTimer:CreateAnchor()
|
||||
self.anchor = CreateFrame("Frame")
|
||||
self.anchor:SetMovable(true)
|
||||
self.anchor:EnableMouse(true)
|
||||
self.anchor:SetWidth(35)
|
||||
self.anchor:SetHeight(17)
|
||||
self.anchor:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
|
||||
self.anchor:SetScript("OnMouseDown",function(self) self:StartMoving() end)
|
||||
self.anchor:SetScript("OnMouseUp",function(self)
|
||||
self:StopMovingOrSizing()
|
||||
Gladdy.db.shadowsightTimerRelPoint1,_,Gladdy.db.shadowsightTimerRelPoint2,Gladdy.db.shadowsightTimerX,Gladdy.db.shadowsightTimerY = self:GetPoint()
|
||||
end)
|
||||
self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale)
|
||||
self.timerFrame:Hide()
|
||||
self.anchor:SetScale(Gladdy.db.shadowsightTimerScale)
|
||||
self.anchor:Hide()
|
||||
|
||||
self:CreateTimerFrame(self.anchor, "timerFrame1", {"TOP", "TOP"})
|
||||
local show = Gladdy.db.shadowsightTimerShowTwoTimer
|
||||
self:CreateTimerFrame(show and self.timerFrame1 or self.anchor, "timerFrame2", show and {"TOP", "BOTTOM"} or {"TOP", "TOP"})
|
||||
end
|
||||
|
||||
function ShadowsightTimer:UpdateFrame()
|
||||
function ShadowsightTimer:UpdateFrameOnce()
|
||||
self.anchor:EnableMouse(not Gladdy.db.shadowsightTimerLocked)
|
||||
|
||||
self.anchor:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
|
||||
self.anchor:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
|
||||
self.timerFrame1:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
|
||||
self.timerFrame1:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
|
||||
self.timerFrame2:SetFrameStrata(Gladdy.db.shadowsightTimerFrameStrata)
|
||||
self.timerFrame2:SetFrameLevel(Gladdy.db.shadowsightTimerFrameLevel)
|
||||
|
||||
if Gladdy.db.shadowsightTimerEnabled then
|
||||
self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale)
|
||||
self.timerFrame:ClearAllPoints()
|
||||
self.timerFrame:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
|
||||
self.timerFrame:Show()
|
||||
self.anchor:SetScale(Gladdy.db.shadowsightTimerScale)
|
||||
self.anchor:ClearAllPoints()
|
||||
self.anchor:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
|
||||
if Gladdy.frame.testing or Gladdy.curBracket then
|
||||
self.anchor:Show()
|
||||
end
|
||||
if Gladdy.db.shadowsightTimerShowTwoTimer then
|
||||
self.anchor:SetHeight(34)
|
||||
self.timerFrame2:ClearAllPoints()
|
||||
self.timerFrame2:SetPoint("TOP", self.timerFrame1, "BOTTOM")
|
||||
ShadowsightTimer:NotifyStart()
|
||||
else
|
||||
self.anchor:SetHeight(17)
|
||||
self.timerFrame2:ClearAllPoints()
|
||||
self.timerFrame2:SetPoint("TOP", self.anchor, "TOP")
|
||||
ShadowsightTimer:NotifyStart()
|
||||
end
|
||||
else
|
||||
self.timerFrame:SetScale(Gladdy.db.shadowsightTimerScale)
|
||||
self.timerFrame:ClearAllPoints()
|
||||
self.timerFrame:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
|
||||
self.timerFrame:Hide()
|
||||
self.anchor:SetScale(Gladdy.db.shadowsightTimerScale)
|
||||
self.anchor:ClearAllPoints()
|
||||
self.anchor:SetPoint(Gladdy.db.shadowsightTimerRelPoint1, nil, Gladdy.db.shadowsightTimerRelPoint2, Gladdy.db.shadowsightTimerX, Gladdy.db.shadowsightTimerY)
|
||||
self.anchor:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function ShadowsightTimer:Start()
|
||||
self.timerFrame.endTime = 92
|
||||
self.timerFrame.timeSinceLastUpdate = 0
|
||||
self.timerFrame:SetScript("OnUpdate", ShadowsightTimer.OnUpdate)
|
||||
---------------------------
|
||||
|
||||
-- EVENT HANDLING
|
||||
|
||||
---------------------------
|
||||
|
||||
function ShadowsightTimer:JOINED_ARENA()
|
||||
self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
|
||||
self:SetScript("OnEvent", ShadowsightTimer.OnEvent)
|
||||
for i=1,2 do
|
||||
self["timerFrame" .. i].font:SetText("1:30")
|
||||
self["timerFrame" .. i].font:SetTextColor(1, 0.8, 0)
|
||||
end
|
||||
self.anchor:Show()
|
||||
end
|
||||
|
||||
function ShadowsightTimer:AURA_GAIN(unit, auraType, spellID)
|
||||
if (spellID == 34709 and Gladdy.db.shadowsightTimerEnabled) then
|
||||
self:Start(Gladdy.db.shadowsightTimerResetTime, self:GetHiddenTimer())
|
||||
end
|
||||
end
|
||||
|
||||
function ShadowsightTimer:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
|
||||
for k,v in pairs(self.locale) do
|
||||
if str_find(msg, v) then
|
||||
if k == 0 then
|
||||
self:Start(nil, self.timerFrame1)
|
||||
self:Start(nil, self.timerFrame2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- TEST
|
||||
|
||||
---------------------------
|
||||
|
||||
function ShadowsightTimer:Test()
|
||||
if Gladdy.db.shadowsightTimerEnabled then
|
||||
self.anchor:Show()
|
||||
ShadowsightTimer:JOINED_ARENA()
|
||||
self:Start(20, self.timerFrame1)
|
||||
self:Start(25, self.timerFrame2)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- TIMER
|
||||
|
||||
---------------------------
|
||||
|
||||
function ShadowsightTimer:Start(time, frame)
|
||||
frame.endTime = time or Gladdy.db.shadowsightTimerStartTime
|
||||
frame.active = true
|
||||
ShadowsightTimer:NotifyStart()
|
||||
frame.announced = nil
|
||||
frame.timeSinceLastUpdate = 0
|
||||
frame.font:SetTextColor(1, 0.8, 0)
|
||||
frame:SetScript("OnUpdate", ShadowsightTimer.OnUpdate)
|
||||
end
|
||||
|
||||
function ShadowsightTimer.OnUpdate(self, elapsed)
|
||||
self.timeSinceLastUpdate = self.timeSinceLastUpdate + elapsed;
|
||||
self.endTime = self.endTime - elapsed
|
||||
|
||||
if (self.timeSinceLastUpdate > 0.1) then
|
||||
if (self.timeSinceLastUpdate > 0.01) then
|
||||
self.font:SetFormattedText(floor(self.endTime / 60) .. ":" .. "%02d", self.endTime - floor(self.endTime / 60) * 60)
|
||||
self.timeSinceLastUpdate = 0;
|
||||
if floor(self.endTime) == 15 and Gladdy.db.shadowsightAnnounce then
|
||||
if floor(self.endTime) == 15 and Gladdy.db.shadowsightAnnounce and not self.announced then
|
||||
self.announced = true
|
||||
Gladdy:SendMessage("SHADOWSIGHT", L["Shadowsight up in %ds"]:format(15))
|
||||
end
|
||||
end
|
||||
@ -132,12 +224,64 @@ function ShadowsightTimer.OnUpdate(self, elapsed)
|
||||
self:SetScript("OnUpdate", nil)
|
||||
self.font:SetText("0:00")
|
||||
self.font:SetTextColor(0, 1, 0)
|
||||
self.active = false
|
||||
ShadowsightTimer:NotifyEnd()
|
||||
end
|
||||
end
|
||||
|
||||
function ShadowsightTimer:NotifyStart()
|
||||
local show = Gladdy.db.shadowsightTimerShowTwoTimer
|
||||
if self.timerFrame1.active and self.timerFrame2.active then
|
||||
if self.timerFrame1.endTime < self.timerFrame2.endTime then
|
||||
self.timerFrame1:SetAlpha(1)
|
||||
self.timerFrame2:SetAlpha(show and 1 or 0)
|
||||
else
|
||||
self.timerFrame1:SetAlpha(show and 1 or 0)
|
||||
self.timerFrame2:SetAlpha(1)
|
||||
end
|
||||
else
|
||||
if self.timerFrame1.active then
|
||||
self.timerFrame1:SetAlpha(1)
|
||||
self.timerFrame2:SetAlpha(show and 1 or 0)
|
||||
elseif self.timerFrame2.active then
|
||||
self.timerFrame1:SetAlpha(show and 1 or 0)
|
||||
self.timerFrame2:SetAlpha(1)
|
||||
else
|
||||
self.timerFrame1:SetAlpha(1)
|
||||
self.timerFrame2:SetAlpha(show and 1 or 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
function ShadowsightTimer:NotifyEnd()
|
||||
local show = Gladdy.db.shadowsightTimerShowTwoTimer
|
||||
if self.timerFrame1.active then
|
||||
self.timerFrame1:SetAlpha(1)
|
||||
self.timerFrame2:SetAlpha(show and 1 or 0)
|
||||
elseif self.timerFrame2.active then
|
||||
self.timerFrame1:SetAlpha(show and 1 or 0)
|
||||
self.timerFrame2:SetAlpha(1)
|
||||
else
|
||||
self.timerFrame1:SetAlpha(1)
|
||||
self.timerFrame2:SetAlpha(show and 1 or 0)
|
||||
end
|
||||
end
|
||||
function ShadowsightTimer:GetHiddenTimer()
|
||||
if self.timerFrame1.active and self.timerFrame2.active then
|
||||
return self.timerFrame1.endTime < self.timerFrame2.endTime and self.timerFrame1 or self.timerFrame2
|
||||
else
|
||||
return self.timerFrame1.active and self.timerFrame2 or self.timerFrame1
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- OPTIONS
|
||||
|
||||
---------------------------
|
||||
|
||||
function ShadowsightTimer:GetOptions()
|
||||
return {
|
||||
headerArenaCountdown = {
|
||||
headerShadowsight = {
|
||||
type = "header",
|
||||
name = L["Shadowsight Timer"],
|
||||
order = 2,
|
||||
@ -147,23 +291,143 @@ function ShadowsightTimer:GetOptions()
|
||||
name = L["Enabled"],
|
||||
--desc = L["Turns countdown before the start of an arena match on/off."],
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
shadowsightTimerLocked = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Locked"],
|
||||
--desc = L["Turns countdown before the start of an arena match on/off."],
|
||||
order = 4,
|
||||
}),
|
||||
shadowsightTimerShowTwoTimer = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Show two timers"],
|
||||
order = 5,
|
||||
}),
|
||||
shadowsightAnnounce = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Announce"],
|
||||
--desc = L["Turns countdown before the start of an arena match on/off."],
|
||||
order = 4,
|
||||
width = "full",
|
||||
}),
|
||||
shadowsightTimerScale = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Scale"],
|
||||
order = 5,
|
||||
min = 0.1,
|
||||
max = 5,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
order = 6,
|
||||
}),
|
||||
group = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = L["Frame"],
|
||||
order = 7,
|
||||
args = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["Scale"],
|
||||
order = 1,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Scale"],
|
||||
order = 1,
|
||||
},
|
||||
shadowsightTimerScale = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Scale"],
|
||||
order = 2,
|
||||
min = 0.1,
|
||||
max = 5,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
cooldown = {
|
||||
type = "group",
|
||||
name = L["Cooldown"],
|
||||
order = 2,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Shadowsight CDs"],
|
||||
order = 1,
|
||||
},
|
||||
shadowsightTimerStartTime = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Start Time"],
|
||||
desc = L["Start time in seconds"],
|
||||
min = 80,
|
||||
max = 100,
|
||||
order = 2,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
shadowsightTimerResetTime = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Reset Time"],
|
||||
desc = L["Reset time in seconds"],
|
||||
min = 110,
|
||||
max = 130,
|
||||
order = 3,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
--[[font = {
|
||||
type = "group",
|
||||
name = L["Font"],
|
||||
order = 3,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Font"],
|
||||
order = 4,
|
||||
},
|
||||
racialFont = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Font"],
|
||||
desc = L["Font of the cooldown"],
|
||||
order = 11,
|
||||
dialogControl = "LSM30_Font",
|
||||
values = AceGUIWidgetLSMlists.font,
|
||||
}),
|
||||
racialFontScale = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Font scale"],
|
||||
desc = L["Scale of the font"],
|
||||
order = 12,
|
||||
min = 0.1,
|
||||
max = 2,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},--]]
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
shadowsightTimerFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
shadowsightTimerFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
@ -3,7 +3,7 @@ local UnitExists, UnitIsUnit, UnitName, UnitIsEnemy = UnitExists, UnitIsUnit, Un
|
||||
local C_NamePlate = C_NamePlate
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
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))),
|
||||
type = "toggle",
|
||||
width = "full",
|
||||
get = function(info) return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled end,
|
||||
set = function(info, value)
|
||||
get = function() return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled end,
|
||||
set = function(_, value)
|
||||
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].enabled = value
|
||||
Gladdy:UpdateFrame()
|
||||
end
|
||||
@ -130,15 +130,13 @@ local function GetTotemColorDefaultOptions()
|
||||
order = 3,
|
||||
hasAlpha = true,
|
||||
width = "full",
|
||||
get = function(info)
|
||||
local key = info.arg or info[#info]
|
||||
get = function()
|
||||
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.b,
|
||||
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].color.a
|
||||
end,
|
||||
set = function(info, r, g, b, a)
|
||||
local key = info.arg or info[#info]
|
||||
set = function(_, r, g, b, a)
|
||||
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.b,
|
||||
@ -154,10 +152,10 @@ local function GetTotemColorDefaultOptions()
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
get = function(info)
|
||||
get = function()
|
||||
return Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha
|
||||
end,
|
||||
set = function(info, value)
|
||||
set = function(_, value)
|
||||
Gladdy.dbi.profile.npTotemColors["totem" .. indexedList[i].id].alpha = value
|
||||
Gladdy:UpdateFrame()
|
||||
end
|
||||
@ -167,8 +165,8 @@ local function GetTotemColorDefaultOptions()
|
||||
name = L["Custom totem name"],
|
||||
order = 5,
|
||||
width = "full",
|
||||
get = function(info) 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
|
||||
get = function() return Gladdy.db.npTotemColors["totem" .. indexedList[i].id].customText 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
|
||||
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()
|
||||
return GetTotemColorDefaultOptions()
|
||||
end
|
||||
@ -227,6 +216,7 @@ function TotemPlates:Initialize()
|
||||
self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
|
||||
self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
|
||||
self:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
self:RegisterEvent("UNIT_NAME_UPDATE")
|
||||
self:SetScript("OnEvent", TotemPlates.OnEvent)
|
||||
if Gladdy.db.npTotems and Gladdy.db.npTotemsShowEnemy then
|
||||
--GetCVar("nameplateShowEnemyTotems")
|
||||
@ -279,16 +269,38 @@ function TotemPlates:UpdateFrameOnce()
|
||||
Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].color.b,
|
||||
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: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 "")
|
||||
self:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
|
||||
self:ToggleAddon(nameplate)
|
||||
|
||||
if not Gladdy.db.npTotems then
|
||||
nameplate.gladdyTotemFrame:Hide()
|
||||
self:ToggleAddon(nameplate, true)
|
||||
else
|
||||
nameplate.gladdyTotemFrame:Show()
|
||||
self:ToggleAddon(nameplate)
|
||||
end
|
||||
local isEnemy = UnitIsEnemy("player", nameplate.gladdyTotemFrame.unitID)
|
||||
if Gladdy.db.npTotems and Gladdy.db.npTotemsShowEnemy and isEnemy then
|
||||
nameplate.gladdyTotemFrame:Show()
|
||||
self:ToggleAddon(nameplate)
|
||||
elseif Gladdy.db.npTotems and not Gladdy.db.npTotemsShowEnemy and isEnemy then
|
||||
nameplate.gladdyTotemFrame:Hide()
|
||||
self:ToggleAddon(nameplate, true)
|
||||
end
|
||||
if Gladdy.db.npTotems and Gladdy.db.npTotemsShowFriendly and not isEnemy then
|
||||
nameplate.gladdyTotemFrame:Show()
|
||||
self:ToggleAddon(nameplate)
|
||||
elseif not Gladdy.db.npTotemsShowFriendly and not isEnemy then
|
||||
nameplate.gladdyTotemFrame:Hide()
|
||||
self:ToggleAddon(nameplate, true)
|
||||
end
|
||||
end
|
||||
for i,gladdyTotemFrame in ipairs(self.totemPlateCache) do
|
||||
for _,gladdyTotemFrame in ipairs(self.totemPlateCache) do
|
||||
gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
|
||||
gladdyTotemFrame:SetHeight(Gladdy.db.npTotemPlatesSize)
|
||||
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)
|
||||
end
|
||||
end
|
||||
@ -315,7 +327,7 @@ function TotemPlates:CreateTotemFrame(nameplate)
|
||||
nameplate.gladdyTotemFrame.totemBorder:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT")
|
||||
nameplate.gladdyTotemFrame.totemBorder:SetTexture(Gladdy.db.npTotemPlatesBorderStyle)
|
||||
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.selectionHighlight = nameplate.gladdyTotemFrame:CreateTexture(nil, "OVERLAY")
|
||||
nameplate.gladdyTotemFrame.selectionHighlight:SetTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill")
|
||||
@ -337,27 +349,47 @@ end
|
||||
|
||||
---------------------------------------------------
|
||||
|
||||
function TotemPlates:GetAddonFrame(nameplate)
|
||||
if self.addon == "Blizzard" then
|
||||
if nameplate.UnitFrame then
|
||||
return nameplate.UnitFrame
|
||||
end
|
||||
elseif self.addon == "Plater" or self.addon == "Tukui" or self.addon == "ElvUI" then
|
||||
if nameplate.unitFrame then
|
||||
return nameplate.unitFrame
|
||||
end
|
||||
elseif self.addon == "Kui_Nameplates" then
|
||||
if nameplate.kui then
|
||||
return nameplate.kui
|
||||
end
|
||||
elseif self.addon == "NeatPlates" then
|
||||
if nameplate.extended or nameplate.carrier then
|
||||
return nameplate.extended , nameplate.carrier
|
||||
end
|
||||
elseif self.addon == "TidyPlates_ThreatPlates" then
|
||||
if nameplate.TPFrame then
|
||||
return nameplate.TPFrame
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TotemPlates:PLAYER_TARGET_CHANGED()
|
||||
for k,nameplate in pairs(self.activeTotemNameplates) do
|
||||
TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
|
||||
end
|
||||
end
|
||||
|
||||
function TotemPlates:ToggleAddon(nameplate)
|
||||
if self.addon == "Blizzard" then
|
||||
nameplate.UnitFrame:Hide()
|
||||
elseif self.addon == "Plater" then
|
||||
nameplate.unitFrame:Hide()
|
||||
elseif self.addon == "Kui_Nameplates" then
|
||||
nameplate.kui:Hide()
|
||||
elseif self.addon == "NeatPlates" then
|
||||
nameplate.extended:Hide()
|
||||
nameplate.carrier:Hide()
|
||||
elseif self.addon == "TidyPlates_ThreatPlates" then
|
||||
nameplate.TPFrame:Hide()
|
||||
elseif self.addon == "Tukui" or self.addon == "ElvUI" then
|
||||
if nameplate.unitFrame then
|
||||
nameplate.unitFrame:Hide()
|
||||
function TotemPlates:ToggleAddon(nameplate, show)
|
||||
local addonFrames = { self:GetAddonFrame(nameplate) }
|
||||
if addonFrames and #addonFrames > 0 then
|
||||
if show then
|
||||
for _,v in ipairs(addonFrames) do
|
||||
v:Show()
|
||||
end
|
||||
else
|
||||
for _,v in ipairs(addonFrames) do
|
||||
v:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -368,18 +400,27 @@ function TotemPlates.OnUpdate(self)
|
||||
else
|
||||
self.selectionHighlight:SetAlpha(0)
|
||||
end
|
||||
if (TotemPlates.addon == "Tukui" or TotemPlates.addon == "ElvUI") and self.parent and self.parent.unitFrame then
|
||||
if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui" or TotemPlates.addon == "ElvUI") and self.parent and self.parent.unitFrame then
|
||||
self.parent.unitFrame:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
|
||||
local unitID = ...
|
||||
function TotemPlates:OnUnitEvent(unitID)
|
||||
local isEnemy = UnitIsEnemy("player", unitID)
|
||||
local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
|
||||
if not nameplate then
|
||||
return
|
||||
end
|
||||
if not Gladdy.db.npTotems then
|
||||
self:ToggleAddon(nameplate, true)
|
||||
return
|
||||
end
|
||||
if not Gladdy.db.npTotemsShowEnemy and isEnemy then
|
||||
self:ToggleAddon(nameplate, true)
|
||||
return
|
||||
end
|
||||
if not Gladdy.db.npTotemsShowFriendly and not isEnemy then
|
||||
self:ToggleAddon(nameplate, true)
|
||||
return
|
||||
end
|
||||
local nameplateName = UnitName(unitID)
|
||||
@ -387,7 +428,6 @@ function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
|
||||
totemName = string_gsub(totemName, "%s+$", "") --trim
|
||||
totemName = string_gsub(totemName, "%s+[I,V,X]+$", "") --trim rank
|
||||
totemName = string_lower(totemName)
|
||||
local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
|
||||
local totemDataEntry = localizedTotemData["default"][totemName] or localizedTotemData["frFR"][totemName] or localizedTotemData["ruRU"][totemName]
|
||||
if totemDataEntry and Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled then-- modify this nameplates
|
||||
if #self.totemPlateCache > 0 then
|
||||
@ -412,13 +452,24 @@ function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
|
||||
TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID)
|
||||
self:ToggleAddon(nameplate)
|
||||
self.activeTotemNameplates[unitID] = nameplate
|
||||
else
|
||||
self:ToggleAddon(nameplate, true)
|
||||
end
|
||||
end
|
||||
|
||||
function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
|
||||
self:OnUnitEvent(...)
|
||||
end
|
||||
|
||||
function TotemPlates:UNIT_NAME_UPDATE(...)
|
||||
self:OnUnitEvent(...)
|
||||
end
|
||||
|
||||
function TotemPlates:NAME_PLATE_UNIT_REMOVED(...)
|
||||
local unitID = ...
|
||||
local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
|
||||
self.activeTotemNameplates[unitID] = nil
|
||||
--self:ToggleAddon(nameplate, true)
|
||||
if nameplate.gladdyTotemFrame then
|
||||
nameplate.gladdyTotemFrame:Hide()
|
||||
nameplate.gladdyTotemFrame:SetParent(nil)
|
||||
@ -603,19 +654,23 @@ function TotemPlates:GetOptions()
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
order = 23,
|
||||
get = function(info)
|
||||
local alphas = GetTotemOptions()
|
||||
for i=2, #alphas do
|
||||
if alphas[i].alpha ~= alphas[1].alpha then
|
||||
return ""
|
||||
get = function()
|
||||
local alpha, i = nil, 1
|
||||
for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
|
||||
if i == 1 then
|
||||
alpha = v.alpha
|
||||
i = i + 1
|
||||
else
|
||||
if v.alpha ~= alpha then
|
||||
return ""
|
||||
end
|
||||
end
|
||||
end
|
||||
return alphas[1].alpha
|
||||
return alpha
|
||||
end,
|
||||
set = function(info, value)
|
||||
local alphas = GetTotemOptions()
|
||||
for i=1, #alphas do
|
||||
alphas[i].alpha = value
|
||||
set = function(_, value)
|
||||
for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
|
||||
v.alpha = value
|
||||
end
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
@ -643,23 +698,27 @@ function TotemPlates:GetOptions()
|
||||
name = L["All totem border color"],
|
||||
order = 42,
|
||||
hasAlpha = true,
|
||||
get = function(info)
|
||||
local colors = GetTotemOptions()
|
||||
local color = colors[1].color
|
||||
for i=2, #colors 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
|
||||
return 0, 0, 0, 0
|
||||
get = function()
|
||||
local color
|
||||
local i = 1
|
||||
for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
|
||||
if i == 1 then
|
||||
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
|
||||
return color.r, color.g, color.b, color.a
|
||||
end,
|
||||
set = function(info, r, g, b, a)
|
||||
local colors = GetTotemOptions()
|
||||
for i=1, #colors do
|
||||
colors[i].color.r = r
|
||||
colors[i].color.g = g
|
||||
colors[i].color.b = b
|
||||
colors[i].color.a = a
|
||||
set = function(_, r, g, b, a)
|
||||
for _,v in pairs(Gladdy.dbi.profile.npTotemColors) do
|
||||
v.color.r = r
|
||||
v.color.g = g
|
||||
v.color.b = b
|
||||
v.color.a = a
|
||||
end
|
||||
Gladdy:UpdateFrame()
|
||||
end,
|
||||
|
@ -1,4 +1,4 @@
|
||||
local ceil, floor, string_format, tonumber = ceil, floor, string.format, tonumber
|
||||
local ceil = ceil
|
||||
local C_PvP = C_PvP
|
||||
|
||||
local CreateFrame = CreateFrame
|
||||
@ -6,19 +6,26 @@ local GetTime = GetTime
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
local Trinket = Gladdy:NewModule("Trinket", nil, {
|
||||
local Trinket = Gladdy:NewModule("Trinket", 80, {
|
||||
trinketFont = "DorisPP",
|
||||
trinketFontScale = 1,
|
||||
trinketFontEnabled = true,
|
||||
trinketEnabled = true,
|
||||
trinketSize = 60 + 20 + 1,
|
||||
trinketWidthFactor = 0.9,
|
||||
trinketPos = "RIGHT",
|
||||
trinketBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
|
||||
trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 },
|
||||
trinketDisableCircle = false,
|
||||
trinketCooldownAlpha = 1,
|
||||
trinketCooldownNumberAlpha = 1,
|
||||
trinketXOffset = 0,
|
||||
trinketYOffset = 0,
|
||||
trinketFrameStrata = "MEDIUM",
|
||||
trinketFrameLevel = 5,
|
||||
trinketColored = false,
|
||||
trinketColoredCd = { r = 1, g = 0, b = 0, a = 1 },
|
||||
trinketColoredNoCd = { r = 0, g = 1, b = 0, a = 1 },
|
||||
})
|
||||
LibStub("AceComm-3.0"):Embed(Trinket)
|
||||
|
||||
function Trinket:Initialize()
|
||||
self.frames = {}
|
||||
@ -32,6 +39,9 @@ local function iconTimer(self, elapsed)
|
||||
self.active = false
|
||||
self.cooldown:Clear()
|
||||
Gladdy:SendMessage("TRINKET_READY", self.unit)
|
||||
if Gladdy.db.trinketColored then
|
||||
self:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd))
|
||||
end
|
||||
else
|
||||
self.timeLeft = self.timeLeft - elapsed
|
||||
end
|
||||
@ -39,30 +49,23 @@ local function iconTimer(self, elapsed)
|
||||
local timeLeft = ceil(self.timeLeft)
|
||||
|
||||
if timeLeft >= 60 then
|
||||
-- more than 1 minute
|
||||
self.cooldownFont:SetTextColor(1, 1, 0)
|
||||
self.cooldownFont:SetText(floor(timeLeft / 60) .. ":" .. string_format("%02.f", floor(timeLeft - floor(timeLeft / 60) * 60)))
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 0.15*self:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
elseif timeLeft < 60 and timeLeft >= 21 then
|
||||
-- between 60s and 21s (green)
|
||||
self.cooldownFont:SetTextColor(0.7, 1, 0)
|
||||
self.cooldownFont:SetText(timeLeft)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
elseif timeLeft < 20.9 and timeLeft >= 11 then
|
||||
-- between 20s and 11s (green)
|
||||
self.cooldownFont:SetTextColor(0, 1, 0)
|
||||
self.cooldownFont:SetText(timeLeft)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
|
||||
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
|
||||
self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
elseif timeLeft < 30 and timeLeft >= 11 then
|
||||
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
elseif timeLeft <= 10 and timeLeft >= 5 then
|
||||
-- between 10s and 5s (orange)
|
||||
self.cooldownFont:SetTextColor(1, 0.7, 0)
|
||||
self.cooldownFont:SetFormattedText("%.1f", self.timeLeft)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
elseif timeLeft < 5 and timeLeft > 0 then
|
||||
-- between 5s and 1s (red)
|
||||
self.cooldownFont:SetTextColor(1, 0, 0)
|
||||
self.cooldownFont:SetFormattedText("%.1f", self.timeLeft >= 0.0 and self.timeLeft or 0.0)
|
||||
self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.trinketFont), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.trinketCooldownNumberAlpha)
|
||||
self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
|
||||
end
|
||||
if Gladdy.db.trinketFontEnabled then
|
||||
Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
|
||||
else
|
||||
self.cooldownFont:SetText("")
|
||||
end
|
||||
@ -70,8 +73,12 @@ local function iconTimer(self, elapsed)
|
||||
end
|
||||
|
||||
function Trinket:CreateFrame(unit)
|
||||
local trinket = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit])
|
||||
local trinket = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate")
|
||||
trinket:SetBackdrop({bgFile = "Interface\\AddOns\\Gladdy\\Images\\trinket" })
|
||||
trinket:EnableMouse(false)
|
||||
trinket:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket:SetFrameLevel(Gladdy.db.trinketFrameLevel)
|
||||
|
||||
trinket.texture = trinket:CreateTexture(nil, "BACKGROUND")
|
||||
trinket.texture:SetAllPoints(trinket)
|
||||
trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
|
||||
@ -80,20 +87,27 @@ function Trinket:CreateFrame(unit)
|
||||
trinket.cooldown = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate")
|
||||
trinket.cooldown.noCooldownCount = true --Gladdy.db.trinketDisableOmniCC
|
||||
trinket.cooldown:SetHideCountdownNumbers(true)
|
||||
trinket.cooldown:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket.cooldown:SetFrameLevel(Gladdy.db.trinketFrameLevel + 1)
|
||||
|
||||
trinket.cooldownFrame = CreateFrame("Frame", nil, trinket)
|
||||
trinket.cooldownFrame:ClearAllPoints()
|
||||
trinket.cooldownFrame:SetPoint("TOPLEFT", trinket, "TOPLEFT")
|
||||
trinket.cooldownFrame:SetPoint("BOTTOMRIGHT", trinket, "BOTTOMRIGHT")
|
||||
trinket.cooldownFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket.cooldownFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 2)
|
||||
|
||||
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:SetJustifyH("CENTER")
|
||||
trinket.cooldownFont:SetPoint("CENTER")
|
||||
|
||||
trinket.borderFrame = CreateFrame("Frame", nil, trinket)
|
||||
trinket.borderFrame:SetAllPoints(trinket)
|
||||
trinket.borderFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket.borderFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 3)
|
||||
|
||||
trinket.texture.overlay = trinket.borderFrame:CreateTexture(nil, "OVERLAY")
|
||||
trinket.texture.overlay:SetAllPoints(trinket)
|
||||
trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
|
||||
@ -112,8 +126,29 @@ function Trinket:UpdateFrame(unit)
|
||||
return
|
||||
end
|
||||
|
||||
if Gladdy.db.trinketColored then
|
||||
if trinket.active then
|
||||
trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
|
||||
else
|
||||
trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd))
|
||||
end
|
||||
trinket.texture:SetTexture()
|
||||
else
|
||||
trinket:SetBackdropColor(0,0,0,0)
|
||||
trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
|
||||
end
|
||||
|
||||
local width, height = Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor, Gladdy.db.trinketSize
|
||||
|
||||
trinket:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket:SetFrameLevel(Gladdy.db.trinketFrameLevel)
|
||||
trinket.cooldown:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket.cooldown:SetFrameLevel(Gladdy.db.trinketFrameLevel + 1)
|
||||
trinket.cooldownFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket.cooldownFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 2)
|
||||
trinket.borderFrame:SetFrameStrata(Gladdy.db.trinketFrameStrata)
|
||||
trinket.borderFrame:SetFrameLevel(Gladdy.db.trinketFrameLevel + 3)
|
||||
|
||||
trinket:SetWidth(width)
|
||||
trinket:SetHeight(height)
|
||||
trinket.cooldown:SetWidth(width - width/16)
|
||||
@ -127,25 +162,28 @@ function Trinket:UpdateFrame(unit)
|
||||
trinket.texture:SetAllPoints(trinket)
|
||||
|
||||
trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
|
||||
trinket.texture.overlay:SetVertexColor(Gladdy.db.trinketBorderColor.r, Gladdy.db.trinketBorderColor.g, Gladdy.db.trinketBorderColor.b, Gladdy.db.trinketBorderColor.a)
|
||||
trinket.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.trinketBorderColor))
|
||||
|
||||
trinket:ClearAllPoints()
|
||||
local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "LEFT") then
|
||||
if (Gladdy.db.trinketPos == "RIGHT") then
|
||||
trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", margin, 0)
|
||||
else
|
||||
trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].classIcon, "TOPLEFT", -Gladdy.db.padding, 0)
|
||||
end
|
||||
else
|
||||
if (Gladdy.db.trinketPos == "RIGHT") then
|
||||
trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].classIcon, "TOPRIGHT", Gladdy.db.padding, 0)
|
||||
else
|
||||
trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
|
||||
end
|
||||
Gladdy:SetPosition(trinket, unit, "trinketXOffset", "trinketYOffset", Trinket:LegacySetPosition(trinket, unit), Trinket)
|
||||
|
||||
if (unit == "arena1") then
|
||||
Gladdy:CreateMover(trinket,"trinketXOffset", "trinketYOffset", L["Trinket"],
|
||||
{"TOPLEFT", "TOPLEFT"},
|
||||
Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor,
|
||||
Gladdy.db.trinketSize,
|
||||
0,
|
||||
0, "trinketEnabled")
|
||||
end
|
||||
|
||||
if (Gladdy.db.trinketEnabled == false) then
|
||||
trinket.cooldown:SetAlpha(Gladdy.db.trinketCooldownAlpha)
|
||||
|
||||
if Gladdy.db.trinketDisableCircle then
|
||||
trinket.cooldown:Hide()
|
||||
else
|
||||
trinket.cooldown:Show()
|
||||
end
|
||||
|
||||
if (not Gladdy.db.trinketEnabled) then
|
||||
trinket:Hide()
|
||||
else
|
||||
trinket:Show()
|
||||
@ -209,6 +247,9 @@ function Trinket:Used(unit, startTime, duration)
|
||||
trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime()
|
||||
if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end
|
||||
trinket.active = true
|
||||
if Gladdy.db.trinketColored then
|
||||
trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
|
||||
end
|
||||
Gladdy:SendMessage("TRINKET_USED", unit)
|
||||
end
|
||||
end
|
||||
@ -226,11 +267,37 @@ function Trinket:GetOptions()
|
||||
desc = L["Enable trinket icon"],
|
||||
order = 3,
|
||||
}),
|
||||
trinketColored = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Colored trinket"],
|
||||
desc = L["Shows a solid colored icon when off/off CD."],
|
||||
order = 4,
|
||||
}),
|
||||
trinketColoredCd = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Colored trinket CD"],
|
||||
desc = L["Color of the border"],
|
||||
order = 5,
|
||||
hasAlpha = true,
|
||||
disabled = function()
|
||||
return not Gladdy.db.trinketColored
|
||||
end,
|
||||
}),
|
||||
trinketColoredNoCd = Gladdy:colorOption({
|
||||
type = "color",
|
||||
name = L["Colored trinket No CD"],
|
||||
desc = L["Color of the border"],
|
||||
order = 6,
|
||||
hasAlpha = true,
|
||||
disabled = function()
|
||||
return not Gladdy.db.trinketColored
|
||||
end,
|
||||
}),
|
||||
group = {
|
||||
type = "group",
|
||||
childGroups = "tree",
|
||||
name = L["Frame"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
general = {
|
||||
type = "group",
|
||||
@ -287,6 +354,15 @@ function Trinket:GetOptions()
|
||||
order = 8,
|
||||
width = "full",
|
||||
}),
|
||||
trinketCooldownNumberAlpha = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Cooldown number alpha"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.1,
|
||||
order = 9,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
font = {
|
||||
@ -297,13 +373,19 @@ function Trinket:GetOptions()
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Font"],
|
||||
order = 4,
|
||||
order = 1,
|
||||
},
|
||||
trinketFontEnabled = Gladdy:option({
|
||||
type = "toggle",
|
||||
name = L["Font Enabled"],
|
||||
order = 2,
|
||||
width = "full",
|
||||
}),
|
||||
trinketFont = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Font"],
|
||||
desc = L["Font of the cooldown"],
|
||||
order = 11,
|
||||
order = 3,
|
||||
dialogControl = "LSM30_Font",
|
||||
values = AceGUIWidgetLSMlists.font,
|
||||
}),
|
||||
@ -311,7 +393,7 @@ function Trinket:GetOptions()
|
||||
type = "range",
|
||||
name = L["Font scale"],
|
||||
desc = L["Scale of the font"],
|
||||
order = 12,
|
||||
order = 4,
|
||||
min = 0.1,
|
||||
max = 2,
|
||||
step = 0.1,
|
||||
@ -322,22 +404,30 @@ function Trinket:GetOptions()
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Position"],
|
||||
order = 4,
|
||||
order = 5,
|
||||
args = {
|
||||
header = {
|
||||
type = "header",
|
||||
name = L["Icon position"],
|
||||
order = 4,
|
||||
},
|
||||
trinketPos = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Icon position"],
|
||||
desc = L["This changes positions of the trinket"],
|
||||
order = 21,
|
||||
values = {
|
||||
["LEFT"] = L["Left"],
|
||||
["RIGHT"] = L["Right"],
|
||||
},
|
||||
trinketXOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Horizontal offset"],
|
||||
order = 23,
|
||||
min = -800,
|
||||
max = 800,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
trinketYOffset = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Vertical offset"],
|
||||
order = 24,
|
||||
min = -800,
|
||||
max = 800,
|
||||
step = 0.1,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
@ -366,7 +456,63 @@ function Trinket:GetOptions()
|
||||
}),
|
||||
},
|
||||
},
|
||||
frameStrata = {
|
||||
type = "group",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 6,
|
||||
args = {
|
||||
headerAuraLevel = {
|
||||
type = "header",
|
||||
name = L["Frame Strata and Level"],
|
||||
order = 1,
|
||||
},
|
||||
trinketFrameStrata = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Frame Strata"],
|
||||
order = 2,
|
||||
values = Gladdy.frameStrata,
|
||||
sorting = Gladdy.frameStrataSorting,
|
||||
width = "full",
|
||||
}),
|
||||
trinketFrameLevel = Gladdy:option({
|
||||
type = "range",
|
||||
name = L["Frame Level"],
|
||||
min = 0,
|
||||
max = 500,
|
||||
step = 1,
|
||||
order = 3,
|
||||
width = "full",
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------
|
||||
|
||||
-- LAGACY HANDLER
|
||||
|
||||
---------------------------
|
||||
|
||||
function Trinket:LegacySetPosition(trinket, unit)
|
||||
if Gladdy.db.newLayout then
|
||||
return Gladdy.db.newLayout
|
||||
end
|
||||
trinket:ClearAllPoints()
|
||||
local margin = (Gladdy.db.highlightInset and 0 or Gladdy.db.highlightBorderSize) + Gladdy.db.padding
|
||||
if (Gladdy.db.classIconPos == "LEFT") then
|
||||
if (Gladdy.db.trinketPos == "RIGHT") then
|
||||
trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].healthBar, "TOPRIGHT", margin, 0)
|
||||
else
|
||||
trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].classIcon, "TOPLEFT", -Gladdy.db.padding, 0)
|
||||
end
|
||||
else
|
||||
if (Gladdy.db.trinketPos == "RIGHT") then
|
||||
trinket:SetPoint("TOPLEFT", Gladdy.buttons[unit].classIcon, "TOPRIGHT", Gladdy.db.padding, 0)
|
||||
else
|
||||
trinket:SetPoint("TOPRIGHT", Gladdy.buttons[unit].healthBar, "TOPLEFT", -margin, 0)
|
||||
end
|
||||
end
|
||||
end
|
@ -1,11 +1,11 @@
|
||||
local str_match, tonumber, tostring = string.match, tonumber, tostring
|
||||
local tonumber, tostring = tonumber, tostring
|
||||
|
||||
local UnitName = UnitName
|
||||
local IsInGroup, IsInRaid = IsInGroup, IsInRaid
|
||||
local LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local L = Gladdy.L
|
||||
|
||||
local VersionCheck = Gladdy:NewModule("VersionCheck", 1, {
|
||||
})
|
||||
LibStub("AceComm-3.0"):Embed(VersionCheck)
|
||||
|
@ -4,54 +4,17 @@ local L = Gladdy.L
|
||||
local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
|
||||
})
|
||||
|
||||
function XiconProfiles:ApplyKlimp()
|
||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetKlimpProfile())
|
||||
if deserialized then
|
||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
||||
end
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
Gladdy:ToggleFrame(3)
|
||||
end
|
||||
|
||||
function XiconProfiles:ApplyKnall()
|
||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetKnallProfile())
|
||||
if deserialized then
|
||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
||||
end
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
Gladdy:ToggleFrame(3)
|
||||
end
|
||||
|
||||
function XiconProfiles:ApplyClassic()
|
||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetClassicProfile())
|
||||
if deserialized then
|
||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
||||
end
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
Gladdy:ToggleFrame(3)
|
||||
end
|
||||
|
||||
function XiconProfiles:ApplyClassicNoPet()
|
||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetClassicProfileNoPet())
|
||||
if deserialized then
|
||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
||||
end
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
Gladdy:ToggleFrame(3)
|
||||
end
|
||||
|
||||
function XiconProfiles:ApplyBlizz()
|
||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetBlizzardProfile())
|
||||
local function applyProfile(profileString)
|
||||
local deserialized = Gladdy.modules["Export Import"]:Decode(profileString)
|
||||
if deserialized then
|
||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
||||
end
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
Gladdy:ToggleFrame(3)
|
||||
Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
|
||||
Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
|
||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||
end
|
||||
|
||||
function XiconProfiles:GetOptions()
|
||||
@ -65,7 +28,7 @@ function XiconProfiles:GetOptions()
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
XiconProfiles:ApplyBlizz()
|
||||
applyProfile(Gladdy:GetBlizzardProfile())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Blizzard " .. L["Profile"],
|
||||
@ -84,7 +47,7 @@ function XiconProfiles:GetOptions()
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
XiconProfiles:ApplyClassic()
|
||||
applyProfile(Gladdy:GetClassicProfile())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Classic " .. L["Profile"],
|
||||
@ -96,17 +59,17 @@ function XiconProfiles:GetOptions()
|
||||
},
|
||||
headerProfileClassicNoPet = {
|
||||
type = "header",
|
||||
name = "Classic " .. L["Profile"] .. " No Pet",
|
||||
name = "Classic " .. L["Profile"] .. L[" No Pet"],
|
||||
order = 6,
|
||||
},
|
||||
classicProfileNoPet = {
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
XiconProfiles:ApplyClassicNoPet()
|
||||
applyProfile(Gladdy:GetClassicProfileNoPet())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Classic " .. L["Profile"] .. " No Pet",
|
||||
desc = "Classic " .. L["Profile"] .. L[" No Pet"],
|
||||
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic2.blp",
|
||||
imageWidth = 350,
|
||||
imageHeight = 175,
|
||||
@ -122,7 +85,7 @@ function XiconProfiles:GetOptions()
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
XiconProfiles:ApplyKnall()
|
||||
applyProfile(Gladdy:GetKnallProfile())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Knall's " .. L["Profile"],
|
||||
@ -141,7 +104,7 @@ function XiconProfiles:GetOptions()
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
XiconProfiles:ApplyKlimp()
|
||||
applyProfile(Gladdy:GetKlimpProfile())
|
||||
end,
|
||||
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
|
||||
imageWidth = 350,
|
||||
@ -151,6 +114,62 @@ function XiconProfiles:GetOptions()
|
||||
width = "full",
|
||||
order = 11,
|
||||
},
|
||||
|
||||
headerProfileRukk = {
|
||||
type = "header",
|
||||
name = "Rukk1's " .. L["Profile"],
|
||||
order = 12,
|
||||
},
|
||||
rukkProfile = {
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
applyProfile(Gladdy:GetRukkProfile())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Rukk1's " .. L["Profile"],
|
||||
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Rukk1.blp",
|
||||
imageWidth = 350,
|
||||
imageHeight = 175,
|
||||
width = "full",
|
||||
order = 13,
|
||||
},
|
||||
headerProfileMir = {
|
||||
type = "header",
|
||||
name = "Mir's " .. L["Profile"],
|
||||
order = 14,
|
||||
},
|
||||
mirProfile = {
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
applyProfile(Gladdy:GetMirProfile())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Mir's " .. L["Profile"],
|
||||
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Mir1.blp",
|
||||
imageWidth = 350,
|
||||
imageHeight = 175,
|
||||
width = "full",
|
||||
order = 15,
|
||||
},
|
||||
headerProfileMirEdited = {
|
||||
type = "header",
|
||||
name = "Mir's " .. L["Profile"] .. " edited",
|
||||
order = 16,
|
||||
},
|
||||
mirProfileEdited = {
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||
applyProfile(Gladdy:GetMirEditedProfile())
|
||||
end,
|
||||
name = " ",
|
||||
desc = "Mir's " .. L["Profile"],
|
||||
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Mir1_edited.blp",
|
||||
imageWidth = 350,
|
||||
imageHeight = 175,
|
||||
width = "full",
|
||||
order = 17,
|
||||
},
|
||||
}
|
||||
end
|
172
Options.lua
172
Options.lua
@ -1,4 +1,7 @@
|
||||
local type, pairs, tinsert, tsort, tostring, str_match, tonumber = type, pairs, table.insert, table.sort, tostring, string.match, tonumber
|
||||
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 ceil, floor = ceil, floor
|
||||
local ReloadUI = ReloadUI
|
||||
|
||||
local InterfaceOptionsFrame_OpenToFrame = InterfaceOptionsFrame_OpenToFrame
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
@ -6,23 +9,54 @@ local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
|
||||
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
|
||||
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
|
||||
|
||||
|
||||
local Gladdy = LibStub("Gladdy")
|
||||
local LibClassAuras = LibStub("LibClassAuras-1.0")
|
||||
local L = Gladdy.L
|
||||
|
||||
Gladdy.TIMER_FORMAT = { tenths = "tenths", seconds = "seconds",
|
||||
values = {
|
||||
["tenths"] = "xx:xx Miliseconds",
|
||||
["seconds"] = "xx Seconds"
|
||||
}}
|
||||
|
||||
function Gladdy:FormatTimer(fontString, timeLeft, milibreakpoint, showSeconds)
|
||||
if timeLeft < 0 then
|
||||
fontString:SetText("")
|
||||
return
|
||||
end
|
||||
local time = timeLeft >= 0.0 and timeLeft or 0.0
|
||||
if Gladdy.db.timerFormat == Gladdy.TIMER_FORMAT.tenths and milibreakpoint then
|
||||
fontString:SetFormattedText("%.1f", time)
|
||||
else
|
||||
if time >= 60 then
|
||||
if showSeconds then
|
||||
fontString:SetText(floor(timeLeft / 60) .. ":" .. string_format("%02.f", floor(timeLeft - floor(timeLeft / 60) * 60)))
|
||||
else
|
||||
fontString:SetText(ceil(ceil(time / 60)) .. "m")
|
||||
end
|
||||
else
|
||||
fontString:SetFormattedText("%d", ceil(time))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Gladdy.defaults = {
|
||||
profile = {
|
||||
locked = false,
|
||||
hideBlizzard = "arena",
|
||||
x = 0,
|
||||
y = 0,
|
||||
growUp = false,
|
||||
growDirection = "BOTTOM",
|
||||
frameScale = 1,
|
||||
padding = 1,
|
||||
pixelPerfect = false,
|
||||
barWidth = 180,
|
||||
bottomMargin = 2,
|
||||
statusbarBorderOffset = 6,
|
||||
timerFormat = Gladdy.TIMER_FORMAT.tenths,
|
||||
backgroundColor = {r = 0, g = 0, b = 0, a = 0},
|
||||
newLayout = false,
|
||||
showMover = true,
|
||||
},
|
||||
}
|
||||
|
||||
@ -70,6 +104,10 @@ function Gladdy:option(params)
|
||||
return defaults
|
||||
end
|
||||
|
||||
function Gladdy:SetColor(option)
|
||||
return option.r, option.g, option.b, option.a
|
||||
end
|
||||
|
||||
function Gladdy:colorOption(params)
|
||||
local defaults = {
|
||||
get = function(info)
|
||||
@ -175,31 +213,80 @@ end
|
||||
function Gladdy:SetupOptions()
|
||||
self.options = {
|
||||
type = "group",
|
||||
name = "Gladdy",
|
||||
name = L["Gladdy"],
|
||||
plugins = {},
|
||||
childGroups = "tree",
|
||||
get = getOpt,
|
||||
set = setOpt,
|
||||
args = {
|
||||
lock = {
|
||||
order = 1,
|
||||
width = 0.7,
|
||||
name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"],
|
||||
desc = L["Toggle if frame can be moved"],
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.db.locked = not Gladdy.db.locked
|
||||
Gladdy:UpdateFrame()
|
||||
self.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
|
||||
end,
|
||||
},
|
||||
showMover = {
|
||||
order = 2,
|
||||
width = 0.7,
|
||||
name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"],
|
||||
desc = L["Toggle to show Mover Frames"],
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy.db.showMover = not Gladdy.db.showMover
|
||||
Gladdy:UpdateFrame()
|
||||
self.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
|
||||
end,
|
||||
},
|
||||
test = {
|
||||
order = 2,
|
||||
width = 0.7,
|
||||
name = L["Test"],
|
||||
desc = L["Show Test frames"],
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy:ToggleFrame(3)
|
||||
end,
|
||||
},
|
||||
hide = {
|
||||
order = 3,
|
||||
width = 0.7,
|
||||
name = L["Hide"],
|
||||
desc = L["Hide frames"],
|
||||
type = "execute",
|
||||
func = function()
|
||||
Gladdy:Reset()
|
||||
Gladdy:HideFrame()
|
||||
end,
|
||||
},
|
||||
reload = {
|
||||
order = 4,
|
||||
width = 0.7,
|
||||
name = L["ReloadUI"],
|
||||
desc = L["Reloads the UI"],
|
||||
type = "execute",
|
||||
func = function()
|
||||
ReloadUI()
|
||||
end,
|
||||
},
|
||||
version = {
|
||||
order = 5,
|
||||
width = 1,
|
||||
type = "description",
|
||||
name = " Gladdy v" .. Gladdy.version_num .. "-" .. Gladdy.version_releaseType
|
||||
},
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General"],
|
||||
desc = L["General settings"],
|
||||
childGroups = "tab",
|
||||
order = 1,
|
||||
order = 5,
|
||||
args = {
|
||||
locked = {
|
||||
type = "toggle",
|
||||
name = L["Lock frame"],
|
||||
desc = L["Toggle if frame can be moved"],
|
||||
order = 1,
|
||||
},
|
||||
growUp = {
|
||||
type = "toggle",
|
||||
name = L["Grow frame upwards"],
|
||||
desc = L["If enabled the frame will grow upwards instead of downwards"],
|
||||
order = 2,
|
||||
},
|
||||
growDirection = {
|
||||
type = "select",
|
||||
name = L["Grow Direction"],
|
||||
@ -237,29 +324,27 @@ function Gladdy:SetupOptions()
|
||||
name = L["Frame General"],
|
||||
order = 3,
|
||||
},
|
||||
pixelPerfect = {
|
||||
type = "toggle",
|
||||
name = L["Pixel Perfect Scale"],
|
||||
desc = L["Enables Pixel Perfect Scale - disables manual "].. L["Frame scale"],
|
||||
order = 4,
|
||||
},
|
||||
frameScale = {
|
||||
type = "range",
|
||||
name = L["Frame scale"],
|
||||
desc = L["Scale of the frame"],
|
||||
order = 4,
|
||||
disabled = function() return Gladdy.db.pixelPerfect end,
|
||||
order = 5,
|
||||
min = .1,
|
||||
max = 2,
|
||||
step = .1,
|
||||
},
|
||||
padding = {
|
||||
type = "range",
|
||||
name = L["Frame padding"],
|
||||
desc = L["Padding of the frame"],
|
||||
order = 5,
|
||||
min = 0,
|
||||
max = 20,
|
||||
step = 1,
|
||||
step = .01,
|
||||
},
|
||||
barWidth = {
|
||||
type = "range",
|
||||
name = L["Frame width"],
|
||||
desc = L["Width of the bars"],
|
||||
order = 6,
|
||||
order = 7,
|
||||
min = 10,
|
||||
max = 500,
|
||||
step = 5,
|
||||
@ -268,11 +353,20 @@ function Gladdy:SetupOptions()
|
||||
type = "range",
|
||||
name = L["Margin"],
|
||||
desc = L["Margin between each button"],
|
||||
order = 7,
|
||||
order = 8,
|
||||
min = -200,
|
||||
max = 200,
|
||||
step = 1,
|
||||
},
|
||||
backgroundColor = {
|
||||
type = "color",
|
||||
name = L["Background color"],
|
||||
desc = L["Background Color of the frame"],
|
||||
order = 9,
|
||||
hasAlpha = true,
|
||||
get = getColorOpt,
|
||||
set = setColorOpt,
|
||||
},
|
||||
}
|
||||
},
|
||||
cooldownGeneral = {
|
||||
@ -343,6 +437,12 @@ function Gladdy:SetupOptions()
|
||||
Gladdy:UpdateFrame()
|
||||
end
|
||||
},
|
||||
timerFormat = Gladdy:option({
|
||||
type = "select",
|
||||
name = L["Timer Format"],
|
||||
order = 11,
|
||||
values = Gladdy.TIMER_FORMAT.values
|
||||
})
|
||||
},
|
||||
},
|
||||
fontGeneral = {
|
||||
@ -658,19 +758,19 @@ function Gladdy:SetupOptions()
|
||||
},
|
||||
}
|
||||
|
||||
local order = 2
|
||||
local order = 6
|
||||
for k, v in pairsByKeys(self.modules) do
|
||||
self:SetupModule(k, v, order)
|
||||
order = order + 1
|
||||
end
|
||||
|
||||
local options = {
|
||||
name = "Gladdy",
|
||||
name = L["Gladdy"],
|
||||
type = "group",
|
||||
args = {
|
||||
load = {
|
||||
name = "Load configuration",
|
||||
desc = "Load configuration options",
|
||||
name = L["Load configuration"],
|
||||
desc = L["Load configuration options"],
|
||||
type = "execute",
|
||||
func = function()
|
||||
HideUIPanel(InterfaceOptionsFrame)
|
||||
@ -697,7 +797,7 @@ function Gladdy:GetAuras(auraType)
|
||||
ckeckAll = {
|
||||
order = 1,
|
||||
width = "0.7",
|
||||
name = "Check All",
|
||||
name = L["Check All"],
|
||||
type = "execute",
|
||||
func = function(info)
|
||||
if auraType == AURA_TYPE_DEBUFF then
|
||||
@ -714,7 +814,7 @@ function Gladdy:GetAuras(auraType)
|
||||
uncheckAll = {
|
||||
order = 2,
|
||||
width = "0.7",
|
||||
name = "Uncheck All",
|
||||
name = L["Uncheck All"],
|
||||
type = "execute",
|
||||
func = function(info)
|
||||
if auraType == AURA_TYPE_DEBUFF then
|
||||
|
142
README.md
142
README.md
@ -1,7 +1,10 @@
|
||||
# Gladdy - TBC
|
||||
|
||||
### The most powerful arena addon for WoW TBC 2.5.1
|
||||
## [v1.15-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v1.15-Beta/Gladdy_TBC-Classic_v1.15-Beta.zip)
|
||||
|
||||
---
|
||||
|
||||
## [v2.00-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.00-Release/Gladdy_TBC-Classic_v2.00-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
|
||||
|
||||
@ -49,6 +52,16 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
|
||||
<img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/sample2.jpg" align="right" width="48.5%">
|
||||
<img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/sample3.png" width="48.5%">
|
||||
|
||||
## Contributors
|
||||
|
||||
- [ManneN1](https://github.com/ManneN1)
|
||||
- [AlexFolland](https://github.com/AlexFolland)
|
||||
- [dfherr](https://github.com/dfherr)
|
||||
- [miraage](https://github.com/miraage)
|
||||
- [veiz](https://github.com/veiz)
|
||||
|
||||
Thank you!
|
||||
|
||||
## Special Thanks
|
||||
|
||||
- **miraage** - the origininal author of Gladdy! Your work set the foundation for this edit. Thanks!
|
||||
@ -59,9 +72,136 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
|
||||
- **Klimp** (thanks for all the suggestions and active feedback)
|
||||
- **the whole TBC addons 2.4.3 discord** (thanks for the support and great community, especially the MVPs)
|
||||
- **Hydra** (thanks for constructive feedback and suggestions)
|
||||
- **Xyz** (thanks for suggestions)
|
||||
|
||||
---
|
||||
|
||||
### Changes
|
||||
|
||||
### v2.00-Release
|
||||
|
||||
This is a packed release with new features and bugfixes. Most importantly, positioning of all elements has been redone with movable frames.
|
||||
Thank you for the great feedback and active contribution.
|
||||
|
||||
***Attention: Once you install this version it will drastically change your current profile! You can't go back to an earlier version. Either back up your WTF or export your Profile before updating!***
|
||||
|
||||
**Here is a list of all changes:**
|
||||
- **major release version set to v2**
|
||||
- this will mean, that export strings will still be backwards compatible, but not forward (Gladdy v2.x String can't be imported into Gladdy v1.x but vice versa)
|
||||
- **big overhaul of positioning elements added! All elements besides HP and PowerBar can be moved separately**
|
||||
- added Mover Frames for Auras, Interrupts, (De)Buffs, CastBar, ClassIcon, CombatIndicator, Cooldowns, DRs, Pets, Racial, Trinket
|
||||
- this will hopefully make configuration a lot easier
|
||||
- all visible elements' FrameStrata and FrameLevel can be configured (overlap frames how you want it)
|
||||
- **SpecDetection:**
|
||||
- fixed spec detection for Paladins
|
||||
- added following spells for better spec detection:
|
||||
- Expose Weakness (Survival Hunter)
|
||||
- Slow (Arcane Mage)
|
||||
- Improved Blink (Arcane Mage)
|
||||
- Vindication (Retribution Paladin)
|
||||
- Holy Shield (Protection Paladin)
|
||||
- Vampiric Embrace (Shadow Priest)
|
||||
- Blade Flurry (Combat Rogue)
|
||||
- Unleashed Rage (Enhancement Shaman)
|
||||
- Flurry (Enhancement Shaman)
|
||||
- Shamanistic Rage (Enhancement Shaman)
|
||||
- Healing Way (Restoration Shaman)
|
||||
- Totem of Wrath (Elemental Shaman)
|
||||
- Dark Pact (Affliction Warlock)
|
||||
- Conflagrate (Destruction Warlock)
|
||||
- Shield Slam (Protection Warrior)
|
||||
- **Cooldowns:**
|
||||
- added Fear Ward and Fear Ward Cooldown Detection in case it was used before arena
|
||||
- added following cooldowns:
|
||||
- Scare Beast (Hunter)
|
||||
- Feign Death (Hunter)
|
||||
- Viper Sting (Hunter)
|
||||
- Flare (Hunter)
|
||||
- Fear Ward (Priest)
|
||||
- Shadow Word: Death (Priest)
|
||||
- Evocation (Mage)
|
||||
- Grounding Totem (Shaman)
|
||||
- Spell Lock (Warlock)
|
||||
- Devour Magic (Warlock)
|
||||
- Intercept (Warrior)
|
||||
- **Auras/Interrupts:**
|
||||
- can now be detached from ClassIcon and positioned/scaled anywhere separately
|
||||
- added Auras:
|
||||
- Scare Beast (Hunter)
|
||||
- Fear Ward (Priest)
|
||||
- **Shadowsight:**
|
||||
- reset timer when buff was taken
|
||||
- add a configurable 2nd timer or show one timer with the closest CD
|
||||
- **CastBar Icon can be enabled/disabled**
|
||||
- **Trinket solid color option added**
|
||||
- color for Trinket on/off CD can be configured (red/green by default)
|
||||
- **fixed some DR-categories** (Hibernate / Chastice / Dragonsbreath / ImpConcussiveShot / Counterattack)
|
||||
- **Pixel Perfect option added** (makes your Gladdy Frames pixel perfect - no more weird scaling interferences)
|
||||
- **Pets can be grouped** (not perfect yet, but a first step)
|
||||
- **added DR-Level Text** (thanks https://github.com/ManneN1)
|
||||
- **added zhCN Locale** (thanks https://github.com/veiz)
|
||||
- **ClassIcon can be disabled**
|
||||
- **add interrupt announcement**
|
||||
- **detect SpellLock and Devour Magic cooldowns properly**
|
||||
- **minor fixes:**
|
||||
- fixed reloading during arena to properly show all frames
|
||||
- fix grow up positioning
|
||||
|
||||
### v1.22-Release
|
||||
- fixed import for some localizations not working
|
||||
- added cooldown number alpha configurations for Auras, BuffsDebuffs, Cooldowns, Diminishings, Racial & Trinket
|
||||
- grounding totem effect fix
|
||||
- fixed some buffs/debuffs not being present in BuffsDebuffs
|
||||
|
||||
### v1.21-Release
|
||||
- fixed error when hiding blizzard frames ArenaEnemyFrames related to ElvUI
|
||||
- added Pummel cooldown
|
||||
|
||||
### 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
|
||||
- fix gladdy frames not showing v2
|
||||
- minor bug fixes
|
||||
|
||||
### v1.18-Beta
|
||||
- castbar font now working properly
|
||||
|
||||
### v1.17-Beta
|
||||
- option TimerFormat added (seconds or seconds + milliseconds) (General > Cooldown General > Timer Format)
|
||||
- hide blizzard arena frames without cvars
|
||||
- fix Gladdy bugging out on arena join when in combat
|
||||
- fix some TotemPlates issues
|
||||
- fix Feign Death causing to reset DR and Aura tracking
|
||||
- ArenaX option in Healthbar module now only shows the number
|
||||
- add background for all frames (General > Frame General > Background Color)
|
||||
- add evasion and banish to Aura
|
||||
- add MSBT to Announcement module
|
||||
- Shadowsight timer can be locked now
|
||||
- add "All" modifier to Clicks module
|
||||
- updated testmode for BuffsDebuffs (show only from enabled set)
|
||||
- updated Klimp's profile
|
||||
- added a new Profile in XiconProfiles -> Rukk1
|
||||
|
||||
### v1.16-Beta
|
||||
- unit gray in stealth when rangecheck module disabled
|
||||
|
||||
### v1.15-Beta
|
||||
- hotfix added entangling roots nature's grasp
|
||||
|
||||
|
Reference in New Issue
Block a user