Compare commits

..

1 Commits

Author SHA1 Message Date
Sumsebrum
81c483db6d github-actions 2022-08-07 04:43:37 +02:00
66 changed files with 1278 additions and 1431 deletions

48
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,48 @@
# description of this workflow, can be anything you want
name: Package and release
# we need to let GitHub know _when_ we want to release, typically only when we create a new tag.
# this will target only tags, and not all pushes to the master branch.
# this part can be heavily customized to your liking, like targeting only tags that match a certain word,
# other branches or even pullrequests.
on:
push:
tags:
- '**'
-
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# a workflow is built up as jobs, and within these jobs are steps
jobs:
# "release" is a job, you can name it anything you want
release:
# we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet
runs-on: ubuntu-latest
# specify the environment variables used by the packager, matching the secrets from the project on GitHub
env:
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # "GITHUB_TOKEN" is a secret always provided to the workflow
# for your own token, the name cannot start with "GITHUB_"
# "steps" holds a list of all the steps needed to package and release our AddOn
steps:
# we first have to clone the AddOn project, this is a required step
- name: Clone project
uses: actions/checkout@v3
with:
fetch-depth: 0 # gets git history for changelogs
# once cloned, we just run the GitHub Action for the packager project
- name: Package and release
uses: BigWigsMods/packager@v2
# another example where we supply additional arguments, this example is specifically to release
# for the Burning Crusade Classic version of the game and doesn't upload to WoWInterface
- name: Package and release for Burning Crusade Classic
uses: BigWigsMods/packager@v2
with:
args: -g bcc -w 0

1
.gitignore vendored
View File

@ -6,6 +6,5 @@ BuffLib
Ace-Libs Ace-Libs
Images_Raw Images_Raw
Gladdy_old Gladdy_old
DoNotCommit
untracked untracked
Gladdy_TW Gladdy_TW

10
.pkgmeta Normal file
View File

@ -0,0 +1,10 @@
package-as: Gladdy
enable-nolib-creation: no
embedded-libraries:
- drlist-1-0
manual-changelog:
filename: CHANGELOG.md
markup-type: markdown

24
CHANGELOG.md Normal file
View File

@ -0,0 +1,24 @@
### v2.20-Beta
- **Wrath** & **BCC** support
- different auras/DRs/Cooldowns/Buffs per expansion
- **Zoomed Icon** options added for all modules
- **Cooldowns**
- desaturate icon on cd added
- alpha on cd added
- glow on CD active added
- **Diminishing**
- replaced DRData with DRList (your dr-categories options will be reset like "force icon" and what is enabled)
- zoomed icons
- changed DR-tracking behaviour (DR will show once aura is applied and start CD once aura fades)
- **Trinket & Racial**
- in Wrath racials like wotf share CD with Trinket and vice versa
- fixed some potential API bug in Trinket use detection
- **ArenaCountdown**
- uses C_Timer now
- **Import/Export of Profiles**
- profiles should now be able to import/export between BCC and Wrath
- auras, cooldowns, DRs and buffs/debuffs are ignored
- positioning, style etc will be transferred between expansions
- proper Feign Death detection
- fix detect pet abilities CD like Spell Lock
- minor bugfixes

View File

@ -626,7 +626,7 @@ local importantAuras = {
spellID = 24259, spellID = 24259,
}, },
-- Unstable Affliction Silence -- Unstable Affliction Silence
[select(1, GetSpellInfo(31117)) .. " Silence"] = { -- GetSpellInfo returns "Unstable Affliction" ["Unstable Affliction Silence"] = { -- GetSpellInfo returns "Unstable Affliction"
track = AURA_TYPE_DEBUFF, track = AURA_TYPE_DEBUFF,
altName = select(1, GetSpellInfo(31117)) .. " Silence", altName = select(1, GetSpellInfo(31117)) .. " Silence",
duration = 5, duration = 5,
@ -759,9 +759,9 @@ local importantAuras = {
}, },
-- Shadowsight Buff -- Shadowsight Buff
[GetSpellInfo(34709)] = { [GetSpellInfo(34709)] = {
track = AURA_TYPE_DEBUFF, track = AURA_TYPE_BUFF,
duration = 15, duration = 15,
priority = 9, priority = 15,
magic = true, magic = true,
spellID = 34709, spellID = 34709,
}, },
@ -978,7 +978,7 @@ local cooldownList = {
icon = select(3, GetSpellInfo(14311)), icon = select(3, GetSpellInfo(14311)),
}, },
[34490] = { cd = 20, spec = L["Marksmanship"], }, -- Silencing Shot [34490] = { cd = 20, spec = L["Marksmanship"], }, -- Silencing Shot
[19386] = { cd = 120, spec = L["Survival"], }, -- Wyvern Sting [19386] = { cd = 60, spec = L["Survival"], }, -- Wyvern Sting
[19577] = { cd = 60, spec = L["Beast Mastery"], }, -- Intimidation [19577] = { cd = 60, spec = L["Beast Mastery"], }, -- Intimidation
[34471] = { cd = 120, spec = L["Beast Mastery"], }, -- The Beast Within [34471] = { cd = 120, spec = L["Beast Mastery"], }, -- The Beast Within
[5384] = 30, -- Feign Death [5384] = 30, -- Feign Death
@ -1121,55 +1121,333 @@ end
local totemData = { local totemData = {
-- Fire -- Fire
[string_lower("Searing Totem")] = {id = 3599,texture = select(3, GetSpellInfo(3599)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Flametongue Totem")] = {id = 8227,texture = select(3, GetSpellInfo(8227)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Magma Totem")] = {id = 8190,texture = select(3, GetSpellInfo(8190)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
[string_lower("Fire Nova Totem")] = {id = 1535,texture = select(3, GetSpellInfo(1535)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = { cd = 4, once = true }},
[string_lower("Totem of Wrath")] = {id = 30706,texture = select(3, GetSpellInfo(30706)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Fire Elemental Totem")] = {id = 32982,texture = select(3, GetSpellInfo(32982)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Frost Resistance Totem")] = {id = 8181,texture = select(3, GetSpellInfo(8181)), color = {r = 0, g = 0, b = 0, a = 1}},
-- Water -- Water
[string_lower("Fire Resistance Totem")] = {id = 8184,texture = select(3, GetSpellInfo(8184)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Poison Cleansing Totem")] = {id = 8166,texture = select(3, GetSpellInfo(8166)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 5}, [string_lower("Poison Cleansing Totem")] = {id = 8166,texture = select(3, GetSpellInfo(8166)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 5},
[string_lower("Disease Cleansing Totem")] = {id = 8170,texture = select(3, GetSpellInfo(8170)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 5},
[string_lower("Healing Stream Totem")] = {id = 5394,texture = select(3, GetSpellInfo(5394)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
[string_lower("Mana Tide Totem")] = {id = 16190,texture = select(3, GetSpellInfo(16190)), color = {r = 0.078, g = 0.9, b = 0.16, a = 1}},
[string_lower("Mana Spring Totem")] = {id = 5675,texture = select(3, GetSpellInfo(5675)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2}, [string_lower("Mana Spring Totem")] = {id = 5675,texture = select(3, GetSpellInfo(5675)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
-- Earth -- Earth
[string_lower("Earthbind Totem")] = {id = 2484,texture = select(3, GetSpellInfo(2484)), color = {r = 0.5, g = 0.5, b = 0.5, a = 1}, pulse = 3},
[string_lower("Stoneclaw Totem")] = {id = 5730,texture = select(3, GetSpellInfo(5730)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
[string_lower("Stoneskin Totem")] = {id = 8071,texture = select(3, GetSpellInfo(8071)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Strength of Earth Totem")] = {id = 8075,texture = select(3, GetSpellInfo(8075)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Earth Elemental Totem")] = {id = 33663,texture = select(3, GetSpellInfo(33663)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Tremor Totem")] = {id = 8143,texture = select(3, GetSpellInfo(8143)), color = {r = 1, g = 0.9, b = 0.1, a = 1}, pulse = 3},
-- Air -- Air
[string_lower("Grounding Totem")] = {id = 8177,texture = select(3, GetSpellInfo(8177)), color = {r = 0, g = 0.53, b = 0.92, a = 1}},
[string_lower("Grace of Air Totem")] = {id = 8835,texture = select(3, GetSpellInfo(8835)), color = {r = 0, g = 0, b = 0, a = 1}}, [string_lower("Grace of Air Totem")] = {id = 8835,texture = select(3, GetSpellInfo(8835)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Nature Resistance Totem")] = {id = 10595,texture = select(3, GetSpellInfo(10595)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Windfury Totem")] = {id = 8512,texture = select(3, GetSpellInfo(8512)), color = {r = 0.96, g = 0, b = 0.07, a = 1}},
[string_lower("Sentry Totem")] = {id = 6495, texture = select(3, GetSpellInfo(6495)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Windwall Totem")] = {id = 15107,texture = select(3, GetSpellInfo(15107)), color = {r = 0, g = 0, b = 0, a = 1}}, [string_lower("Windwall Totem")] = {id = 15107,texture = select(3, GetSpellInfo(15107)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Wrath of Air Totem")] = {id = 3738,texture = select(3, GetSpellInfo(3738)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Tranquil Air Totem")] = {id = 25908,texture = select(3, GetSpellInfo(25908)), color = {r = 0, g = 0, b = 0, a = 1}}, [string_lower("Tranquil Air Totem")] = {id = 25908,texture = select(3, GetSpellInfo(25908)), color = {r = 0, g = 0, b = 0, a = 1}},
} }
local totemSpellIdToPulse = { local totemSpellIdToPulse = {
[GetSpellInfo(totemData[string_lower("Earthbind Totem")].id)] = totemData[string_lower("Earthbind Totem")].pulse,
[2484] = totemData[string_lower("Earthbind Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Tremor Totem")].id)] = totemData[string_lower("Tremor Totem")].pulse,
[8143] = totemData[string_lower("Tremor Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Poison Cleansing Totem")].id)] = totemData[string_lower("Poison Cleansing Totem")].pulse, [GetSpellInfo(totemData[string_lower("Poison Cleansing Totem")].id)] = totemData[string_lower("Poison Cleansing Totem")].pulse,
[8166] = totemData[string_lower("Poison Cleansing Totem")].pulse, [8166] = totemData[string_lower("Poison Cleansing Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Disease Cleansing Totem")].id)] = totemData[string_lower("Disease Cleansing Totem")].pulse,
[8170] = totemData[string_lower("Disease Cleansing Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Fire Nova Totem")].id)] = totemData[string_lower("Fire Nova Totem")].pulse,
[1535] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 1
[8498] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 2
[8499] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 3
[11314] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 4
[11315] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 5
[25546] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 6
[25547] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 7
[GetSpellInfo(totemData[string_lower("Magma Totem")].id)] = totemData[string_lower("Magma Totem")].pulse,
[8190] = totemData[string_lower("Magma Totem")].pulse, -- Rank 1
[10585] = totemData[string_lower("Magma Totem")].pulse, -- Rank 2
[10586] = totemData[string_lower("Magma Totem")].pulse, -- Rank 3
[10587] = totemData[string_lower("Magma Totem")].pulse, -- Rank 4
[25552] = totemData[string_lower("Magma Totem")].pulse, -- Rank 5
[GetSpellInfo(totemData[string_lower("Healing Stream Totem")].id)] = totemData[string_lower("Healing Stream Totem")].pulse,
[5394] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 1
[6375] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 2
[6377] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 3
[10462] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 4
[10463] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 5
[25567] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 6
[GetSpellInfo(totemData[string_lower("Mana Spring Totem")].id)] = totemData[string_lower("Mana Spring Totem")].pulse, [GetSpellInfo(totemData[string_lower("Mana Spring Totem")].id)] = totemData[string_lower("Mana Spring Totem")].pulse,
[5675] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 1 [5675] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 1
[10495] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 2 [10495] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 2
[10496] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 3 [10496] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 3
[10497] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 4 [10497] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 4
[25570] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 5 [25570] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 5
[58771] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 6 [GetSpellInfo(totemData[string_lower("Stoneclaw Totem")].id)] = totemData[string_lower("Stoneclaw Totem")].pulse,
[58773] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 7 [5730] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 1
[58774] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 8 [6390] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 2
[6391] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 3
[6392] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 4
[10427] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 5
[10428] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 6
[25525] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 7
} }
local totemNpcIdsToTotemData = { local totemNpcIdsToTotemData = {
--fire --fire
[2523] = totemData[string_lower("Searing Totem")],
[3902] = totemData[string_lower("Searing Totem")],
[3903] = totemData[string_lower("Searing Totem")],
[3904] = totemData[string_lower("Searing Totem")],
[7400] = totemData[string_lower("Searing Totem")],
[7402] = totemData[string_lower("Searing Totem")],
[15480] = totemData[string_lower("Searing Totem")],
[31162] = totemData[string_lower("Searing Totem")],
[31164] = totemData[string_lower("Searing Totem")],
[31165] = totemData[string_lower("Searing Totem")],
[21995] = totemData[string_lower("Searing Totem")],
[22209] = totemData[string_lower("Searing Totem")],
[22895] = totemData[string_lower("Searing Totem")],
[22896] = totemData[string_lower("Searing Totem")],
[34687] = totemData[string_lower("Searing Totem")],
[36532] = totemData[string_lower("Searing Totem")],
[43423] = totemData[string_lower("Searing Totem")],
[67380] = totemData[string_lower("Searing Totem")],
[73477] = totemData[string_lower("Searing Totem")],
[79238] = totemData[string_lower("Searing Totem")],
[22896] = totemData[string_lower("Searing Totem")],
[84519] = totemData[string_lower("Searing Totem")],
[110730] = totemData[string_lower("Searing Totem")],
[132178] = totemData[string_lower("Searing Totem")],
[9637] = totemData[string_lower("Searing Totem")],
[5950] = totemData[string_lower("Flametongue Totem")],
[6012] = totemData[string_lower("Flametongue Totem")],
[7423] = totemData[string_lower("Flametongue Totem")],
[10557] = totemData[string_lower("Flametongue Totem")],
[15485] = totemData[string_lower("Flametongue Totem")],
[31132] = totemData[string_lower("Flametongue Totem")],
[31133] = totemData[string_lower("Flametongue Totem")],
[31158] = totemData[string_lower("Flametongue Totem")],
[42605] = totemData[string_lower("Flametongue Totem")],
[5929] = totemData[string_lower("Magma Totem")],
[7464] = totemData[string_lower("Magma Totem")],
[7465] = totemData[string_lower("Magma Totem")],
[7466] = totemData[string_lower("Magma Totem")],
[15484] = totemData[string_lower("Magma Totem")],
[31166] = totemData[string_lower("Magma Totem")],
[31167] = totemData[string_lower("Magma Totem")],
[32887] = totemData[string_lower("Magma Totem")],
[42211] = totemData[string_lower("Magma Totem")],
[71335] = totemData[string_lower("Magma Totem")],
[71925] = totemData[string_lower("Magma Totem")],
[73085] = totemData[string_lower("Magma Totem")],
[73093] = totemData[string_lower("Magma Totem")],
[73268] = totemData[string_lower("Magma Totem")],
[88971] = totemData[string_lower("Magma Totem")],
[97369] = totemData[string_lower("Magma Totem")],
[98676] = totemData[string_lower("Magma Totem")],
[5879] = totemData[string_lower("Fire Nova Totem")],
[6110] = totemData[string_lower("Fire Nova Totem")],
[6111] = totemData[string_lower("Fire Nova Totem")],
[7844] = totemData[string_lower("Fire Nova Totem")],
[7845] = totemData[string_lower("Fire Nova Totem")],
[14662] = totemData[string_lower("Fire Nova Totem")],
[15482] = totemData[string_lower("Fire Nova Totem")],
[15483] = totemData[string_lower("Fire Nova Totem")],
[24320] = totemData[string_lower("Fire Nova Totem")],
[32775] = totemData[string_lower("Fire Nova Totem")],
[32776] = totemData[string_lower("Fire Nova Totem")],
[17539] = totemData[string_lower("Totem of Wrath")],
[22970] = totemData[string_lower("Totem of Wrath")],
[22971] = totemData[string_lower("Totem of Wrath")],
[30652] = totemData[string_lower("Totem of Wrath")],
[30653] = totemData[string_lower("Totem of Wrath")],
[30654] = totemData[string_lower("Totem of Wrath")],
[15439] = totemData[string_lower("Fire Elemental Totem")],
[40830] = totemData[string_lower("Fire Elemental Totem")],
[41337] = totemData[string_lower("Fire Elemental Totem")],
[41346] = totemData[string_lower("Fire Elemental Totem")],
[72301] = totemData[string_lower("Fire Elemental Totem")],
[5926] = totemData[string_lower("Frost Resistance Totem")],
[7412] = totemData[string_lower("Frost Resistance Totem")],
[7413] = totemData[string_lower("Frost Resistance Totem")],
[15486] = totemData[string_lower("Frost Resistance Totem")],
[31171] = totemData[string_lower("Frost Resistance Totem")],
[31172] = totemData[string_lower("Frost Resistance Totem")],
-- Water -- Water
[5927] = totemData[string_lower("Fire Resistance Totem")],
[7424] = totemData[string_lower("Fire Resistance Totem")],
[7425] = totemData[string_lower("Fire Resistance Totem")],
[15487] = totemData[string_lower("Fire Resistance Totem")],
[31169] = totemData[string_lower("Fire Resistance Totem")],
[31170] = totemData[string_lower("Fire Resistance Totem")],
[5923] = totemData[string_lower("Poison Cleansing Totem")], [5923] = totemData[string_lower("Poison Cleansing Totem")],
[22487] = totemData[string_lower("Poison Cleansing Totem")], [22487] = totemData[string_lower("Poison Cleansing Totem")],
[5924] = totemData[string_lower("Disease Cleansing Totem")],
[3527] = totemData[string_lower("Healing Stream Totem")],
[3906] = totemData[string_lower("Healing Stream Totem")],
[3907] = totemData[string_lower("Healing Stream Totem")],
[3908] = totemData[string_lower("Healing Stream Totem")],
[3909] = totemData[string_lower("Healing Stream Totem")],
[14664] = totemData[string_lower("Healing Stream Totem")],
[15488] = totemData[string_lower("Healing Stream Totem")],
[18235] = totemData[string_lower("Healing Stream Totem")],
[31181] = totemData[string_lower("Healing Stream Totem")],
[31182] = totemData[string_lower("Healing Stream Totem")],
[31185] = totemData[string_lower("Healing Stream Totem")],
[34686] = totemData[string_lower("Healing Stream Totem")],
[36542] = totemData[string_lower("Healing Stream Totem")],
[37810] = totemData[string_lower("Healing Stream Totem")],
[38428] = totemData[string_lower("Healing Stream Totem")],
[47077] = totemData[string_lower("Healing Stream Totem")],
[72309] = totemData[string_lower("Healing Stream Totem")],
[72457] = totemData[string_lower("Healing Stream Totem")],
[73890] = totemData[string_lower("Healing Stream Totem")],
[74433] = totemData[string_lower("Healing Stream Totem")],
[97508] = totemData[string_lower("Healing Stream Totem")],
[112567] = totemData[string_lower("Healing Stream Totem")],
[120357] = totemData[string_lower("Healing Stream Totem")],
[128539] = totemData[string_lower("Healing Stream Totem")],
[132049] = totemData[string_lower("Healing Stream Totem")],
[10467] = totemData[string_lower("Mana Tide Totem")],
[11100] = totemData[string_lower("Mana Tide Totem")],
[11101] = totemData[string_lower("Mana Tide Totem")],
[17061] = totemData[string_lower("Mana Tide Totem")],
[3573] = totemData[string_lower("Mana Spring Totem")],
[7414] = totemData[string_lower("Mana Spring Totem")],
[7415] = totemData[string_lower("Mana Spring Totem")],
[7416] = totemData[string_lower("Mana Spring Totem")],
[15304] = totemData[string_lower("Mana Spring Totem")],
[15489] = totemData[string_lower("Mana Spring Totem")],
[31186] = totemData[string_lower("Mana Spring Totem")],
[31189] = totemData[string_lower("Mana Spring Totem")],
[31190] = totemData[string_lower("Mana Spring Totem")],
-- Earth -- Earth
[2630] = totemData[string_lower("Earthbind Totem")],
[22486] = totemData[string_lower("Earthbind Totem")],
[40233] = totemData[string_lower("Earthbind Totem")],
[74737] = totemData[string_lower("Earthbind Totem")],
[79155] = totemData[string_lower("Earthbind Totem")],
[3579] = totemData[string_lower("Stoneclaw Totem")],
[3911] = totemData[string_lower("Stoneclaw Totem")],
[3912] = totemData[string_lower("Stoneclaw Totem")],
[3913] = totemData[string_lower("Stoneclaw Totem")],
[7398] = totemData[string_lower("Stoneclaw Totem")],
[7399] = totemData[string_lower("Stoneclaw Totem")],
[14870] = totemData[string_lower("Stoneclaw Totem")],
[15478] = totemData[string_lower("Stoneclaw Totem")],
[31120] = totemData[string_lower("Stoneclaw Totem")],
[31121] = totemData[string_lower("Stoneclaw Totem")],
[31122] = totemData[string_lower("Stoneclaw Totem")],
[40258] = totemData[string_lower("Stoneclaw Totem")],
[102402] = totemData[string_lower("Stoneclaw Totem")],
[5873] = totemData[string_lower("Stoneskin Totem")],
[5919] = totemData[string_lower("Stoneskin Totem")],
[5920] = totemData[string_lower("Stoneskin Totem")],
[7366] = totemData[string_lower("Stoneskin Totem")],
[7367] = totemData[string_lower("Stoneskin Totem")],
[7368] = totemData[string_lower("Stoneskin Totem")],
[14663] = totemData[string_lower("Stoneskin Totem")],
[15470] = totemData[string_lower("Stoneskin Totem")],
[15474] = totemData[string_lower("Stoneskin Totem")],
[18177] = totemData[string_lower("Stoneskin Totem")],
[21994] = totemData[string_lower("Stoneskin Totem")],
[31175] = totemData[string_lower("Stoneskin Totem")],
[31176] = totemData[string_lower("Stoneskin Totem")],
[36550] = totemData[string_lower("Stoneskin Totem")],
[40267] = totemData[string_lower("Stoneskin Totem")],
[41967] = totemData[string_lower("Stoneskin Totem")],
[5874] = totemData[string_lower("Strength of Earth Totem")],
[5921] = totemData[string_lower("Strength of Earth Totem")],
[5922] = totemData[string_lower("Strength of Earth Totem")],
[7403] = totemData[string_lower("Strength of Earth Totem")],
[15464] = totemData[string_lower("Strength of Earth Totem")],
[15479] = totemData[string_lower("Strength of Earth Totem")],
[21992] = totemData[string_lower("Strength of Earth Totem")],
[30647] = totemData[string_lower("Strength of Earth Totem")],
[31129] = totemData[string_lower("Strength of Earth Totem")],
[40266] = totemData[string_lower("Strength of Earth Totem")],
[15430] = totemData[string_lower("Earth Elemental Totem")],
[24649] = totemData[string_lower("Earth Elemental Totem")],
[39387] = totemData[string_lower("Earth Elemental Totem")],
[40247] = totemData[string_lower("Earth Elemental Totem")],
[72307] = totemData[string_lower("Earth Elemental Totem")],
[5913] = totemData[string_lower("Tremor Totem")],
[41938] = totemData[string_lower("Tremor Totem")],
[41939] = totemData[string_lower("Tremor Totem")],
-- Air -- Air
[5925] = totemData[string_lower("Grounding Totem")],
[128537] = totemData[string_lower("Grounding Totem")],
[136251] = totemData[string_lower("Grounding Totem")],
[7486] = totemData[string_lower("Grace of Air Totem")], [7486] = totemData[string_lower("Grace of Air Totem")],
[7487] = totemData[string_lower("Grace of Air Totem")], [7487] = totemData[string_lower("Grace of Air Totem")],
[15463] = totemData[string_lower("Grace of Air Totem")], [15463] = totemData[string_lower("Grace of Air Totem")],
[7467] = totemData[string_lower("Nature Resistance Totem")],
[7468] = totemData[string_lower("Nature Resistance Totem")],
[7469] = totemData[string_lower("Nature Resistance Totem")],
[15490] = totemData[string_lower("Nature Resistance Totem")],
[31173] = totemData[string_lower("Nature Resistance Totem")],
[31174] = totemData[string_lower("Nature Resistance Totem")],
[6112] = totemData[string_lower("Windfury Totem")],
[7483] = totemData[string_lower("Windfury Totem")],
[7484] = totemData[string_lower("Windfury Totem")],
[14666] = totemData[string_lower("Windfury Totem")],
[15496] = totemData[string_lower("Windfury Totem")],
[15497] = totemData[string_lower("Windfury Totem")],
[22897] = totemData[string_lower("Windfury Totem")],
[41940] = totemData[string_lower("Windfury Totem")],
[41941] = totemData[string_lower("Windfury Totem")],
[80703] = totemData[string_lower("Windfury Totem")],
[105690] = totemData[string_lower("Windfury Totem")],
[133684] = totemData[string_lower("Windfury Totem")],
[3968] = totemData[string_lower("Sentry Totem")],
[28938] = totemData[string_lower("Sentry Totem")],
[40187] = totemData[string_lower("Sentry Totem")],
[69505] = totemData[string_lower("Sentry Totem")],
[70413] = totemData[string_lower("Sentry Totem")],
[71145] = totemData[string_lower("Sentry Totem")],
[147410] = totemData[string_lower("Sentry Totem")],
[9687] = totemData[string_lower("Windwall Totem")], [9687] = totemData[string_lower("Windwall Totem")],
[9688] = totemData[string_lower("Windwall Totem")], [9688] = totemData[string_lower("Windwall Totem")],
[9689] = totemData[string_lower("Windwall Totem")], [9689] = totemData[string_lower("Windwall Totem")],
[15492] = totemData[string_lower("Windwall Totem")], [15492] = totemData[string_lower("Windwall Totem")],
[15447] = totemData[string_lower("Wrath of Air Totem")],
[36556] = totemData[string_lower("Wrath of Air Totem")],
[15803] = totemData[string_lower("Tranquil Air Totem")], [15803] = totemData[string_lower("Tranquil Air Totem")],
} }
local totemDataShared, totemNpcIdsToTotemDataShared, totemSpellIdToPulseShared = Gladdy:GetSharedTotemData()
Gladdy:AddEntriesToTable(totemData, totemDataShared)
Gladdy:AddEntriesToTable(totemNpcIdsToTotemData, totemNpcIdsToTotemDataShared)
Gladdy:AddEntriesToTable(totemSpellIdToPulse, totemSpellIdToPulseShared)
function Gladdy:GetTotemData() function Gladdy:GetTotemData()
return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse
end end

View File

@ -85,17 +85,14 @@ local specBuffs = {
-- HUNTER -- HUNTER
[GetSpellInfo(20895)] = L["Beast Mastery"], -- Spirit Bond [GetSpellInfo(20895)] = L["Beast Mastery"], -- Spirit Bond
[GetSpellInfo(34471)] = L["Beast Mastery"], -- The Beast Within [GetSpellInfo(34471)] = L["Beast Mastery"], -- The Beast Within
[GetSpellInfo(75447)] = L["Beast Mastery"], -- Ferocious Inspiration
[GetSpellInfo(19506)] = L["Marksmanship"], -- Trueshot Aura [GetSpellInfo(19506)] = L["Marksmanship"], -- Trueshot Aura
[GetSpellInfo(64420)] = L["Survival"], -- Sniper Training [GetSpellInfo(64420)] = L["Survival"], -- Sniper Training
-- DRUID -- DRUID
[GetSpellInfo(24932)] = L["Feral"], -- Leader of the Pack [GetSpellInfo(24932)] = L["Feral"], -- Leader of the Pack
[GetSpellInfo(16975)] = L["Feral"], -- Predatory Strikes [GetSpellInfo(16975)] = L["Feral"], -- Predatory Strikes
[GetSpellInfo(50334) .. " Feral"] = L["Feral"], -- Berserk [GetSpellInfo(50334)] = L["Feral"], -- Berserk
[GetSpellInfo(24907)] = L["Balance"], -- Moonkin Aura [GetSpellInfo(24907)] = L["Balance"], -- Moonkin Aura
[GetSpellInfo(24858)] = L["Balance"], -- Moonkin Form [GetSpellInfo(24858)] = L["Balance"], -- Moonkin Form
[GetSpellInfo(48504)] = L["Restoration"], -- Living Seed
[GetSpellInfo(45283)] = L["Restoration"], -- Natural Perfection
[GetSpellInfo(53251)] = L["Restoration"], -- Wild Growth [GetSpellInfo(53251)] = L["Restoration"], -- Wild Growth
[GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness [GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
[GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life [GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life
@ -153,7 +150,6 @@ local specSpells = {
[GetSpellInfo(47843)] = L["Affliction"], -- Unstable Affliction [GetSpellInfo(47843)] = L["Affliction"], -- Unstable Affliction
[GetSpellInfo(59672)] = L["Demonology"], -- Metamorphosis [GetSpellInfo(59672)] = L["Demonology"], -- Metamorphosis
[GetSpellInfo(47193)] = L["Demonology"], -- Demonic Empowerment [GetSpellInfo(47193)] = L["Demonology"], -- Demonic Empowerment
[GetSpellInfo(47996) .. " Felguard"] = L["Demonology"], -- Intercept Felguard
[GetSpellInfo(59172)] = L["Destruction"], -- Chaos Bolt [GetSpellInfo(59172)] = L["Destruction"], -- Chaos Bolt
[GetSpellInfo(47847)] = L["Destruction"], -- Shadowfury [GetSpellInfo(47847)] = L["Destruction"], -- Shadowfury
-- SHAMAN -- SHAMAN
@ -176,7 +172,7 @@ local specSpells = {
[GetSpellInfo(24858)] = L["Balance"], -- Moonkin Form [GetSpellInfo(24858)] = L["Balance"], -- Moonkin Form
[GetSpellInfo(48566)] = L["Feral"], -- Mangle (Cat) [GetSpellInfo(48566)] = L["Feral"], -- Mangle (Cat)
[GetSpellInfo(48564)] = L["Feral"], -- Mangle (Bear) [GetSpellInfo(48564)] = L["Feral"], -- Mangle (Bear)
[GetSpellInfo(50334) .. " Feral"] = L["Feral"], -- Berserk [GetSpellInfo(50334)] = L["Feral"], -- Berserk
[GetSpellInfo(18562)] = L["Restoration"], -- Swiftmend [GetSpellInfo(18562)] = L["Restoration"], -- Swiftmend
[GetSpellInfo(17116)] = L["Restoration"], -- Nature's Swiftness [GetSpellInfo(17116)] = L["Restoration"], -- Nature's Swiftness
[GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life [GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life
@ -490,7 +486,7 @@ local importantAuras = {
priority = 20, priority = 20,
spellID = 63529, spellID = 63529,
}, },
[select(1, GetSpellInfo(31117)) .. " Silence"] = { -- Unstable Affliction Silence (GetSpellInfo returns "Unstable Affliction") ["Unstable Affliction Silence"] = { -- Unstable Affliction Silence (GetSpellInfo returns "Unstable Affliction")
track = AURA_TYPE_DEBUFF, track = AURA_TYPE_DEBUFF,
altName = select(1, GetSpellInfo(31117)) .. " Silence", altName = select(1, GetSpellInfo(31117)) .. " Silence",
priority = 20, priority = 20,
@ -587,7 +583,7 @@ local importantAuras = {
}, },
[GetSpellInfo(54428)] = { -- Divine Plea [GetSpellInfo(54428)] = { -- Divine Plea
track = AURA_TYPE_BUFF, track = AURA_TYPE_BUFF,
priority = 15, priority = 20,
spellID = 54428, spellID = 54428,
}, },
[GetSpellInfo(31821)] = { -- Aura mastery [GetSpellInfo(31821)] = { -- Aura mastery
@ -615,16 +611,11 @@ local importantAuras = {
priority = 9, priority = 9,
spellID = 6346, spellID = 6346,
}, },
[GetSpellInfo(50334) .. " Feral"] = {-- Berserk [GetSpellInfo(50334)] = {-- Berserk
track = AURA_TYPE_BUFF, track = AURA_TYPE_BUFF,
priority = 20, priority = 20,
spellID = 50334, spellID = 50334,
}, },
[GetSpellInfo(46924)] = { -- Bladestorm
track = AURA_TYPE_BUFF,
priority = 20,
spellID = 46924,
},
--- Turtling abilities --- Turtling abilities
[GetSpellInfo(871)] = { -- Shield Wall [GetSpellInfo(871)] = { -- Shield Wall
@ -684,22 +675,12 @@ local importantAuras = {
priority = 30, priority = 30,
spellID = 1719, spellID = 1719,
}, },
[GetSpellInfo(48792)] = { -- Icebound Fortitude
track = AURA_TYPE_BUFF,
priority = 15,
spellID = 48792,
},
[GetSpellInfo(49039)] = { -- Lichborne
track = AURA_TYPE_BUFF,
priority = 15,
spellID = 49039,
},
--- Alt Stuff --- Alt Stuff
[GetSpellInfo(34709)] = { -- Shadowsight Buff [GetSpellInfo(34709)] = { -- Shadowsight Buff
track = AURA_TYPE_DEBUFF, track = AURA_TYPE_BUFF,
duration = 15, duration = 15,
priority = 9, priority = 15,
magic = true, magic = true,
spellID = 34709, spellID = 34709,
}, },
@ -803,11 +784,10 @@ local cooldownList = {
[8983] = 60, -- Bash [8983] = 60, -- Bash
[53312] = 60, -- Natures Grasp [53312] = 60, -- Natures Grasp
[48505] = { cd = 90, spec = L["Balance"], }, -- Starfall [48505] = { cd = 90, spec = L["Balance"], }, -- Starfall
[50334] = { cd = 180, spec = L["Feral"], altName = GetSpellInfo(50334) .. " Feral" }, -- Berserk [50334] = { cd = 180, spec = L["Feral"], }, -- Berserk
[17116] = { cd = 120, spec = L["Restoration"], }, -- Natures Swiftness [17116] = { cd = 120, spec = L["Restoration"], }, -- Natures Swiftness
[18562] = { cd = 15, spec = L["Restoration"], }, -- Swiftmend [18562] = { cd = 15, spec = L["Restoration"], }, -- Swiftmend
[33831] = { cd = 180, spec = L["Balance"], }, -- Force of Nature [33831] = { cd = 180, spec = L["Balance"], }, -- Force of Nature
[61384] = { cd = 20, spec = L["Balance"], }, -- Typhoon
}, },
-- Shaman -- Shaman
@ -865,7 +845,7 @@ local cooldownList = {
[17962] = { cd = 10, spec = L["Destruction"], }, -- Conflagrate [17962] = { cd = 10, spec = L["Destruction"], }, -- Conflagrate
[59172] = { cd = 12, spec = L["Destruction"], }, -- Chaos Bolt [59172] = { cd = 12, spec = L["Destruction"], }, -- Chaos Bolt
[47241] = { cd = 180, spec = L["Demonology"], }, -- Metamorphosis [47241] = { cd = 180, spec = L["Demonology"], }, -- Metamorphosis
[47996] = { cd = 30, spec = L["Demonology"], pet = true, altName = GetSpellInfo(47996) .. " Felguard" }, -- Intercept [47996] = { cd = 30, spec = L["Demonology"], pet = true, }, -- Intercept
[1122] = { cd = 600, spec = L["Demonology"], }, -- Inferno [1122] = { cd = 600, spec = L["Demonology"], }, -- Inferno
}, },
@ -909,7 +889,7 @@ local cooldownList = {
[19503] = 30, -- Scatter Shot [19503] = 30, -- Scatter Shot
[19263] = 90, -- Deterrence [19263] = 90, -- Deterrence
[781] = 15, -- Disengage [781] = 15, -- Disengage
[5384] = 30, -- Feign Death [5384] = 20, -- Feign Death
[3045] = 20, -- Rapid Fire [3045] = 20, -- Rapid Fire
[60192] = { cd = 28, -- Freezing Arrow [60192] = { cd = 28, -- Freezing Arrow
sharedCD = { sharedCD = {
@ -1087,21 +1067,211 @@ end
local totemData = { local totemData = {
-- Fire -- Fire
[string_lower("Searing Totem")] = { id = 3599, texture = select(3, GetSpellInfo(3599)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Flametongue Totem")] = { id = 8227, texture = select(3, GetSpellInfo(8227)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Magma Totem")] = { id = 8190, texture = select(3, GetSpellInfo(8190)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 },
[string_lower("Fire Nova Totem")] = { id = 1535, texture = select(3, GetSpellInfo(1535)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = { cd = 4, once = true } },
[string_lower("Totem of Wrath")] = { id = 30706, texture = select(3, GetSpellInfo(30706)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Fire Elemental Totem")] = { id = 32982, texture = select(3, GetSpellInfo(32982)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Frost Resistance Totem")] = { id = 8181, texture = select(3, GetSpellInfo(8181)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Totem of Wrath")] = { id = 30706, texture = select(3, GetSpellInfo(30706)), color = { r = 0, g = 0, b = 0, a = 1 } },
-- Water -- Water
[string_lower("Disease Cleansing Totem")] = {id = 8170,texture = select(3, GetSpellInfo(8170)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 3}, [string_lower("Fire Resistance Totem")] = { id = 8184, texture = select(3, GetSpellInfo(8184)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Mana Spring Totem")] = { id = 5675, texture = select(3, GetSpellInfo(5675)), color = { r = 0, g = 0, b = 0, a = 1 } }, [string_lower("Disease Cleansing Totem")] = { id = 8170, texture = select(3, GetSpellInfo(8170)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 5 },
[string_lower("Healing Stream Totem")] = { id = 5394, texture = select(3, GetSpellInfo(5394)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 },
[string_lower("Mana Tide Totem")] = { id = 16190, texture = select(3, GetSpellInfo(16190)), color = { r = 0.078, g = 0.9, b = 0.16, a = 1 } },
[string_lower("Mana Spring Totem")] = { id = 5675, texture = select(3, GetSpellInfo(5675)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 },
-- Earth -- Earth
[string_lower("Earthbind Totem")] = { id = 2484, texture = select(3, GetSpellInfo(2484)), color = { r = 0.5, g = 0.5, b = 0.5, a = 1 }, pulse = 3 },
[string_lower("Stoneclaw Totem")] = { id = 5730, texture = select(3, GetSpellInfo(5730)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 },
[string_lower("Stoneskin Totem")] = { id = 8071, texture = select(3, GetSpellInfo(8071)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Strength of Earth Totem")] = { id = 8075, texture = select(3, GetSpellInfo(8075)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Earth Elemental Totem")] = { id = 33663, texture = select(3, GetSpellInfo(33663)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Tremor Totem")] = { id = 8143, texture = select(3, GetSpellInfo(8143)), color = { r = 1, g = 0.9, b = 0.1, a = 1 }, pulse = 3 },
-- Air -- Air
[string_lower("Grounding Totem")] = { id = 8177, texture = select(3, GetSpellInfo(8177)), color = { r = 0, g = 0.53, b = 0.92, a = 1 } },
[string_lower("Nature Resistance Totem")] = { id = 10595, texture = select(3, GetSpellInfo(10595)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Windfury Totem")] = { id = 8512, texture = select(3, GetSpellInfo(8512)), color = { r = 0.96, g = 0, b = 0.07, a = 1 } },
[string_lower("Sentry Totem")] = { id = 6495, texture = select(3, GetSpellInfo(6495)), color = { r = 0, g = 0, b = 0, a = 1 } },
[string_lower("Wrath of Air Totem")] = { id = 3738, texture = select(3, GetSpellInfo(3738)), color = { r = 0, g = 0, b = 0, a = 1 } },
} }
local totemSpellIdToPulse = { local totemSpellIdToPulse = {
[GetSpellInfo(totemData[string_lower("Earthbind Totem")].id)] = totemData[string_lower("Earthbind Totem")].pulse,
[2484] = totemData[string_lower("Earthbind Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Tremor Totem")].id)] = totemData[string_lower("Tremor Totem")].pulse,
[8143] = totemData[string_lower("Tremor Totem")].pulse,
--[GetSpellInfo(totemData[string_lower("Poison Cleansing Totem")].id)] = totemData[string_lower("Poison Cleansing Totem")].pulse,
--[8166] = totemData[string_lower("Poison Cleansing Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Disease Cleansing Totem")].id)] = totemData[string_lower("Disease Cleansing Totem")].pulse, [GetSpellInfo(totemData[string_lower("Disease Cleansing Totem")].id)] = totemData[string_lower("Disease Cleansing Totem")].pulse,
[8170] = totemData[string_lower("Disease Cleansing Totem")].pulse, [8170] = totemData[string_lower("Disease Cleansing Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Fire Nova Totem")].id)] = totemData[string_lower("Fire Nova Totem")].pulse,
[1535] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 1
[8498] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 2
[8499] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 3
[11314] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 4
[11315] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 5
[25546] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 6
[25547] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 7
[GetSpellInfo(totemData[string_lower("Magma Totem")].id)] = totemData[string_lower("Magma Totem")].pulse,
[8190] = totemData[string_lower("Magma Totem")].pulse, -- Rank 1
[10585] = totemData[string_lower("Magma Totem")].pulse, -- Rank 2
[10586] = totemData[string_lower("Magma Totem")].pulse, -- Rank 3
[10587] = totemData[string_lower("Magma Totem")].pulse, -- Rank 4
[25552] = totemData[string_lower("Magma Totem")].pulse, -- Rank 5
[GetSpellInfo(totemData[string_lower("Healing Stream Totem")].id)] = totemData[string_lower("Healing Stream Totem")].pulse,
[5394] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 1
[6375] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 2
[6377] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 3
[10462] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 4
[10463] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 5
[25567] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 6
[GetSpellInfo(totemData[string_lower("Mana Spring Totem")].id)] = totemData[string_lower("Mana Spring Totem")].pulse,
[5675] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 1
[10495] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 2
[10496] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 3
[10497] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 4
[25570] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 5
[GetSpellInfo(totemData[string_lower("Stoneclaw Totem")].id)] = totemData[string_lower("Stoneclaw Totem")].pulse,
[5730] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 1
[6390] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 2
[6391] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 3
[6392] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 4
[10427] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 5
[10428] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 6
[25525] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 7
} }
local totemNpcIdsToTotemData = { local totemNpcIdsToTotemData = {
--fire
[2523] = totemData[string_lower("Searing Totem")],
[3902] = totemData[string_lower("Searing Totem")],
[3903] = totemData[string_lower("Searing Totem")],
[3904] = totemData[string_lower("Searing Totem")],
[7400] = totemData[string_lower("Searing Totem")],
[7402] = totemData[string_lower("Searing Totem")],
[15480] = totemData[string_lower("Searing Totem")],
[31162] = totemData[string_lower("Searing Totem")],
[31164] = totemData[string_lower("Searing Totem")],
[31165] = totemData[string_lower("Searing Totem")],
[21995] = totemData[string_lower("Searing Totem")],
[22209] = totemData[string_lower("Searing Totem")],
[22895] = totemData[string_lower("Searing Totem")],
[22896] = totemData[string_lower("Searing Totem")],
[34687] = totemData[string_lower("Searing Totem")],
[36532] = totemData[string_lower("Searing Totem")],
[43423] = totemData[string_lower("Searing Totem")],
[67380] = totemData[string_lower("Searing Totem")],
[73477] = totemData[string_lower("Searing Totem")],
[79238] = totemData[string_lower("Searing Totem")],
[22896] = totemData[string_lower("Searing Totem")],
[84519] = totemData[string_lower("Searing Totem")],
[110730] = totemData[string_lower("Searing Totem")],
[132178] = totemData[string_lower("Searing Totem")],
[9637] = totemData[string_lower("Searing Totem")],
[5950] = totemData[string_lower("Flametongue Totem")],
[6012] = totemData[string_lower("Flametongue Totem")],
[7423] = totemData[string_lower("Flametongue Totem")],
[10557] = totemData[string_lower("Flametongue Totem")],
[15485] = totemData[string_lower("Flametongue Totem")],
[31132] = totemData[string_lower("Flametongue Totem")],
[31133] = totemData[string_lower("Flametongue Totem")],
[31158] = totemData[string_lower("Flametongue Totem")],
[42605] = totemData[string_lower("Flametongue Totem")],
[5929] = totemData[string_lower("Magma Totem")],
[7464] = totemData[string_lower("Magma Totem")],
[7465] = totemData[string_lower("Magma Totem")],
[7466] = totemData[string_lower("Magma Totem")],
[15484] = totemData[string_lower("Magma Totem")],
[31166] = totemData[string_lower("Magma Totem")],
[31167] = totemData[string_lower("Magma Totem")],
[32887] = totemData[string_lower("Magma Totem")],
[42211] = totemData[string_lower("Magma Totem")],
[71335] = totemData[string_lower("Magma Totem")],
[71925] = totemData[string_lower("Magma Totem")],
[73085] = totemData[string_lower("Magma Totem")],
[73093] = totemData[string_lower("Magma Totem")],
[73268] = totemData[string_lower("Magma Totem")],
[88971] = totemData[string_lower("Magma Totem")],
[97369] = totemData[string_lower("Magma Totem")],
[98676] = totemData[string_lower("Magma Totem")],
[5879] = totemData[string_lower("Fire Nova Totem")],
[6110] = totemData[string_lower("Fire Nova Totem")],
[6111] = totemData[string_lower("Fire Nova Totem")],
[7844] = totemData[string_lower("Fire Nova Totem")],
[7845] = totemData[string_lower("Fire Nova Totem")],
[14662] = totemData[string_lower("Fire Nova Totem")],
[15482] = totemData[string_lower("Fire Nova Totem")],
[15483] = totemData[string_lower("Fire Nova Totem")],
[24320] = totemData[string_lower("Fire Nova Totem")],
[32775] = totemData[string_lower("Fire Nova Totem")],
[32776] = totemData[string_lower("Fire Nova Totem")],
[17539] = totemData[string_lower("Totem of Wrath")],
[22970] = totemData[string_lower("Totem of Wrath")],
[22971] = totemData[string_lower("Totem of Wrath")],
[30652] = totemData[string_lower("Totem of Wrath")],
[30653] = totemData[string_lower("Totem of Wrath")],
[30654] = totemData[string_lower("Totem of Wrath")],
[15439] = totemData[string_lower("Fire Elemental Totem")],
[40830] = totemData[string_lower("Fire Elemental Totem")],
[41337] = totemData[string_lower("Fire Elemental Totem")],
[41346] = totemData[string_lower("Fire Elemental Totem")],
[72301] = totemData[string_lower("Fire Elemental Totem")],
[5926] = totemData[string_lower("Frost Resistance Totem")],
[7412] = totemData[string_lower("Frost Resistance Totem")],
[7413] = totemData[string_lower("Frost Resistance Totem")],
[15486] = totemData[string_lower("Frost Resistance Totem")],
[31171] = totemData[string_lower("Frost Resistance Totem")],
[31172] = totemData[string_lower("Frost Resistance Totem")],
-- Water
[5927] = totemData[string_lower("Fire Resistance Totem")],
[7424] = totemData[string_lower("Fire Resistance Totem")],
[7425] = totemData[string_lower("Fire Resistance Totem")],
[15487] = totemData[string_lower("Fire Resistance Totem")],
[31169] = totemData[string_lower("Fire Resistance Totem")],
[31170] = totemData[string_lower("Fire Resistance Totem")],
[5924] = totemData[string_lower("Disease Cleansing Totem")], [5924] = totemData[string_lower("Disease Cleansing Totem")],
[3527] = totemData[string_lower("Healing Stream Totem")],
[3906] = totemData[string_lower("Healing Stream Totem")],
[3907] = totemData[string_lower("Healing Stream Totem")],
[3908] = totemData[string_lower("Healing Stream Totem")],
[3909] = totemData[string_lower("Healing Stream Totem")],
[14664] = totemData[string_lower("Healing Stream Totem")],
[15488] = totemData[string_lower("Healing Stream Totem")],
[18235] = totemData[string_lower("Healing Stream Totem")],
[31181] = totemData[string_lower("Healing Stream Totem")],
[31182] = totemData[string_lower("Healing Stream Totem")],
[31185] = totemData[string_lower("Healing Stream Totem")],
[34686] = totemData[string_lower("Healing Stream Totem")],
[36542] = totemData[string_lower("Healing Stream Totem")],
[37810] = totemData[string_lower("Healing Stream Totem")],
[38428] = totemData[string_lower("Healing Stream Totem")],
[47077] = totemData[string_lower("Healing Stream Totem")],
[72309] = totemData[string_lower("Healing Stream Totem")],
[72457] = totemData[string_lower("Healing Stream Totem")],
[73890] = totemData[string_lower("Healing Stream Totem")],
[74433] = totemData[string_lower("Healing Stream Totem")],
[97508] = totemData[string_lower("Healing Stream Totem")],
[112567] = totemData[string_lower("Healing Stream Totem")],
[120357] = totemData[string_lower("Healing Stream Totem")],
[128539] = totemData[string_lower("Healing Stream Totem")],
[132049] = totemData[string_lower("Healing Stream Totem")],
[10467] = totemData[string_lower("Mana Tide Totem")],
[11100] = totemData[string_lower("Mana Tide Totem")],
[11101] = totemData[string_lower("Mana Tide Totem")],
[17061] = totemData[string_lower("Mana Tide Totem")],
[3573] = totemData[string_lower("Mana Spring Totem")], [3573] = totemData[string_lower("Mana Spring Totem")],
[7414] = totemData[string_lower("Mana Spring Totem")], [7414] = totemData[string_lower("Mana Spring Totem")],
[7415] = totemData[string_lower("Mana Spring Totem")], [7415] = totemData[string_lower("Mana Spring Totem")],
@ -1112,14 +1282,102 @@ local totemNpcIdsToTotemData = {
[31189] = totemData[string_lower("Mana Spring Totem")], [31189] = totemData[string_lower("Mana Spring Totem")],
[31190] = totemData[string_lower("Mana Spring Totem")], [31190] = totemData[string_lower("Mana Spring Totem")],
-- Earth
[2630] = totemData[string_lower("Earthbind Totem")],
[22486] = totemData[string_lower("Earthbind Totem")],
[40233] = totemData[string_lower("Earthbind Totem")],
[74737] = totemData[string_lower("Earthbind Totem")],
[79155] = totemData[string_lower("Earthbind Totem")],
[3579] = totemData[string_lower("Stoneclaw Totem")],
[3911] = totemData[string_lower("Stoneclaw Totem")],
[3912] = totemData[string_lower("Stoneclaw Totem")],
[3913] = totemData[string_lower("Stoneclaw Totem")],
[7398] = totemData[string_lower("Stoneclaw Totem")],
[7399] = totemData[string_lower("Stoneclaw Totem")],
[14870] = totemData[string_lower("Stoneclaw Totem")],
[15478] = totemData[string_lower("Stoneclaw Totem")],
[31120] = totemData[string_lower("Stoneclaw Totem")],
[31121] = totemData[string_lower("Stoneclaw Totem")],
[31122] = totemData[string_lower("Stoneclaw Totem")],
[40258] = totemData[string_lower("Stoneclaw Totem")],
[102402] = totemData[string_lower("Stoneclaw Totem")],
[5873] = totemData[string_lower("Stoneskin Totem")],
[5919] = totemData[string_lower("Stoneskin Totem")],
[5920] = totemData[string_lower("Stoneskin Totem")],
[7366] = totemData[string_lower("Stoneskin Totem")],
[7367] = totemData[string_lower("Stoneskin Totem")],
[7368] = totemData[string_lower("Stoneskin Totem")],
[14663] = totemData[string_lower("Stoneskin Totem")],
[15470] = totemData[string_lower("Stoneskin Totem")],
[15474] = totemData[string_lower("Stoneskin Totem")],
[18177] = totemData[string_lower("Stoneskin Totem")],
[21994] = totemData[string_lower("Stoneskin Totem")],
[31175] = totemData[string_lower("Stoneskin Totem")],
[31176] = totemData[string_lower("Stoneskin Totem")],
[36550] = totemData[string_lower("Stoneskin Totem")],
[40267] = totemData[string_lower("Stoneskin Totem")],
[41967] = totemData[string_lower("Stoneskin Totem")],
[5874] = totemData[string_lower("Strength of Earth Totem")],
[5921] = totemData[string_lower("Strength of Earth Totem")],
[5922] = totemData[string_lower("Strength of Earth Totem")],
[7403] = totemData[string_lower("Strength of Earth Totem")],
[15464] = totemData[string_lower("Strength of Earth Totem")],
[15479] = totemData[string_lower("Strength of Earth Totem")],
[21992] = totemData[string_lower("Strength of Earth Totem")],
[30647] = totemData[string_lower("Strength of Earth Totem")],
[31129] = totemData[string_lower("Strength of Earth Totem")],
[40266] = totemData[string_lower("Strength of Earth Totem")],
[15430] = totemData[string_lower("Earth Elemental Totem")],
[24649] = totemData[string_lower("Earth Elemental Totem")],
[39387] = totemData[string_lower("Earth Elemental Totem")],
[40247] = totemData[string_lower("Earth Elemental Totem")],
[72307] = totemData[string_lower("Earth Elemental Totem")],
[5913] = totemData[string_lower("Tremor Totem")],
[41938] = totemData[string_lower("Tremor Totem")],
[41939] = totemData[string_lower("Tremor Totem")],
-- Air
[5925] = totemData[string_lower("Grounding Totem")],
[128537] = totemData[string_lower("Grounding Totem")],
[136251] = totemData[string_lower("Grounding Totem")],
[7467] = totemData[string_lower("Nature Resistance Totem")],
[7468] = totemData[string_lower("Nature Resistance Totem")],
[7469] = totemData[string_lower("Nature Resistance Totem")],
[15490] = totemData[string_lower("Nature Resistance Totem")],
[31173] = totemData[string_lower("Nature Resistance Totem")],
[31174] = totemData[string_lower("Nature Resistance Totem")],
[6112] = totemData[string_lower("Windfury Totem")],
[7483] = totemData[string_lower("Windfury Totem")],
[7484] = totemData[string_lower("Windfury Totem")],
[14666] = totemData[string_lower("Windfury Totem")],
[15496] = totemData[string_lower("Windfury Totem")],
[15497] = totemData[string_lower("Windfury Totem")],
[22897] = totemData[string_lower("Windfury Totem")],
[41940] = totemData[string_lower("Windfury Totem")],
[41941] = totemData[string_lower("Windfury Totem")],
[80703] = totemData[string_lower("Windfury Totem")],
[105690] = totemData[string_lower("Windfury Totem")],
[133684] = totemData[string_lower("Windfury Totem")],
[3968] = totemData[string_lower("Sentry Totem")],
[28938] = totemData[string_lower("Sentry Totem")],
[40187] = totemData[string_lower("Sentry Totem")],
[69505] = totemData[string_lower("Sentry Totem")],
[70413] = totemData[string_lower("Sentry Totem")],
[71145] = totemData[string_lower("Sentry Totem")],
[147410] = totemData[string_lower("Sentry Totem")],
[15447] = totemData[string_lower("Wrath of Air Totem")],
[36556] = totemData[string_lower("Wrath of Air Totem")],
} }
local totemDataShared, totemNpcIdsToTotemDataShared, totemSpellIdToPulseShared = Gladdy:GetSharedTotemData()
Gladdy:AddEntriesToTable(totemData, totemDataShared)
Gladdy:AddEntriesToTable(totemNpcIdsToTotemData, totemNpcIdsToTotemDataShared)
Gladdy:AddEntriesToTable(totemSpellIdToPulse, totemSpellIdToPulseShared)
function Gladdy:GetTotemData() function Gladdy:GetTotemData()
return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse
end end

View File

@ -1,6 +1,5 @@
local tbl_sort, select, string_lower = table.sort, select, string.lower local tbl_sort, select, string_lower = table.sort, select, string.lower
local GetLocale = GetLocale local GetLocale = GetLocale
local GetSpellInfo = GetSpellInfo
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
@ -184,30 +183,6 @@ Gladdy.frameStrataSorting = {
[8] = "TOOLTIP", [8] = "TOOLTIP",
} }
Gladdy.exceptionNames = {
[50334] = (GetSpellInfo(50334) or "...") .. " Feral", -- Berserk
[30151] = select(1, GetSpellInfo(30151)) .. " Felguard", -- Intercept
[30194] = select(1, GetSpellInfo(30151)) .. " Felguard", -- Intercept
[30198] = select(1, GetSpellInfo(30151)) .. " Felguard", -- Intercept
[47996] = select(1, GetSpellInfo(30151)) .. " Felguard", -- Intercept
[31117] = select(1, GetSpellInfo(30405)) .. " Silence", -- Unstable Affliction Silence
[43523] = select(1, GetSpellInfo(30405)) .. " Silence",
[24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot
[24134] = select(1, GetSpellInfo(19386)) .. " Dot",
[24135] = select(1, GetSpellInfo(19386)) .. " Dot",
[27069] = select(1, GetSpellInfo(19386)) .. " Dot",
[49009] = select(1, GetSpellInfo(19386)) .. " Dot",
[49010] = select(1, GetSpellInfo(19386)) .. " Dot",
[19975] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)), -- Entangling Roots Nature's Grasp
[19974] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19973] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19972] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[27010] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[53312] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
}
local dispelTypeColors = {} local dispelTypeColors = {}
dispelTypeColors["none"] = { r = 0.80, g = 0, b = 0, a = 1 } dispelTypeColors["none"] = { r = 0.80, g = 0, b = 0, a = 1 }
dispelTypeColors["magic"] = { r = 0.20, g = 0.60, b = 1.00, a = 1 } dispelTypeColors["magic"] = { r = 0.20, g = 0.60, b = 1.00, a = 1 }
@ -317,325 +292,4 @@ local pvpTrinkets = { -- [itemID] = cd in ms
function Gladdy:GetPvpTrinkets() function Gladdy:GetPvpTrinkets()
return pvpTrinkets return pvpTrinkets
end
---------------------
-- TOTEM STUFF
---------------------
local totemData = {
-- Fire
[string_lower("Searing Totem")] = {id = 3599,texture = select(3, GetSpellInfo(3599)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Flametongue Totem")] = {id = 8227,texture = select(3, GetSpellInfo(8227)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Magma Totem")] = {id = 8190,texture = select(3, GetSpellInfo(8190)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
[string_lower("Fire Nova Totem")] = {id = 1535,texture = select(3, GetSpellInfo(1535)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = { cd = 4, once = true }},
[string_lower("Totem of Wrath")] = {id = 30706,texture = select(3, GetSpellInfo(30706)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Fire Elemental Totem")] = {id = 32982,texture = select(3, GetSpellInfo(32982)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Frost Resistance Totem")] = {id = 8181,texture = select(3, GetSpellInfo(8181)), color = {r = 0, g = 0, b = 0, a = 1}},
-- Water
[string_lower("Fire Resistance Totem")] = {id = 8184,texture = select(3, GetSpellInfo(8184)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Disease Cleansing Totem")] = {id = 8170,texture = select(3, GetSpellInfo(8170)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 5},
[string_lower("Healing Stream Totem")] = {id = 5394,texture = select(3, GetSpellInfo(5394)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
[string_lower("Mana Tide Totem")] = {id = 16190,texture = select(3, GetSpellInfo(16190)), color = {r = 0.078, g = 0.9, b = 0.16, a = 1}, pulse = 3 },
[string_lower("Mana Spring Totem")] = {id = 5675,texture = select(3, GetSpellInfo(5675)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
-- Earth
[string_lower("Earthbind Totem")] = {id = 2484,texture = select(3, GetSpellInfo(2484)), color = {r = 0.5, g = 0.5, b = 0.5, a = 1}, pulse = 3},
[string_lower("Stoneclaw Totem")] = {id = 5730,texture = select(3, GetSpellInfo(5730)), color = {r = 0, g = 0, b = 0, a = 1}, pulse = 2},
[string_lower("Stoneskin Totem")] = {id = 8071,texture = select(3, GetSpellInfo(8071)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Strength of Earth Totem")] = {id = 8075,texture = select(3, GetSpellInfo(8075)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Earth Elemental Totem")] = {id = 33663,texture = select(3, GetSpellInfo(33663)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Tremor Totem")] = {id = 8143,texture = select(3, GetSpellInfo(8143)), color = {r = 1, g = 0.9, b = 0.1, a = 1}, pulse = 3},
-- Air
[string_lower("Grounding Totem")] = {id = 8177,texture = select(3, GetSpellInfo(8177)), color = {r = 0, g = 0.53, b = 0.92, a = 1}},
[string_lower("Nature Resistance Totem")] = {id = 10595,texture = select(3, GetSpellInfo(10595)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Windfury Totem")] = {id = 8512,texture = select(3, GetSpellInfo(8512)), color = {r = 0.96, g = 0, b = 0.07, a = 1}},
[string_lower("Sentry Totem")] = {id = 6495, texture = select(3, GetSpellInfo(6495)), color = {r = 0, g = 0, b = 0, a = 1}},
[string_lower("Wrath of Air Totem")] = {id = 3738,texture = select(3, GetSpellInfo(3738)), color = {r = 0, g = 0, b = 0, a = 1}},
}
local totemSpellIdToPulse = {
[GetSpellInfo(totemData[string_lower("Earthbind Totem")].id)] = totemData[string_lower("Earthbind Totem")].pulse,
[2484] = totemData[string_lower("Earthbind Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Tremor Totem")].id)] = totemData[string_lower("Tremor Totem")].pulse,
[8143] = totemData[string_lower("Tremor Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Disease Cleansing Totem")].id)] = totemData[string_lower("Disease Cleansing Totem")].pulse,
[8170] = totemData[string_lower("Disease Cleansing Totem")].pulse,
[GetSpellInfo(totemData[string_lower("Fire Nova Totem")].id)] = totemData[string_lower("Fire Nova Totem")].pulse,
[1535] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 1
[8498] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 2
[8499] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 3
[11314] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 4
[11315] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 5
[25546] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 6
[25547] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 7
[GetSpellInfo(totemData[string_lower("Magma Totem")].id)] = totemData[string_lower("Magma Totem")].pulse,
[8190] = totemData[string_lower("Magma Totem")].pulse, -- Rank 1
[10585] = totemData[string_lower("Magma Totem")].pulse, -- Rank 2
[10586] = totemData[string_lower("Magma Totem")].pulse, -- Rank 3
[10587] = totemData[string_lower("Magma Totem")].pulse, -- Rank 4
[25552] = totemData[string_lower("Magma Totem")].pulse, -- Rank 5
[58731] = totemData[string_lower("Magma Totem")].pulse, -- Rank 6
[58734] = totemData[string_lower("Magma Totem")].pulse, -- Rank 7
[GetSpellInfo(totemData[string_lower("Healing Stream Totem")].id)] = totemData[string_lower("Healing Stream Totem")].pulse,
[5394] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 1
[6375] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 2
[6377] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 3
[10462] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 4
[10463] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 5
[25567] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 6
[58755] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 7
[58756] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 8
[58757] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 9
[GetSpellInfo(totemData[string_lower("Mana Tide Totem")].id)] = totemData[string_lower("Mana Tide Totem")].pulse,
[16190] = totemData[string_lower("Mana Tide Totem")].pulse, -- Rank 1
[GetSpellInfo(totemData[string_lower("Stoneclaw Totem")].id)] = totemData[string_lower("Stoneclaw Totem")].pulse,
[5730] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 1
[6390] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 2
[6391] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 3
[6392] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 4
[10427] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 5
[10428] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 6
[25525] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 7
[58580] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 8
[58581] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 9
[58582] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 10
}
local totemNpcIdsToTotemData = {
--fire
[2523] = totemData[string_lower("Searing Totem")],
[3902] = totemData[string_lower("Searing Totem")],
[3903] = totemData[string_lower("Searing Totem")],
[3904] = totemData[string_lower("Searing Totem")],
[7400] = totemData[string_lower("Searing Totem")],
[7402] = totemData[string_lower("Searing Totem")],
[15480] = totemData[string_lower("Searing Totem")],
[31162] = totemData[string_lower("Searing Totem")],
[31164] = totemData[string_lower("Searing Totem")],
[31165] = totemData[string_lower("Searing Totem")],
[21995] = totemData[string_lower("Searing Totem")],
[22209] = totemData[string_lower("Searing Totem")],
[22895] = totemData[string_lower("Searing Totem")],
[22896] = totemData[string_lower("Searing Totem")],
[34687] = totemData[string_lower("Searing Totem")],
[36532] = totemData[string_lower("Searing Totem")],
[43423] = totemData[string_lower("Searing Totem")],
[67380] = totemData[string_lower("Searing Totem")],
[73477] = totemData[string_lower("Searing Totem")],
[79238] = totemData[string_lower("Searing Totem")],
[22896] = totemData[string_lower("Searing Totem")],
[84519] = totemData[string_lower("Searing Totem")],
[110730] = totemData[string_lower("Searing Totem")],
[132178] = totemData[string_lower("Searing Totem")],
[9637] = totemData[string_lower("Searing Totem")],
[5950] = totemData[string_lower("Flametongue Totem")],
[6012] = totemData[string_lower("Flametongue Totem")],
[7423] = totemData[string_lower("Flametongue Totem")],
[10557] = totemData[string_lower("Flametongue Totem")],
[15485] = totemData[string_lower("Flametongue Totem")],
[31132] = totemData[string_lower("Flametongue Totem")],
[31133] = totemData[string_lower("Flametongue Totem")],
[31158] = totemData[string_lower("Flametongue Totem")],
[42605] = totemData[string_lower("Flametongue Totem")],
[5929] = totemData[string_lower("Magma Totem")],
[7464] = totemData[string_lower("Magma Totem")],
[7465] = totemData[string_lower("Magma Totem")],
[7466] = totemData[string_lower("Magma Totem")],
[15484] = totemData[string_lower("Magma Totem")],
[31166] = totemData[string_lower("Magma Totem")],
[31167] = totemData[string_lower("Magma Totem")],
[32887] = totemData[string_lower("Magma Totem")],
[42211] = totemData[string_lower("Magma Totem")],
[71335] = totemData[string_lower("Magma Totem")],
[71925] = totemData[string_lower("Magma Totem")],
[73085] = totemData[string_lower("Magma Totem")],
[73093] = totemData[string_lower("Magma Totem")],
[73268] = totemData[string_lower("Magma Totem")],
[88971] = totemData[string_lower("Magma Totem")],
[97369] = totemData[string_lower("Magma Totem")],
[98676] = totemData[string_lower("Magma Totem")],
[5879] = totemData[string_lower("Fire Nova Totem")],
[6110] = totemData[string_lower("Fire Nova Totem")],
[6111] = totemData[string_lower("Fire Nova Totem")],
[7844] = totemData[string_lower("Fire Nova Totem")],
[7845] = totemData[string_lower("Fire Nova Totem")],
[14662] = totemData[string_lower("Fire Nova Totem")],
[15482] = totemData[string_lower("Fire Nova Totem")],
[15483] = totemData[string_lower("Fire Nova Totem")],
[24320] = totemData[string_lower("Fire Nova Totem")],
[32775] = totemData[string_lower("Fire Nova Totem")],
[32776] = totemData[string_lower("Fire Nova Totem")],
[17539] = totemData[string_lower("Totem of Wrath")],
[22970] = totemData[string_lower("Totem of Wrath")],
[22971] = totemData[string_lower("Totem of Wrath")],
[30652] = totemData[string_lower("Totem of Wrath")],
[30653] = totemData[string_lower("Totem of Wrath")],
[30654] = totemData[string_lower("Totem of Wrath")],
[15439] = totemData[string_lower("Fire Elemental Totem")],
[40830] = totemData[string_lower("Fire Elemental Totem")],
[41337] = totemData[string_lower("Fire Elemental Totem")],
[41346] = totemData[string_lower("Fire Elemental Totem")],
[72301] = totemData[string_lower("Fire Elemental Totem")],
[5926] = totemData[string_lower("Frost Resistance Totem")],
[7412] = totemData[string_lower("Frost Resistance Totem")],
[7413] = totemData[string_lower("Frost Resistance Totem")],
[15486] = totemData[string_lower("Frost Resistance Totem")],
[31171] = totemData[string_lower("Frost Resistance Totem")],
[31172] = totemData[string_lower("Frost Resistance Totem")],
-- Water
[5927] = totemData[string_lower("Fire Resistance Totem")],
[7424] = totemData[string_lower("Fire Resistance Totem")],
[7425] = totemData[string_lower("Fire Resistance Totem")],
[15487] = totemData[string_lower("Fire Resistance Totem")],
[31169] = totemData[string_lower("Fire Resistance Totem")],
[31170] = totemData[string_lower("Fire Resistance Totem")],
[5924] = totemData[string_lower("Disease Cleansing Totem")],
[3527] = totemData[string_lower("Healing Stream Totem")],
[3906] = totemData[string_lower("Healing Stream Totem")],
[3907] = totemData[string_lower("Healing Stream Totem")],
[3908] = totemData[string_lower("Healing Stream Totem")],
[3909] = totemData[string_lower("Healing Stream Totem")],
[14664] = totemData[string_lower("Healing Stream Totem")],
[15488] = totemData[string_lower("Healing Stream Totem")],
[18235] = totemData[string_lower("Healing Stream Totem")],
[31181] = totemData[string_lower("Healing Stream Totem")],
[31182] = totemData[string_lower("Healing Stream Totem")],
[31185] = totemData[string_lower("Healing Stream Totem")],
[34686] = totemData[string_lower("Healing Stream Totem")],
[36542] = totemData[string_lower("Healing Stream Totem")],
[37810] = totemData[string_lower("Healing Stream Totem")],
[38428] = totemData[string_lower("Healing Stream Totem")],
[47077] = totemData[string_lower("Healing Stream Totem")],
[72309] = totemData[string_lower("Healing Stream Totem")],
[72457] = totemData[string_lower("Healing Stream Totem")],
[73890] = totemData[string_lower("Healing Stream Totem")],
[74433] = totemData[string_lower("Healing Stream Totem")],
[97508] = totemData[string_lower("Healing Stream Totem")],
[112567] = totemData[string_lower("Healing Stream Totem")],
[120357] = totemData[string_lower("Healing Stream Totem")],
[128539] = totemData[string_lower("Healing Stream Totem")],
[132049] = totemData[string_lower("Healing Stream Totem")],
[10467] = totemData[string_lower("Mana Tide Totem")],
[11100] = totemData[string_lower("Mana Tide Totem")],
[11101] = totemData[string_lower("Mana Tide Totem")],
[17061] = totemData[string_lower("Mana Tide Totem")],
[3573] = totemData[string_lower("Mana Spring Totem")],
[7414] = totemData[string_lower("Mana Spring Totem")],
[7415] = totemData[string_lower("Mana Spring Totem")],
[7416] = totemData[string_lower("Mana Spring Totem")],
[15304] = totemData[string_lower("Mana Spring Totem")],
[15489] = totemData[string_lower("Mana Spring Totem")],
[31186] = totemData[string_lower("Mana Spring Totem")],
[31189] = totemData[string_lower("Mana Spring Totem")],
[31190] = totemData[string_lower("Mana Spring Totem")],
-- Earth
[2630] = totemData[string_lower("Earthbind Totem")],
[22486] = totemData[string_lower("Earthbind Totem")],
[40233] = totemData[string_lower("Earthbind Totem")],
[74737] = totemData[string_lower("Earthbind Totem")],
[79155] = totemData[string_lower("Earthbind Totem")],
[3579] = totemData[string_lower("Stoneclaw Totem")],
[3911] = totemData[string_lower("Stoneclaw Totem")],
[3912] = totemData[string_lower("Stoneclaw Totem")],
[3913] = totemData[string_lower("Stoneclaw Totem")],
[7398] = totemData[string_lower("Stoneclaw Totem")],
[7399] = totemData[string_lower("Stoneclaw Totem")],
[14870] = totemData[string_lower("Stoneclaw Totem")],
[15478] = totemData[string_lower("Stoneclaw Totem")],
[31120] = totemData[string_lower("Stoneclaw Totem")],
[31121] = totemData[string_lower("Stoneclaw Totem")],
[31122] = totemData[string_lower("Stoneclaw Totem")],
[40258] = totemData[string_lower("Stoneclaw Totem")],
[102402] = totemData[string_lower("Stoneclaw Totem")],
[5873] = totemData[string_lower("Stoneskin Totem")],
[5919] = totemData[string_lower("Stoneskin Totem")],
[5920] = totemData[string_lower("Stoneskin Totem")],
[7366] = totemData[string_lower("Stoneskin Totem")],
[7367] = totemData[string_lower("Stoneskin Totem")],
[7368] = totemData[string_lower("Stoneskin Totem")],
[14663] = totemData[string_lower("Stoneskin Totem")],
[15470] = totemData[string_lower("Stoneskin Totem")],
[15474] = totemData[string_lower("Stoneskin Totem")],
[18177] = totemData[string_lower("Stoneskin Totem")],
[21994] = totemData[string_lower("Stoneskin Totem")],
[31175] = totemData[string_lower("Stoneskin Totem")],
[31176] = totemData[string_lower("Stoneskin Totem")],
[36550] = totemData[string_lower("Stoneskin Totem")],
[40267] = totemData[string_lower("Stoneskin Totem")],
[41967] = totemData[string_lower("Stoneskin Totem")],
[5874] = totemData[string_lower("Strength of Earth Totem")],
[5921] = totemData[string_lower("Strength of Earth Totem")],
[5922] = totemData[string_lower("Strength of Earth Totem")],
[7403] = totemData[string_lower("Strength of Earth Totem")],
[15464] = totemData[string_lower("Strength of Earth Totem")],
[15479] = totemData[string_lower("Strength of Earth Totem")],
[21992] = totemData[string_lower("Strength of Earth Totem")],
[30647] = totemData[string_lower("Strength of Earth Totem")],
[31129] = totemData[string_lower("Strength of Earth Totem")],
[40266] = totemData[string_lower("Strength of Earth Totem")],
[15430] = totemData[string_lower("Earth Elemental Totem")],
[24649] = totemData[string_lower("Earth Elemental Totem")],
[39387] = totemData[string_lower("Earth Elemental Totem")],
[40247] = totemData[string_lower("Earth Elemental Totem")],
[72307] = totemData[string_lower("Earth Elemental Totem")],
[5913] = totemData[string_lower("Tremor Totem")],
[41938] = totemData[string_lower("Tremor Totem")],
[41939] = totemData[string_lower("Tremor Totem")],
-- Air
[5925] = totemData[string_lower("Grounding Totem")],
[128537] = totemData[string_lower("Grounding Totem")],
[136251] = totemData[string_lower("Grounding Totem")],
[7467] = totemData[string_lower("Nature Resistance Totem")],
[7468] = totemData[string_lower("Nature Resistance Totem")],
[7469] = totemData[string_lower("Nature Resistance Totem")],
[15490] = totemData[string_lower("Nature Resistance Totem")],
[31173] = totemData[string_lower("Nature Resistance Totem")],
[31174] = totemData[string_lower("Nature Resistance Totem")],
[6112] = totemData[string_lower("Windfury Totem")],
[7483] = totemData[string_lower("Windfury Totem")],
[7484] = totemData[string_lower("Windfury Totem")],
[14666] = totemData[string_lower("Windfury Totem")],
[15496] = totemData[string_lower("Windfury Totem")],
[15497] = totemData[string_lower("Windfury Totem")],
[22897] = totemData[string_lower("Windfury Totem")],
[41940] = totemData[string_lower("Windfury Totem")],
[41941] = totemData[string_lower("Windfury Totem")],
[80703] = totemData[string_lower("Windfury Totem")],
[105690] = totemData[string_lower("Windfury Totem")],
[133684] = totemData[string_lower("Windfury Totem")],
[3968] = totemData[string_lower("Sentry Totem")],
[28938] = totemData[string_lower("Sentry Totem")],
[40187] = totemData[string_lower("Sentry Totem")],
[69505] = totemData[string_lower("Sentry Totem")],
[70413] = totemData[string_lower("Sentry Totem")],
[71145] = totemData[string_lower("Sentry Totem")],
[147410] = totemData[string_lower("Sentry Totem")],
[15447] = totemData[string_lower("Wrath of Air Totem")],
[36556] = totemData[string_lower("Wrath of Air Totem")],
}
function Gladdy:GetSharedTotemData()
return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse
end end

View File

@ -1,6 +1,4 @@
local select, string_gsub, tostring, pairs, ipairs = select, string.gsub, tostring, pairs, ipairs local select, string_gsub, tostring, pairs, ipairs = select, string.gsub, tostring, pairs, ipairs
local wipe = wipe
local unpack = unpack
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
local AURA_TYPE_DEBUFF = AURA_TYPE_DEBUFF local AURA_TYPE_DEBUFF = AURA_TYPE_DEBUFF
@ -36,11 +34,10 @@ function EventListener:JOINED_ARENA()
self:RegisterEvent("UNIT_SPELLCAST_START") self:RegisterEvent("UNIT_SPELLCAST_START")
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START") self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
self:SetScript("OnEvent", EventListener.OnEvent)
-- in case arena has started already we check for units -- in case arena has started already we check for units
for i=1,Gladdy.curBracket do for i=1,Gladdy.curBracket do
if Gladdy.buttons["arena"..i].lastAuras then
wipe(Gladdy.buttons["arena"..i].lastAuras)
end
if UnitExists("arena" .. i) then if UnitExists("arena" .. i) then
Gladdy:SpotEnemy("arena" .. i, true) Gladdy:SpotEnemy("arena" .. i, true)
end end
@ -48,7 +45,6 @@ function EventListener:JOINED_ARENA()
Gladdy:SendMessage("PET_SPOTTED", "arenapet" .. i) Gladdy:SendMessage("PET_SPOTTED", "arenapet" .. i)
end end
end end
self:SetScript("OnEvent", EventListener.OnEvent)
end end
function EventListener:Reset() function EventListener:Reset()
@ -61,6 +57,7 @@ function Gladdy:SpotEnemy(unit, auraScan)
if not unit or not button then if not unit or not button then
return return
end end
button.stealthed = false
if UnitExists(unit) then if UnitExists(unit) then
button.raceLoc = UnitRace(unit) button.raceLoc = UnitRace(unit)
button.race = select(2, UnitRace(unit)) button.race = select(2, UnitRace(unit))
@ -80,11 +77,6 @@ function Gladdy:SpotEnemy(unit, auraScan)
Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, AURA_TYPE_BUFF, n - 1) Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, AURA_TYPE_BUFF, n - 1)
break break
end end
if Gladdy.exceptionNames[spellID] then
spellName = Gladdy.exceptionNames[spellID]
end
if Gladdy.specBuffs[spellName] and unitCaster then -- Check for auras that detect a spec if Gladdy.specBuffs[spellName] and unitCaster then -- Check for auras that detect a spec
local unitPet = string_gsub(unit, "%d$", "pet%1") local unitPet = string_gsub(unit, "%d$", "pet%1")
if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then
@ -116,10 +108,15 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
Gladdy.modules["Shadowsight Timer"]:AURA_GAIN(nil, nil, 34709) Gladdy.modules["Shadowsight Timer"]:AURA_GAIN(nil, nil, 34709)
end end
if Gladdy.exceptionNames[spellID] then
spellName = Gladdy.exceptionNames[spellID]
end
if destUnit then if destUnit then
-- cooldown
if (Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName]) then
local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
spellId = spellID
end
Cooldowns:AURA_FADE(destUnit, spellID)
end
-- diminish tracker -- diminish tracker
if Gladdy.buttons[destUnit] and Gladdy.db.drEnabled and extraSpellId == AURA_TYPE_DEBUFF then if Gladdy.buttons[destUnit] and Gladdy.db.drEnabled and extraSpellId == AURA_TYPE_DEBUFF then
if (eventType == "SPELL_AURA_REMOVED") then if (eventType == "SPELL_AURA_REMOVED") then
@ -134,7 +131,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
end end
end end
-- death detection -- 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
if not Gladdy:isFeignDeath(destUnit) then if not Gladdy:isFeignDeath(destUnit) then
Gladdy:SendMessage("UNIT_DEATH", destUnit) Gladdy:SendMessage("UNIT_DEATH", destUnit)
end end
@ -159,7 +156,8 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
if not Gladdy.buttons[srcUnit].spec then if not Gladdy.buttons[srcUnit].spec then
self:DetectSpec(srcUnit, Gladdy.specSpells[spellName]) self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
end end
if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_MISSED") then if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_MISSED") then
self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
-- cooldown tracker -- cooldown tracker
if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then
local unitClass local unitClass
@ -167,34 +165,23 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman) if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
spellId = spellID spellId = spellID
end end
if Gladdy.db.cooldownCooldowns[tostring(spellId)] and (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_MISSED" or eventType == "SPELL_DODGED") then if Gladdy.db.cooldownCooldowns[tostring(spellId)] then
if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then
unitClass = Gladdy.buttons[srcUnit].class unitClass = Gladdy.buttons[srcUnit].class
else else
unitClass = Gladdy.buttons[srcUnit].race unitClass = Gladdy.buttons[srcUnit].race
end end
if spellID ~= 16188 and spellID ~= 17116 and spellID ~= 16166 and spellID ~= 12043 and spellID ~= 5384 then -- Nature's Swiftness CD starts when buff fades if spellID ~= 16188 and spellID ~= 17116 then -- Nature's Swiftness CD starts when buff fades
Gladdy:Debug("INFO", eventType, "- CooldownUsed", srcUnit, "spellID:", spellID) Gladdy:Debug("INFO", "SPELL_CAST_SUCCESS - CooldownUsed", srcUnit, "spellID:", spellID)
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId) Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
end end
end end
end end
end end
if (eventType == "SPELL_AURA_REMOVED" and (spellID == 16188 or spellID == 17116 or spellID == 16166 or spellID == 12043) and Gladdy.buttons[srcUnit].class) then if (eventType == "SPELL_AURA_REMOVED" and (spellID == 16188 or spellID == 17116) and Gladdy.buttons[srcUnit].class) then
Gladdy:Debug("INFO", "SPELL_AURA_REMOVED - CooldownUsed", srcUnit, "spellID:", spellID) Gladdy:Debug("INFO", "SPELL_AURA_REMOVED - CooldownUsed", srcUnit, "spellID:", spellID)
Cooldowns:CooldownUsed(srcUnit, Gladdy.buttons[srcUnit].class, spellID) Cooldowns:CooldownUsed(srcUnit, Gladdy.buttons[srcUnit].class, spellID)
end end
if (eventType == "SPELL_AURA_REMOVED" and Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName]) then
local unit = Gladdy:GetArenaUnit(srcUnit, true)
local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
spellId = spellID
end
if unit then
--Gladdy:Debug("INFO", "EL:CL:SPELL_AURA_REMOVED (srcUnit)", "Cooldowns:AURA_FADE", unit, spellId)
Cooldowns:AURA_FADE(unit, spellId)
end
end
end end
end end
@ -209,7 +196,6 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
if updateReason == "seen" then if updateReason == "seen" then
-- ENEMY_SPOTTED -- ENEMY_SPOTTED
if button then if button then
button.stealthed = false
Gladdy:SendMessage("ENEMY_STEALTH", unit, false) Gladdy:SendMessage("ENEMY_STEALTH", unit, false)
if not button.class or not button.race then if not button.class or not button.race then
Gladdy:SpotEnemy(unit, true) Gladdy:SpotEnemy(unit, true)
@ -221,7 +207,6 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
elseif updateReason == "unseen" then elseif updateReason == "unseen" then
-- STEALTH -- STEALTH
if button then if button then
button.stealthed = true
Gladdy:SendMessage("ENEMY_STEALTH", unit, true) Gladdy:SendMessage("ENEMY_STEALTH", unit, true)
end end
if pet then if pet then
@ -241,6 +226,25 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
end end
end end
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
[24134] = select(1, GetSpellInfo(19386)) .. " Dot",
[24135] = select(1, GetSpellInfo(19386)) .. " Dot",
[27069] = select(1, GetSpellInfo(19386)) .. " Dot",
[49009] = select(1, GetSpellInfo(19386)) .. " Dot",
[49010] = select(1, GetSpellInfo(19386)) .. " Dot",
[19975] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)), -- Entangling Roots Nature's Grasp
[19974] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19973] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19972] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[27010] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
[53312] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
}
Gladdy.cooldownBuffs = { Gladdy.cooldownBuffs = {
[GetSpellInfo(6346)] = { cd = function(expTime) -- 180s uptime == cd [GetSpellInfo(6346)] = { cd = function(expTime) -- 180s uptime == cd
return expTime return expTime
@ -271,32 +275,19 @@ function EventListener:UNIT_AURA(unit, isFullUpdate, updatedAuras)
if not button then if not button then
return return
end end
if not button.auras then
button.auras = {}
end
wipe(button.auras)
if not button.lastAuras then
button.lastAuras = {}
end
Gladdy:Debug("INFO", "AURA_FADE", unit, AURA_TYPE_BUFF, AURA_TYPE_DEBUFF)
Gladdy:SendMessage("AURA_FADE", unit, AURA_TYPE_BUFF)
Gladdy:SendMessage("AURA_FADE", unit, AURA_TYPE_DEBUFF)
for i = 1, 2 do for i = 1, 2 do
if not Gladdy.buttons[unit].class or not Gladdy.buttons[unit].race then if not Gladdy.buttons[unit].class or not Gladdy.buttons[unit].race then
Gladdy:SpotEnemy(unit, false) Gladdy:SpotEnemy(unit, false)
end end
local filter = (i == 1 and "HELPFUL" or "HARMFUL") local filter = (i == 1 and "HELPFUL" or "HARMFUL")
local auraType = i == 1 and AURA_TYPE_BUFF or AURA_TYPE_DEBUFF local auraType = i == 1 and AURA_TYPE_BUFF or AURA_TYPE_DEBUFF
Gladdy:SendMessage("AURA_FADE", unit, auraType)
for n = 1, 30 do for n = 1, 30 do
local spellName, texture, count, dispelType, duration, expirationTime, unitCaster, _, shouldConsolidate, spellID = UnitAura(unit, n, filter) local spellName, texture, count, dispelType, duration, expirationTime, unitCaster, _, shouldConsolidate, spellID = UnitAura(unit, n, filter)
if ( not spellID ) then if ( not spellID ) then
Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, auraType, n - 1) Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, auraType, n - 1)
break break
end end
if Gladdy.exceptionNames[spellID] then
spellName = Gladdy.exceptionNames[spellID]
end
button.auras[spellID] = { auraType, spellID, spellName, texture, duration, expirationTime, count, dispelType }
if not button.spec and Gladdy.specBuffs[spellName] and unitCaster then if not button.spec and Gladdy.specBuffs[spellName] and unitCaster then
local unitPet = string_gsub(unit, "%d$", "pet%1") local unitPet = string_gsub(unit, "%d$", "pet%1")
if unitCaster and (UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster)) then if unitCaster and (UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster)) then
@ -314,38 +305,12 @@ function EventListener:UNIT_AURA(unit, isFullUpdate, updatedAuras)
if Gladdy.cooldownBuffs.racials[spellName] then if Gladdy.cooldownBuffs.racials[spellName] then
Gladdy:SendMessage("RACIAL_USED", unit, spellName, Gladdy.cooldownBuffs.racials[spellName].cd(expirationTime - GetTime()), spellName) Gladdy:SendMessage("RACIAL_USED", unit, spellName, Gladdy.cooldownBuffs.racials[spellName].cd(expirationTime - GetTime()), spellName)
end end
Gladdy:Debug("INFO", "AURA_GAIN", unit, auraType, spellName) if Gladdy.exceptionNames[spellID] then
spellName = Gladdy.exceptionNames[spellID]
end
Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, dispelType, i, unitCaster) Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, dispelType, i, unitCaster)
end end
end end
-- check auras
for spellID,v in pairs(button.lastAuras) do
if not button.auras[spellID] then
if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[v[3]] then
local spellId = Cooldowns.cooldownSpellIds[v[3]] -- don't use spellId from combatlog, in case of different spellrank
if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
spellId = spellID
end
--Gladdy:Debug("INFO", "EL:UNIT_AURA Cooldowns:AURA_FADE", unit, spellId)
Cooldowns:AURA_FADE(unit, spellId)
if spellID == 5384 then -- Feign Death CD Detection needs this
Cooldowns:CooldownUsed(unit, Gladdy.buttons[unit].class, 5384)
end
end
end
end
wipe(button.lastAuras)
button.lastAuras = Gladdy:DeepCopy(button.auras)
end
function EventListener:UpdateAuras(unit)
local button = Gladdy.buttons[unit]
if not button or button.lastAuras then
return
end
for i=1, #button.lastAuras do
Gladdy.modules["Auras"]:AURA_GAIN(unit, unpack(button.lastAuras[i]))
end
end end
function EventListener:UNIT_SPELLCAST_START(unit) function EventListener:UNIT_SPELLCAST_START(unit)
@ -373,12 +338,8 @@ function EventListener:UNIT_SPELLCAST_SUCCEEDED(...)
local unitRace = Gladdy.buttons[unit].race local unitRace = Gladdy.buttons[unit].race
local spellName = GetSpellInfo(spellID) local spellName = GetSpellInfo(spellID)
if Gladdy.exceptionNames[spellID] then
spellName = Gladdy.exceptionNames[spellID]
end
-- spec detection -- spec detection
if spellName and Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
self:DetectSpec(unit, Gladdy.specSpells[spellName]) self:DetectSpec(unit, Gladdy.specSpells[spellName])
end end
@ -389,22 +350,10 @@ function EventListener:UNIT_SPELLCAST_SUCCEEDED(...)
end end
-- racial -- racial
if unitRace and Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then if Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then
Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - RACIAL_USED", unit, spellID) Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - RACIAL_USED", unit, spellID)
Gladdy:SendMessage("RACIAL_USED", unit) Gladdy:SendMessage("RACIAL_USED", unit)
end end
--cooldown
local unitClass
if (Gladdy:GetCooldownList()[Gladdy.buttons[unit].class][unit]) then
unitClass = Gladdy.buttons[unit].class
else
unitClass = Gladdy.buttons[unit].race
end
if spellID ~= 16188 and spellID ~= 17116 and spellID ~= 16166 and spellID ~= 12043 and spellID ~= 5384 then -- Nature's Swiftness CD starts when buff fades
Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED", "- CooldownUsed", unit, "spellID:", spellID)
Cooldowns:CooldownUsed(unit, unitClass, spellID)
end
end end
end end
@ -413,7 +362,7 @@ function EventListener:DetectSpec(unit, spec)
if (not button or not spec or button.spec) then if (not button or not spec or button.spec) then
return return
end end
if button.class == "PALADIN" and not Gladdy:contains(spec, {L["Holy"], L["Retribution"], L["Protection"]}) if button.class == "PALADIN" and Gladdy:contains(spec, {L["Holy"], L["Retribution"], L["Protection"]})
or button.class == "SHAMAN" and not Gladdy:contains(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]}) or button.class == "SHAMAN" and not Gladdy:contains(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]})
or button.class == "ROGUE" and not Gladdy:contains(spec, {L["Subtlety"], L["Assassination"], L["Combat"]}) or button.class == "ROGUE" and not Gladdy:contains(spec, {L["Subtlety"], L["Assassination"], L["Combat"]})
or button.class == "WARLOCK" and not Gladdy:contains(spec, {L["Demonology"], L["Destruction"], L["Affliction"]}) or button.class == "WARLOCK" and not Gladdy:contains(spec, {L["Demonology"], L["Destruction"], L["Affliction"]})

View File

@ -31,8 +31,6 @@ Gladdy.BUTTON_DEFAULTS = {
stealthed = false, stealthed = false,
classColors = {}, classColors = {},
lastState = 0, lastState = 0,
auras = {},
lastAuras = {}
} }
function Gladdy:CreateFrame() function Gladdy:CreateFrame()

View File

@ -13,6 +13,7 @@ local CreateFrame = CreateFrame
local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
local IsAddOnLoaded = IsAddOnLoaded local IsAddOnLoaded = IsAddOnLoaded
local GetBattlefieldStatus = GetBattlefieldStatus local GetBattlefieldStatus = GetBattlefieldStatus
local IsActiveBattlefieldArena = IsActiveBattlefieldArena
local IsInInstance = IsInInstance local IsInInstance = IsInInstance
local GetNumArenaOpponents = GetNumArenaOpponents local GetNumArenaOpponents = GetNumArenaOpponents
local RELEASE_TYPES = { alpha = "Alpha", beta = "Beta", release = "Release"} local RELEASE_TYPES = { alpha = "Alpha", beta = "Beta", release = "Release"}
@ -26,13 +27,13 @@ local LibStub = LibStub
--------------------------- ---------------------------
local MAJOR, MINOR = "Gladdy", 15 local MAJOR, MINOR = "Gladdy", 8
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR) local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
local L local L
Gladdy.version_major_num = 2 Gladdy.version_major_num = 2
Gladdy.version_minor_num = 0.27 Gladdy.version_minor_num = 0.20
Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
Gladdy.version_releaseType = RELEASE_TYPES.release Gladdy.version_releaseType = RELEASE_TYPES.beta
Gladdy.version = PREFIX .. string.format("%.2f", Gladdy.version_num) .. "-" .. Gladdy.version_releaseType Gladdy.version = PREFIX .. string.format("%.2f", Gladdy.version_num) .. "-" .. Gladdy.version_releaseType
Gladdy.VERSION_REGEX = VERSION_REGEX Gladdy.VERSION_REGEX = VERSION_REGEX
@ -432,22 +433,23 @@ end
function Gladdy:UPDATE_BATTLEFIELD_STATUS(_, index) function Gladdy:UPDATE_BATTLEFIELD_STATUS(_, index)
local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, isRankedArena, suspendedQueue, bool, queueType = GetBattlefieldStatus(index) local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, isRankedArena, suspendedQueue, bool, queueType = GetBattlefieldStatus(index)
local instanceType = select(2, IsInInstance()) local instanceType = select(2, IsInInstance())
self:Debug("INFO", "UPDATE_BATTLEFIELD_STATUS", instanceType, status, teamSize) Gladdy:Debug("INFO", "UPDATE_BATTLEFIELD_STATUS", instanceType, status, teamSize)
if ((instanceType == "arena" or GetNumArenaOpponents() > 0) and status == "active" and teamSize > 0) then if ((instanceType == "arena" or GetNumArenaOpponents() > 0) and status == "active" and teamSize > 0) then
self.curBracket = teamSize self.curBracket = teamSize
self:JoinedArena() self:JoinedArena()
elseif status == "active" then
if self.db.hideBlizzard == "always" then
self:BlizzArenaSetAlpha(0)
else
self:BlizzArenaSetAlpha(1)
end
end end
end end
function Gladdy:PLAYER_REGEN_ENABLED() function Gladdy:PLAYER_REGEN_ENABLED()
if self.showFrame then if self.showFrame then
self:InitFrames() self:UpdateFrame()
if self.startTest then
self:Test()
self.startTest = nil
end
self.frame:Show()
self:SendMessage("JOINED_ARENA")
self.showFrame = nil
end end
if self.hideFrame then if self.hideFrame then
self:Reset() self:Reset()
@ -479,8 +481,8 @@ function Gladdy:Reset()
for unit in pairs(self.buttons) do for unit in pairs(self.buttons) do
self:ResetUnit(unit) self:ResetUnit(unit)
end end
if self.db.hideBlizzard == "never" or self.db.hideBlizzard == "arena" then if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then
self:BlizzArenaSetAlpha(1) Gladdy:BlizzArenaSetAlpha(1)
end end
end end
@ -523,16 +525,6 @@ end
--------------------------- ---------------------------
function Gladdy:JoinedArena() function Gladdy:JoinedArena()
if InCombatLockdown() then
self:Print("Gladdy frames show as soon as you leave combat")
self.showFrame = true
else
self:InitFrames()
end
end
function Gladdy:InitFrames()
self.showFrame = nil
if not self.curBracket then if not self.curBracket then
self.curBracket = 2 self.curBracket = 2
end end
@ -543,21 +535,19 @@ function Gladdy:InitFrames()
end end
end end
self:UpdateFrame() if InCombatLockdown() then
if self.startTest then Gladdy:Print("Gladdy frames show as soon as you leave combat")
self:Test() self.showFrame = true
self.startTest = nil else
self:UpdateFrame()
self.frame:Show()
self:SendMessage("JOINED_ARENA")
end end
self.frame:Show()
self:SendMessage("JOINED_ARENA")
for i=1, self.curBracket do for i=1, self.curBracket do
self.buttons["arena" .. i]:SetAlpha(1) self.buttons["arena" .. i]:SetAlpha(1)
end end
if self.db.hideBlizzard == "arena" or self.db.hideBlizzard == "always" then if Gladdy.db.hideBlizzard == "arena" or Gladdy.db.hideBlizzard == "always" then
self:BlizzArenaSetAlpha(0) Gladdy:BlizzArenaSetAlpha(0)
else
self:BlizzArenaSetAlpha(1)
end end
end end

View File

@ -1,5 +1,6 @@
## Interface: 20504
## Title: Gladdy |cFFFF0000 game client not supported|r ## Title: Gladdy |cFFFF0000 game client not supported|r
## Version: 2.27-Release ## Version: @project-version@
## Notes: The most powerful arena AddOn for WoW Classic TBC/WotLK ## Notes: The most powerful arena AddOn for WoW Classic TBC/WotLK
## Author: XiconQoo, DnB_Junkee, Knall ## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751 ## X-Email: contact me on discord Knall#1751

View File

@ -1,6 +1,6 @@
## Interface: 20504 ## Interface: 20504
## Title: Gladdy - TBC ## Title: Gladdy - TBC
## Version: 2.27-Release ## Version: @project-version@
## Notes: The most powerful arena AddOn for WoW 2.5.4 ## Notes: The most powerful arena AddOn for WoW 2.5.4
## Author: XiconQoo, DnB_Junkee, Knall ## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751 ## X-Email: contact me on discord Knall#1751
@ -13,12 +13,12 @@ embeds.xml
Gladdy.lua Gladdy.lua
Lang.lua Lang.lua
Util.lua
Frame.lua Frame.lua
Options.lua Options.lua
Constants_shared.lua Constants_shared.lua
Constants_BCC.lua Constants_BCC.lua
ImportStrings.lua ImportStrings.lua
Util.lua
Modules\Announcements.lua Modules\Announcements.lua
Modules\Healthbar.lua Modules\Healthbar.lua

View File

@ -1,7 +1,7 @@
## Interface: 30402 ## Interface: 30400
## Title: Gladdy - WotLK ## Title: Gladdy - WotLK
## Version: 2.27-Release ## Version: @project-version@
## Notes: The most powerful arena AddOn for WoW 3.4.2 ## Notes: The most powerful arena AddOn for WoW 3.4.0
## Author: XiconQoo, DnB_Junkee, Knall ## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751 ## X-Email: contact me on discord Knall#1751
## X-Curse-Project-ID: 482332 ## X-Curse-Project-ID: 482332
@ -13,12 +13,12 @@ embeds.xml
Gladdy.lua Gladdy.lua
Lang.lua Lang.lua
Util.lua
Frame.lua Frame.lua
Options.lua Options.lua
Constants_shared.lua Constants_shared.lua
Constants_Wrath.lua Constants_Wrath.lua
ImportStrings.lua ImportStrings.lua
Util.lua
Modules\Announcements.lua Modules\Announcements.lua
Modules\Healthbar.lua Modules\Healthbar.lua

View File

@ -9,7 +9,7 @@
-- make into AceComm. -- make into AceComm.
-- @class file -- @class file
-- @name AceComm-3.0 -- @name AceComm-3.0
-- @release $Id: AceComm-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ -- @release $Id: AceComm-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
--[[ AceComm-3.0 --[[ AceComm-3.0
@ -35,6 +35,10 @@ local error, assert = error, assert
-- WoW APIs -- WoW APIs
local Ambiguate = Ambiguate local Ambiguate = Ambiguate
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, DEFAULT_CHAT_FRAME, geterrorhandler, RegisterAddonMessagePrefix
AceComm.embeds = AceComm.embeds or {} AceComm.embeds = AceComm.embeds or {}
-- for my sanity and yours, let's give the message type bytes some names -- for my sanity and yours, let's give the message type bytes some names

View File

@ -75,7 +75,7 @@ local next = next
local strlen = string.len local strlen = string.len
local GetFramerate = GetFramerate local GetFramerate = GetFramerate
local strlower = string.lower local strlower = string.lower
local unpack,type,pairs,wipe = unpack,type,pairs,table.wipe local unpack,type,pairs,wipe = unpack,type,pairs,wipe
local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty

View File

@ -1,7 +1,7 @@
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames. --- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames.
-- @class file -- @class file
-- @name AceConfigCmd-3.0 -- @name AceConfigCmd-3.0
-- @release $Id: AceConfigCmd-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ -- @release $Id: AceConfigCmd-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
--[[ --[[
AceConfigCmd-3.0 AceConfigCmd-3.0
@ -37,10 +37,17 @@ local error, assert = error, assert
-- WoW APIs -- WoW APIs
local _G = _G local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, SELECTED_CHAT_FRAME, DEFAULT_CHAT_FRAME
local L = setmetatable({}, { -- TODO: replace with proper locale local L = setmetatable({}, { -- TODO: replace with proper locale
__index = function(self,k) return k end __index = function(self,k) return k end
}) })
local function print(msg) local function print(msg)
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg) (SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
end end
@ -394,7 +401,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
return return
end end
local strInput = strsub(info.input,inputpos); local str = strsub(info.input,inputpos);
if tab.type=="execute" then if tab.type=="execute" then
------------ execute -------------------------------------------- ------------ execute --------------------------------------------
@ -407,21 +414,21 @@ local function handle(info, inputpos, tab, depth, retfalse)
local res = true local res = true
if tab.pattern then if tab.pattern then
if type(tab.pattern)~="string" then err(info, inputpos, "'pattern' - expected a string") end if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(strInput, tab.pattern) then if not strmatch(str, tab.pattern) then
usererr(info, inputpos, "'"..strInput.."' - " .. L["invalid input"]) usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
return return
end end
end end
do_final(info, inputpos, tab, "set", strInput) do_final(info, inputpos, tab, "set", str)
elseif tab.type=="toggle" then elseif tab.type=="toggle" then
------------ toggle -------------------------------------------- ------------ toggle --------------------------------------------
local b local b
local str = strtrim(strlower(strInput)) local str = strtrim(strlower(str))
if str=="" then if str=="" then
b = callmethod(info, inputpos, tab, "get") b = callmethod(info, inputpos, tab, "get")
@ -458,9 +465,9 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="range" then elseif tab.type=="range" then
------------ range -------------------------------------------- ------------ range --------------------------------------------
local val = tonumber(strInput) local val = tonumber(str)
if not val then if not val then
usererr(info, inputpos, "'"..strInput.."' - "..L["expected number"]) usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
return return
end end
if type(info.step)=="number" then if type(info.step)=="number" then
@ -480,7 +487,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="select" then elseif tab.type=="select" then
------------ select ------------------------------------ ------------ select ------------------------------------
local str = strtrim(strlower(strInput)) local str = strtrim(strlower(str))
local values = tab.values local values = tab.values
if type(values) == "function" or type(values) == "string" then if type(values) == "function" or type(values) == "string" then
@ -521,7 +528,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="multiselect" then elseif tab.type=="multiselect" then
------------ multiselect ------------------------------------------- ------------ multiselect -------------------------------------------
local str = strtrim(strlower(strInput)) local str = strtrim(strlower(str))
local values = tab.values local values = tab.values
if type(values) == "function" or type(values) == "string" then if type(values) == "function" or type(values) == "string" then
@ -558,7 +565,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
--check that the opt is valid --check that the opt is valid
local ok local ok
for k in pairs(values) do for k,v in pairs(values) do
if strlower(k)==opt then if strlower(k)==opt then
opt = k -- overwrite with key (in case of case mismatches) opt = k -- overwrite with key (in case of case mismatches)
ok = true ok = true
@ -627,7 +634,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="color" then elseif tab.type=="color" then
------------ color -------------------------------------------- ------------ color --------------------------------------------
local str = strtrim(strlower(strInput)) local str = strtrim(strlower(str))
if str == "" then if str == "" then
--TODO: Show current value --TODO: Show current value
return return
@ -699,7 +706,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="keybinding" then elseif tab.type=="keybinding" then
------------ keybinding -------------------------------------------- ------------ keybinding --------------------------------------------
local str = strtrim(strlower(strInput)) local str = strtrim(strlower(str))
if str == "" then if str == "" then
--TODO: Show current value --TODO: Show current value
return return

View File

@ -1,13 +1,13 @@
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
-- @class file -- @class file
-- @name AceConfigDialog-3.0 -- @name AceConfigDialog-3.0
-- @release $Id: AceConfigDialog-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $ -- @release $Id: AceConfigDialog-3.0.lua 1232 2020-04-14 22:21:22Z nevcairiel $
local LibStub = LibStub local LibStub = LibStub
local gui = LibStub("AceGUI-3.0") local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0") local reg = LibStub("AceConfigRegistry-3.0")
local MAJOR, MINOR = "AceConfigDialog-3.0", 86 local MAJOR, MINOR = "AceConfigDialog-3.0", 79
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigDialog then return end if not AceConfigDialog then return end
@ -22,13 +22,19 @@ AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {}
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {} AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}
-- Lua APIs -- Lua APIs
local tinsert, tsort, tremove, wipe = table.insert, table.sort, table.remove, table.wipe local tinsert, tsort, tremove = table.insert, table.sort, table.remove
local strmatch, format = string.match, string.format local strmatch, format = string.match, string.format
local error = error local error = error
local pairs, next, select, type, unpack, ipairs = pairs, next, select, type, unpack, ipairs local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs
local tostring, tonumber = tostring, tonumber local tostring, tonumber = tostring, tonumber
local math_min, math_max, math_floor = math.min, math.max, math.floor local math_min, math_max, math_floor = math.min, math.max, math.floor
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NORMAL_FONT_COLOR, ACCEPT, CANCEL
-- GLOBALS: PlaySound, GameFontHighlight, GameFontHighlightSmall, GameFontHighlightLarge
-- GLOBALS: CloseSpecialWindows, InterfaceOptions_AddCategory, geterrorhandler
local emptyTbl = {} local emptyTbl = {}
--[[ --[[
@ -147,7 +153,6 @@ local stringIsLiteral = {
width = true, width = true,
image = true, image = true,
fontSize = true, fontSize = true,
tooltipHyperlink = true
} }
--Is Never a function or method --Is Never a function or method
@ -189,8 +194,9 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
--We have a function to call --We have a function to call
local info = new() local info = new()
--traverse the options table, picking up the handler and filling the info with the path --traverse the options table, picking up the handler and filling the info with the path
local handler
local group = options local group = options
local handler = group.handler handler = group.handler or handler
for i = 1, #path do for i = 1, #path do
group = GetSubOption(group, path[i]) group = GetSubOption(group, path[i])
@ -502,14 +508,6 @@ local function OptionOnMouseOver(widget, event)
local tooltip = AceConfigDialog.tooltip local tooltip = AceConfigDialog.tooltip
tooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT") tooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
local tooltipHyperlink = GetOptionsMemberValue("tooltipHyperlink", opt, options, path, appName)
if tooltipHyperlink then
tooltip:SetHyperlink(tooltipHyperlink)
tooltip:Show()
return
end
local name = GetOptionsMemberValue("name", opt, options, path, appName) local name = GetOptionsMemberValue("name", opt, options, path, appName)
local desc = GetOptionsMemberValue("desc", opt, options, path, appName) local desc = GetOptionsMemberValue("desc", opt, options, path, appName)
local usage = GetOptionsMemberValue("usage", opt, options, path, appName) local usage = GetOptionsMemberValue("usage", opt, options, path, appName)
@ -537,7 +535,8 @@ local function OptionOnMouseLeave(widget, event)
end end
local function GetFuncName(option) local function GetFuncName(option)
if option.type == "execute" then local type = option.type
if type == "execute" then
return "func" return "func"
else else
return "set" return "set"
@ -545,15 +544,13 @@ local function GetFuncName(option)
end end
do do
local frame = AceConfigDialog.popup local frame = AceConfigDialog.popup
if not frame or oldminor < 81 then if not frame then
frame = CreateFrame("Frame", nil, UIParent) frame = CreateFrame("Frame", nil, UIParent)
AceConfigDialog.popup = frame AceConfigDialog.popup = frame
frame:Hide() frame:Hide()
frame:SetPoint("CENTER", UIParent, "CENTER") frame:SetPoint("CENTER", UIParent, "CENTER")
frame:SetSize(320, 72) frame:SetSize(320, 72)
frame:EnableMouse(true) -- Do not allow click-through on the frame
frame:SetFrameStrata("TOOLTIP") frame:SetFrameStrata("TOOLTIP")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetScript("OnKeyDown", function(self, key) frame:SetScript("OnKeyDown", function(self, key)
if key == "ESCAPE" then if key == "ESCAPE" then
self:SetPropagateKeyboardInput(false) self:SetPropagateKeyboardInput(false)
@ -567,17 +564,26 @@ do
end end
end) end)
local border = CreateFrame("Frame", nil, frame, "DialogBorderOpaqueTemplate") if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
border:SetAllPoints(frame) frame:SetBackdrop({
frame:SetFixedFrameStrata(true) bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
frame:SetFixedFrameLevel(true) edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
tile = true,
tileSize = 32,
edgeSize = 32,
insets = { left = 11, right = 11, top = 11, bottom = 11 },
})
else
local border = CreateFrame("Frame", nil, frame, "DialogBorderDarkTemplate")
border:SetAllPoints(frame)
end
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight") local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
text:SetSize(290, 0) text:SetSize(290, 0)
text:SetPoint("TOP", 0, -16) text:SetPoint("TOP", 0, -16)
frame.text = text frame.text = text
local function newButton(newText) local function newButton(text)
local button = CreateFrame("Button", nil, frame) local button = CreateFrame("Button", nil, frame)
button:SetSize(128, 21) button:SetSize(128, 21)
button:SetNormalFontObject(GameFontNormal) button:SetNormalFontObject(GameFontNormal)
@ -588,7 +594,7 @@ do
button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875) button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetHighlightTexture(130762) -- "Interface\\Buttons\\UI-DialogBox-Button-Highlight" button:SetHighlightTexture(130762) -- "Interface\\Buttons\\UI-DialogBox-Button-Highlight"
button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875) button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetText(newText) button:SetText(text)
return button return button
end end
@ -675,7 +681,7 @@ local function ActivateControl(widget, event, ...)
if group[funcname] ~= nil then if group[funcname] ~= nil then
func = group[funcname] func = group[funcname]
end end
handler = group.handler handler = group.handler or handler
confirm = group.confirm confirm = group.confirm
validate = group.validate validate = group.validate
for i = 1, #path do for i = 1, #path do
@ -739,6 +745,7 @@ local function ActivateControl(widget, event, ...)
end end
end end
local rootframe = user.rootframe
if not validated or type(validated) == "string" then if not validated or type(validated) == "string" then
if not validated then if not validated then
if usage then if usage then
@ -753,8 +760,8 @@ local function ActivateControl(widget, event, ...)
end end
-- show validate message -- show validate message
if user.rootframe.SetStatusText then if rootframe.SetStatusText then
user.rootframe:SetStatusText(validated) rootframe:SetStatusText(validated)
else else
validationErrorPopup(validated) validationErrorPopup(validated)
end end
@ -791,14 +798,14 @@ local function ActivateControl(widget, event, ...)
if type(confirm) == "boolean" then if type(confirm) == "boolean" then
if confirm then if confirm then
if not confirmText then if not confirmText then
local option_name, desc = option.name, option.desc local name, desc = option.name, option.desc
if type(option_name) == "function" then if type(name) == "function" then
option_name = option_name(info) name = name(info)
end end
if type(desc) == "function" then if type(desc) == "function" then
desc = desc(info) desc = desc(info)
end end
confirmText = option_name confirmText = name
if desc then if desc then
confirmText = confirmText.." - "..desc confirmText = confirmText.." - "..desc
end end
@ -1140,6 +1147,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
--Control to feed --Control to feed
local control local control
local name = GetOptionsMemberValue("name", v, options, path, appName)
if v.type == "execute" then if v.type == "execute" then
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName) local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
@ -1242,7 +1251,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
end end
tsort(sorting, sortTblAsStrings) tsort(sorting, sortTblAsStrings)
end end
for _, value in ipairs(sorting) do for k, value in ipairs(sorting) do
local text = values[value] local text = values[value]
local radio = gui:Create("CheckBox") local radio = gui:Create("CheckBox")
radio:SetLabel(text) radio:SetLabel(text)
@ -1324,8 +1333,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:SetWidth(width_multiplier) control:SetWidth(width_multiplier)
end end
--check:SetTriState(v.tristate) --check:SetTriState(v.tristate)
for s = 1, #valuesort do for i = 1, #valuesort do
local key = valuesort[s] local key = valuesort[i]
local value = GetOptionsMemberValue("get",v, options, path, appName, key) local value = GetOptionsMemberValue("get",v, options, path, appName, key)
control:SetItemValue(key,value) control:SetItemValue(key,value)
end end
@ -1337,8 +1346,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:PauseLayout() control:PauseLayout()
local width = GetOptionsMemberValue("width",v,options,path,appName) local width = GetOptionsMemberValue("width",v,options,path,appName)
for s = 1, #valuesort do for i = 1, #valuesort do
local value = valuesort[s] local value = valuesort[i]
local text = values[value] local text = values[value]
local check = gui:Create("CheckBox") local check = gui:Create("CheckBox")
check:SetLabel(text) check:SetLabel(text)
@ -1355,7 +1364,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
elseif width == "half" then elseif width == "half" then
check:SetWidth(width_multiplier / 2) check:SetWidth(width_multiplier / 2)
elseif (type(width) == "number") then elseif (type(width) == "number") then
check:SetWidth(width_multiplier * width) control:SetWidth(width_multiplier * width)
elseif width == "full" then elseif width == "full" then
check.width = "fill" check.width = "fill"
else else
@ -1425,8 +1434,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
end end
control:SetImageSize(width, height) control:SetImageSize(width, height)
end end
local controlWidth = GetOptionsMemberValue("width",v,options,path,appName) local width = GetOptionsMemberValue("width",v,options,path,appName)
control.width = not controlWidth and "fill" control.width = not width and "fill"
end end
--Common Init --Common Init
@ -1681,29 +1690,29 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
elseif grouptype == "select" then elseif grouptype == "select" then
local selectGroup = gui:Create("DropdownGroup") local select = gui:Create("DropdownGroup")
selectGroup:SetTitle(name) select:SetTitle(name)
InjectInfo(selectGroup, options, group, path, rootframe, appName) InjectInfo(select, options, group, path, rootframe, appName)
selectGroup:SetCallback("OnGroupSelected", GroupSelected) select:SetCallback("OnGroupSelected", GroupSelected)
local status = AceConfigDialog:GetStatusTable(appName, path) local status = AceConfigDialog:GetStatusTable(appName, path)
if not status.groups then if not status.groups then
status.groups = {} status.groups = {}
end end
selectGroup:SetStatusTable(status.groups) select:SetStatusTable(status.groups)
local grouplist, orderlist = BuildSelect(group, options, path, appName) local grouplist, orderlist = BuildSelect(group, options, path, appName)
selectGroup:SetGroupList(grouplist, orderlist) select:SetGroupList(grouplist, orderlist)
selectGroup:SetUserData("grouplist", grouplist) select:SetUserData("grouplist", grouplist)
selectGroup:SetUserData("orderlist", orderlist) select:SetUserData("orderlist", orderlist)
local firstgroup = orderlist[1] local firstgroup = orderlist[1]
if firstgroup then if firstgroup then
selectGroup:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup) select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
end end
selectGroup.width = "fill" select.width = "fill"
selectGroup.height = "fill" select.height = "fill"
container:AddChild(selectGroup) container:AddChild(select)
--assume tree group by default --assume tree group by default
--if parenttype is tree then this group is already a node on that tree --if parenttype is tree then this group is already a node on that tree
@ -1931,13 +1940,13 @@ end
-- convert pre-39 BlizOptions structure to the new format -- convert pre-39 BlizOptions structure to the new format
if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then
local old = AceConfigDialog.BlizOptions local old = AceConfigDialog.BlizOptions
local newOpt = {} local new = {}
for key, widget in pairs(old) do for key, widget in pairs(old) do
local appName = widget:GetUserData("appName") local appName = widget:GetUserData("appName")
if not newOpt[appName] then newOpt[appName] = {} end if not new[appName] then new[appName] = {} end
newOpt[appName][key] = widget new[appName][key] = widget
end end
AceConfigDialog.BlizOptions = newOpt AceConfigDialog.BlizOptions = new
else else
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {} AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
end end
@ -1970,7 +1979,6 @@ end
-- @param parent The parent to use in the interface options tree. -- @param parent The parent to use in the interface options tree.
-- @param ... The path in the options table to feed into the interface options panel. -- @param ... The path in the options table to feed into the interface options panel.
-- @return The reference to the frame registered into the Interface Options. -- @return The reference to the frame registered into the Interface Options.
-- @return The category ID to pass to Settings.OpenToCategory (or InterfaceOptionsFrame_OpenToCategory)
function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...) function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
local BlizOptions = AceConfigDialog.BlizOptions local BlizOptions = AceConfigDialog.BlizOptions
@ -1986,6 +1994,7 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
if not BlizOptions[appName][key] then if not BlizOptions[appName][key] then
local group = gui:Create("BlizOptionsGroup") local group = gui:Create("BlizOptionsGroup")
BlizOptions[appName][key] = group BlizOptions[appName][key] = group
group:SetName(name or appName, parent)
group:SetTitle(name or appName) group:SetTitle(name or appName)
group:SetUserData("appName", appName) group:SetUserData("appName", appName)
@ -1998,30 +2007,8 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
end end
group:SetCallback("OnShow", FeedToBlizPanel) group:SetCallback("OnShow", FeedToBlizPanel)
group:SetCallback("OnHide", ClearBlizPanel) group:SetCallback("OnHide", ClearBlizPanel)
if Settings and Settings.RegisterCanvasLayoutCategory then InterfaceOptions_AddCategory(group.frame)
local categoryName = name or appName return group.frame
if parent then
local category = Settings.GetCategory(parent)
if not category then
error(("The parent category '%s' was not found"):format(parent), 2)
end
local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName)
-- force the generated ID to be used for subcategories, as these can have very simple names like "Profiles"
group:SetName(subcategory.ID, parent)
else
local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName)
-- using appName here would be cleaner, but would not be 100% compatible
-- but for top-level categories it should be fine, as these are typically addon names
category.ID = categoryName
group:SetName(categoryName, parent)
Settings.RegisterAddOnCategory(category)
end
else
group:SetName(name or appName, parent)
InterfaceOptions_AddCategory(group.frame)
end
return group.frame, group.frame.name
else else
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2) error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
end end

View File

@ -8,10 +8,10 @@
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". -- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName".
-- @class file -- @class file
-- @name AceConfigRegistry-3.0 -- @name AceConfigRegistry-3.0
-- @release $Id: AceConfigRegistry-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $ -- @release $Id: AceConfigRegistry-3.0.lua 1207 2019-06-23 12:08:33Z nevcairiel $
local CallbackHandler = LibStub("CallbackHandler-1.0") local CallbackHandler = LibStub("CallbackHandler-1.0")
local MAJOR, MINOR = "AceConfigRegistry-3.0", 21 local MAJOR, MINOR = "AceConfigRegistry-3.0", 20
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigRegistry then return end if not AceConfigRegistry then return end
@ -83,7 +83,6 @@ local basekeys={
dialogHidden=optmethodbool, dialogHidden=optmethodbool,
dropdownHidden=optmethodbool, dropdownHidden=optmethodbool,
cmdHidden=optmethodbool, cmdHidden=optmethodbool,
tooltipHyperlink=optstringfunc,
icon=optstringnumberfunc, icon=optstringnumberfunc,
iconCoords=optmethodtable, iconCoords=optmethodtable,
handler=opttable, handler=opttable,

View File

@ -40,8 +40,8 @@
-- end -- end
-- @class file -- @class file
-- @name AceDB-3.0.lua -- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 1306 2023-06-23 14:55:09Z nevcairiel $ -- @release $Id: AceDB-3.0.lua 1217 2019-07-11 03:06:18Z funkydude $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 28 local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 27
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
if not AceDB then return end -- No upgrade needed if not AceDB then return end -- No upgrade needed
@ -53,6 +53,10 @@ local setmetatable, rawset, rawget = setmetatable, rawset, rawget
-- WoW APIs -- WoW APIs
local _G = _G local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub
AceDB.db_registry = AceDB.db_registry or {} AceDB.db_registry = AceDB.db_registry or {}
AceDB.frame = AceDB.frame or CreateFrame("Frame") AceDB.frame = AceDB.frame or CreateFrame("Frame")
@ -94,11 +98,11 @@ local function copyDefaults(dest, src)
-- This is a metatable used for table defaults -- This is a metatable used for table defaults
local mt = { local mt = {
-- This handles the lookup and creation of new subtables -- This handles the lookup and creation of new subtables
__index = function(t,k2) __index = function(t,k)
if k2 == nil then return nil end if k == nil then return nil end
local tbl = {} local tbl = {}
copyDefaults(tbl, v) copyDefaults(tbl, v)
rawset(t, k2, tbl) rawset(t, k, tbl)
return tbl return tbl
end, end,
} }
@ -111,7 +115,7 @@ local function copyDefaults(dest, src)
end end
else else
-- Values are not tables, so this is just a simple return -- Values are not tables, so this is just a simple return
local mt = {__index = function(t,k2) return k2~=nil and v or nil end} local mt = {__index = function(t,k) return k~=nil and v or nil end}
setmetatable(dest, mt) setmetatable(dest, mt)
end end
elseif type(v) == "table" then elseif type(v) == "table" then
@ -260,7 +264,7 @@ local factionrealmKey = factionKey .. " - " .. realmKey
local localeKey = GetLocale():lower() local localeKey = GetLocale():lower()
local regionTable = { "US", "KR", "EU", "TW", "CN" } local regionTable = { "US", "KR", "EU", "TW", "CN" }
local regionKey = regionTable[GetCurrentRegion()] or GetCurrentRegionName() or "TR" local regionKey = regionTable[GetCurrentRegion()]
local factionrealmregionKey = factionrealmKey .. " - " .. regionKey local factionrealmregionKey = factionrealmKey .. " - " .. regionKey
-- Actual database initialization function -- Actual database initialization function

View File

@ -1,7 +1,7 @@
--- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles. --- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles.
-- @class file -- @class file
-- @name AceDBOptions-3.0 -- @name AceDBOptions-3.0
-- @release $Id: AceDBOptions-3.0.lua 1304 2023-05-19 19:50:10Z nevcairiel $ -- @release $Id: AceDBOptions-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15 local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR) local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
@ -13,6 +13,10 @@ local pairs, next = pairs, next
-- WoW APIs -- WoW APIs
local UnitClass = UnitClass local UnitClass = UnitClass
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NORMAL_FONT_COLOR_CODE, FONT_COLOR_CODE_CLOSE
AceDBOptions.optionTables = AceDBOptions.optionTables or {} AceDBOptions.optionTables = AceDBOptions.optionTables or {}
AceDBOptions.handlers = AceDBOptions.handlers or {} AceDBOptions.handlers = AceDBOptions.handlers or {}
@ -84,25 +88,25 @@ elseif LOCALE == "frFR" then
L["reset_desc"] = "Réinitialise le profil actuel au cas où votre configuration est corrompue ou si vous voulez tout simplement faire table rase." L["reset_desc"] = "Réinitialise le profil actuel au cas où votre configuration est corrompue ou si vous voulez tout simplement faire table rase."
L["reset_sub"] = "Réinitialise le profil actuel avec les paramètres par défaut." L["reset_sub"] = "Réinitialise le profil actuel avec les paramètres par défaut."
elseif LOCALE == "koKR" then elseif LOCALE == "koKR" then
L["choose"] = "기존 프로필" L["choose"] = "저장 중인 프로필"
L["choose_desc"] = "편집 상자에 이름을 입력하여 새로운 프로필을 만들거나 이미 존재하는 프로필 중 하나를 선택할 수 있습니다." L["choose_desc"] = "입력창에 새로운 이름을 입력하거나 저장 중인 프로필 중 하나를 선택하여 새로운 프로필을 만들 수 있습니다."
L["choose_sub"] = "현재 이용할 수 있는 프로필 중 하나를 선택합니다." L["choose_sub"] = "현재 이용할 수 있는 프로필 중 하나를 선택합니다."
L["copy"] = "복사해 올 프로필" L["copy"] = "복사해오기"
L["copy_desc"] = "기존 프로필의 설정을 현재 활성화된 프로필로 복사합니다." L["copy_desc"] = "현재 사용 중인 프로필에 선택한 프로필의 설정을 복사합니다."
L["current"] = "현재 프로필:" L["current"] = "현재 프로필:"
L["default"] = "기본값" L["default"] = "기본값"
L["delete"] = "프로필 삭제" L["delete"] = "프로필 삭제"
L["delete_confirm"] = "선택한 프로필을 삭제하시겠습니까?" L["delete_confirm"] = "정말로 선택한 프로필을 삭제할까요?"
L["delete_desc"] = "데이터베이스에서 기존 프로필과 사용하지 않는 프로필을 삭제하여 공간을 절약하고 SavedVariables 파일을 정리합니다." L["delete_desc"] = "저장 공간 절약과 SavedVariables 파일의 정리를 위해 데이터베이스에서 사용하지 않는 프로필을 삭제하세요."
L["delete_sub"] = "데이터베이스에서 프로필을 삭제합니다." L["delete_sub"] = "데이터베이스 프로필을 삭제합니다."
L["intro"] = "활성 데이터베이스 프로필을 변경할 수 있으며, 모든 캐릭터마다 서로 다른 설정을 지정할 수 있습니다." L["intro"] = "활성 데이터베이스 프로필을 변경할 수 있고, 각 캐릭터 별로 다른 설정을 할 수 있습니다."
L["new"] = "새로운 프로필" L["new"] = "새로운 프로필"
L["new_sub"] = "비어 있는 프로필을 새로 만듭니다." L["new_sub"] = "새로운 프로필을 만듭니다."
L["profiles"] = "프로필" L["profiles"] = "프로필"
L["profiles_sub"] = "프로필 관리" L["profiles_sub"] = "프로필 관리"
L["reset"] = "프로필 재설정" L["reset"] = "프로필 초기화"
L["reset_desc"] = "구성이 손상되었거나 처음부터 다시 시작하고 싶은 경우 현재 프로필을 기본값으로 재설정하세요." L["reset_desc"] = "설정이 깨졌거나 처음부터 다시 설정을 원하는 경우, 현재 프로필을 기본값으로 초기화하세요."
L["reset_sub"] = "현재 프로필을 기본값으로 재설정합니다" L["reset_sub"] = "현재 프로필을 기본값으로 초기화합니다"
elseif LOCALE == "esES" or LOCALE == "esMX" then elseif LOCALE == "esES" or LOCALE == "esMX" then
L["choose"] = "Perfiles existentes" L["choose"] = "Perfiles existentes"
L["choose_desc"] = "Puedes crear un nuevo perfil introduciendo un nombre en el recuadro o puedes seleccionar un perfil de los ya existentes." L["choose_desc"] = "Puedes crear un nuevo perfil introduciendo un nombre en el recuadro o puedes seleccionar un perfil de los ya existentes."
@ -166,31 +170,31 @@ elseif LOCALE == "zhCN" then
elseif LOCALE == "ruRU" then elseif LOCALE == "ruRU" then
L["choose"] = "Существующие профили" L["choose"] = "Существующие профили"
L["choose_desc"] = "Вы можете создать новый профиль, введя название в поле ввода, или выбрать один из уже существующих профилей." L["choose_desc"] = "Вы можете создать новый профиль, введя название в поле ввода, или выбрать один из уже существующих профилей."
L["choose_sub"] = "Выбор одного из уже доступных профилей." L["choose_sub"] = "Выбор одиного из уже доступных профилей"
L["copy"] = "Скопировать из" L["copy"] = "Скопировать из"
L["copy_desc"] = "Копирование настроек из выбранного профиля в активный." L["copy_desc"] = "Скопировать настройки из выбранного профиля в активный."
L["current"] = "Текущий профиль:" L["current"] = "Текущий профиль:"
L["default"] = "По умолчанию" L["default"] = "По умолчанию"
L["delete"] = "Удалить профиль" L["delete"] = "Удалить профиль"
L["delete_confirm"] = "Вы уверены, что хотите удалить выбранный профиль?" L["delete_confirm"] = "Вы уверены, что вы хотите удалить выбранный профиль?"
L["delete_desc"] = "Удаление существующего и неиспользуемого профиля из базы данных для сохранения места, и очистка файла SavedVariables." L["delete_desc"] = "Удалить существующий и неиспользуемый профиль из БД для сохранения места, и очистить SavedVariables файл."
L["delete_sub"] = "Удаление профиля из базы данных." L["delete_sub"] = "Удаление профиля из БД"
L["intro"] = "Изменяя активный профиль, Вы можете задать разные настройки для каждого персонажа." L["intro"] = "Изменяя активный профиль, вы можете задать различные настройки модификаций для каждого персонажа."
L["new"] = "Новый" L["new"] = "Новый"
L["new_sub"] = "Создание нового чистого профиля." L["new_sub"] = "Создать новый чистый профиль"
L["profiles"] = "Профили" L["profiles"] = "Профили"
L["profiles_sub"] = "Управление профилями" L["profiles_sub"] = "Управление профилями"
L["reset"] = "Сбросить профиль" L["reset"] = "Сброс профиля"
L["reset_desc"] = "Сброс текущего профиля к стандартным настройкам, если Ваша конфигурация испорчена или Вы хотите настроить все заново." L["reset_desc"] = "Сбросить текущий профиль к стандартным настройкам, если ваша конфигурация испорчена или вы хотите настроить всё заново."
L["reset_sub"] = "Сброс текущего профиля на стандартный" L["reset_sub"] = "Сброс текущего профиля на стандартный"
elseif LOCALE == "itIT" then elseif LOCALE == "itIT" then
L["choose"] = "Profili Esistenti" L["choose"] = "Profili Esistenti"
L["choose_desc"] = "Puoi creare un nuovo profilo digitando il nome della casella di testo, oppure scegliendone uno tra i profili già esistenti." L["choose_desc"] = "Puoi creare un nuovo profilo digitando il nome della casella di testo, oppure scegliendone uno tra i profili già esistenti."
L["choose_sub"] = "Seleziona uno dei profili attualmente disponibili." L["choose_sub"] = "Seleziona uno dei profili attualmente disponibili."
L["copy"] = "Copia Da" L["copy"] = "Copia Da"
L["copy_desc"] = "Copia le impostazioni da un profilo esistente nel profilo attivo in questo momento." L["copy_desc"] = "Copia le impostazioni da un profilo esistente, nel profilo attivo in questo momento."
L["current"] = "Profilo Attivo:" L["current"] = "Profilo Attivo:"
L["default"] = "Predefinito" L["default"] = "Standard"
L["delete"] = "Cancella un Profilo" L["delete"] = "Cancella un Profilo"
L["delete_confirm"] = "Sei sicuro di voler cancellare il profilo selezionato?" L["delete_confirm"] = "Sei sicuro di voler cancellare il profilo selezionato?"
L["delete_desc"] = "Cancella i profili non utilizzati dal database per risparmiare spazio e mantenere puliti i file di configurazione SavedVariables." L["delete_desc"] = "Cancella i profili non utilizzati dal database per risparmiare spazio e mantenere puliti i file di configurazione SavedVariables."

View File

@ -24,22 +24,28 @@
-- f:AddChild(btn) -- f:AddChild(btn)
-- @class file -- @class file
-- @name AceGUI-3.0 -- @name AceGUI-3.0
-- @release $Id: AceGUI-3.0.lua 1288 2022-09-25 14:19:00Z funkehdude $ -- @release $Id: AceGUI-3.0.lua 1231 2020-04-14 22:20:36Z nevcairiel $
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41 local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
if not AceGUI then return end -- No upgrade needed if not AceGUI then return end -- No upgrade needed
-- Lua APIs -- Lua APIs
local tinsert, wipe = table.insert, table.wipe local tinsert = table.insert
local select, pairs, next, type = select, pairs, next, type local select, pairs, next, type = select, pairs, next, type
local error, assert = error, assert local error, assert = error, assert
local setmetatable, rawget = setmetatable, rawget local setmetatable, rawget = setmetatable, rawget
local math_max, math_min, math_ceil = math.max, math.min, math.ceil local math_max = math.max
-- WoW APIs -- WoW APIs
local UIParent = UIParent local UIParent = UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: geterrorhandler, LibStub
--local con = LibStub("AceConsole-3.0",true)
AceGUI.WidgetRegistry = AceGUI.WidgetRegistry or {} AceGUI.WidgetRegistry = AceGUI.WidgetRegistry or {}
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {} AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
AceGUI.WidgetBase = AceGUI.WidgetBase or {} AceGUI.WidgetBase = AceGUI.WidgetBase or {}
@ -88,38 +94,38 @@ do
AceGUI.objPools = AceGUI.objPools or {} AceGUI.objPools = AceGUI.objPools or {}
local objPools = AceGUI.objPools local objPools = AceGUI.objPools
--Returns a new instance, if none are available either returns a new table or calls the given contructor --Returns a new instance, if none are available either returns a new table or calls the given contructor
function newWidget(widgetType) function newWidget(type)
if not WidgetRegistry[widgetType] then if not WidgetRegistry[type] then
error("Attempt to instantiate unknown widget type", 2) error("Attempt to instantiate unknown widget type", 2)
end end
if not objPools[widgetType] then if not objPools[type] then
objPools[widgetType] = {} objPools[type] = {}
end end
local newObj = next(objPools[widgetType]) local newObj = next(objPools[type])
if not newObj then if not newObj then
newObj = WidgetRegistry[widgetType]() newObj = WidgetRegistry[type]()
newObj.AceGUIWidgetVersion = WidgetVersions[widgetType] newObj.AceGUIWidgetVersion = WidgetVersions[type]
else else
objPools[widgetType][newObj] = nil objPools[type][newObj] = nil
-- if the widget is older then the latest, don't even try to reuse it -- if the widget is older then the latest, don't even try to reuse it
-- just forget about it, and grab a new one. -- just forget about it, and grab a new one.
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[widgetType] then if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[type] then
return newWidget(widgetType) return newWidget(type)
end end
end end
return newObj return newObj
end end
-- Releases an instance to the Pool -- Releases an instance to the Pool
function delWidget(obj,widgetType) function delWidget(obj,type)
if not objPools[widgetType] then if not objPools[type] then
objPools[widgetType] = {} objPools[type] = {}
end end
if objPools[widgetType][obj] then if objPools[type][obj] then
error("Attempt to Release Widget that is already released", 2) error("Attempt to Release Widget that is already released", 2)
end end
objPools[widgetType][obj] = true objPools[type][obj] = true
end end
end end
@ -135,9 +141,9 @@ end
-- OnAcquire function on it, before returning. -- OnAcquire function on it, before returning.
-- @param type The type of the widget. -- @param type The type of the widget.
-- @return The newly created widget. -- @return The newly created widget.
function AceGUI:Create(widgetType) function AceGUI:Create(type)
if WidgetRegistry[widgetType] then if WidgetRegistry[type] then
local widget = newWidget(widgetType) local widget = newWidget(type)
if rawget(widget, "Acquire") then if rawget(widget, "Acquire") then
widget.OnAcquire = widget.Acquire widget.OnAcquire = widget.Acquire
@ -155,7 +161,7 @@ function AceGUI:Create(widgetType)
if widget.OnAcquire then if widget.OnAcquire then
widget:OnAcquire() widget:OnAcquire()
else else
error(("Widget type %s doesn't supply an OnAcquire Function"):format(widgetType)) error(("Widget type %s doesn't supply an OnAcquire Function"):format(type))
end end
-- Set the default Layout ("List") -- Set the default Layout ("List")
safecall(widget.SetLayout, widget, "List") safecall(widget.SetLayout, widget, "List")
@ -583,25 +589,25 @@ AceGUI.counts = AceGUI.counts or {}
-- This is used by widgets that require a named frame, e.g. when a Blizzard -- This is used by widgets that require a named frame, e.g. when a Blizzard
-- Template requires it. -- Template requires it.
-- @param type The widget type -- @param type The widget type
function AceGUI:GetNextWidgetNum(widgetType) function AceGUI:GetNextWidgetNum(type)
if not self.counts[widgetType] then if not self.counts[type] then
self.counts[widgetType] = 0 self.counts[type] = 0
end end
self.counts[widgetType] = self.counts[widgetType] + 1 self.counts[type] = self.counts[type] + 1
return self.counts[widgetType] return self.counts[type]
end end
--- Return the number of created widgets for this type. --- Return the number of created widgets for this type.
-- In contrast to GetNextWidgetNum, the number is not incremented. -- In contrast to GetNextWidgetNum, the number is not incremented.
-- @param widgetType The widget type -- @param type The widget type
function AceGUI:GetWidgetCount(widgetType) function AceGUI:GetWidgetCount(type)
return self.counts[widgetType] or 0 return self.counts[type] or 0
end end
--- Return the version of the currently registered widget type. --- Return the version of the currently registered widget type.
-- @param widgetType The widget type -- @param type The widget type
function AceGUI:GetWidgetVersion(widgetType) function AceGUI:GetWidgetVersion(type)
return WidgetVersions[widgetType] return WidgetVersions[type]
end end
------------- -------------
@ -764,6 +770,7 @@ AceGUI:RegisterLayout("Flow",
usedwidth = 0 usedwidth = 0
rowstart = frame rowstart = frame
rowstartoffset = frameoffset
if child.DoLayout then if child.DoLayout then
child:DoLayout() child:DoLayout()
@ -806,8 +813,7 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
or colObj and (colObj["align" .. dir] or colObj.align) or colObj and (colObj["align" .. dir] or colObj.align)
or tableObj["align" .. dir] or tableObj.align or tableObj["align" .. dir] or tableObj.align
or "CENTERLEFT" or "CENTERLEFT"
local val local child, cell, val = child or 0, cell or 0, nil
child, cell = child or 0, cell or 0
if type(fn) == "string" then if type(fn) == "string" then
fn = fn:lower() fn = fn:lower()
@ -821,7 +827,7 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
val = fn val = fn
end end
return fn, math_max(0, math_min(val, cell)) return fn, max(0, min(val, cell))
end end
-- Get width or height for multiple cells combined -- Get width or height for multiple cells combined
@ -830,7 +836,7 @@ local GetCellDimension = function (dir, laneDim, from, to, space)
for cell=from,to do for cell=from,to do
dim = dim + (laneDim[cell] or 0) dim = dim + (laneDim[cell] or 0)
end end
return dim + math_max(0, to - from) * (space or 0) return dim + max(0, to - from) * (space or 0)
end end
--[[ Options --[[ Options
@ -876,7 +882,7 @@ AceGUI:RegisterLayout("Table",
repeat repeat
n = n + 1 n = n + 1
local col = (n - 1) % #cols + 1 local col = (n - 1) % #cols + 1
local row = math_ceil(n / #cols) local row = ceil(n / #cols)
local rowspan = rowspans[col] local rowspan = rowspans[col]
local cell = rowspan and rowspan.child or child local cell = rowspan and rowspan.child or child
local cellObj = cell:GetUserData("cell") local cellObj = cell:GetUserData("cell")
@ -892,7 +898,7 @@ AceGUI:RegisterLayout("Table",
end end
-- Colspan -- Colspan
local colspan = math_max(0, math_min((cellObj and cellObj.colspan or 1) - 1, #cols - col)) local colspan = max(0, min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
n = n + colspan n = n + colspan
-- Place the cell -- Place the cell
@ -909,7 +915,7 @@ AceGUI:RegisterLayout("Table",
end end
end end
local rows = math_ceil(n / #cols) local rows = ceil(n / #cols)
-- Determine fixed size cols and collect weights -- Determine fixed size cols and collect weights
local extantH, totalWeight = totalH, 0 local extantH, totalWeight = totalH, 0
@ -934,16 +940,16 @@ AceGUI:RegisterLayout("Table",
f:ClearAllPoints() f:ClearAllPoints()
local childH = f:GetWidth() or 0 local childH = f:GetWidth() or 0
laneH[col] = math_max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH)) laneH[col] = max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH))
end end
end end
laneH[col] = math_max(colObj.min or colObj[1] or 0, math_min(laneH[col], colObj.max or colObj[2] or laneH[col])) laneH[col] = max(colObj.min or colObj[1] or 0, min(laneH[col], colObj.max or colObj[2] or laneH[col]))
else else
-- Rel./Abs. width -- Rel./Abs. width
laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width
end end
extantH = math_max(0, extantH - laneH[col]) extantH = max(0, extantH - laneH[col])
end end
end end
@ -982,7 +988,7 @@ AceGUI:RegisterLayout("Table",
child:DoLayout() child:DoLayout()
end end
rowV = math_max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV)) rowV = max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
end end
end end

View File

@ -2,7 +2,7 @@
BlizOptionsGroup Container BlizOptionsGroup Container
Simple container widget for the integration of AceGUI into the Blizzard Interface Options Simple container widget for the integration of AceGUI into the Blizzard Interface Options
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local Type, Version = "BlizOptionsGroup", 26 local Type, Version = "BlizOptionsGroup", 21
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -99,7 +99,7 @@ local methods = {
Constructor Constructor
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local function Constructor() local function Constructor()
local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer) local frame = CreateFrame("Frame")
frame:Hide() frame:Hide()
-- support functions for the Blizzard Interface Options -- support functions for the Blizzard Interface Options
@ -108,11 +108,6 @@ local function Constructor()
frame.default = default frame.default = default
frame.refresh = refresh frame.refresh = refresh
-- 10.0 support function aliases (cancel has been removed)
frame.OnCommit = okay
frame.OnDefault = default
frame.OnRefresh = refresh
frame:SetScript("OnHide", OnHide) frame:SetScript("OnHide", OnHide)
frame:SetScript("OnShow", OnShow) frame:SetScript("OnShow", OnShow)

View File

@ -125,7 +125,7 @@ local function Constructor()
dropdown.frame:Show() dropdown.frame:Show()
dropdown:SetLabel("") dropdown:SetLabel("")
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate") local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
border:SetPoint("TOPLEFT", 0, -26) border:SetPoint("TOPLEFT", 0, -26)
border:SetPoint("BOTTOMRIGHT", 0, 3) border:SetPoint("BOTTOMRIGHT", 0, 3)
border:SetBackdrop(PaneBackdrop) border:SetBackdrop(PaneBackdrop)

View File

@ -1,7 +1,7 @@
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Frame Container Frame Container
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local Type, Version = "Frame", 30 local Type, Version = "Frame", 27
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -13,6 +13,10 @@ local wipe = table.wipe
local PlaySound = PlaySound local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: CLOSE
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Scripts Scripts
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
@ -79,7 +83,6 @@ local methods = {
["OnAcquire"] = function(self) ["OnAcquire"] = function(self)
self.frame:SetParent(UIParent) self.frame:SetParent(UIParent)
self.frame:SetFrameStrata("FULLSCREEN_DIALOG") self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
self.frame:SetFrameLevel(100) -- Lots of room to draw under it
self:SetTitle() self:SetTitle()
self:SetStatusText() self:SetStatusText()
self:ApplyStatus() self:ApplyStatus()
@ -176,21 +179,16 @@ local PaneBackdrop = {
} }
local function Constructor() local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate") local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
frame:Hide() frame:Hide()
frame:EnableMouse(true) frame:EnableMouse(true)
frame:SetMovable(true) frame:SetMovable(true)
frame:SetResizable(true) frame:SetResizable(true)
frame:SetFrameStrata("FULLSCREEN_DIALOG") frame:SetFrameStrata("FULLSCREEN_DIALOG")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetBackdrop(FrameBackdrop) frame:SetBackdrop(FrameBackdrop)
frame:SetBackdropColor(0, 0, 0, 1) frame:SetBackdropColor(0, 0, 0, 1)
if frame.SetResizeBounds then -- WoW 10.0 frame:SetMinResize(400, 200)
frame:SetResizeBounds(400, 200)
else
frame:SetMinResize(400, 200)
end
frame:SetToplevel(true) frame:SetToplevel(true)
frame:SetScript("OnShow", Frame_OnShow) frame:SetScript("OnShow", Frame_OnShow)
frame:SetScript("OnHide", Frame_OnClose) frame:SetScript("OnHide", Frame_OnClose)
@ -203,7 +201,7 @@ local function Constructor()
closebutton:SetWidth(100) closebutton:SetWidth(100)
closebutton:SetText(CLOSE) closebutton:SetText(CLOSE)
local statusbg = CreateFrame("Button", nil, frame, "BackdropTemplate") local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
statusbg:SetPoint("BOTTOMLEFT", 15, 15) statusbg:SetPoint("BOTTOMLEFT", 15, 15)
statusbg:SetPoint("BOTTOMRIGHT", -132, 15) statusbg:SetPoint("BOTTOMRIGHT", -132, 15)
statusbg:SetHeight(24) statusbg:SetHeight(24)
@ -271,7 +269,7 @@ local function Constructor()
line2:SetHeight(8) line2:SetHeight(8)
line2:SetPoint("BOTTOMRIGHT", -8, 8) line2:SetPoint("BOTTOMRIGHT", -8, 8)
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
x = 0.1 * 8/17 local x = 0.1 * 8/17
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
local sizer_s = CreateFrame("Frame", nil, frame) local sizer_s = CreateFrame("Frame", nil, frame)

View File

@ -75,7 +75,7 @@ local function Constructor()
titletext:SetJustifyH("LEFT") titletext:SetJustifyH("LEFT")
titletext:SetHeight(18) titletext:SetHeight(18)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate") local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
border:SetPoint("TOPLEFT", 0, -17) border:SetPoint("TOPLEFT", 0, -17)
border:SetPoint("BOTTOMRIGHT", -1, 3) border:SetPoint("BOTTOMRIGHT", -1, 3)
border:SetBackdrop(PaneBackdrop) border:SetBackdrop(PaneBackdrop)

View File

@ -2,18 +2,22 @@
TabGroup Container TabGroup Container
Container that uses tabs on top to switch between groups. Container that uses tabs on top to switch between groups.
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local Type, Version = "TabGroup", 38 local Type, Version = "TabGroup", 37
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs -- Lua APIs
local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, table.wipe local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, wipe
-- WoW APIs -- WoW APIs
local PlaySound = PlaySound local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: PanelTemplates_TabResize, PanelTemplates_SetDisabledTabState, PanelTemplates_SelectTab, PanelTemplates_DeselectTab
-- local upvalue storage used by BuildTabs -- local upvalue storage used by BuildTabs
local widths = {} local widths = {}
local rowwidths = {} local rowwidths = {}
@ -22,143 +26,6 @@ local rowends = {}
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local function PanelTemplates_TabResize(tab, padding, absoluteSize, minWidth, maxWidth, absoluteTextSize)
local tabName = tab:GetName();
local buttonMiddle = tab.Middle or tab.middleTexture or _G[tabName.."Middle"];
local buttonMiddleDisabled = tab.MiddleDisabled or (tabName and _G[tabName.."MiddleDisabled"]);
local left = tab.Left or tab.leftTexture or _G[tabName.."Left"];
local sideWidths = 2 * left:GetWidth();
local tabText = tab.Text or _G[tab:GetName().."Text"];
local highlightTexture = tab.HighlightTexture or (tabName and _G[tabName.."HighlightTexture"]);
local width, tabWidth;
local textWidth;
if ( absoluteTextSize ) then
textWidth = absoluteTextSize;
else
tabText:SetWidth(0);
textWidth = tabText:GetWidth();
end
-- If there's an absolute size specified then use it
if ( absoluteSize ) then
if ( absoluteSize < sideWidths) then
width = 1;
tabWidth = sideWidths
else
width = absoluteSize - sideWidths;
tabWidth = absoluteSize
end
tabText:SetWidth(width);
else
-- Otherwise try to use padding
if ( padding ) then
width = textWidth + padding;
else
width = textWidth + 24;
end
-- If greater than the maxWidth then cap it
if ( maxWidth and width > maxWidth ) then
if ( padding ) then
width = maxWidth + padding;
else
width = maxWidth + 24;
end
tabText:SetWidth(width);
else
tabText:SetWidth(0);
end
if (minWidth and width < minWidth) then
width = minWidth;
end
tabWidth = width + sideWidths;
end
if ( buttonMiddle ) then
buttonMiddle:SetWidth(width);
end
if ( buttonMiddleDisabled ) then
buttonMiddleDisabled:SetWidth(width);
end
tab:SetWidth(tabWidth);
if ( highlightTexture ) then
highlightTexture:SetWidth(tabWidth);
end
end
local function PanelTemplates_DeselectTab(tab)
local name = tab:GetName();
local left = tab.Left or _G[name.."Left"];
local middle = tab.Middle or _G[name.."Middle"];
local right = tab.Right or _G[name.."Right"];
left:Show();
middle:Show();
right:Show();
--tab:UnlockHighlight();
tab:Enable();
local text = tab.Text or _G[name.."Text"];
text:SetPoint("CENTER", tab, "CENTER", (tab.deselectedTextX or 0), (tab.deselectedTextY or 2));
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
leftDisabled:Hide();
middleDisabled:Hide();
rightDisabled:Hide();
end
local function PanelTemplates_SelectTab(tab)
local name = tab:GetName();
local left = tab.Left or _G[name.."Left"];
local middle = tab.Middle or _G[name.."Middle"];
local right = tab.Right or _G[name.."Right"];
left:Hide();
middle:Hide();
right:Hide();
--tab:LockHighlight();
tab:Disable();
tab:SetDisabledFontObject(GameFontHighlightSmall);
local text = tab.Text or _G[name.."Text"];
text:SetPoint("CENTER", tab, "CENTER", (tab.selectedTextX or 0), (tab.selectedTextY or -3));
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
leftDisabled:Show();
middleDisabled:Show();
rightDisabled:Show();
if GameTooltip:IsOwned(tab) then
GameTooltip:Hide();
end
end
local function PanelTemplates_SetDisabledTabState(tab)
local name = tab:GetName();
local left = tab.Left or _G[name.."Left"];
local middle = tab.Middle or _G[name.."Middle"];
local right = tab.Right or _G[name.."Right"];
left:Show();
middle:Show();
right:Show();
--tab:UnlockHighlight();
tab:Disable();
tab.text = tab:GetText();
-- Gray out text
tab:SetDisabledFontObject(GameFontDisableSmall);
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
leftDisabled:Hide();
middleDisabled:Hide();
rightDisabled:Hide();
end
local function UpdateTabLook(frame) local function UpdateTabLook(frame)
if frame.disabled then if frame.disabled then
PanelTemplates_SetDisabledTabState(frame) PanelTemplates_SetDisabledTabState(frame)
@ -236,64 +103,11 @@ local methods = {
["CreateTab"] = function(self, id) ["CreateTab"] = function(self, id)
local tabname = ("AceGUITabGroup%dTab%d"):format(self.num, id) local tabname = ("AceGUITabGroup%dTab%d"):format(self.num, id)
local tab = CreateFrame("Button", tabname, self.border) local tab = CreateFrame("Button", tabname, self.border, "OptionsFrameTabButtonTemplate")
tab:SetSize(115, 24)
tab.deselectedTextY = -3
tab.selectedTextY = -2
tab.LeftDisabled = tab:CreateTexture(tabname .. "LeftDisabled", "BORDER")
tab.LeftDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
tab.LeftDisabled:SetSize(20, 24)
tab.LeftDisabled:SetPoint("BOTTOMLEFT", 0, -3)
tab.LeftDisabled:SetTexCoord(0, 0.15625, 0, 1.0)
tab.MiddleDisabled = tab:CreateTexture(tabname .. "MiddleDisabled", "BORDER")
tab.MiddleDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
tab.MiddleDisabled:SetSize(88, 24)
tab.MiddleDisabled:SetPoint("LEFT", tab.LeftDisabled, "RIGHT")
tab.MiddleDisabled:SetTexCoord(0.15625, 0.84375, 0, 1.0)
tab.RightDisabled = tab:CreateTexture(tabname .. "RightDisabled", "BORDER")
tab.RightDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
tab.RightDisabled:SetSize(20, 24)
tab.RightDisabled:SetPoint("LEFT", tab.MiddleDisabled, "RIGHT")
tab.RightDisabled:SetTexCoord(0.84375, 1.0, 0, 1.0)
tab.Left = tab:CreateTexture(tabname .. "Left", "BORDER")
tab.Left:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
tab.Left:SetSize(20, 24)
tab.Left:SetPoint("TOPLEFT")
tab.Left:SetTexCoord(0, 0.15625, 0, 1.0)
tab.Middle = tab:CreateTexture(tabname .. "Middle", "BORDER")
tab.Middle:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
tab.Middle:SetSize(88, 24)
tab.Middle:SetPoint("LEFT", tab.Left, "RIGHT")
tab.Middle:SetTexCoord(0.15625, 0.84375, 0, 1.0)
tab.Right = tab:CreateTexture(tabname .. "Right", "BORDER")
tab.Right:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
tab.Right:SetSize(20, 24)
tab.Right:SetPoint("LEFT", tab.Middle, "RIGHT")
tab.Right:SetTexCoord(0.84375, 1.0, 0, 1.0)
tab.Text = tab:CreateFontString(tabname .. "Text")
tab:SetFontString(tab.Text)
tab:SetNormalFontObject(GameFontNormalSmall)
tab:SetHighlightFontObject(GameFontHighlightSmall)
tab:SetDisabledFontObject(GameFontHighlightSmall)
tab:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight", "ADD")
tab.HighlightTexture = tab:GetHighlightTexture()
tab.HighlightTexture:ClearAllPoints()
tab.HighlightTexture:SetPoint("LEFT", tab, "LEFT", 10, -4)
tab.HighlightTexture:SetPoint("RIGHT", tab, "RIGHT", -10, -4)
_G[tabname .. "HighlightTexture"] = tab.HighlightTexture
tab.obj = self tab.obj = self
tab.id = id tab.id = id
tab.text = tab.Text -- compat tab.text = _G[tabname .. "Text"]
tab.text:ClearAllPoints() tab.text:ClearAllPoints()
tab.text:SetPoint("LEFT", 14, -3) tab.text:SetPoint("LEFT", 14, -3)
tab.text:SetPoint("RIGHT", -12, -3) tab.text:SetPoint("RIGHT", -12, -3)
@ -502,7 +316,7 @@ local function Constructor()
titletext:SetHeight(18) titletext:SetHeight(18)
titletext:SetText("") titletext:SetText("")
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate") local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
border:SetPoint("TOPLEFT", 1, -27) border:SetPoint("TOPLEFT", 1, -27)
border:SetPoint("BOTTOMRIGHT", -1, 3) border:SetPoint("BOTTOMRIGHT", -1, 3)
border:SetBackdrop(PaneBackdrop) border:SetBackdrop(PaneBackdrop)

View File

@ -2,18 +2,22 @@
TreeGroup Container TreeGroup Container
Container that uses a tree control to switch between groups. Container that uses a tree control to switch between groups.
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local Type, Version = "TreeGroup", 47 local Type, Version = "TreeGroup", 45
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs -- Lua APIs
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
local math_min, math_max, floor = math.min, math.max, math.floor local math_min, math_max, floor = math.min, math.max, floor
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
-- WoW APIs -- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: FONT_COLOR_CODE_CLOSE
-- Recycling functions -- Recycling functions
local new, del local new, del
do do
@ -563,11 +567,7 @@ local methods = {
if maxtreewidth > 100 and status.treewidth > maxtreewidth then if maxtreewidth > 100 and status.treewidth > maxtreewidth then
self:SetTreeWidth(maxtreewidth, status.treesizable) self:SetTreeWidth(maxtreewidth, status.treesizable)
end end
if treeframe.SetResizeBounds then treeframe:SetMaxResize(maxtreewidth, 1600)
treeframe:SetResizeBounds(100, 1, maxtreewidth, 1600)
else
treeframe:SetMaxResize(maxtreewidth, 1600)
end
end, end,
["OnHeightSet"] = function(self, height) ["OnHeightSet"] = function(self, height)
@ -637,7 +637,7 @@ local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type) local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent) local frame = CreateFrame("Frame", nil, UIParent)
local treeframe = CreateFrame("Frame", nil, frame, "BackdropTemplate") local treeframe = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
treeframe:SetPoint("TOPLEFT") treeframe:SetPoint("TOPLEFT")
treeframe:SetPoint("BOTTOMLEFT") treeframe:SetPoint("BOTTOMLEFT")
treeframe:SetWidth(DEFAULT_TREE_WIDTH) treeframe:SetWidth(DEFAULT_TREE_WIDTH)
@ -646,17 +646,13 @@ local function Constructor()
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5) treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4) treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
treeframe:SetResizable(true) treeframe:SetResizable(true)
if treeframe.SetResizeBounds then -- WoW 10.0 treeframe:SetMinResize(100, 1)
treeframe:SetResizeBounds(100, 1, 400, 1600) treeframe:SetMaxResize(400, 1600)
else
treeframe:SetMinResize(100, 1)
treeframe:SetMaxResize(400, 1600)
end
treeframe:SetScript("OnUpdate", FirstFrameUpdate) treeframe:SetScript("OnUpdate", FirstFrameUpdate)
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged) treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel) treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
local dragger = CreateFrame("Frame", nil, treeframe, "BackdropTemplate") local dragger = CreateFrame("Frame", nil, treeframe, BackdropTemplateMixin and "BackdropTemplate" or nil)
dragger:SetWidth(8) dragger:SetWidth(8)
dragger:SetPoint("TOP", treeframe, "TOPRIGHT") dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT") dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
@ -681,7 +677,7 @@ local function Constructor()
scrollbg:SetAllPoints(scrollbar) scrollbg:SetAllPoints(scrollbar)
scrollbg:SetColorTexture(0,0,0,0.4) scrollbg:SetColorTexture(0,0,0,0.4)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate") local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT") border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
border:SetPoint("BOTTOMRIGHT") border:SetPoint("BOTTOMRIGHT")
border:SetBackdrop(PaneBackdrop) border:SetBackdrop(PaneBackdrop)

View File

@ -7,6 +7,10 @@ local pairs, assert, type = pairs, assert, type
local PlaySound = PlaySound local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameFontNormal
---------------- ----------------
-- Main Frame -- -- Main Frame --
---------------- ----------------
@ -17,7 +21,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
]] ]]
do do
local Type = "Window" local Type = "Window"
local Version = 8 local Version = 6
local function frameOnShow(this) local function frameOnShow(this)
this.obj:Fire("OnShow") this.obj:Fire("OnShow")
@ -182,11 +186,7 @@ do
frame:SetScript("OnShow",frameOnShow) frame:SetScript("OnShow",frameOnShow)
frame:SetScript("OnHide",frameOnClose) frame:SetScript("OnHide",frameOnClose)
if frame.SetResizeBounds then -- WoW 10.0 frame:SetMinResize(240,240)
frame:SetResizeBounds(240,240)
else
frame:SetMinResize(240,240)
end
frame:SetToplevel(true) frame:SetToplevel(true)
local titlebg = frame:CreateTexture(nil, "BACKGROUND") local titlebg = frame:CreateTexture(nil, "BACKGROUND")
@ -300,7 +300,7 @@ do
line2:SetHeight(8) line2:SetHeight(8)
line2:SetPoint("BOTTOMRIGHT", -8, 8) line2:SetPoint("BOTTOMRIGHT", -8, 8)
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
x = 0.1 * 8/17 local x = 0.1 * 8/17
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
local sizer_s = CreateFrame("Frame",nil,frame) local sizer_s = CreateFrame("Frame",nil,frame)

View File

@ -12,6 +12,10 @@ local select, pairs = select, pairs
local PlaySound = PlaySound local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: SetDesaturation, GameFontHighlight
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
@ -195,14 +199,14 @@ local methods = {
["SetDescription"] = function(self, desc) ["SetDescription"] = function(self, desc)
if desc then if desc then
if not self.desc then if not self.desc then
local f = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall") local desc = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
f:ClearAllPoints() desc:ClearAllPoints()
f:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21) desc:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
f:SetWidth(self.frame.width - 30) desc:SetWidth(self.frame.width - 30)
f:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0) desc:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
f:SetJustifyH("LEFT") desc:SetJustifyH("LEFT")
f:SetJustifyV("TOP") desc:SetJustifyV("TOP")
self.desc = f self.desc = desc
end end
self.desc:Show() self.desc:Show()
--self.text:SetFontObject(GameFontNormal) --self.text:SetFontObject(GameFontNormal)

View File

@ -11,6 +11,10 @@ local pairs = pairs
-- WoW APIs -- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: ColorPickerFrame, OpacitySliderFrame
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]

View File

@ -1,4 +1,4 @@
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1272 2022-08-29 15:56:35Z nevcairiel $ ]]-- --[[ $Id: AceGUIWidget-DropDown-Items.lua 1202 2019-05-15 23:11:22Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0") local AceGUI = LibStub("AceGUI-3.0")
@ -41,7 +41,7 @@ local ItemBase = {
-- NOTE: The ItemBase version is added to each item's version number -- NOTE: The ItemBase version is added to each item's version number
-- to ensure proper updates on ItemBase changes. -- to ensure proper updates on ItemBase changes.
-- Use at least 1000er steps. -- Use at least 1000er steps.
version = 2000, version = 1000,
counter = 0, counter = 0,
} }
@ -178,7 +178,7 @@ function ItemBase.Create(type)
highlight:Hide() highlight:Hide()
self.highlight = highlight self.highlight = highlight
local check = frame:CreateTexture(nil, "OVERLAY") local check = frame:CreateTexture("OVERLAY")
check:SetWidth(16) check:SetWidth(16)
check:SetHeight(16) check:SetHeight(16)
check:SetPoint("LEFT",frame,"LEFT",3,-1) check:SetPoint("LEFT",frame,"LEFT",3,-1)
@ -186,7 +186,7 @@ function ItemBase.Create(type)
check:Hide() check:Hide()
self.check = check self.check = check
local sub = frame:CreateTexture(nil, "OVERLAY") local sub = frame:CreateTexture("OVERLAY")
sub:SetWidth(16) sub:SetWidth(16)
sub:SetHeight(16) sub:SetHeight(16)
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1) sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)

View File

@ -1,4 +1,4 @@
--[[ $Id: AceGUIWidget-DropDown.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]-- --[[ $Id: AceGUIWidget-DropDown.lua 1239 2020-09-20 10:22:02Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0") local AceGUI = LibStub("AceGUI-3.0")
-- Lua APIs -- Lua APIs
@ -11,6 +11,10 @@ local PlaySound = PlaySound
local UIParent, CreateFrame = UIParent, CreateFrame local UIParent, CreateFrame = UIParent, CreateFrame
local _G = _G local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: CLOSE
local function fixlevels(parent,...) local function fixlevels(parent,...)
local i = 1 local i = 1
local child = select(i, ...) local child = select(i, ...)
@ -249,7 +253,7 @@ do
local function Constructor() local function Constructor()
local count = AceGUI:GetNextWidgetNum(widgetType) local count = AceGUI:GetNextWidgetNum(widgetType)
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, "BackdropTemplate") local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
local self = {} local self = {}
self.count = count self.count = count
self.type = widgetType self.type = widgetType
@ -300,7 +304,7 @@ do
scrollFrame.obj = self scrollFrame.obj = self
itemFrame.obj = self itemFrame.obj = self
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, "BackdropTemplate") local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, BackdropTemplateMixin and "BackdropTemplate" or nil)
slider:SetOrientation("VERTICAL") slider:SetOrientation("VERTICAL")
slider:SetHitRectInsets(0, 0, -10, 0) slider:SetHitRectInsets(0, 0, -10, 0)
slider:SetBackdrop(sliderBackdrop) slider:SetBackdrop(sliderBackdrop)
@ -347,7 +351,7 @@ end
do do
local widgetType = "Dropdown" local widgetType = "Dropdown"
local widgetVersion = 36 local widgetVersion = 35
--[[ Static data ]]-- --[[ Static data ]]--
@ -372,6 +376,7 @@ do
local function Dropdown_TogglePullout(this) local function Dropdown_TogglePullout(this)
local self = this.obj local self = this.obj
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
if self.open then if self.open then
self.open = nil self.open = nil
self.pullout:Close() self.pullout:Close()

View File

@ -14,6 +14,10 @@ local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, Get
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: AceGUIEditBoxInsertLink, ChatFontNormal, OKAY
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]

View File

@ -13,6 +13,10 @@ local pairs = pairs
local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NOT_BOUND
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Scripts Scripts
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
@ -210,7 +214,7 @@ local function Constructor()
label:SetJustifyH("CENTER") label:SetJustifyH("CENTER")
label:SetHeight(18) label:SetHeight(18)
local msgframe = CreateFrame("Frame", nil, UIParent, "BackdropTemplate") local msgframe = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
msgframe:SetHeight(30) msgframe:SetHeight(30)
msgframe:SetBackdrop(ControlBackdrop) msgframe:SetBackdrop(ControlBackdrop)
msgframe:SetBackdropColor(0,0,0) msgframe:SetBackdropColor(0,0,0)

View File

@ -2,7 +2,7 @@
Label Widget Label Widget
Displays text and optionally an icon. Displays text and optionally an icon.
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
local Type, Version = "Label", 28 local Type, Version = "Label", 27
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -12,6 +12,10 @@ local max, select, pairs = math.max, select, pairs
-- WoW APIs -- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameFontHighlightSmall
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
@ -125,16 +129,12 @@ local methods = {
end, end,
["SetFont"] = function(self, font, height, flags) ["SetFont"] = function(self, font, height, flags)
if not self.fontObject then self.label:SetFont(font, height, flags)
self.fontObject = CreateFont("AceGUI30LabelFont" .. AceGUI:GetNextWidgetNum(Type)) UpdateImageAnchor(self)
end
self.fontObject:SetFont(font, height, flags)
self:SetFontObject(self.fontObject)
end, end,
["SetFontObject"] = function(self, font) ["SetFontObject"] = function(self, font)
self.label:SetFontObject(font or GameFontHighlightSmall) self:SetFont((font or GameFontHighlightSmall):GetFont())
UpdateImageAnchor(self)
end, end,
["SetImageSize"] = function(self, width, height) ["SetImageSize"] = function(self, width, height)

View File

@ -1,4 +1,4 @@
local Type, Version = "MultiLineEditBox", 32 local Type, Version = "MultiLineEditBox", 29
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -10,6 +10,10 @@ local GetCursorInfo, GetSpellInfo, ClearCursor = GetCursorInfo, GetSpellInfo, Cl
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: ACCEPT, ChatFontNormal
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
@ -141,14 +145,6 @@ local function OnVerticalScroll(self, offset)
editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight()) editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
end end
local function OnScrollRangeChanged(self, xrange, yrange)
if yrange == 0 then
self.obj.editBox:SetHitRectInsets(0, 0, 0, 0)
else
OnVerticalScroll(self, self:GetVerticalScroll())
end
end
local function OnShowFocus(frame) local function OnShowFocus(frame)
frame.obj.editBox:SetFocus() frame.obj.editBox:SetFocus()
frame:SetScript("OnShow", nil) frame:SetScript("OnShow", nil)
@ -261,6 +257,8 @@ local methods = {
["SetCursorPosition"] = function(self, ...) ["SetCursorPosition"] = function(self, ...)
return self.editBox:SetCursorPosition(...) return self.editBox:SetCursorPosition(...)
end, end,
} }
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
@ -299,7 +297,7 @@ local function Constructor()
text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1) text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1)
text:SetJustifyV("MIDDLE") text:SetJustifyV("MIDDLE")
local scrollBG = CreateFrame("Frame", nil, frame, "BackdropTemplate") local scrollBG = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
scrollBG:SetBackdrop(backdrop) scrollBG:SetBackdrop(backdrop)
scrollBG:SetBackdropColor(0, 0, 0) scrollBG:SetBackdropColor(0, 0, 0)
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4) scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
@ -323,7 +321,6 @@ local function Constructor()
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag) scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged) scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll) scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
scrollFrame:HookScript("OnScrollRangeChanged", OnScrollRangeChanged)
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame) local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame)
editBox:SetAllPoints() editBox:SetAllPoints()

View File

@ -14,6 +14,10 @@ local tonumber, pairs = tonumber, pairs
local PlaySound = PlaySound local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameFontHighlightSmall
--[[----------------------------------------------------------------------------- --[[-----------------------------------------------------------------------------
Support functions Support functions
-------------------------------------------------------------------------------]] -------------------------------------------------------------------------------]]
@ -27,13 +31,13 @@ local function UpdateText(self)
end end
local function UpdateLabels(self) local function UpdateLabels(self)
local min_value, max_value = (self.min or 0), (self.max or 100) local min, max = (self.min or 0), (self.max or 100)
if self.ispercent then if self.ispercent then
self.lowtext:SetFormattedText("%s%%", (min_value * 100)) self.lowtext:SetFormattedText("%s%%", (min * 100))
self.hightext:SetFormattedText("%s%%", (max_value * 100)) self.hightext:SetFormattedText("%s%%", (max * 100))
else else
self.lowtext:SetText(min_value) self.lowtext:SetText(min)
self.hightext:SetText(max_value) self.hightext:SetText(max)
end end
end end
@ -171,13 +175,13 @@ local methods = {
self.label:SetText(text) self.label:SetText(text)
end, end,
["SetSliderValues"] = function(self, min_value, max_value, step) ["SetSliderValues"] = function(self, min, max, step)
local frame = self.slider local frame = self.slider
frame.setup = true frame.setup = true
self.min = min_value self.min = min
self.max = max_value self.max = max
self.step = step self.step = step
frame:SetMinMaxValues(min_value or 0,max_value or 100) frame:SetMinMaxValues(min or 0,max or 100)
UpdateLabels(self) UpdateLabels(self)
frame:SetValueStep(step or 1) frame:SetValueStep(step or 1)
if self.value then if self.value then
@ -221,7 +225,7 @@ local function Constructor()
label:SetJustifyH("CENTER") label:SetJustifyH("CENTER")
label:SetHeight(15) label:SetHeight(15)
local slider = CreateFrame("Slider", nil, frame, "BackdropTemplate") local slider = CreateFrame("Slider", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
slider:SetOrientation("HORIZONTAL") slider:SetOrientation("HORIZONTAL")
slider:SetHeight(15) slider:SetHeight(15)
slider:SetHitRectInsets(0, 0, -10, 0) slider:SetHitRectInsets(0, 0, -10, 0)
@ -243,7 +247,7 @@ local function Constructor()
local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3) hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3)
local editbox = CreateFrame("EditBox", nil, frame, "BackdropTemplate") local editbox = CreateFrame("EditBox", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
editbox:SetAutoFocus(false) editbox:SetAutoFocus(false)
editbox:SetFontObject(GameFontHighlightSmall) editbox:SetFontObject(GameFontHighlightSmall)
editbox:SetPoint("TOP", slider, "BOTTOM") editbox:SetPoint("TOP", slider, "BOTTOM")

View File

@ -9,8 +9,8 @@
-- make into AceHook. -- make into AceHook.
-- @class file -- @class file
-- @name AceHook-3.0 -- @name AceHook-3.0
-- @release $Id: AceHook-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ -- @release $Id: AceHook-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 9 local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 8
local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR) local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR)
if not AceHook then return end -- No upgrade needed if not AceHook then return end -- No upgrade needed
@ -195,6 +195,7 @@ function hook(self, obj, method, handler, script, secure, raw, forceSecure, usag
registry[self][method] = nil registry[self][method] = nil
end end
handlers[uid], actives[uid], scripts[uid] = nil, nil, nil handlers[uid], actives[uid], scripts[uid] = nil, nil, nil
uid = nil
end end
local orig local orig
@ -477,10 +478,10 @@ function AceHook:UnhookAll()
for key, value in pairs(registry[self]) do for key, value in pairs(registry[self]) do
if type(key) == "table" then if type(key) == "table" then
for method in pairs(value) do for method in pairs(value) do
AceHook.Unhook(self, key, method) self:Unhook(key, method)
end end
else else
AceHook.Unhook(self, key) self:Unhook(key)
end end
end end
end end

View File

@ -10,7 +10,7 @@
-- make into AceSerializer. -- make into AceSerializer.
-- @class file -- @class file
-- @name AceSerializer-3.0 -- @name AceSerializer-3.0
-- @release $Id: AceSerializer-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ -- @release $Id: AceSerializer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
local MAJOR,MINOR = "AceSerializer-3.0", 5 local MAJOR,MINOR = "AceSerializer-3.0", 5
local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR) local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
@ -83,9 +83,9 @@ local function SerializeValue(v, res, nres)
elseif t=="table" then -- ^T...^t = table (list of key,value pairs) elseif t=="table" then -- ^T...^t = table (list of key,value pairs)
nres=nres+1 nres=nres+1
res[nres] = "^T" res[nres] = "^T"
for key,value in pairs(v) do for k,v in pairs(v) do
nres = SerializeValue(key, res, nres) nres = SerializeValue(k, res, nres)
nres = SerializeValue(value, res, nres) nres = SerializeValue(v, res, nres)
end end
nres=nres+1 nres=nres+1
res[nres] = "^t" res[nres] = "^t"

View File

@ -15,7 +15,7 @@
-- make into AceTimer. -- make into AceTimer.
-- @class file -- @class file
-- @name AceTimer-3.0 -- @name AceTimer-3.0
-- @release $Id: AceTimer-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ -- @release $Id: AceTimer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR) local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
@ -61,11 +61,11 @@ local function new(self, loop, func, delay, ...)
-- Compensate delay to get a perfect average delay, even if individual times don't match up perfectly -- Compensate delay to get a perfect average delay, even if individual times don't match up perfectly
-- due to fps differences -- due to fps differences
local time = GetTime() local time = GetTime()
local ndelay = timer.delay - (time - timer.ends) local delay = timer.delay - (time - timer.ends)
-- Ensure the delay doesn't go below the threshold -- Ensure the delay doesn't go below the threshold
if ndelay < 0.01 then ndelay = 0.01 end if delay < 0.01 then delay = 0.01 end
C_TimerAfter(ndelay, timer.callback) C_TimerAfter(delay, timer.callback)
timer.ends = time + ndelay timer.ends = time + delay
else else
activeTimers[timer.handle or timer] = nil activeTimers[timer.handle or timer] = nil
end end

View File

@ -1,26 +1,61 @@
--[[ $Id: CallbackHandler-1.0.lua 1298 2022-12-12 15:10:10Z nevcairiel $ ]] --[[ $Id: CallbackHandler-1.0.lua 3 2008-09-29 16:54:20Z nevcairiel $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 8 local MAJOR, MINOR = "CallbackHandler-1.0", 3
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
if not CallbackHandler then return end -- No upgrade needed if not CallbackHandler then return end -- No upgrade needed
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
-- Lua APIs local type = type
local securecallfunction, error = securecallfunction, error local pcall = pcall
local setmetatable, rawget = setmetatable, rawget local pairs = pairs
local next, select, pairs, type, tostring = next, select, pairs, type, tostring local assert = assert
local concat = table.concat
local loadstring = loadstring
local next = next
local select = select
local type = type
local xpcall = xpcall
local function errorhandler(err)
local function Dispatch(handlers, ...) return geterrorhandler()(err)
local index, method = next(handlers)
if not method then return end
repeat
securecallfunction(method, ...)
index, method = next(handlers, index)
until not method
end end
local function CreateDispatcher(argCount)
local code = [[
local next, xpcall, eh = ...
local method, ARGS
local function call() method(ARGS) end
local function dispatch(handlers, ...)
local index
index, method = next(handlers)
if not method then return end
local OLD_ARGS = ARGS
ARGS = ...
repeat
xpcall(call, eh)
index, method = next(handlers, index)
until not method
ARGS = OLD_ARGS
end
return dispatch
]]
local ARGS, OLD_ARGS = {}, {}
for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end
code = code:gsub("OLD_ARGS", concat(OLD_ARGS, ", ")):gsub("ARGS", concat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler)
end
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
-------------------------------------------------------------------------- --------------------------------------------------------------------------
-- CallbackHandler:New -- CallbackHandler:New
-- --
@ -29,7 +64,9 @@ end
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" -- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. -- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName) function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused)
-- TODO: Remove this after beta has gone out
assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused")
RegisterName = RegisterName or "RegisterCallback" RegisterName = RegisterName or "RegisterCallback"
UnregisterName = UnregisterName or "UnregisterCallback" UnregisterName = UnregisterName or "UnregisterCallback"
@ -51,19 +88,19 @@ function CallbackHandler.New(_self, target, RegisterName, UnregisterName, Unregi
local oldrecurse = registry.recurse local oldrecurse = registry.recurse
registry.recurse = oldrecurse + 1 registry.recurse = oldrecurse + 1
Dispatch(events[eventname], eventname, ...) Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...)
registry.recurse = oldrecurse registry.recurse = oldrecurse
if registry.insertQueue and oldrecurse==0 then if registry.insertQueue and oldrecurse==0 then
-- Something in one of our callbacks wanted to register more callbacks; they got queued -- Something in one of our callbacks wanted to register more callbacks; they got queued
for event,callbacks in pairs(registry.insertQueue) do for eventname,callbacks in pairs(registry.insertQueue) do
local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten. local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
for object,func in pairs(callbacks) do for self,func in pairs(callbacks) do
events[event][object] = func events[eventname][self] = func
-- fire OnUsed callback? -- fire OnUsed callback?
if first and registry.OnUsed then if first and registry.OnUsed then
registry.OnUsed(registry, target, event) registry.OnUsed(registry, target, eventname)
first = nil first = nil
end end
end end
@ -109,9 +146,9 @@ function CallbackHandler.New(_self, target, RegisterName, UnregisterName, Unregi
regfunc = function(...) self[method](self,...) end regfunc = function(...) self[method](self,...) end
end end
else else
-- function ref with self=object or self="addonId" or self=thread -- function ref with self=object or self="addonId"
if type(self)~="table" and type(self)~="string" and type(self)~="thread" then if type(self)~="table" and type(self)~="string" then
error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2) error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string expected.", 2)
end end
if select("#",...)>=1 then -- this is not the same as testing for arg==nil! if select("#",...)>=1 then -- this is not the same as testing for arg==nil!

View File

@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd"> ..\FrameXML\UI.xsd">
<Script file="CallbackHandler-1.0.lua"/> <Script file="CallbackHandler-1.0.lua"/>
</Ui> </Ui>

View File

@ -9,7 +9,7 @@ License: MIT
--- DRList-1.0 --- DRList-1.0
-- @module DRList-1.0 -- @module DRList-1.0
local MAJOR, MINOR = "DRList-1.0", 54 -- Don't forget to change this in Spells.lua aswell! local MAJOR, MINOR = "DRList-1.0", 40 -- Don't forget to change this in Spells.lua aswell!
local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR) local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR)
if not Lib then return end -- already loaded if not Lib then return end -- already loaded
@ -30,7 +30,7 @@ L["TAUNTS"] = "Taunts"
L["FEARS"] = "Fears" L["FEARS"] = "Fears"
L["RANDOM_ROOTS"] = "Random roots" L["RANDOM_ROOTS"] = "Random roots"
L["RANDOM_STUNS"] = "Random stuns" L["RANDOM_STUNS"] = "Random stuns"
L["OPENER_STUN"] = "Opener stuns" L["OPENER_STUN"] = "Opener Stuns"
L["HORROR"] = "Horrors" L["HORROR"] = "Horrors"
L["SCATTERS"] = "Scatters" L["SCATTERS"] = "Scatters"
L["SLEEPS"] = GetSpellInfo(1090) or "Sleep" L["SLEEPS"] = GetSpellInfo(1090) or "Sleep"
@ -129,30 +129,34 @@ Lib.gameExpansion = ({
[WOW_PROJECT_MAINLINE] = "retail", [WOW_PROJECT_MAINLINE] = "retail",
[WOW_PROJECT_CLASSIC] = "classic", [WOW_PROJECT_CLASSIC] = "classic",
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc", [WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc",
[WOW_PROJECT_WRATH_CLASSIC or 11] = "wotlk",
})[WOW_PROJECT_ID] })[WOW_PROJECT_ID]
local tocVersion = select(4, GetBuildInfo())
if tocVersion >= 30400 and tocVersion < 40000 then
Lib.gameExpansion = "wotlk" -- temporary check for wotlk build until new constant is added
end
-- How long it takes for a DR to expire, in seconds. -- How long it takes for a DR to expire, in seconds.
Lib.resetTimes = { Lib.resetTimes = {
retail = { retail = {
["default"] = 18.5, -- static 18 sec + 0.5 latency ["default"] = 18.5, -- 18 sec + 0.5 latency
["npc"] = 21, -- Against mobs it seems to last slightly longer, depending on server load ["npc"] = 23, -- Against mobs it seems to last slightly longer, depending on server load
["knockback"] = 10.5, -- Knockbacks are immediately immune and only DRs for 10s ["knockback"] = 10, -- Knockbacks are immediately immune and only DRs for 10s
}, },
classic = { classic = {
["default"] = 20, -- dynamic between 15 and 20s ["default"] = 19, -- dynamic between 15 and 20s
["npc"] = 21, ["npc"] = 23,
}, },
tbc = { tbc = {
["default"] = 20, -- dynamic between 15 and 20s ["default"] = 19, -- dynamic between 15 and 20s
["npc"] = 21, ["npc"] = 23,
}, },
wotlk = { wotlk = {
["default"] = 20, -- dynamic between 15 and 20s ["default"] = 19, -- dynamic between 15 and 20s
["npc"] = 21, ["npc"] = 23,
}, },
} }
@ -199,7 +203,7 @@ Lib.categoryNames = {
["counterattack"] = L.COUNTERATTACK, ["counterattack"] = L.COUNTERATTACK,
}, },
wotlk = { wotlk = { -- WORK IN PROGRESS
["incapacitate"] = L.INCAPACITATES, ["incapacitate"] = L.INCAPACITATES,
["stun"] = L.STUNS, ["stun"] = L.STUNS,
["random_stun"] = L.RANDOM_STUNS, ["random_stun"] = L.RANDOM_STUNS,
@ -219,12 +223,13 @@ Lib.categoryNames = {
} }
-- Categories that have DR against normal mobs. -- Categories that have DR against normal mobs.
-- Note that for retail some special mobs have DR on all categories, -- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
-- see UnitClassification() and UnitIsQuestBoss(). -- see UnitClassification() and UnitIsQuestBoss().
Lib.categoriesPvE = { Lib.categoriesPvE = {
retail = { retail = {
["taunt"] = L.TAUNTS, ["taunt"] = L.TAUNTS, -- Lib.categoryNames.retail.taunt
["stun"] = L.STUNS, ["stun"] = L.STUNS,
["root"] = L.ROOTS,
}, },
classic = { classic = {
@ -291,9 +296,9 @@ function Lib:GetCategories()
return Lib.categoryNames[Lib.gameExpansion] return Lib.categoryNames[Lib.gameExpansion]
end end
--- Get table of all categories that DRs in PvE. --- Get table of all categories that DRs in PvE only.
-- Key is unlocalized name used for API functions, value is localized name used for UI. -- Key is unlocalized name used for API functions, value is localized name used for UI.
-- Note that for retail some special mobs have DR on all categories, -- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
-- see UnitClassification() and UnitIsQuestBoss(). -- see UnitClassification() and UnitIsQuestBoss().
-- Tip: you can combine :GetPvECategories() and :IterateSpellsByCategory() to get spellIDs only for PvE aswell. -- Tip: you can combine :GetPvECategories() and :IterateSpellsByCategory() to get spellIDs only for PvE aswell.
-- @treturn table {string=string} -- @treturn table {string=string}
@ -336,7 +341,7 @@ function Lib:GetCategoryLocalization(category)
end end
--- Check if a category has DR against mobs. --- Check if a category has DR against mobs.
-- Note that for retail some special mobs have DR on all categories, you need to check for this yourself; -- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
-- see UnitClassification() and UnitIsQuestBoss(). -- see UnitClassification() and UnitIsQuestBoss().
-- @tparam string category Unlocalized category name -- @tparam string category Unlocalized category name
-- @treturn bool -- @treturn bool
@ -377,6 +382,7 @@ do
--- Iterate through the spells of a given category. --- Iterate through the spells of a given category.
-- @tparam string category Unlocalized category name -- @tparam string category Unlocalized category name
-- @usage for spellID in DRList:IterateSpellsByCategory("root") do print(spellID) end -- @usage for spellID in DRList:IterateSpellsByCategory("root") do print(spellID) end
-- @warning Slow function, do not use for frequent combat related stuff unless you cache results.
-- @return Iterator function -- @return Iterator function
function Lib:IterateSpellsByCategory(category) function Lib:IterateSpellsByCategory(category)
assert(Lib.categoryNames[Lib.gameExpansion][category], "invalid category") assert(Lib.categoryNames[Lib.gameExpansion][category], "invalid category")
@ -389,6 +395,6 @@ Lib.GetCategoryName = Lib.GetCategoryLocalization
Lib.IsPVE = Lib.IsPvECategory Lib.IsPVE = Lib.IsPvECategory
Lib.NextDR = Lib.GetNextDR Lib.NextDR = Lib.GetNextDR
Lib.GetSpellCategory = Lib.GetCategoryBySpellID Lib.GetSpellCategory = Lib.GetCategoryBySpellID
Lib.IterateSpells = Lib.IterateSpellsByCategory
Lib.RESET_TIME = Lib.resetTimes[Lib.gameExpansion].default Lib.RESET_TIME = Lib.resetTimes[Lib.gameExpansion].default
Lib.pveDR = Lib.categoriesPvE Lib.pveDR = Lib.categoriesPvE
Lib.IterateSpells = function(cat) if cat then return Lib.IterateSpellsByCategory(cat) else return next, Lib.spellList end end

View File

@ -1,8 +1,7 @@
## Interface: 100105 ## Interface: 90205
## Interface-Classic: 11403 ## Interface-Classic: 11402
## Interface-BCC: 20504 ## Interface-BCC: 20504
## Interface-Wrath: 30402 ## Interface-Wrath: 30400
## IconTexture: Interface\Icons\Spell_nature_heavypolymorph1
## Title: Lib: DRList-1.0 ## Title: Lib: DRList-1.0
## Version: @project-version@ ## Version: @project-version@
## X-Category: Library ## X-Category: Library
@ -15,7 +14,6 @@ libs\LibStub\LibStub.lua
#@end-no-lib-strip@ #@end-no-lib-strip@
DRList-1.0.xml DRList-1.0.xml
#@do-not-package@ #@do-not-package@
tests\engine.lua tests\engine.lua
tests\test-retail.lua tests\test-retail.lua

View File

@ -1,10 +1,5 @@
local MAJOR, MINOR = "DRList-1.0", 54 -- Don't forget to change this in DRList-1.0.lua aswell! local Lib, version = LibStub("DRList-1.0")
local Lib = LibStub(MAJOR) if Lib.spellList and version >= 40 then return end
if Lib.spellListVersion and Lib.spellListVersion >= MINOR then
return
end
Lib.spellListVersion = MINOR
if Lib.gameExpansion == "retail" then if Lib.gameExpansion == "retail" then
@ -13,20 +8,17 @@ if Lib.gameExpansion == "retail" then
[207167] = "disorient", -- Blinding Sleet [207167] = "disorient", -- Blinding Sleet
[207685] = "disorient", -- Sigil of Misery [207685] = "disorient", -- Sigil of Misery
[33786] = "disorient", -- Cyclone [33786] = "disorient", -- Cyclone
[360806] = "disorient", -- Sleep Walk
[1513] = "disorient", -- Scare Beast [1513] = "disorient", -- Scare Beast
[31661] = "disorient", -- Dragon's Breath [31661] = "disorient", -- Dragon's Breath
[198909] = "disorient", -- Song of Chi-ji [198909] = "disorient", -- Song of Chi-ji
[202274] = "disorient", -- Hot Trub [202274] = "disorient", -- Incendiary Brew
[105421] = "disorient", -- Blinding Light [105421] = "disorient", -- Blinding Light
[10326] = "disorient", -- Turn Evil [10326] = "disorient", -- Turn Evil
[205364] = "disorient", -- Dominate Mind
[605] = "disorient", -- Mind Control [605] = "disorient", -- Mind Control
[8122] = "disorient", -- Psychic Scream [8122] = "disorient", -- Psychic Scream
[226943] = "disorient", -- Mind Bomb [226943] = "disorient", -- Mind Bomb
[2094] = "disorient", -- Blind [2094] = "disorient", -- Blind
[118699] = "disorient", -- Fear [118699] = "disorient", -- Fear
[130616] = "disorient", -- Fear (Horrify)
[5484] = "disorient", -- Howl of Terror [5484] = "disorient", -- Howl of Terror
[261589] = "disorient", -- Seduction (Grimoire of Sacrifice) [261589] = "disorient", -- Seduction (Grimoire of Sacrifice)
[6358] = "disorient", -- Seduction (Succubus) [6358] = "disorient", -- Seduction (Succubus)
@ -39,11 +31,9 @@ if Lib.gameExpansion == "retail" then
[221527] = "incapacitate", -- Imprison (Honor talent) [221527] = "incapacitate", -- Imprison (Honor talent)
[2637] = "incapacitate", -- Hibernate [2637] = "incapacitate", -- Hibernate
[99] = "incapacitate", -- Incapacitating Roar [99] = "incapacitate", -- Incapacitating Roar
[378441] = "incapacitate", -- Time Stop
[3355] = "incapacitate", -- Freezing Trap [3355] = "incapacitate", -- Freezing Trap
[203337] = "incapacitate", -- Freezing Trap (Honor talent) [203337] = "incapacitate", -- Freezing Trap (Honor talent)
[213691] = "incapacitate", -- Scatter Shot [213691] = "incapacitate", -- Scatter Shot
[383121] = "incapacitate", -- Mass Polymorph
[118] = "incapacitate", -- Polymorph [118] = "incapacitate", -- Polymorph
[28271] = "incapacitate", -- Polymorph (Turtle) [28271] = "incapacitate", -- Polymorph (Turtle)
[28272] = "incapacitate", -- Polymorph (Pig) [28272] = "incapacitate", -- Polymorph (Pig)
@ -58,11 +48,8 @@ if Lib.gameExpansion == "retail" then
[161372] = "incapacitate", -- Polymorph (Peacock) [161372] = "incapacitate", -- Polymorph (Peacock)
[277787] = "incapacitate", -- Polymorph (Baby Direhorn) [277787] = "incapacitate", -- Polymorph (Baby Direhorn)
[277792] = "incapacitate", -- Polymorph (Bumblebee) [277792] = "incapacitate", -- Polymorph (Bumblebee)
[321395] = "incapacitate", -- Polymorph (Mawrat)
[391622] = "incapacitate", -- Polymorph (Duck)
[82691] = "incapacitate", -- Ring of Frost [82691] = "incapacitate", -- Ring of Frost
[115078] = "incapacitate", -- Paralysis [115078] = "incapacitate", -- Paralysis
[357768] = "incapacitate", -- Paralysis 2 (Perpetual Paralysis?)
[20066] = "incapacitate", -- Repentance [20066] = "incapacitate", -- Repentance
[9484] = "incapacitate", -- Shackle Undead [9484] = "incapacitate", -- Shackle Undead
[200196] = "incapacitate", -- Holy Word: Chastise [200196] = "incapacitate", -- Holy Word: Chastise
@ -85,12 +72,9 @@ if Lib.gameExpansion == "retail" then
[47476] = "silence", -- Strangulate [47476] = "silence", -- Strangulate
[204490] = "silence", -- Sigil of Silence [204490] = "silence", -- Sigil of Silence
-- [78675] = "silence", -- Solar Beam (has no DR) -- [78675] = "silence", -- Solar Beam (doesn't seem to DR)
[410065] = "silence", -- Reactive Resin
[202933] = "silence", -- Spider Sting [202933] = "silence", -- Spider Sting
[356727] = "silence", -- Spider Venom [356727] = "silence", -- Spider Venom
[354831] = "silence", -- Wailing Arrow 1
[355596] = "silence", -- Wailing Arrow 2
[217824] = "silence", -- Shield of Virtue [217824] = "silence", -- Shield of Virtue
[15487] = "silence", -- Silence [15487] = "silence", -- Silence
[1330] = "silence", -- Garrote [1330] = "silence", -- Garrote
@ -113,14 +97,10 @@ if Lib.gameExpansion == "retail" then
[5211] = "stun", -- Mighty Bash [5211] = "stun", -- Mighty Bash
[202244] = "stun", -- Overrun [202244] = "stun", -- Overrun
[325321] = "stun", -- Wild Hunt's Charge [325321] = "stun", -- Wild Hunt's Charge
[372245] = "stun", -- Terror of the Skies
[117526] = "stun", -- Binding Shot
[357021] = "stun", -- Consecutive Concussion [357021] = "stun", -- Consecutive Concussion
[24394] = "stun", -- Intimidation [24394] = "stun", -- Intimidation
[389831] = "stun", -- Snowdrift
[119381] = "stun", -- Leg Sweep [119381] = "stun", -- Leg Sweep
[202346] = "stun", -- Double Barrel [202346] = "stun", -- Double Barrel
[385149] = "stun", -- Exorcism
[853] = "stun", -- Hammer of Justice [853] = "stun", -- Hammer of Justice
[255941] = "stun", -- Wake of Ashes [255941] = "stun", -- Wake of Ashes
[64044] = "stun", -- Psychic Horror [64044] = "stun", -- Psychic Horror
@ -134,7 +114,6 @@ if Lib.gameExpansion == "retail" then
[171017] = "stun", -- Meteor Strike (Infernal) [171017] = "stun", -- Meteor Strike (Infernal)
[171018] = "stun", -- Meteor Strike (Abyssal) [171018] = "stun", -- Meteor Strike (Abyssal)
[30283] = "stun", -- Shadowfury [30283] = "stun", -- Shadowfury
[385954] = "stun", -- Shield Charge
[46968] = "stun", -- Shockwave [46968] = "stun", -- Shockwave
[132168] = "stun", -- Shockwave (Protection) [132168] = "stun", -- Shockwave (Protection)
[145047] = "stun", -- Shockwave (Proving Grounds PvE) [145047] = "stun", -- Shockwave (Proving Grounds PvE)
@ -144,16 +123,13 @@ if Lib.gameExpansion == "retail" then
[255723] = "stun", -- Bull Rush (Highmountain Tauren) [255723] = "stun", -- Bull Rush (Highmountain Tauren)
[287712] = "stun", -- Haymaker (Kul Tiran) [287712] = "stun", -- Haymaker (Kul Tiran)
[332423] = "stun", -- Sparkling Driftglobe Core (Kyrian Covenant) [332423] = "stun", -- Sparkling Driftglobe Core (Kyrian Covenant)
-- TODO: Inferal Awakening?
[204085] = "root", -- Deathchill (Chains of Ice) [204085] = "root", -- Deathchill (Chains of Ice)
[233395] = "root", -- Deathchill (Remorseless Winter) [233395] = "root", -- Deathchill (Remorseless Winter)
[339] = "root", -- Entangling Roots [339] = "root", -- Entangling Roots
[235963] = "root", -- Entangling Roots (Earthen Grasp)
[170855] = "root", -- Entangling Roots (Nature's Grasp) [170855] = "root", -- Entangling Roots (Nature's Grasp)
[102359] = "root", -- Mass Entanglement [102359] = "root", -- Mass Entanglement
[355689] = "root", -- Landslide [117526] = "root", -- Binding Shot
[393456] = "root", -- Entrapment (Tar Trap)
[162480] = "root", -- Steel Trap [162480] = "root", -- Steel Trap
[273909] = "root", -- Steelclaw Trap [273909] = "root", -- Steelclaw Trap
-- [190927] = "root_harpoon", -- Harpoon (TODO: confirm) -- [190927] = "root_harpoon", -- Harpoon (TODO: confirm)
@ -161,26 +137,19 @@ if Lib.gameExpansion == "retail" then
[201158] = "root", -- Super Sticky Tar [201158] = "root", -- Super Sticky Tar
[122] = "root", -- Frost Nova [122] = "root", -- Frost Nova
[33395] = "root", -- Freeze [33395] = "root", -- Freeze
[386770] = "root", -- Freezing Cold
[198121] = "root", -- Frostbite [198121] = "root", -- Frostbite
[114404] = "root", -- Void Tendril's Grasp
[342375] = "root", -- Tormenting Backlash (Torghast PvE) [342375] = "root", -- Tormenting Backlash (Torghast PvE)
[233582] = "root", -- Entrenched in Flame [233582] = "root", -- Entrenched in Flame
[116706] = "root", -- Disable [116706] = "root", -- Disable
[324382] = "root", -- Clash [324382] = "root", -- Clash
[64695] = "root", -- Earthgrab (Totem effect) [64695] = "root", -- Earthgrab (Totem effect)
-- [356738] = "root", -- Earth Unleashed (doesn't seem to DR)
[285515] = "root", -- Surge of Power [285515] = "root", -- Surge of Power
[199042] = "root", -- Thunderstruck (Protection PvP Talent)
--[356356] = "root", -- Warbringer TODO: has DR?
[39965] = "root", -- Frost Grenade (Item) [39965] = "root", -- Frost Grenade (Item)
[75148] = "root", -- Embersilk Net (Item) [75148] = "root", -- Embersilk Net (Item)
[55536] = "root", -- Frostweave Net (Item) [55536] = "root", -- Frostweave Net (Item)
[268966] = "root", -- Hooked Deep Sea Net (Item) [268966] = "root", -- Hooked Deep Sea Net (Item)
[209749] = "disarm", -- Faerie Swarm (Balance Honor Talent) [209749] = "disarm", -- Faerie Swarm (Balance Honor Talent)
[407032] = "disarm", -- Sticky Tar Bomb 1
[407031] = "disarm", -- Sticky Tar Bomb 2
[207777] = "disarm", -- Dismantle [207777] = "disarm", -- Dismantle
[233759] = "disarm", -- Grapple Weapon [233759] = "disarm", -- Grapple Weapon
[236077] = "disarm", -- Disarm [236077] = "disarm", -- Disarm
@ -245,8 +214,6 @@ elseif Lib.gameExpansion == "tbc" then
[11285] = "incapacitate", -- Gouge (Rank 4) [11285] = "incapacitate", -- Gouge (Rank 4)
[11286] = "incapacitate", -- Gouge (Rank 5) [11286] = "incapacitate", -- Gouge (Rank 5)
[38764] = "incapacitate", -- Gouge (Rank 6) [38764] = "incapacitate", -- Gouge (Rank 6)
[710] = "incapacitate", -- Banish (Rank 1)
[18647] = "incapacitate", -- Banish (Rank 2)
[13327] = "incapacitate", -- Reckless Charge (Rocket Helmet) [13327] = "incapacitate", -- Reckless Charge (Rocket Helmet)
[4064] = "incapacitate", -- Rough Copper Bomb [4064] = "incapacitate", -- Rough Copper Bomb
[4065] = "incapacitate", -- Large Copper Bomb [4065] = "incapacitate", -- Large Copper Bomb
@ -386,7 +353,7 @@ elseif Lib.gameExpansion == "tbc" then
[27067] = "counterattack", -- Counterattack (Rank 4) [27067] = "counterattack", -- Counterattack (Rank 4)
} }
elseif Lib.gameExpansion == "wotlk" then elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE BETA ACCESS
-- SpellID list for Wrath of the Lich King. -- SpellID list for Wrath of the Lich King.
-- spellID for every rank is used over spell name to avoid name collisions, and faster lookups -- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
@ -441,9 +408,6 @@ elseif Lib.gameExpansion == "wotlk" then
[30216] = "incapacitate", -- Fel Iron Bomb [30216] = "incapacitate", -- Fel Iron Bomb
[30461] = "incapacitate", -- The Bigger One [30461] = "incapacitate", -- The Bigger One
[30217] = "incapacitate", -- Adamantite Grenade [30217] = "incapacitate", -- Adamantite Grenade
[67769] = "incapacitate", -- Cobalt Frag Bomb
[67890] = "incapacitate", -- Cobalt Frag Bomb (Frag Belt)
[54466] = "incapacitate", -- Saronite Grenade
[47481] = "stun", -- Gnaw (Ghoul Pet) [47481] = "stun", -- Gnaw (Ghoul Pet)
[5211] = "stun", -- Bash (Rank 1) [5211] = "stun", -- Bash (Rank 1)
@ -533,7 +497,6 @@ elseif Lib.gameExpansion == "wotlk" then
[9853] = "root", -- Entangling Roots (Rank 6) [9853] = "root", -- Entangling Roots (Rank 6)
[26989] = "root", -- Entangling Roots (Rank 7) [26989] = "root", -- Entangling Roots (Rank 7)
[53308] = "root", -- Entangling Roots (Rank 8) [53308] = "root", -- Entangling Roots (Rank 8)
[65857] = "root", -- Entangling Roots (Rank 8) (TODO: Not sure which ID is correct)
[19975] = "root", -- Nature's Grasp (Rank 1) [19975] = "root", -- Nature's Grasp (Rank 1)
[19974] = "root", -- Nature's Grasp (Rank 2) [19974] = "root", -- Nature's Grasp (Rank 2)
[19973] = "root", -- Nature's Grasp (Rank 3) [19973] = "root", -- Nature's Grasp (Rank 3)
@ -541,8 +504,7 @@ elseif Lib.gameExpansion == "wotlk" then
[19971] = "root", -- Nature's Grasp (Rank 5) [19971] = "root", -- Nature's Grasp (Rank 5)
[19970] = "root", -- Nature's Grasp (Rank 6) [19970] = "root", -- Nature's Grasp (Rank 6)
[27010] = "root", -- Nature's Grasp (Rank 7) [27010] = "root", -- Nature's Grasp (Rank 7)
[53313] = "root", -- Nature's Grasp (Rank 8) [53312] = "root", -- Nature's Grasp (Rank 8)
[66070] = "root", -- Nature's Grasp (Rank 8) (TODO: Not sure which ID is correct)
[50245] = "root", -- Pin (Rank 1) [50245] = "root", -- Pin (Rank 1)
[53544] = "root", -- Pin (Rank 2) [53544] = "root", -- Pin (Rank 2)
[53545] = "root", -- Pin (Rank 3) [53545] = "root", -- Pin (Rank 3)
@ -556,10 +518,8 @@ elseif Lib.gameExpansion == "wotlk" then
[10230] = "root", -- Frost Nova (Rank 4) [10230] = "root", -- Frost Nova (Rank 4)
[27088] = "root", -- Frost Nova (Rank 5) [27088] = "root", -- Frost Nova (Rank 5)
[42917] = "root", -- Frost Nova (Rank 6) [42917] = "root", -- Frost Nova (Rank 6)
[64695] = "root", -- Earthgrab
[39965] = "root", -- Frost Grenade (Item) [39965] = "root", -- Frost Grenade (Item)
[63685] = "root", -- Freeze (Frost Shock) [63685] = "root", -- Freeze (Frost Shock)
[55536] = "root", -- Frostweave Net (Item)
[12494] = "random_root", -- Frostbite [12494] = "random_root", -- Frostbite
[55080] = "random_root", -- Shattered Barrier [55080] = "random_root", -- Shattered Barrier
@ -575,7 +535,6 @@ elseif Lib.gameExpansion == "wotlk" then
[53540] = "disarm", -- Snatch (Rank 4) [53540] = "disarm", -- Snatch (Rank 4)
[53542] = "disarm", -- Snatch (Rank 5) [53542] = "disarm", -- Snatch (Rank 5)
[53543] = "disarm", -- Snatch (Rank 6) [53543] = "disarm", -- Snatch (Rank 6)
[64346] = "disarm", -- Fiery Payback
[64058] = "disarm", -- Psychic Horror Disarm Effect [64058] = "disarm", -- Psychic Horror Disarm Effect
[51722] = "disarm", -- Dismantle [51722] = "disarm", -- Dismantle
[676] = "disarm", -- Disarm [676] = "disarm", -- Disarm
@ -593,8 +552,8 @@ elseif Lib.gameExpansion == "wotlk" then
[24259] = "silence", -- Spell Lock [24259] = "silence", -- Spell Lock
[43523] = "silence", -- Unstable Affliction 1 [43523] = "silence", -- Unstable Affliction 1
[31117] = "silence", -- Unstable Affliction 2 [31117] = "silence", -- Unstable Affliction 2
[18498] = "silence", -- Silenced - Gag Order (Shield Slam) [18498] = "silence", -- Silenced - Gag Order 1
[74347] = "silence", -- Silenced - Gag Order (Heroic Throw?) [74347] = "silence", -- Silenced - Gag Order 1
[50613] = "silence", -- Arcane Torrent (Racial, Runic Power) [50613] = "silence", -- Arcane Torrent (Racial, Runic Power)
[28730] = "silence", -- Arcane Torrent (Racial, Mana) [28730] = "silence", -- Arcane Torrent (Racial, Mana)
[25046] = "silence", -- Arcane Torrent (Racial, Energy) [25046] = "silence", -- Arcane Torrent (Racial, Energy)
@ -626,7 +585,6 @@ elseif Lib.gameExpansion == "wotlk" then
[33786] = "cyclone", -- Cyclone [33786] = "cyclone", -- Cyclone
[605] = "mind_control", -- Mind Control [605] = "mind_control", -- Mind Control
[13181] = "mind_control", -- Gnomish Mind Control Cap [13181] = "mind_control", -- Gnomish Mind Control Cap
[67799] = "mind_control", -- Mind Amplification Dish
[7922] = "charge", -- Charge Stun [7922] = "charge", -- Charge Stun
[19306] = "counterattack", -- Counterattack 1 [19306] = "counterattack", -- Counterattack 1
[20909] = "counterattack", -- Counterattack 2 [20909] = "counterattack", -- Counterattack 2
@ -634,6 +592,9 @@ elseif Lib.gameExpansion == "wotlk" then
[27067] = "counterattack", -- Counterattack 4 [27067] = "counterattack", -- Counterattack 4
[48998] = "counterattack", -- Counterattack 5 [48998] = "counterattack", -- Counterattack 5
[48999] = "counterattack", -- Counterattack 6 [48999] = "counterattack", -- Counterattack 6
--Storm, Earth and Fire has no DR
-- TODO: profession stuff
} }
elseif Lib.gameExpansion == "classic" then elseif Lib.gameExpansion == "classic" then

View File

@ -51,7 +51,7 @@ GlowMaskPool.parent = GlowParent
local TexPoolResetter = function(pool,tex) local TexPoolResetter = function(pool,tex)
local maskNum = tex:GetNumMaskTextures() local maskNum = tex:GetNumMaskTextures()
for i = maskNum , 1, -1 do for i = maskNum,1 do
tex:RemoveMaskTexture(tex:GetMaskTexture(i)) tex:RemoveMaskTexture(tex:GetMaskTexture(i))
end end
tex:Hide() tex:Hide()
@ -93,14 +93,14 @@ lib.GlowFramePool = GlowFramePool
local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel) local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel)
key = key or "" key = key or ""
frameLevel = frameLevel or 8 frameLevel = frameLevel or 8
if not r[name..key] then if not r[name..key] then
r[name..key] = GlowFramePool:Acquire() r[name..key] = GlowFramePool:Acquire()
r[name..key]:SetParent(r) r[name..key]:SetParent(r)
r[name..key].name = name..key r[name..key].name = name..key
end end
local f = r[name..key] local f = r[name..key]
f:SetFrameLevel(r:GetFrameLevel()+frameLevel) f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
f:SetPoint("TOPLEFT",r,"TOPLEFT",-xOffset+0.05,yOffset+0.05) f:SetPoint("TOPLEFT",r,"TOPLEFT",-xOffset+0.05,yOffset+0.05)
f:SetPoint("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05) f:SetPoint("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05)
f:Show() f:Show()
@ -613,7 +613,7 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
if not r then if not r then
return return
end end
frameLevel = frameLevel or 8; frameLevel = frameLevel or 8;
local throttle local throttle
if frequency and frequency > 0 then if frequency and frequency > 0 then
throttle = 0.25/frequency*0.01 throttle = 0.25/frequency*0.01
@ -628,8 +628,8 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2) f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2) f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
f.ants:SetSize(width*1.4*0.85, height*1.4*0.85) f.ants:SetSize(width*1.4*0.85, height*1.4*0.85)
AnimIn_OnFinished(f.animIn) AnimIn_OnFinished(f.animIn)
if f.animOut:IsPlaying() then if f.animOut:IsPlaying() then
f.animOut:Stop() f.animOut:Stop()
f.animIn:Play() f.animIn:Play()
end end

View File

@ -1,7 +1,6 @@
--@curseforge-project-slug: libsharedmedia-3-0@
--[[ --[[
Name: LibSharedMedia-3.0 Name: LibSharedMedia-3.0
Revision: $Revision: 128 $ Revision: $Revision: 114 $
Author: Elkano (elkano@gmx.de) Author: Elkano (elkano@gmx.de)
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com)
Website: http://www.wowace.com/projects/libsharedmedia-3-0/ Website: http://www.wowace.com/projects/libsharedmedia-3-0/

View File

@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd"> ..\FrameXML\UI.xsd">
<Script file="LibSharedMedia-3.0.lua" /> <Script file="LibSharedMedia-3.0.lua" />
</Ui> </Ui>

View File

@ -7,24 +7,24 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} } LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub _G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR LibStub.minor = LIBSTUB_MINOR
function LibStub:NewLibrary(major, minor) function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(string.match(minor, "%d+")), "Minor version must either be a number or contain a number.") minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
local oldminor = self.minors[major] local oldminor = self.minors[major]
if oldminor and oldminor >= minor then return nil end if oldminor and oldminor >= minor then return nil end
self.minors[major], self.libs[major] = minor, self.libs[major] or {} self.minors[major], self.libs[major] = minor, self.libs[major] or {}
return self.libs[major], oldminor return self.libs[major], oldminor
end end
function LibStub:GetLibrary(major, silent) function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2) error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
end end
return self.libs[major], self.minors[major] return self.libs[major], self.minors[major]
end end
function LibStub:IterateLibraries() return pairs(self.libs) end function LibStub:IterateLibraries() return pairs(self.libs) end
setmetatable(LibStub, { __call = LibStub.GetLibrary }) setmetatable(LibStub, { __call = LibStub.GetLibrary })
end end

View File

@ -27,19 +27,19 @@ function ACDFrame:Initialize()
self.ACDNumFrame:SetPoint("CENTER", 0, 128) self.ACDNumFrame:SetPoint("CENTER", 0, 128)
self.ACDNumFrame:Hide() self.ACDNumFrame:Hide()
local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "OVERLAY") local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH")
self.ACDNumTens = ACDNumTens self.ACDNumTens = ACDNumTens
self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize) self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize) self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0) self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "OVERLAY") local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH")
self.ACDNumOnes = ACDNumOnes self.ACDNumOnes = ACDNumOnes
self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize) self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize) self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0) self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "OVERLAY") local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH")
self.ACDNumOne = ACDNumOne self.ACDNumOne = ACDNumOne
self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize) self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize) self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize)

View File

@ -130,7 +130,7 @@ function Auras:CreateFrame(unit)
self.frame:SetAlpha(1) self.frame:SetAlpha(1)
end end
if (self.timeLeft <= 0) then if (self.timeLeft <= 0) then
Auras:AURA_FADE(self.unit, self.track, true) Auras:AURA_FADE(self.unit, self.track)
else else
if self.spellID == 8178 then if self.spellID == 8178 then
self.text:SetText("") self.text:SetText("")
@ -331,13 +331,13 @@ function Auras:UpdateFrame(unit)
if Gladdy.db.auraIconZoomed then if Gladdy.db.auraIconZoomed then
if auraFrame.icon.masked then if auraFrame.icon.masked then
auraFrame.icon:SetMask("") auraFrame.icon:SetMask(nil)
auraFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9) auraFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9)
auraFrame.icon.masked = nil auraFrame.icon.masked = nil
end end
else else
if not auraFrame.icon.masked then if not auraFrame.icon.masked then
auraFrame.icon:SetMask("") auraFrame.icon:SetMask(nil)
auraFrame.icon:SetTexCoord(0,1,0,1) auraFrame.icon:SetTexCoord(0,1,0,1)
auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
auraFrame.icon.masked = true auraFrame.icon.masked = true
@ -479,13 +479,13 @@ function Auras:UpdateInterruptFrame(unit)
if Gladdy.db.auraInterruptIconZoomed then if Gladdy.db.auraInterruptIconZoomed then
if interruptFrame.icon.masked then if interruptFrame.icon.masked then
interruptFrame.icon:SetMask("") interruptFrame.icon:SetMask(nil)
interruptFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9) interruptFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9)
interruptFrame.icon.masked = nil interruptFrame.icon.masked = nil
end end
else else
if not interruptFrame.icon.masked then if not interruptFrame.icon.masked then
interruptFrame.icon:SetMask("") interruptFrame.icon:SetMask(nil)
interruptFrame.icon:SetTexCoord(0,1,0,1) interruptFrame.icon:SetTexCoord(0,1,0,1)
interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
interruptFrame.icon.masked = true interruptFrame.icon.masked = true
@ -554,6 +554,8 @@ function Auras:Test(unit)
self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, duration, GetTime() + duration) self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, duration, GetTime() + duration)
end end
end end
-- /run LibStub("Gladdy").modules["Auras"]:Test("arena1")
-- /run LibStub("Gladdy"):JoinedArena()
--Interrupts --Interrupts
if (unit == "arena1" or unit == "arena3") then if (unit == "arena1" or unit == "arena3") then
@ -594,6 +596,10 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
return return
end end
if spellID == 31117 then
spellName = "Unstable Affliction Silence"
end
if not self.auras[spellName] then if not self.auras[spellName] then
return return
end end
@ -633,9 +639,9 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
end end
end end
function Auras:AURA_FADE(unit, auraType, force) function Auras:AURA_FADE(unit, auraType)
local auraFrame = self.frames[unit] local auraFrame = self.frames[unit]
if (not auraFrame or auraFrame.track ~= auraType or not Gladdy.buttons[unit] or (not force and Gladdy.buttons[unit].stealthed)) then if (not auraFrame or auraFrame.track ~= auraType) then
return return
end end
if auraFrame.active then if auraFrame.active then
@ -1236,7 +1242,14 @@ function Auras:GetAuraOptions(auraType)
for i,k in ipairs(auras) do for i,k in ipairs(auras) do
options[tostring(k)] = { options[tostring(k)] = {
type = "group", type = "group",
name = Gladdy:GetExceptionSpellName(k), name = (Gladdy:GetImportantAuras()["Unstable Affliction Silence"]
and Gladdy:GetImportantAuras()["Unstable Affliction Silence"].spellID == k
and Gladdy:GetImportantAuras()["Unstable Affliction Silence"].altName)
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, order = i+2,
icon = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)), icon = Gladdy:GetImportantAuras()[GetSpellInfo(k)] and Gladdy:GetImportantAuras()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
args = { args = {
@ -1309,7 +1322,10 @@ function Auras:GetInterruptOptions()
for i,k in ipairs(auras) do for i,k in ipairs(auras) do
options[tostring(k)] = { options[tostring(k)] = {
type = "group", type = "group",
name = GetSpellInfo(k), name = Gladdy:GetInterrupts()["Unstable Affliction Silence"]
and Gladdy:GetInterrupts()["Unstable Affliction Silence"].spellID == k
and Gladdy:GetInterrupts()["Unstable Affliction Silence"].altName
or GetSpellInfo(k),
order = i+2, order = i+2,
icon = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)), icon = Gladdy:GetInterrupts()[GetSpellInfo(k)] and Gladdy:GetInterrupts()[GetSpellInfo(k)].texture or select(3, GetSpellInfo(k)),
args = { args = {

View File

@ -300,13 +300,13 @@ local function styleIcon(aura, auraType)
if zoomedOption then if zoomedOption then
if aura.texture.masked then if aura.texture.masked then
aura.texture:SetMask("") aura.texture:SetMask(nil)
aura.texture:SetTexCoord(0.1,0.9,0.1,0.9) aura.texture:SetTexCoord(0.1,0.9,0.1,0.9)
aura.texture.masked = nil aura.texture.masked = nil
end end
else else
if not aura.texture.masked then if not aura.texture.masked then
aura.texture:SetMask("") aura.texture:SetMask(nil)
aura.texture:SetTexCoord(0,1,0,1) aura.texture:SetTexCoord(0,1,0,1)
aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
aura.texture.masked = true aura.texture.masked = true

View File

@ -123,7 +123,7 @@ function Castbar:CreateFrame(unit)
castBar.icon:SetPoint("LEFT", castBar, "RIGHT", 3, 0) -- Icon of castbar castBar.icon:SetPoint("LEFT", castBar, "RIGHT", 3, 0) -- Icon of castbar
end end
castBar.spellText = castBar:CreateFontString(nil, "OVERLAY") castBar.spellText = castBar:CreateFontString(nil, "LOW")
castBar.spellText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE") castBar.spellText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor)) castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
castBar.spellText:SetShadowOffset(1, -1) castBar.spellText:SetShadowOffset(1, -1)
@ -131,7 +131,7 @@ function Castbar:CreateFrame(unit)
castBar.spellText:SetJustifyH("CENTER") castBar.spellText:SetJustifyH("CENTER")
castBar.spellText:SetPoint("LEFT", 10, 0) -- Text of the spell castBar.spellText:SetPoint("LEFT", 10, 0) -- Text of the spell
castBar.timeText = castBar:CreateFontString(nil, "OVERLAY") castBar.timeText = castBar:CreateFontString(nil, "LOW")
castBar.timeText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE") castBar.timeText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor)) castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
castBar.timeText:SetShadowOffset(1, -1) castBar.timeText:SetShadowOffset(1, -1)
@ -197,13 +197,13 @@ function Castbar:UpdateFrame(unit)
castBar.icon.texture:SetAllPoints(castBar.icon) castBar.icon.texture:SetAllPoints(castBar.icon)
if Gladdy.db.castBarIconZoomed then if Gladdy.db.castBarIconZoomed then
if castBar.icon.texture.masked then if castBar.icon.texture.masked then
castBar.icon.texture:SetMask("") castBar.icon.texture:SetMask(nil)
castBar.icon.texture:SetTexCoord(0.1,0.9,0.1,0.9) castBar.icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
castBar.icon.texture.masked = nil castBar.icon.texture.masked = nil
end end
else else
if not castBar.icon.texture.masked then if not castBar.icon.texture.masked then
castBar.icon.texture:SetMask("") castBar.icon.texture:SetMask(nil)
castBar.icon.texture:SetTexCoord(0,1,0,1) castBar.icon.texture:SetTexCoord(0,1,0,1)
castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
castBar.icon.texture.masked = true castBar.icon.texture.masked = true

View File

@ -145,13 +145,13 @@ function Classicon:UpdateFrame(unit)
if Gladdy.db.classIconZoomed then if Gladdy.db.classIconZoomed then
if classIcon.texture.masked then if classIcon.texture.masked then
classIcon.texture:SetMask("") classIcon.texture:SetMask(nil)
classIcon.texture:SetTexCoord(0.1,0.9,0.1,0.9) classIcon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
classIcon.texture.masked = nil classIcon.texture.masked = nil
end end
else else
if not classIcon.texture.masked then if not classIcon.texture.masked then
classIcon.texture:SetMask("") classIcon.texture:SetMask(nil)
classIcon.texture:SetTexCoord(0,1,0,1) classIcon.texture:SetTexCoord(0,1,0,1)
classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
classIcon.texture.masked = true classIcon.texture.masked = true

View File

@ -1,6 +1,5 @@
local type, pairs, ipairs, ceil, tonumber, mod, tostring, upper, select, tinsert, tremove = type, pairs, ipairs, ceil, tonumber, mod, tostring, string.upper, select, tinsert, tremove local type, pairs, ipairs, ceil, tonumber, mod, tostring, upper, select, tinsert, tremove = type, pairs, ipairs, ceil, tonumber, mod, tostring, string.upper, select, tinsert, tremove
local tbl_sort = table.sort local tbl_sort = table.sort
local C_Timer = C_Timer
local GetTime = GetTime local GetTime = GetTime
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetSpellInfo = GetSpellInfo local GetSpellInfo = GetSpellInfo
@ -60,7 +59,6 @@ local Cooldowns = Gladdy:NewModule("Cooldowns", nil, {
cooldownXOffset = 0, cooldownXOffset = 0,
cooldownSize = 30, cooldownSize = 30,
cooldownIconGlow = true, cooldownIconGlow = true,
cooldownIconGlowColor = {r = 0.95, g = 0.95, b = 0.32, a = 1},
cooldownIconZoomed = false, cooldownIconZoomed = false,
cooldownIconDesaturateOnCooldown = false, cooldownIconDesaturateOnCooldown = false,
cooldownIconAlphaOnCooldown = 1, cooldownIconAlphaOnCooldown = 1,
@ -87,13 +85,8 @@ function Cooldowns:Initialize()
for _,spellTable in pairs(Gladdy:GetCooldownList()) do for _,spellTable in pairs(Gladdy:GetCooldownList()) do
for spellId,val in pairs(spellTable) do for spellId,val in pairs(spellTable) do
local spellName, _, texture = GetSpellInfo(spellId) local spellName, _, texture = GetSpellInfo(spellId)
if type(val) == "table" then if type(val) == "table" and val.icon then
if val.icon then texture = val.icon
texture = val.icon
end
if val.altName then
spellName = val.altName
end
end end
if spellName then if spellName then
self.cooldownSpellIds[spellName] = spellId self.cooldownSpellIds[spellName] = spellId
@ -116,6 +109,7 @@ end
function Cooldowns:CreateFrame(unit) function Cooldowns:CreateFrame(unit)
local button = Gladdy.buttons[unit] local button = Gladdy.buttons[unit]
-- Cooldown frame
local spellCooldownFrame = CreateFrame("Frame", nil, button) local spellCooldownFrame = CreateFrame("Frame", nil, button)
spellCooldownFrame:EnableMouse(false) spellCooldownFrame:EnableMouse(false)
spellCooldownFrame:SetMovable(true) spellCooldownFrame:SetMovable(true)
@ -126,7 +120,7 @@ function Cooldowns:CreateFrame(unit)
self.frames[unit] = spellCooldownFrame self.frames[unit] = spellCooldownFrame
end end
function Cooldowns:CreateIcon() function Cooldowns:CreateIcon() -- returns iconFrame
local icon local icon
if (#self.iconCache > 0) then if (#self.iconCache > 0) then
icon = tremove(self.iconCache, #self.iconCache) icon = tremove(self.iconCache, #self.iconCache)
@ -154,9 +148,6 @@ function Cooldowns:CreateIcon()
icon.cooldownFont = icon.cooldownFrame:CreateFontString(nil, "OVERLAY") icon.cooldownFont = icon.cooldownFrame:CreateFontString(nil, "OVERLAY")
icon.cooldownFont:SetAllPoints(icon) icon.cooldownFont:SetAllPoints(icon)
icon.glow = CreateFrame("Frame", nil, icon)
icon.glow:SetAllPoints(icon)
self:UpdateIcon(icon) self:UpdateIcon(icon)
end end
return icon return icon
@ -169,8 +160,6 @@ function Cooldowns:UpdateIcon(icon)
icon.cooldown:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 1) icon.cooldown:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 1)
icon.cooldownFrame:SetFrameStrata(Gladdy.db.cooldownFrameStrata) icon.cooldownFrame:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
icon.cooldownFrame:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 2) icon.cooldownFrame:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 2)
icon.glow:SetFrameStrata(Gladdy.db.cooldownFrameStrata)
icon.glow:SetFrameLevel(Gladdy.db.cooldownFrameLevel + 3)
icon:SetHeight(Gladdy.db.cooldownSize) icon:SetHeight(Gladdy.db.cooldownSize)
icon:SetWidth(Gladdy.db.cooldownSize * Gladdy.db.cooldownWidthFactor) icon:SetWidth(Gladdy.db.cooldownSize * Gladdy.db.cooldownWidthFactor)
@ -196,13 +185,13 @@ function Cooldowns:UpdateIcon(icon)
if Gladdy.db.cooldownIconZoomed then if Gladdy.db.cooldownIconZoomed then
if icon.texture.masked then if icon.texture.masked then
icon.texture:SetMask("") icon.texture:SetMask(nil)
icon.texture:SetTexCoord(0.1,0.9,0.1,0.9) icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
icon.texture.masked = nil icon.texture.masked = nil
end end
else else
if not icon.texture.masked then if not icon.texture.masked then
icon.texture:SetMask("") icon.texture:SetMask(nil)
icon.texture:SetTexCoord(0,1,0,1) icon.texture:SetTexCoord(0,1,0,1)
icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
icon.texture.masked = true icon.texture.masked = true
@ -218,9 +207,6 @@ function Cooldowns:UpdateIcon(icon)
else else
icon.texture:SetAlpha(1) icon.texture:SetAlpha(1)
end end
if icon.timer and not icon.timer:IsCancelled() then
LCG.PixelGlow_Start(icon.glow, Gladdy:ColorAsArray(Gladdy.db.cooldownIconGlowColor), 12, 0.15, nil, 2)
end
end end
function Cooldowns:IconsSetPoint(button) function Cooldowns:IconsSetPoint(button)
@ -272,6 +258,7 @@ end
function Cooldowns:UpdateFrame(unit) function Cooldowns:UpdateFrame(unit)
local button = Gladdy.buttons[unit] local button = Gladdy.buttons[unit]
-- Cooldown frame
local testAgain = false local testAgain = false
if (Gladdy.db.cooldown) then if (Gladdy.db.cooldown) then
button.spellCooldownFrame:SetHeight(Gladdy.db.cooldownSize) button.spellCooldownFrame:SetHeight(Gladdy.db.cooldownSize)
@ -346,11 +333,6 @@ function Cooldowns:ClearIcon(button, index, spellId, icon)
end end
end end
end end
icon:Show()
LCG.PixelGlow_Stop(icon.glow)
if icon.timer then
icon.timer:Cancel()
end
icon:ClearAllPoints() icon:ClearAllPoints()
icon:SetParent(nil) icon:SetParent(nil)
icon:Hide() icon:Hide()
@ -359,6 +341,7 @@ function Cooldowns:ClearIcon(button, index, spellId, icon)
icon.cooldown:Hide() icon.cooldown:Hide()
icon.cooldownFont:SetText("") icon.cooldownFont:SetText("")
icon:SetScript("OnUpdate", nil) icon:SetScript("OnUpdate", nil)
LCG:ButtonGlow_Stop(icon)
tinsert(self.iconCache, icon) tinsert(self.iconCache, icon)
end end
@ -366,13 +349,11 @@ end
-- Test -- Test
--------------------- ---------------------
-- /run LibStub("Gladdy").modules["Cooldowns"]:AURA_GAIN(_, AURA_TYPE_BUFF, 22812, "Barkskin", _, 20, _, _, _, _, "arena1", true)
-- /run LibStub("Gladdy").modules["Cooldowns"]:AURA_FADE("arena1", 22812)
function Cooldowns:Test(unit) function Cooldowns:Test(unit)
if Gladdy.frame.testing then if Gladdy.frame.testing then
self:UpdateTestCooldowns(unit) self:UpdateTestCooldowns(unit)
end end
Cooldowns:AURA_GAIN(_, AURA_TYPE_BUFF, 22812, "Barkskin", _, 20, _, _, _, _, unit, true) Cooldowns:AURA_GAIN(_, AURA_TYPE_BUFF, "22812", "Barkskin", _, 20, _, _, _, _, unit, true) -- unit, auraType, spellID, spellName, texture, duration, expirationTime
end end
function Cooldowns:UpdateTestCooldowns(unit) function Cooldowns:UpdateTestCooldowns(unit)
@ -387,9 +368,6 @@ function Cooldowns:UpdateTestCooldowns(unit)
end) end)
for _,icon in ipairs(orderedIcons) do for _,icon in ipairs(orderedIcons) do
if icon.timer then
icon.timer:Cancel()
end
self:CooldownUsed(unit, button.class, icon.spellId) self:CooldownUsed(unit, button.class, icon.spellId)
end end
end end
@ -416,9 +394,13 @@ function Cooldowns:UNIT_DESTROYED(unit)
self:ResetUnit(unit) self:ResetUnit(unit)
end end
--[[
/run local a=LibStub("Gladdy").modules["Cooldowns"] a:AURA_GAIN("arena1",22812)
/run local a=LibStub("Gladdy").modules["Cooldowns"] a:AURA_FADE("arena1",22812)
--]]
function Cooldowns:AURA_GAIN(_, auraType, spellID, spellName, _, duration, _, _, _, _, unitCaster, test) function Cooldowns:AURA_GAIN(_, auraType, spellID, spellName, _, duration, _, _, _, _, unitCaster, test)
local arenaUnit = test and unitCaster or Gladdy:GetArenaUnit(unitCaster, true) local arenaUnit = test and unitCaster or Gladdy:GetArenaUnit(unitCaster, true)
if not Gladdy.db.cooldownIconGlow or not arenaUnit or not Gladdy.buttons[arenaUnit] or auraType ~= AURA_TYPE_BUFF or spellID == 26889 then if not Gladdy.db.cooldownIconGlow or not arenaUnit or not Gladdy.buttons[arenaUnit] or auraType ~= AURA_TYPE_BUFF then
return return
end end
local cooldownFrame = Gladdy.buttons[arenaUnit].spellCooldownFrame local cooldownFrame = Gladdy.buttons[arenaUnit].spellCooldownFrame
@ -430,31 +412,22 @@ function Cooldowns:AURA_GAIN(_, auraType, spellID, spellName, _, duration, _, _,
for _,icon in pairs(cooldownFrame.icons) do for _,icon in pairs(cooldownFrame.icons) do
if (icon.spellId == spellId) then if (icon.spellId == spellId) then
Gladdy:Debug("INFO", "Cooldowns:AURA_GAIN", "PixelGlow_Start", spellID) if icon._ButtonGlow and not icon._ButtonGlow.animIn:IsPlaying() or not icon._ButtonGlow then
LCG.PixelGlow_Start(icon.glow, Gladdy:ColorAsArray(Gladdy.db.cooldownIconGlowColor), 12, 0.15, nil, 2) LCG.ButtonGlow_Start(icon, nil, 0.15)
if icon.timer then C_Timer.NewTimer(duration, function() LCG.ButtonGlow_Stop(icon) end)
icon.timer:Cancel()
end end
icon.timer = C_Timer.NewTimer(duration, function()
LCG.PixelGlow_Stop(icon.glow)
icon.timer:Cancel()
end)
end end
end end
end end
function Cooldowns:AURA_FADE(unit, spellID) function Cooldowns:AURA_FADE(unit, spellID)
if not Gladdy.buttons[unit] or Gladdy.buttons[unit].stealthed then if not Gladdy.buttons[unit] then
return return
end end
local cooldownFrame = Gladdy.buttons[unit].spellCooldownFrame local cooldownFrame = Gladdy.buttons[unit].spellCooldownFrame
for _,icon in pairs(cooldownFrame.icons) do for _,icon in pairs(cooldownFrame.icons) do
if (icon.spellId == spellID) then if (icon.spellId == spellID) then
Gladdy:Debug("INFO", "Cooldowns:AURA_FADE", "LCG.ButtonGlow_Stop") LCG.ButtonGlow_Stop(icon)
if icon.timer then
icon.timer:Cancel()
end
LCG.PixelGlow_Stop(icon.glow)
end end
end end
end end
@ -464,22 +437,12 @@ end
--------------------- ---------------------
function Cooldowns:CooldownStart(button, spellId, duration, start) function Cooldowns:CooldownStart(button, spellId, duration, start)
-- starts timer frame
if not duration or duration == nil or type(duration) ~= "number" then if not duration or duration == nil or type(duration) ~= "number" then
return return
end end
local cooldown = Gladdy:GetCooldownList()[button.class][spellId]
if type(cooldown) == "table" then
if (button.spec ~= nil and cooldown[button.spec] ~= nil) then
cooldown = cooldown[button.spec]
else
cooldown = cooldown.cd
end
end
for _,icon in pairs(button.spellCooldownFrame.icons) do for _,icon in pairs(button.spellCooldownFrame.icons) do
if (icon.spellId == spellId) then if (icon.spellId == spellId) then
if not start and icon.active and icon.timeLeft > cooldown/2 then
return -- do not trigger cooldown again
end
icon.active = true icon.active = true
icon.timeLeft = start and start - GetTime() + duration or duration icon.timeLeft = start and start - GetTime() + duration or duration
if (not Gladdy.db.cooldownDisableCircle) then icon.cooldown:SetCooldown(start or GetTime(), duration) end if (not Gladdy.db.cooldownDisableCircle) then icon.cooldown:SetCooldown(start or GetTime(), duration) end
@ -489,6 +452,7 @@ function Cooldowns:CooldownStart(button, spellId, duration, start)
if Gladdy.db.cooldownIconAlphaOnCooldown < 1 then if Gladdy.db.cooldownIconAlphaOnCooldown < 1 then
icon.texture:SetAlpha(Gladdy.db.cooldownIconAlphaOnCooldown) icon.texture:SetAlpha(Gladdy.db.cooldownIconAlphaOnCooldown)
end end
--if math.random(1, 30 ) > 10 then LCG.ButtonGlow_Start(icon, nil, 0.15) end
icon:SetScript("OnUpdate", function(self, elapsed) icon:SetScript("OnUpdate", function(self, elapsed)
self.timeLeft = self.timeLeft - elapsed self.timeLeft = self.timeLeft - elapsed
local timeLeft = ceil(self.timeLeft) local timeLeft = ceil(self.timeLeft)
@ -507,7 +471,6 @@ function Cooldowns:CooldownStart(button, spellId, duration, start)
Cooldowns:CooldownReady(button, spellId, icon) Cooldowns:CooldownReady(button, spellId, icon)
end end
end) end)
break
--C_VoiceChat.SpeakText(2, GetSpellInfo(spellId), 3, 4, 100) --C_VoiceChat.SpeakText(2, GetSpellInfo(spellId), 3, 4, 100)
end end
end end
@ -524,10 +487,7 @@ local function resetIcon(icon)
icon.cooldown:Hide() icon.cooldown:Hide()
icon.cooldownFont:SetText("") icon.cooldownFont:SetText("")
icon:SetScript("OnUpdate", nil) icon:SetScript("OnUpdate", nil)
if icon.timer then --LCG.ButtonGlow_Stop(icon)
icon.timer:Cancel()
end
LCG.PixelGlow_Stop(icon.glow)
end end
function Cooldowns:CooldownReady(button, spellId, frame) function Cooldowns:CooldownReady(button, spellId, frame)
@ -547,11 +507,13 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, expirationTimeInSecond
if not button then if not button then
return return
end end
-- if (self.db.cooldownList[spellId] == false) then return end
local cooldown = Gladdy:GetCooldownList()[unitClass][spellId] local cooldown = Gladdy:GetCooldownList()[unitClass][spellId]
local cd = cooldown local cd = cooldown
if (type(cooldown) == "table") then if (type(cooldown) == "table") then
-- return if the spec doesn't have a cooldown for this spell -- return if the spec doesn't have a cooldown for this spell
--if (arenaSpecs[unit] ~= nil and cooldown.notSpec ~= nil and arenaSpecs[unit] == cooldown.notSpec) then return end
if (button.spec ~= nil and cooldown.notSpec ~= nil and button.spec == cooldown.notSpec) then if (button.spec ~= nil and cooldown.notSpec ~= nil and button.spec == cooldown.notSpec) then
return return
end end
@ -564,6 +526,7 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, expirationTimeInSecond
end end
-- check if there is a special cooldown for the units spec -- check if there is a special cooldown for the units spec
--if (arenaSpecs[unit] ~= nil and cooldown[arenaSpecs[unit]] ~= nil) then
if (button.spec ~= nil and cooldown[button.spec] ~= nil) then if (button.spec ~= nil and cooldown[button.spec] ~= nil) then
cd = cooldown[button.spec] cd = cooldown[button.spec]
else else
@ -638,6 +601,7 @@ function Cooldowns:AddCooldown(spellID, value, button)
icon.texture:SetTexture(self.spellTextures[spellID]) icon.texture:SetTexture(self.spellTextures[spellID])
tinsert(button.spellCooldownFrame.icons, icon) tinsert(button.spellCooldownFrame.icons, icon)
self:IconsSetPoint(button) self:IconsSetPoint(button)
Gladdy:Debug("INFO", "Cooldowns:AddCooldown", button.unit, GetSpellInfo(spellID))
end end
end end
@ -759,10 +723,17 @@ function Cooldowns:GetOptions()
name = L["Cooldown"], name = L["Cooldown"],
order = 2, order = 2,
}, },
cooldownIconGlow = Gladdy:option({
type = "toggle",
name = L["Glow Icon"],
desc = L["Glow the icon when cooldown active"],
order = 3,
width = "full",
}),
cooldownIconDesaturateOnCooldown = Gladdy:option({ cooldownIconDesaturateOnCooldown = Gladdy:option({
type = "toggle", type = "toggle",
name = L["Desaturate Icon"], name = L["Desaturate Icon"],
order = 5, order = 4,
width = "full", width = "full",
}), }),
cooldownIconAlphaOnCooldown = Gladdy:option({ cooldownIconAlphaOnCooldown = Gladdy:option({
@ -770,7 +741,7 @@ function Cooldowns:GetOptions()
name = L["Cooldown alpha on CD"], name = L["Cooldown alpha on CD"],
desc = L["Alpha of the icon when cooldown active"], desc = L["Alpha of the icon when cooldown active"],
desc = L["changes "], desc = L["changes "],
order = 6, order = 5,
min = 0, min = 0,
max = 1, max = 1,
step = 0.1, step = 0.1,
@ -779,12 +750,12 @@ function Cooldowns:GetOptions()
headerCircle = { headerCircle = {
type = "header", type = "header",
name = L["Cooldowncircle"], name = L["Cooldowncircle"],
order = 10, order = 6,
}, },
cooldownDisableCircle = Gladdy:option({ cooldownDisableCircle = Gladdy:option({
type = "toggle", type = "toggle",
name = L["No Cooldown Circle"], name = L["No Cooldown Circle"],
order = 11, order = 8,
width = "full", width = "full",
}), }),
cooldownCooldownAlpha = Gladdy:option({ cooldownCooldownAlpha = Gladdy:option({
@ -793,7 +764,7 @@ function Cooldowns:GetOptions()
min = 0, min = 0,
max = 1, max = 1,
step = 0.1, step = 0.1,
order = 12, order = 9,
width = "full", width = "full",
}), }),
cooldownCooldownNumberAlpha = { cooldownCooldownNumberAlpha = {
@ -802,7 +773,7 @@ function Cooldowns:GetOptions()
min = 0, min = 0,
max = 1, max = 1,
step = 0.1, step = 0.1,
order = 13, order = 10,
width = "full", width = "full",
set = function(info, value) set = function(info, value)
Gladdy.db.cooldownFontColor.a = value Gladdy.db.cooldownFontColor.a = value
@ -814,48 +785,10 @@ function Cooldowns:GetOptions()
}, },
}, },
}, },
glow = {
type = "group",
name = L["Glow"],
order = 3,
args = {
header = {
type = "header",
name = L["Glow"],
order = 1,
},
cooldownIconGlow = Gladdy:option({
type = "toggle",
name = L["Glow Icon"],
desc = L["Glow the icon when cooldown active"],
order = 2,
width = "full",
}),
cooldownIconGlowColor = Gladdy:colorOption({
disabled = function() return not Gladdy.db.cooldownIconGlow end,
type = "color",
hasAlpha = true,
name = L["Glow color"],
desc = L["Color of the glow"],
order = 3,
width = "full",
}),
resetGlow = {
type = "execute",
name = L["Reset Glow"],
desc = L["Reset Glow Color"],
func = function()
Gladdy.db.cooldownIconGlowColor = {r = 0.95, g = 0.95, b = 0.32, a = 1}
Gladdy:UpdateFrame()
end,
order = 3,
}
},
},
font = { font = {
type = "group", type = "group",
name = L["Font"], name = L["Font"],
order = 4, order = 3,
args = { args = {
header = { header = {
type = "header", type = "header",
@ -892,7 +825,7 @@ function Cooldowns:GetOptions()
position = { position = {
type = "group", type = "group",
name = L["Position"], name = L["Position"],
order = 6, order = 5,
args = { args = {
header = { header = {
type = "header", type = "header",
@ -956,7 +889,7 @@ function Cooldowns:GetOptions()
border = { border = {
type = "group", type = "group",
name = L["Border"], name = L["Border"],
order = 5, order = 4,
args = { args = {
header = { header = {
type = "header", type = "header",
@ -981,7 +914,7 @@ function Cooldowns:GetOptions()
frameStrata = { frameStrata = {
type = "group", type = "group",
name = L["Frame Strata and Level"], name = L["Frame Strata and Level"],
order = 7, order = 6,
args = { args = {
headerAuraLevel = { headerAuraLevel = {
type = "header", type = "header",

View File

@ -7,6 +7,7 @@ local CreateFrame = CreateFrame
local GetTime = GetTime local GetTime = GetTime
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
--local DRData = LibStub("DRData-1.0-BCC")
local DRData = LibStub("DRList-1.0") local DRData = LibStub("DRList-1.0")
local L = Gladdy.L local L = Gladdy.L
local function defaultCategories() local function defaultCategories()
@ -294,13 +295,13 @@ function Diminishings:UpdateFrame(unit)
if Gladdy.db.drIconZoomed then if Gladdy.db.drIconZoomed then
if icon.texture.masked then if icon.texture.masked then
icon.texture:SetMask("") icon.texture:SetMask(nil)
icon.texture:SetTexCoord(0.1,0.9,0.1,0.9) icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
icon.texture.masked = nil icon.texture.masked = nil
end end
else else
if not icon.texture.masked then if not icon.texture.masked then
icon.texture:SetMask("") icon.texture:SetMask(nil)
icon.texture:SetTexCoord(0,1,0,1) icon.texture:SetTexCoord(0,1,0,1)
icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
icon.texture.masked = true icon.texture.masked = true

View File

@ -79,7 +79,7 @@ function Healthbar:CreateFrame(unit)
healthBar.bg:SetAlpha(1) healthBar.bg:SetAlpha(1)
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor)) healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
healthBar.nameText = healthBar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
if (Gladdy.db.healthBarNameFontSize < 1) then if (Gladdy.db.healthBarNameFontSize < 1) then
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1)
healthBar.nameText:Hide() healthBar.nameText:Hide()
@ -93,7 +93,7 @@ function Healthbar:CreateFrame(unit)
healthBar.nameText:SetJustifyH("CENTER") healthBar.nameText:SetJustifyH("CENTER")
healthBar.nameText:SetPoint("LEFT", Gladdy.db.healthTextLeftHOffset, Gladdy.db.healthTextLeftVOffset) healthBar.nameText:SetPoint("LEFT", Gladdy.db.healthTextLeftHOffset, Gladdy.db.healthTextLeftVOffset)
healthBar.healthText = healthBar:CreateFontString(nil, "OVERLAY") healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
if (Gladdy.db.healthBarHealthFontSize < 1) then if (Gladdy.db.healthBarHealthFontSize < 1) then
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1)
healthBar.healthText:Hide() healthBar.healthText:Hide()
@ -146,6 +146,7 @@ local function getGradient(start, ending, percentage, factor)
return start * abs(-2 * percentage + 1) + ending * factor return start * abs(-2 * percentage + 1) + ending * factor
end end
-- /run LibStub("Gladdy").modules["Health Bar"]:SetHealthStatusBarColor("arena1", 51, 100)
local rMax, gMax, bMax, rMid, gMid, bMid, rMin, gMin, bMin, rNow, gNow, bNow, percentage, factor, stealthAlpha local rMax, gMax, bMax, rMid, gMid, bMid, rMin, gMin, bMin, rNow, gNow, bNow, percentage, factor, stealthAlpha
function Healthbar:SetHealthStatusBarColor(unit, health, healthMax) function Healthbar:SetHealthStatusBarColor(unit, health, healthMax)
local button = Gladdy.buttons[unit] local button = Gladdy.buttons[unit]

View File

@ -1,6 +1,6 @@
local string_gsub, floor, pairs = string.gsub, math.floor, pairs local string_gsub, floor, pairs = string.gsub, math.floor, pairs
local CreateFrame, SetPortraitTexture = CreateFrame, SetPortraitTexture local CreateFrame, SetPortraitTexture = CreateFrame, SetPortraitTexture
local UnitHealthMax, UnitHealth, UnitGUID, UnitExists = UnitHealthMax, UnitHealth, UnitGUID, UnitExists local UnitHealthMax, UnitHealth, UnitGUID = UnitHealthMax, UnitHealth, UnitGUID
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
@ -47,7 +47,6 @@ function Pets:UpdateFrameOnce()
self:RegisterMessage("PET_DESTROYED") self:RegisterMessage("PET_DESTROYED")
self:RegisterMessage("PET_STEALTH") self:RegisterMessage("PET_STEALTH")
self:RegisterMessage("ENEMY_SPOTTED") self:RegisterMessage("ENEMY_SPOTTED")
self:RegisterMessage("UNIT_DEATH")
else else
self:UnregisterAllMessages() self:UnregisterAllMessages()
end end
@ -57,11 +56,6 @@ function Pets:JOINED_ARENA()
for _,v in pairs(self.frames) do for _,v in pairs(self.frames) do
v.healthBar:SetAlpha(0) v.healthBar:SetAlpha(0)
end end
for i=1,Gladdy.curBracket do
if UnitExists("arenapet" .. i) then
Gladdy:SendMessage("PET_SPOTTED", "arenapet" .. i)
end
end
if Gladdy.db.petEnabled then if Gladdy.db.petEnabled then
self:RegisterEvent("UNIT_PET") self:RegisterEvent("UNIT_PET")
self:SetScript("OnEvent", function(_, event, unitId) self:SetScript("OnEvent", function(_, event, unitId)
@ -83,7 +77,6 @@ function Pets:ResetUnit(unitId)
end end
petFrame.healthBar:SetAlpha(0) petFrame.healthBar:SetAlpha(0)
petFrame.healthBar:SetScript("OnUpdate", nil) petFrame.healthBar:SetScript("OnUpdate", nil)
petFrame.healthBar.portrait:SetTexture(nil)
self:UnregisterEvent("UNIT_PET") self:UnregisterEvent("UNIT_PET")
end end
@ -97,20 +90,15 @@ function Pets:PET_SPOTTED(unit)
Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit)) Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit))
end) end)
end end
Gladdy:Print(self.frames[unit].healthBar:GetAlpha())
end end
function Pets:PET_DESTROYED(unit) function Pets:PET_DESTROYED(unit)
if Gladdy.db.petEnabled and self.frames[unit] then if Gladdy.db.petEnabled then
self.frames[unit].healthBar:SetAlpha(0) self.frames[unit].healthBar:SetAlpha(0)
self.frames[unit].healthBar:SetScript("OnUpdate", nil) self.frames[unit].healthBar:SetScript("OnUpdate", nil)
end end
end end
function Pets:UNIT_DEATH(unit)
self:PET_DESTROYED(unit)
end
function Pets:PET_STEALTH(unit) function Pets:PET_STEALTH(unit)
if Gladdy.db.petEnabled then if Gladdy.db.petEnabled then
self.frames[unit].healthBar.hp:SetStatusBarColor(0.66, 0.66, 0.66, 1) self.frames[unit].healthBar.hp:SetStatusBarColor(0.66, 0.66, 0.66, 1)
@ -134,7 +122,6 @@ function Pets:CheckUnitPet(unitId)
petFrame.healthBar.hp:SetMinMaxValues(0, UnitHealthMax(unit)) petFrame.healthBar.hp:SetMinMaxValues(0, UnitHealthMax(unit))
petFrame.healthBar.hp:SetValue(UnitHealth(unit)) petFrame.healthBar.hp:SetValue(UnitHealth(unit))
Pets:SetHealthText(petFrame.healthBar, UnitHealth(unit), UnitHealthMax(unit)) Pets:SetHealthText(petFrame.healthBar, UnitHealth(unit), UnitHealthMax(unit))
SetPortraitTexture(petFrame.healthBar.portrait, unit)
petFrame.healthBar:SetScript("OnUpdate", function(self) petFrame.healthBar:SetScript("OnUpdate", function(self)
self.hp:SetValue(UnitHealth(self.unit)) self.hp:SetValue(UnitHealth(self.unit))
Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit)) Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit))
@ -215,7 +202,7 @@ function Pets:CreateFrame(unitId)
healthBar.bg:SetAlpha(1) healthBar.bg:SetAlpha(1)
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor)) healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor))
healthBar.nameText = healthBar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
if (Gladdy.db.petHealthBarFontSize < 1) then if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1) healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.nameText:Hide() healthBar.nameText:Hide()
@ -229,7 +216,7 @@ function Pets:CreateFrame(unitId)
healthBar.nameText:SetJustifyH("CENTER") healthBar.nameText:SetJustifyH("CENTER")
healthBar.nameText:SetPoint("LEFT", 5, 0) healthBar.nameText:SetPoint("LEFT", 5, 0)
healthBar.healthText = healthBar:CreateFontString(nil, "OVERLAY") healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
if (Gladdy.db.petHealthBarFontSize < 1) then if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1) healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.healthText:Hide() healthBar.healthText:Hide()
@ -359,7 +346,7 @@ function Pets:SetHealthText(healthBar, health, healthMax)
healthText = ("%d%%"):format(healthPercentage) healthText = ("%d%%"):format(healthPercentage)
end end
else else
healthText = "" healthText = "DEAD"
end end
healthBar.healthText:SetText(healthText) healthBar.healthText:SetText(healthText)

View File

@ -81,7 +81,7 @@ function Powerbar:CreateFrame(unit)
powerBar.bg:SetAllPoints(powerBar.energy) powerBar.bg:SetAllPoints(powerBar.energy)
powerBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.powerBarBgColor)) powerBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.powerBarBgColor))
powerBar.raceText = powerBar:CreateFontString(nil, "OVERLAY") powerBar.raceText = powerBar:CreateFontString(nil, "LOW")
powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarRaceFontSize, Gladdy.db.powerTextLeftOutline and "OUTLINE") powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarRaceFontSize, Gladdy.db.powerTextLeftOutline and "OUTLINE")
powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor)) powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
powerBar.raceText:SetShadowOffset(1, -1) powerBar.raceText:SetShadowOffset(1, -1)
@ -89,7 +89,7 @@ function Powerbar:CreateFrame(unit)
powerBar.raceText:SetJustifyH("CENTER") powerBar.raceText:SetJustifyH("CENTER")
powerBar.raceText:SetPoint("LEFT", Gladdy.db.powerTextLeftHOffset, Gladdy.db.powerTextLeftVOffset) powerBar.raceText:SetPoint("LEFT", Gladdy.db.powerTextLeftHOffset, Gladdy.db.powerTextLeftVOffset)
powerBar.powerText = powerBar:CreateFontString(nil, "OVERLAY") powerBar.powerText = powerBar:CreateFontString(nil, "LOW")
powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarPowerFontSize, Gladdy.db.powerTextRightOutline and "OUTLINE") powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarPowerFontSize, Gladdy.db.powerTextRightOutline and "OUTLINE")
powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor)) powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
powerBar.powerText:SetShadowOffset(1, -1) powerBar.powerText:SetShadowOffset(1, -1)

View File

@ -169,13 +169,13 @@ function Racial:UpdateFrame(unit)
if Gladdy.db.racialIconZoomed then if Gladdy.db.racialIconZoomed then
if racial.texture.masked then if racial.texture.masked then
racial.texture:SetMask("") racial.texture:SetMask(nil)
racial.texture:SetTexCoord(0.1,0.9,0.1,0.9) racial.texture:SetTexCoord(0.1,0.9,0.1,0.9)
racial.texture.masked = nil racial.texture.masked = nil
end end
else else
if not racial.texture.masked then if not racial.texture.masked then
racial.texture:SetMask("") racial.texture:SetMask(nil)
racial.texture:SetTexCoord(0,1,0,1) racial.texture:SetTexCoord(0,1,0,1)
racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
racial.texture.masked = true racial.texture.masked = true

View File

@ -357,6 +357,8 @@ function RangeCheck:GetSpells()
end, end,
set = function(_, value) set = function(_, value)
Gladdy.db.rangeCheckDefaultSpells[class].min = tonumber(value) Gladdy.db.rangeCheckDefaultSpells[class].min = tonumber(value)
--Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.min.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s", select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
-- 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 - %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))) Gladdy.options.args["Range Check"].args.oorSpells.args[class].args.headerMin.name = GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min) and format("|T%s:20|t %s - %d" .. L["yds"], select(3, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(1, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)), select(6, GetSpellInfo(Gladdy.db.rangeCheckDefaultSpells[class].min)))
or "nil" or "nil"
end end

View File

@ -25,6 +25,9 @@ local ShadowsightTimer = Gladdy:NewModule("Shadowsight Timer", nil, {
shadowsightTimerFrameLevel = 20, 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, ...) function ShadowsightTimer:OnEvent(event, ...)
self[event](self, ...) self[event](self, ...)
end end

View File

@ -203,15 +203,13 @@ end
function TotemPlates:NAME_PLATE_UNIT_REMOVED(unitID) function TotemPlates:NAME_PLATE_UNIT_REMOVED(unitID)
local nameplate = C_NamePlate.GetNamePlateForUnit(unitID) local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
self.activeTotemNameplates[unitID] = nil self.activeTotemNameplates[unitID] = nil
--self:ToggleAddon(nameplate, true)
if nameplate.gladdyTotemFrame then if nameplate.gladdyTotemFrame then
nameplate.gladdyTotemFrame:Hide() nameplate.gladdyTotemFrame:Hide()
nameplate.gladdyTotemFrame:SetParent(nil) nameplate.gladdyTotemFrame:SetParent(nil)
tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame) tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
nameplate.gladdyTotemFrame = nil nameplate.gladdyTotemFrame = nil
end end
if (self.addon == "ElvUI") then
self:ToggleAddon(nameplate, true)
end
end end
--------------------------------------------------- ---------------------------------------------------
@ -375,26 +373,12 @@ function TotemPlates:ToggleAddon(nameplate, show)
local addonFrames = { self:GetAddonFrame(nameplate) } local addonFrames = { self:GetAddonFrame(nameplate) }
if addonFrames and #addonFrames > 0 then if addonFrames and #addonFrames > 0 then
if show then if show then
for _, frame in ipairs(addonFrames) do for _,v in ipairs(addonFrames) do
if frame.UpdateAllElements then v:Show()
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_ADDED - nameplate.unitFrame:UpdateAllElements")
frame:Show()
frame:UpdateAllElements("NAME_PLATE_UNIT_ADDED")
else
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_ADDED - Show")
frame:Show()
end
end end
else else
for _, frame in ipairs(addonFrames) do for _,v in ipairs(addonFrames) do
if frame.UpdateAllElements then v:Hide()
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_REMOVED - nameplate.unitFrame:UpdateAllElements")
frame:UpdateAllElements("NAME_PLATE_UNIT_REMOVED")
frame:Hide()
else
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_REMOVED - Hide")
frame:Hide()
end
end end
end end
end end
@ -406,7 +390,7 @@ function TotemPlates.OnUpdate(self)
else else
self.selectionHighlight:SetAlpha(0) self.selectionHighlight:SetAlpha(0)
end end
if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui") 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() self.parent.unitFrame:Hide()
end end
end end
@ -458,7 +442,7 @@ function TotemPlates:OnUnitEvent(unitID)
nameplate.gladdyTotemFrame.parent = nameplate nameplate.gladdyTotemFrame.parent = nameplate
nameplate.gladdyTotemFrame:Show() nameplate.gladdyTotemFrame:Show()
TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID) TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID)
self:ToggleAddon(nameplate, false) self:ToggleAddon(nameplate)
self.activeTotemNameplates[unitID] = nameplate self.activeTotemNameplates[unitID] = nameplate
elseif totemDataEntry and not Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled and Gladdy.db.npTotemsHideDisabledTotems then elseif totemDataEntry and not Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled and Gladdy.db.npTotemsHideDisabledTotems then
if nameplate.gladdyTotemFrame then if nameplate.gladdyTotemFrame then
@ -467,7 +451,7 @@ function TotemPlates:OnUnitEvent(unitID)
tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame) tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
nameplate.gladdyTotemFrame = nil nameplate.gladdyTotemFrame = nil
end end
self:ToggleAddon(nameplate, false) self:ToggleAddon(nameplate)
else else
self:ToggleAddon(nameplate, true) self:ToggleAddon(nameplate, true)
end end

View File

@ -182,13 +182,13 @@ function Trinket:UpdateFrame(unit)
if Gladdy.db.trinketIconZoomed then if Gladdy.db.trinketIconZoomed then
if trinket.texture.masked then if trinket.texture.masked then
trinket.texture:SetMask("") trinket.texture:SetMask(nil)
trinket.texture:SetTexCoord(0.1,0.9,0.1,0.9) trinket.texture:SetTexCoord(0.1,0.9,0.1,0.9)
trinket.texture.masked = nil trinket.texture.masked = nil
end end
else else
if not trinket.texture.masked then if not trinket.texture.masked then
trinket.texture:SetMask("") trinket.texture:SetMask(nil)
trinket.texture:SetTexCoord(0,1,0,1) trinket.texture:SetTexCoord(0,1,0,1)
trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
trinket.texture.masked = true trinket.texture.masked = true

View File

@ -4,7 +4,7 @@
--- ---
## [v2.27-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.27-Release/Gladdy_Classic_v2.27-Release.zip) ## [v2.20-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.20-Release/Gladdy_Classic_v2.20-Beta.zip)
###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work ###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
@ -55,13 +55,11 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
## Contributors ## Contributors
- [XyzKangUI](https://github.com/XyzKangUI)
- [ManneN1](https://github.com/ManneN1) - [ManneN1](https://github.com/ManneN1)
- [AlexFolland](https://github.com/AlexFolland) - [AlexFolland](https://github.com/AlexFolland)
- [dfherr](https://github.com/dfherr) - [dfherr](https://github.com/dfherr)
- [miraage](https://github.com/miraage) - [miraage](https://github.com/miraage)
- [veiz](https://github.com/veiz) - [veiz](https://github.com/veiz)
- [Flamanis](https://github.com/Flamanis)
Thank you! Thank you!
@ -81,52 +79,6 @@ Thank you!
### Changes ### Changes
### v2.27-Release
- fix TotemPlates interfering with NeatPlates
### v2.26-Release
- fix TotemPlates interfering with Plater (thanks again [Flamanis](https://github.com/Flamanis))
### v2.25-Release
- fix TotemPlates interfering with ElvUI (thanks [Flamanis](https://github.com/Flamanis))
### v2.24-Release
- fix for WotLK v30402 (update libs)
- update DRList
- fix taint issue on first load up
### v2.23-Release
- fix for WotLK v30401 (update libs + layers + masks)
### v2.22-Release
- fixed unwanted committed changes to LibCustomGlow
### v2.21-Release
- **Cooldowns**
- glows minor fix again...
- more tracking
- **Pets**
- death detection improved
- detection improved
### v2.20-Release
- **Cooldowns**
- glow changed to PixelGlow
- glow color configurable
- improved tracking
- feign death cd tracking
- fixed Elemental Mastery and Presence of Mind tracking
- **Auras**
- improved **Aura** tracking
- stealthed unit **Aura** tracking improved
- fixed Berserking Wrath
- **Totemplates**
- ElvUI fix
- fix ManaSpringTotem
- fix Paladin **SpecDetection**
- fix DRList conflict with Diminish
- minor bugfixes/improvements
### v2.20-Beta ### v2.20-Beta
- **Wrath** & **BCC** support - **Wrath** & **BCC** support
- different auras/DRs/Cooldowns/Buffs per expansion - different auras/DRs/Cooldowns/Buffs per expansion

View File

@ -1,9 +1,6 @@
local pairs, ipairs = pairs, ipairs local pairs, ipairs = pairs, ipairs
local select = select
local type = type
local floor = math.floor local floor = math.floor
local str_find, str_gsub, str_sub, str_format = string.find, string.gsub, string.sub, string.format local str_find, str_gsub, str_sub, tinsert = string.find, string.gsub, string.sub, table.insert
local tinsert = table.insert
local Gladdy = LibStub("Gladdy") local Gladdy = LibStub("Gladdy")
local L = Gladdy.L local L = Gladdy.L
local AuraUtil = AuraUtil local AuraUtil = AuraUtil
@ -182,80 +179,4 @@ function Gladdy:GetArenaUnit(unitCaster, unify)
end end
end end
end end
end
function Gladdy:ShallowCopy(table)
local copy
if type(table) == 'table' then
copy = {}
for k,v in pairs(table) do
copy[k] = v
end
else -- number, string, boolean, etc
copy = table
end
return copy
end
function Gladdy:DeepCopy(table)
local copy
if type(table) == 'table' then
copy = {}
for k,v in pairs(table) do
if type(v) == 'table' then
copy[k] = self:DeepCopy(v)
else -- number, string, boolean, etc
copy[k] = v
end
end
else -- number, string, boolean, etc
copy = table
end
return copy
end
function Gladdy:AddEntriesToTable(table, entries)
for k,v in pairs(entries) do
if not table[k] then
table[k] = v
end
end
end
function Gladdy:GetExceptionSpellName(spellID)
for k,v in pairs(Gladdy.exceptionNames) do
if k == spellID and Gladdy:GetImportantAuras()[v] and Gladdy:GetImportantAuras()[v].altName then
return Gladdy:GetImportantAuras()[v].altName
end
end
return select(1, GetSpellInfo(spellID))
end
local function toHex(color)
if not color or not color.r or not color.g or not color.b then
return "000000"
end
return str_format("%.2x%.2x%.2x", floor(color.r * 255), floor(color.g * 255), floor(color.b * 255))
end
function Gladdy:SetTextColor(text, color)
return "|cff" .. toHex(color) .. text or "" .. "|r"
end
function Gladdy:ColorAsArray(color)
return {color.r, color.g, color.b, color.a}
end
function Gladdy:Dump(table, space)
if type(table) ~= "table" then
return
end
if not space then
space = ""
end
for k,v in pairs(table) do
Gladdy:Print(space .. k .. " - ", v)
if type(v) == "table" then
Gladdy:Dump(v, space .. " ")
end
end
end end