diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..d1180b8 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "permissions": { + "deny": [ + "Bash(git push:*)", + "Bash(git commit:*)", + "Bash(git add:*)", + "Bash(git submodule update:*)", + "Bash(gh:*)", + "Edit(~/.github/addons/refs/**)" + ], + "additionalDirectories": [ + "../refs" + ] + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5a0d5e4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3a626c3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/interface.yml b/.github/workflows/interface.yml new file mode 100644 index 0000000..967bd9a --- /dev/null +++ b/.github/workflows/interface.yml @@ -0,0 +1,38 @@ +name: Interface + +on: + schedule: + - cron: '0 6 1 * *' + workflow_dispatch: + +jobs: + bump: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Update TOC + uses: p3lim/toc-interface-updater@v4 + with: + depth: '1' # only Filger.toc, not submodule TOCs + # written in this order, unsorted: keep it matching Filger.toc + flavor: | + vanilla + tbc + wrath + mists + retail + forever + + - name: Create PR + uses: peter-evans/create-pull-request@v8 + with: + branch: toc-bump + delete-branch: true + commit-message: 'toc: update interface' + title: 'toc: update interface' + body: Live client versions changed. Test in-game before merging. diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c8bd603 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint + +on: + push: + branches: [master] + paths: ['**.lua', '**.xml', '*.toc', '.luacheckrc', '.github/workflows/lint.yml'] + pull_request: + paths: ['**.lua', '**.xml', '*.toc', '.luacheckrc', '.github/workflows/lint.yml'] + +jobs: + check: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + submodules: recursive # TOC lists files inside submodules + token: ${{ secrets.SUBMODULES_TOKEN }} # libs/CallbackHandler-1.0 is private + persist-credentials: false + + - name: Luacheck + uses: lunarmodules/luacheck@v1 + + - name: TOC check + uses: lua-wow/toc-check@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56bf1a5..432e1fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,35 +1,24 @@ -name: Release -on: - push: - tags: - - 'v*' -jobs: - release: - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_FILE: "Filger.zip" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - token: ${{ secrets.GH_PAT }} - - - name: Build - run: make zip FILENAME=${{ env.RELEASE_FILE }} - - - name: Create Release - run: | - gh release create \ - --repo ${{ github.repository }} \ - --title ${{ github.ref_name }} \ - --generate-notes \ - ${{ github.ref_name }} - - - name: Upload Zip File - run: | - gh release upload \ - --clobber "${{ github.ref_name }}" \ - --repo ${{ github.repository }} \ - ${{ env.RELEASE_FILE }} +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + submodules: recursive + token: ${{ secrets.SUBMODULES_TOKEN }} # libs/CallbackHandler-1.0 is private + persist-credentials: false + + - name: Package + uses: lua-wow/packager@v1 + with: + check-version: true diff --git a/.gitignore b/.gitignore index 56a6a54..677ec37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# IDE .vscode/ .idea/ *.iml + +# Files +docs/issues/ diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..6d1c8eb --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,79 @@ +std = 'lua51' + +quiet = 1 -- suppress report output for files without warnings + +unused_secondaries = false -- e.g. local name, _, itemLevel = GetItemInfo(...) + +-- see https://luacheck.readthedocs.io/en/stable/warnings.html#list-of-warnings +-- and https://luacheck.readthedocs.io/en/stable/cli.html#patterns +exclude_files = { + '.claude/**', + 'docs/**', + 'core/development.lua', -- dev-only helpers + 'libs/**', -- submodules +} + +ignore = { + '212', -- unused argument (callback signatures) + '213', -- unused loop variable + '431', -- shadowing an upvalue + '432/self', -- shadowing upvalue argument self (nested methods) + '611', -- line contains only whitespace + '612', -- line contains trailing whitespace + '614', -- trailing whitespace in comment + '631', -- line is too long +} + +-- data files keep the full expansion ladder for authoring entries +files['data/shared/blacklist.lua'] = { ignore = { '211/LE_EXPANSION_.*' } } +files['data/shared/cooldowns.lua'] = { ignore = { '211/LE_EXPANSION_.*' } } + +-- globals Filger is allowed to set or mutate +globals = { + -- slash commands + 'SLASH_FILGER1', + 'SlashCmdList', +} + +read_globals = { + string = {fields = {'split'}}, + table = {fields = {'wipe'}}, + + -- namespaces + 'C_AddOns', + 'C_Container', + 'C_Item', + 'C_Spell', + 'C_SpellBook', + 'C_UnitAuras', + + -- constants + 'WOW_PROJECT_BURNING_CRUSADE_CLASSIC', + 'WOW_PROJECT_CAMELOT', + 'WOW_PROJECT_CATACLYSM_CLASSIC', + 'WOW_PROJECT_CLASSIC', + 'WOW_PROJECT_ID', + 'WOW_PROJECT_MAINLINE', + 'WOW_PROJECT_MISTS_CLASSIC', + 'WOW_PROJECT_WRATH_CLASSIC', + + -- API and FrameXML + 'AuraUtil', + 'CreateColor', + 'CreateFrame', + 'Display_DisplayModeDropDown', + 'EnumerateFrames', + 'GameTooltip', + 'GetBuildInfo', + 'GetCVar', + 'GetPhysicalScreenSize', + 'GetTime', + 'LibStub', + 'Mixin', + 'UIParent', + 'UnitCanAssist', + 'UnitCanAttack', + 'UnitClass', + 'UnitGUID', + 'UnitName', +} diff --git a/CHANGELOG.md b/CHANGELOG.md index e075612..26eafa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Support for Midnight (12.0) secret values: restricted auras are looked up by listed spell ids, secret cooldowns use duration objects +- Support for Classic Forever, TBC Anniversary and Titan WotLK clients +- Spells for Mists of Pandaria Classic +- CI: luacheck lint, interface version bump, packager release + ### Changed -- patch 5.5.0 -- Added spells for Mists of Pandaria Classic +- Single `Filger.toc` for every client; removed `Filger_Classic.toc` and `Filger_Mists.toc` +- Spell data split into per-client `data/` folders, loaded through the TOC `[Game]` variable +- Replaced deprecated item/spell globals with `C_Item`, `C_Container`, `C_SpellBook` and `C_Spell` +- Debuff colors from `AuraUtil` +- Updated libraries (LibStub, CallbackHandler-1.0, LibDispel) + +### Removed + +- Cataclysm Classic from the TOC + +### Fixed + +- luacheck warnings, leaked `numVisible` and `itemType` globals ## [5.2.1] - 2025-03-08 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..b2dca78 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,73 @@ +# CLAUDE.md + +`Filger` is a World of Warcraft addon: a minimal buff/debuff tracker. +It is minimal both in-game and in source. The same addon directory is copied unchanged into +every client's `Interface` folder and must look and behave the same everywhere. + +**Status:** being revived after a long break. Expect code broken by changed/removed Blizzard +APIs and by secret values. Don't assume existing code is correct. + +## Philosophy + +**No configuration.** No options UI, slash-command configuration (`/filger` is help/dev only), +profiles, per-character or per-client settings, and no SavedVariables added just to make +something configurable. Decisions are made in code and constants (`config.lua`, `data/`). +The declared SavedVariable (`FilgerData`) is currently unused. If a feature genuinely needs new persistent state, explain +why before adding it. + +**Minimalism.** No frameworks, abstractions, compatibility layers, helper systems or +dependencies unless they solve a real problem. 30 understandable lines beat a 300-line +generic system. + +**Efficiency.** Prefer "detect change → update only what changed" over "event → reapply +everything". Avoid repeated updates, repeated calls to the same API, unnecessary loops, +tables/closures in hot paths, redundant event registrations and reapplying the same style. +Don't micro-optimize ordinary code, but treat repeated work as a design problem. + +**Style.** Lua 5.1 / WoW runtime. Small focused functions, locals, minimal shared mutable +state, no new globals, calculation separated from side effects where practical. Use the +prototype style where it is already used. This is a preference: WoW's API and the existing +architecture win when they conflict. + +## Changing code + +- Preserve existing behavior and visual design unless it is broken or the API makes it impossible. +- Smallest correct change. No unrelated refactors, reformatting or modernization. +- For API compatibility problems: identify the failing API/event/frame behavior → find every + Filger usage → verify current behavior on each affected client → fix → check other + usages of the same changed API. + +## Compatibility + +- One `Filger.toc` serves every client; never add `Filger_*.toc`. Client-specific files are + tagged per line with `[AllowLoadGameType ...]`. +- Never assume an API exists on every client, or that Retail and Classic behave the same. +- Never guess about secret/restricted values: check the target client's generated Blizzard + API docs before using a result in logic. If unsure, say so. +- Never invent an API. Mark anything you can't verify as "unverified". +- Supported clients, TOC rules, libraries, runtime client checks, secret values: [docs/compatibility.md](docs/compatibility.md). + +## References + +- Blizzard `wow-ui-source` (local clone in `../refs`, read-only) is the API authority. Use + targeted searches, not broad exploration. Map: [docs/reference-repositories.md](docs/reference-repositories.md). + +## Git & GitHub + +I review and test changes in-game, then group them into commits myself. + +- Read freely: git status/diff/log/show/blame, branches, worktrees, submodule status; + `gh` issues, PRs and repo info. +- Edit files in the working tree and leave changes uncommitted. +- Never mutate the repository or its history unless I explicitly ask: no commit, add, push, + pull, fetch, merge, rebase, checkout/switch, reset, restore, stash, cherry-pick, tag, + or submodule pointer changes. A finished task is not permission to commit. +- Don't create, edit or comment on GitHub issues/PRs unless I explicitly ask. +- Issue workflow: read the issue → inspect code → propose a plan → implement → leave uncommitted. +- Never add `Co-authored by Claude Code` on commits, PRs or issues. + +## Verifying + +- After Lua changes, run `mise exec -- make check` (luacheck) and report the result. +- Claude can't run the game. Tell me what to verify in-game (`/reload`) and on which clients; + I'll paste Lua errors back. diff --git a/Filger.lua b/Filger.lua index f509819..5be6de4 100644 --- a/Filger.lua +++ b/Filger.lua @@ -5,20 +5,18 @@ local LibDispel = LibStub("LibDispel") assert(LibDispel, "Filger requires LibDispel") local blacklist = ns.Filger.blacklist or {} -local cooldowns = ns.Filger.cooldowns or {} -local spells = ns.Filger.spells or {} -- Blizzard local CreateFrame = _G.CreateFrame local UnitIsUnit = _G.UnitIsUnit local UnitIsOwnerOrControllerOfUnit = _G.UnitIsOwnerOrControllerOfUnit -local IsSpellKnown = _G.IsSpellKnown -local GetSpellInfo = C_Spell and C_Spell.GetSpellInfo or _G.GetSpellInfo -local GetSpellName = C_Spell and C_Spell.GetSpellName or _G.GetSpellInfo -local GetSpellCooldown = _G.GetSpellCooldown +local IsSpellKnown = C_SpellBook.IsSpellKnown local GetInventoryItemLink = _G.GetInventoryItemLink -local GetItemInfo = _G.GetItemInfo +local GetItemInfo = C_Item.GetItemInfo +local GetItemCooldown = C_Container.GetItemCooldown local GetInventoryItemCooldown = _G.GetInventoryItemCooldown +local C_Secrets = _G.C_Secrets +local issecretvalue = _G.issecretvalue -------------------------------------------------- -- Filger @@ -55,6 +53,17 @@ do end end + -- secret durations can't drive the OnUpdate timer text, Blizzard countdown numbers are used instead + function button_proto:SetSecret(isSecret) + if self.isSecret == isSecret then return end + self.isSecret = isSecret + self.Cooldown:SetHideCountdownNumbers(not isSecret) + if isSecret then + self:SetScript("OnUpdate", nil) + self.Time:SetText("") + end + end + function button_proto:OnLeave() if GameTooltip:IsForbidden() then return end GameTooltip:Hide() @@ -328,7 +337,12 @@ do function aura_proto:ProcessData(unit, data) if not data then return end - data.isPlayerAura = data.sourceUnit and (UnitIsUnit("player", data.sourceUnit) or UnitIsOwnerOrControllerOfUnit("player", data.sourceUnit)) + if self.restricted then + -- unit comparisons may be secret while restricted + data.isPlayerAura = data.isFromPlayerOrPlayerPet + else + data.isPlayerAura = data.sourceUnit and (UnitIsUnit("player", data.sourceUnit) or UnitIsOwnerOrControllerOfUnit("player", data.sourceUnit)) + end data.dispelName = LibDispel:GetDispelType(data.spellId, data.dispelName) data.isDispelable = LibDispel:IsDispelable(unit, data.spellId, data.dispelName, data.isHarmful) @@ -348,17 +362,41 @@ do data.enabled = false end - if Filger.isClassic then + if Filger.isVanilla then data.auraIndex = self:GetAuraIndex(unit, data.auraInstanceID, self.filter) end return data end + -- Retail: while auras are secret, tainted code can't list them; only spells whose aura + -- isn't secret can be looked up one by one, so only listed spells are shown. + function aura_proto:ScanSpellAuras(unit) + local isHarmful = self.filter:find("HARMFUL") ~= nil + local isPlayer = self.filter:find("PLAYER") ~= nil + + for spellId in next, self.spells do + if not C_Secrets.ShouldSpellAuraBeSecret(spellId) then + local data = C_UnitAuras.GetUnitAuraBySpellID(unit, spellId) + if data and data.isHarmful == isHarmful and (not isPlayer or data.isFromPlayerOrPlayerPet) then + data = self:ProcessData(unit, data) + self.all[data.auraInstanceID] = data + + if self:FilterAura(unit, data) then + self.actives[data.auraInstanceID] = true + end + end + end + end + end + function aura_proto:UpdateAuras(event, unit, updateInfo) if (self.unit ~= unit) then return end - local isFullUpdate = not updateInfo or updateInfo.isFullUpdate + local isRestricted = C_Secrets and C_Secrets.ShouldAurasBeSecret() + -- updateInfo is secret while restricted; cached auras are stale right after it + local isFullUpdate = isRestricted or self.restricted or not updateInfo or updateInfo.isFullUpdate + self.restricted = isRestricted local changed = false @@ -367,13 +405,17 @@ do self.actives = table.wipe(self.actives or {}) changed = true - local slots = { C_UnitAuras.GetAuraSlots(unit, self.filter) } - for i = 2, #slots do -- #1 return is continuationToken, we don't care about it - local data = self:ProcessData(unit, C_UnitAuras.GetAuraDataBySlot(unit, slots[i])) - self.all[data.auraInstanceID] = data + if isRestricted then + self:ScanSpellAuras(unit) + else + local slots = { C_UnitAuras.GetAuraSlots(unit, self.filter) } + for i = 2, #slots do -- #1 return is continuationToken, we don't care about it + local data = self:ProcessData(unit, C_UnitAuras.GetAuraDataBySlot(unit, slots[i])) + self.all[data.auraInstanceID] = data - if self:FilterAura(unit, data) then - self.actives[data.auraInstanceID] = true + if self:FilterAura(unit, data) then + self.actives[data.auraInstanceID] = true + end end end else @@ -427,7 +469,7 @@ do table.sort(self.sorted, self.SortAuras) - numVisible = math.min(self.limit, #self.sorted) + local numVisible = math.min(self.limit, #self.sorted) for i = 1, numVisible do self:Update(unit, self.sorted[i], i) @@ -504,6 +546,8 @@ do self.createdButtons = self.createdButtons + 1 end + button:SetSecret(data.durationObject ~= nil) + -- tooltips button.unit = unit button.spellId = data.spellId @@ -517,7 +561,10 @@ do button.expirationTime = data.expirationTime or GetTime() if button.Cooldown then - if data.duration and data.duration > 0 then + if data.durationObject then + button.Cooldown:SetCooldownFromDurationObject(data.durationObject) + button.Cooldown:Show() + elseif data.duration and data.duration > 0 then button.Cooldown:SetCooldown(data.expirationTime - data.duration, data.duration, data.timeMod) button.Cooldown:Show() else @@ -553,7 +600,11 @@ do --]] function cooldown_proto:FilterCooldown(data) if not data.name then return end - return data.name + -- secret cooldown: already known to be active and off GCD; casts can't be recorded while restricted + if data.durationObject then + return data.enabled and data.isKnown + end + return data.name and data.enabled and data.isKnown and data.casted @@ -574,7 +625,7 @@ do end function cooldown_proto:ProcessCooldownData(unit, data) - local index, name, icon, start, duration, enabled + local index, name, icon, start, duration, enabled, durationObject if data.spellId then index = "SPELL_" .. data.spellId @@ -585,8 +636,15 @@ do end local cdInfo = Filger.GetSpellCooldown(data.spellId) if cdInfo then - start = cdInfo.startTime - duration = cdInfo.duration + if C_Secrets and C_Secrets.ShouldSpellCooldownBeSecret(data.spellId) then + -- startTime/duration are secret; isActive/isOnGCD never are + if cdInfo.isActive and not cdInfo.isOnGCD then + durationObject = C_Spell.GetSpellCooldownDuration(data.spellId) + end + else + start = cdInfo.startTime + duration = cdInfo.duration + end enabled = cdInfo.enabled end elseif data.slotId then @@ -600,7 +658,7 @@ do end elseif data.itemId then index = "ITEM_" .. data.itemId - name, _, _, _, _, itemType, _, _, _, icon, _, _, _, _, _, _, _ = GetItemInfo(data.itemId) + name, _, _, _, _, _, _, _, _, icon, _, _, _, _, _, _, _ = GetItemInfo(data.itemId) start, duration, enabled = GetItemCooldown(data.itemId) end @@ -617,6 +675,7 @@ do start = start, duration = duration, expirationTime = start + duration, + durationObject = durationObject, enabled = (enabled ~= 0), casted = (not data.spellId) and true or self.casted[data.spellId], isKnown = (not data.spellId) and true or IsSpellKnown(data.spellId) @@ -650,7 +709,7 @@ do table.sort(self.sorted, self.SortCooldowns) - numVisible = math.min(self.limit, #self.sorted) + local numVisible = math.min(self.limit, #self.sorted) for i = 1, numVisible do self:Update(unit, self.sorted[i], i) @@ -688,6 +747,7 @@ do -- register which spell the player cast function cooldown_proto:UNIT_SPELLCAST_SUCCEEDED(unit, guid, spellId) + if issecretvalue and issecretvalue(spellId) then return end self.casted[spellId] = true end end diff --git a/Filger.toc b/Filger.toc index 7e06a45..c5a283d 100644 --- a/Filger.toc +++ b/Filger.toc @@ -1,16 +1,26 @@ -## Interface: 20504, 30403, 40400, 110205 +## Interface: 11509, 20506, 38002, 50504, 120105, 16001 +## Version: 5.2.2 ## Author: Luaerror ## Credits: Nils Ruesch, Shestak, Affli, Garagar, hidekki, FourOne, Tukz -## Version: 5.2.1 -## Title: |cffff8000Filger|r -## Notes: Minimal buff/debuff tracker -## IconTexture: Interface\ICONS\Spell_Shadow_Shadowwordpain + ## OptionalDeps: Tainted, Tukui ## SavedVariables: FilgerData +## Notes: Minimal buff/debuff tracker +## Title: |cffff8000Filger|r + +## IconTexture: Interface\ICONS\Spell_Shadow_Shadowwordpain + ## X-Website: https://github.com/wow-lua/Filger ## X-Maintainer: pedrozc90 libs\init.xml +core\data.lua +data\[Game]\blacklist.lua +data\[Game]\cooldowns.lua +data\[Game]\spells.lua +data\shared\blacklist.lua +data\shared\cooldowns.lua core\init.xml +config.lua Filger.lua diff --git a/Filger_Classic.toc b/Filger_Classic.toc deleted file mode 100644 index b0781cb..0000000 --- a/Filger_Classic.toc +++ /dev/null @@ -1,16 +0,0 @@ -## Interface: 11507 -## Author: Luaerror -## Credits: Nils Ruesch, Shestak, Affli, Garagar, hidekki, FourOne, Tukz -## Version: 5.2.2 -## Title: |cffff8000Filger|r - Classic -## Notes: Minimal buff/debuff tracker -## IconTexture: Interface\ICONS\Spell_Shadow_Shadowwordpain -## OptionalDeps: Tainted, Tukui -## SavedVariables: FilgerData - -## X-Website: https://github.com/wow-lua/Filger -## X-Maintainer: pedrozc90 - -libs\init.xml -core\init.xml -Filger.lua diff --git a/Filger_Mists.toc b/Filger_Mists.toc deleted file mode 100644 index 33ca693..0000000 --- a/Filger_Mists.toc +++ /dev/null @@ -1,16 +0,0 @@ -## Interface: 50500 -## Author: Luaerror -## Credits: Nils Ruesch, Shestak, Affli, Garagar, hidekki, FourOne, Tukz -## Version: 5.2.2 -## Title: |cffff8000Filger|r - Mists of Pandaria -## Notes: Minimal buff/debuff tracker -## IconTexture: Interface\ICONS\Spell_Shadow_Shadowwordpain -## OptionalDeps: Tainted, Tukui -## SavedVariables: FilgerData - -## X-Website: https://github.com/wow-lua/Filger -## X-Maintainer: pedrozc90 - -libs\init.xml -core\init.xml -Filger.lua diff --git a/Makefile b/Makefile index 51f1fc2..7266cfd 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,19 @@ -# Makefile to create a .zip archive of the repository - -# Name of the zip file -FILENAME := repository.zip - -# Default target -zip: $(FILENAME) - -# Create the .zip archive -$(FILENAME): - @echo "Creating $(FILENAME)..." - @zip -r $(FILENAME) . -x@exclude.lst - @echo "$(FILENAME) created." - -# Clean target to remove the .zip file -clean: - @echo "Cleaning up..." - @rm -f $(FILENAME) - @echo "Cleaned." - -.PHONY: zip +.DEFAULT_GOAL := help + +SHELL := bash +.SHELLFLAGS := -eu -o pipefail -c + +LUACHECK ?= luacheck + +# -- help --------------------- + +.PHONY: help +help: ## Show available commands + @grep -E '^[a-zA-Z_-]+:.*## .*$$' $(MAKEFILE_LIST) \ + | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' + +# -- luacheck ----------------- + +.PHONY: check +check: ## Run static analysis (see .luacheckrc) + @$(LUACHECK) . diff --git a/README.md b/README.md index 8f39450..059524f 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,124 @@ -# Filger - -Filger is a minimalistic aura tracker addon for [World of Warcraft](https://worldofwarcraft.com/en-us/). - -It allows you to keep track of any buffs/debuffs of all units (`player`, `target`, `focus`, etc.) - -It also track player's spells cooldown and item cooldowns. - -

- Filger -

- -## Dependencies - -- Required: `None` -- Optional: - - [Tainted](https://github.com/lua-wow/Tainted) - - [Tukui](https://github.com/tukui-org/Tukui) - -## Installation - -1. Download the latest version of [**Filger**](https://github.com/lua-wow/Filger/releases) -2. Backup your **Interface** and **WTF** folders. -3. Delete **Cache** and **WTF** folders for a clean install. -4. Copy/Paste **Filger** folder into WoW interface folder (`World of Warcraft/_retail_/Interface/AddOns`) -5. Now you are ready to start World of Warcraft. - -## Configuration - -The addon configuration can be done by editing the [config.lua](./core/config.lua) file. - -```lua -local config = { - frames = { - ["PLAYER_COOLDOWNS"] = { - enabled = true, - unit = "player", - filter = "COOLDOWN", - caster = "player", - anchor = { "CENTER", UIParent, "BOTTOM", 0, 259 }, - limit = 8, - size = 38, - max_size = 40, - spacing = 3, - initialAnchor = "CENTER", - ["growth-x"] = "CENTER", - ["growth-y"] = "CENTER", - spells = { - { spellId = 586, enabled = true }, -- Fade (Rank 1) - } - } - } -} -``` - -> **obs.:** The addon do not have a in-game configuration. - -## License: - -Please, see [LICENSE](./LICENSE) file. +# Filger + +## Description + +**Filger** is a minimalistic buff/debuff tracker for **World of Warcraft**. +A single addon folder serves every supported client and should look the same on all of them. + +> Filger is being revived after a long break. Most of it is still **pending in-game verification**. + +

+ Filger +

+ +## Supported clients + +| Client | Interface | +|:----------------------|:----------| +| Retail (Midnight) | `120105` | +| Classic Forever | `16001` | +| Classic Era | `11509` | +| Classic TBC | `20506` | +| Classic WotLK (Titan) | `38002` | +| Classic MoP | `50504` | + +Cataclysm is not supported. + +## Frames + +| Frame | Unit | Tracks | +|:-------------------|:---------|:----------------------------------------| +| `PLAYER_DEBUFFS` | `player` | Debuffs | +| `PLAYER_AURAS` | `player` | Buffs cast by the player | +| `PLAYER_BUFFS` | `player` | Buffs | +| `TARGET_DEBUFFS` | `target` | Debuffs | +| `TARGET_AURAS` | `target` | Buffs | +| `FOCUS_DEBUFFS` | `focus` | Debuffs | +| `BOSS_DEBUFFS` | `player` | Debuffs applied by bosses | +| `PLAYER_COOLDOWNS` | `player` | Spell and item cooldowns | + +Spells shown or hidden per client are listed in [data/](./data). + +> On Retail, while auras and cooldowns are restricted (secret values), only listed spells +> are tracked and timers use Blizzard's countdown numbers. + +## Usage + +### Commands + +- `/filger help` - List all available commands. + +## Configuration + +There is no in-game configuration. Frames are defined in [config.lua](./config.lua). + +Please report Lua errors as [issues](https://github.com/lua-wow/Filger/issues). + +## Dependencies + +- Required: none. +- Optional: [Tainted](https://github.com/lua-wow/Tainted) or [Tukui](https://github.com/tukui-org/Tukui). + When either is loaded, Filger uses its API instead of its own. + +## Installation + +1. Download the latest version of [**Filger**](https://github.com/lua-wow/Filger/releases) +2. Backup your **Interface** and **WTF** folders. +3. Delete the **Cache** and **WTF** folders for a clean install. +4. Copy the **Filger** folder into the client's AddOns folder. + - `World of Warcraft/_retail_/Interface/AddOns` + - `World of Warcraft/_classic_era_/Interface/AddOns` +5. Now you're ready to launch World of Warcraft. + +To install from git, clone **with submodules**: the bundled libraries in `libs/` are git +submodules, and the addon won't load without them. + +## Development Setup + +### Method 1 + +```bash +# clone the repository along with submodules +git clone --recurse-submodules git@github.com:lua-wow/Filger.git +``` + +### Method 2 + +```bash +# clone just the main repository +git clone git@github.com:lua-wow/Filger.git + +# initialize/clone submodules +git submodule update --init --recursive +``` + +### Linting + +Static analysis uses [luacheck](https://github.com/lunarmodules/luacheck), configured in [.luacheckrc](./.luacheckrc). + +Requirements: **Lua 5.1**, **LuaRocks** and **luacheck** (`luarocks install luacheck`). + +```bash +# list available make commands +make help + +# lint the whole addon (submodules under libs/ are excluded) +make check + +# lint a directory or a single file, showing warning codes +luacheck core/ +luacheck Filger.lua --codes +``` + +When using a new WoW API function, frame or constant, add it to `read_globals` in `.luacheckrc`. +Globals the addon intentionally sets or mutates go in `globals`. + +## Credits + +- Nils Ruesch, Shestak, Affli, Garagar, hidekki, FourOne and Tukz. +- [Tukui](https://www.tukui.org) by Tukz, the visual reference. +- [LibStub](https://www.curseforge.com/wow/addons/libstub) by Kaelten. + +## License + +Please, see [LICENSE](./LICENSE) file. diff --git a/core/config.lua b/config.lua similarity index 96% rename from core/config.lua rename to config.lua index 8abf863..c17308e 100644 --- a/core/config.lua +++ b/config.lua @@ -1,189 +1,190 @@ -local _, ns = ... -local Filger = ns.Filger - -local class = Filger.class -local cooldowns = Filger.cooldowns or {} -local blacklist = Filger.blacklist or {} -local spells = Filger.spells or {} -local all = Filger.all or {} - ------------------------------------------------------------- --- Config ------------------------------------------------------------- ---[[ - * filter -- list of filters, separated by spaces or pipes. "HELPFUL" by default. - -- "HELPFUL" : Buffs - -- "HARMFUL" : Debuffs - -- "PLAYER" : Auras Debuffs applied by the player - -- "RAID" : Buffs the player can apply and debuffs the player can dispell - -- "CANCELABLE" : Buffs that can be cancelled with /cancelaura or CancelUnitBuff() - -- "NOT_CANCELABLE" : Buffs that cannot be cancelled - -- "INCLUDE_NAME_PLATE_ONLY" : Auras that should be shown on nameplates - -- "MAW" : Torghast Anima Powers - * unit -- unit whose auras to query. ("player", "target", "focus", etc.) - * caster -- aura caster. - * showOnlyPlayer -- - * isDebuff -- - * hidePlayer -- -]] - -local size = 35 -local spacing = 5 -local xOffset, yOffset = 239, 39 - -Filger.config = { - ["general"] = { - ["backdrop"] = { - ["color"] = Filger:CreateColor(0.15, 0.15, 0.15) - }, - ["border"] = { - ["color"] = Filger:CreateColor(0.00, 0.00, 0.00), - ["size"] = 1 - }, - ["well_fed"] = false, -- enabled filter to hide well fed buff (too many spells with this name) - ["gametooltip"] = true, -- enabled tooltips - }, - ["frames"] = { - -- LEFT - ["PLAYER_DEBUFFS"] = { - enabled = true, - unit = "player", - filter = "HARMFUL", - anchor = { "RIGHT", UIParent, "CENTER", -xOffset, yOffset }, - limit = 8, - size = size, - spacing = spacing, - initialAnchor = "BOTTOMRIGHT", - ["growth-x"] = "LEFT", - ["growth-y"] = "DOWN", - spells = { - [124275] = { enabled = true, priority = 3 }, -- Light Stagger - [124274] = { enabled = true, priority = 3 }, -- Moderate Stagger - [124273] = { enabled = true, priority = 3 } -- Heavy Stagger - } - }, - ["PLAYER_AURAS"] = { - enabled = true, - unit = "player", - filter = "PLAYER|HELPFUL", - anchor = { "RIGHT", UIParent, "CENTER", -xOffset, 0 }, - limit = 8, - size = size, - spacing = spacing, - initialAnchor = "BOTTOMRIGHT", - ["growth-x"] = "LEFT", - ["growth-y"] = "DOWN", - spells = Mixin(spells[class] or {}, spells["ALL"] or {}) - }, - ["PLAYER_BUFFS"] = { - enabled = true, - unit = "player", - filter = "HELPFUL", - caster = "all", - hidePlayer = true, - anchor = { "RIGHT", UIParent, "CENTER", -xOffset, -yOffset }, - limit = 8, - size = size, - spacing = spacing, - initialAnchor = "BOTTOMRIGHT", - ["growth-x"] = "LEFT", - ["growth-y"] = "DOWN", - FilterAura = function(element, unit, data) - return data.enabled and not data.isPlayerAura - end - }, - ["TARGET_DEBUFFS"] = { - enabled = true, - unit = "target", - filter = "HARMFUL", - anchor = { "LEFT", UIParent, "CENTER", xOffset, yOffset }, - limit = 8, - size = size, - spacing = spacing, - initialAnchor = "BOTTOMLEFT", - ["growth-x"] = "RIGHT", - ["growth-y"] = "DOWN", - spells = all, - FilterAura = function(element, unit, data) - if UnitCanAttack(unit, "player") then - return data.enabled and data.isPlayerAura - end - return data.enabled and not data.isPlayerAura - end, - SortAuras = function(a, b) - if (a.priority ~= b.priority) then - return a.priority < b.priority - end - - if (a.expirationTime ~= b.expirationTime) then - return a.expirationTime < b.expirationTime - end - - if (a.isPlayerAura ~= b.isPlayerAura) then - return a.isPlayerAura - end - - return a.auraInstanceID < b.auraInstanceID - end - }, - ["TARGET_AURAS"] = { - enabled = true, - unit = "target", - filter = "HELPFUL", - anchor = { "LEFT", UIParent, "CENTER", xOffset, 0 }, - limit = 8, - size = size, - spacing = spacing, - initialAnchor = "BOTTOMLEFT", - ["growth-x"] = "RIGHT", - ["growth-y"] = "DOWN", - spells = all - }, - ["FOCUS_DEBUFFS"] = { - enabled = true, - unit = "focus", - filter = "HARMFUL", - anchor = { "LEFT", UIParent, "CENTER", xOffset, -yOffset }, - limit = 8, - size = size, - spacing = spacing, - initialAnchor = "BOTTOMLEFT", - ["growth-x"] = "RIGHT", - ["growth-y"] = "DOWN", - desaturated = false, - FilterAura = function(element, unit, data) - return data.enabled and data.isBossAura or (data.sourceUnit == nil) or not data.isFromPlayerOrPlayerPet - end - }, - ["BOSS_DEBUFFS"] = { - enabled = false, - unit = "player", - filter = "HARMFUL", - anchor = { "CENTER", UIParent, "CENTER", 0, 160 }, - limit = 1, - size = math.floor(1.5 * size), - spacing = spacing, - initialAnchor = "BOTTOMLEFT", - ["growth-x"] = "RIGHT", - ["growth-y"] = "DOWN", - FilterAura = function(element, unit, data) - return data.enabled and data.isBossAura or (data.sourceUnit == nil) - end - }, - ["PLAYER_COOLDOWNS"] = { - enabled = true, - unit = "player", - filter = "COOLDOWN", - caster = "player", - anchor = { "CENTER", UIParent, "BOTTOM", 0, 175 }, - limit = 8, - size = 38, - max_size = 40, - spacing = 3, - initialAnchor = "CENTER", - ["growth-x"] = "CENTER", - ["growth-y"] = "CENTER", - spells = cooldowns - } - } -} +local _, ns = ... +local Filger = ns.Filger + +ns.data.Finalize() + +local class = Filger.class +local cooldowns = Filger.cooldowns or {} +local spells = Filger.spells or {} +local all = Filger.all or {} + +------------------------------------------------------------ +-- Config +------------------------------------------------------------ +--[[ + * filter -- list of filters, separated by spaces or pipes. "HELPFUL" by default. + -- "HELPFUL" : Buffs + -- "HARMFUL" : Debuffs + -- "PLAYER" : Auras Debuffs applied by the player + -- "RAID" : Buffs the player can apply and debuffs the player can dispell + -- "CANCELABLE" : Buffs that can be cancelled with /cancelaura or CancelUnitBuff() + -- "NOT_CANCELABLE" : Buffs that cannot be cancelled + -- "INCLUDE_NAME_PLATE_ONLY" : Auras that should be shown on nameplates + -- "MAW" : Torghast Anima Powers + * unit -- unit whose auras to query. ("player", "target", "focus", etc.) + * caster -- aura caster. + * showOnlyPlayer -- + * isDebuff -- + * hidePlayer -- +]] + +local size = 35 +local spacing = 5 +local xOffset, yOffset = 239, 39 + +Filger.config = { + ["general"] = { + ["backdrop"] = { + ["color"] = Filger:CreateColor(0.15, 0.15, 0.15) + }, + ["border"] = { + ["color"] = Filger:CreateColor(0.00, 0.00, 0.00), + ["size"] = 1 + }, + ["well_fed"] = false, -- enabled filter to hide well fed buff (too many spells with this name) + ["gametooltip"] = true, -- enabled tooltips + }, + ["frames"] = { + -- LEFT + ["PLAYER_DEBUFFS"] = { + enabled = true, + unit = "player", + filter = "HARMFUL", + anchor = { "RIGHT", UIParent, "CENTER", -xOffset, yOffset }, + limit = 8, + size = size, + spacing = spacing, + initialAnchor = "BOTTOMRIGHT", + ["growth-x"] = "LEFT", + ["growth-y"] = "DOWN", + spells = { + [124275] = { enabled = true, priority = 3 }, -- Light Stagger + [124274] = { enabled = true, priority = 3 }, -- Moderate Stagger + [124273] = { enabled = true, priority = 3 } -- Heavy Stagger + } + }, + ["PLAYER_AURAS"] = { + enabled = true, + unit = "player", + filter = "PLAYER|HELPFUL", + anchor = { "RIGHT", UIParent, "CENTER", -xOffset, 0 }, + limit = 8, + size = size, + spacing = spacing, + initialAnchor = "BOTTOMRIGHT", + ["growth-x"] = "LEFT", + ["growth-y"] = "DOWN", + spells = Mixin(spells[class] or {}, spells["ALL"] or {}) + }, + ["PLAYER_BUFFS"] = { + enabled = true, + unit = "player", + filter = "HELPFUL", + caster = "all", + hidePlayer = true, + anchor = { "RIGHT", UIParent, "CENTER", -xOffset, -yOffset }, + limit = 8, + size = size, + spacing = spacing, + initialAnchor = "BOTTOMRIGHT", + ["growth-x"] = "LEFT", + ["growth-y"] = "DOWN", + FilterAura = function(element, unit, data) + return data.enabled and not data.isPlayerAura + end + }, + ["TARGET_DEBUFFS"] = { + enabled = true, + unit = "target", + filter = "HARMFUL", + anchor = { "LEFT", UIParent, "CENTER", xOffset, yOffset }, + limit = 8, + size = size, + spacing = spacing, + initialAnchor = "BOTTOMLEFT", + ["growth-x"] = "RIGHT", + ["growth-y"] = "DOWN", + spells = all, + FilterAura = function(element, unit, data) + if UnitCanAttack(unit, "player") then + return data.enabled and data.isPlayerAura + end + return data.enabled and not data.isPlayerAura + end, + SortAuras = function(a, b) + if (a.priority ~= b.priority) then + return a.priority < b.priority + end + + if (a.expirationTime ~= b.expirationTime) then + return a.expirationTime < b.expirationTime + end + + if (a.isPlayerAura ~= b.isPlayerAura) then + return a.isPlayerAura + end + + return a.auraInstanceID < b.auraInstanceID + end + }, + ["TARGET_AURAS"] = { + enabled = true, + unit = "target", + filter = "HELPFUL", + anchor = { "LEFT", UIParent, "CENTER", xOffset, 0 }, + limit = 8, + size = size, + spacing = spacing, + initialAnchor = "BOTTOMLEFT", + ["growth-x"] = "RIGHT", + ["growth-y"] = "DOWN", + spells = all + }, + ["FOCUS_DEBUFFS"] = { + enabled = true, + unit = "focus", + filter = "HARMFUL", + anchor = { "LEFT", UIParent, "CENTER", xOffset, -yOffset }, + limit = 8, + size = size, + spacing = spacing, + initialAnchor = "BOTTOMLEFT", + ["growth-x"] = "RIGHT", + ["growth-y"] = "DOWN", + desaturated = false, + FilterAura = function(element, unit, data) + return data.enabled and data.isBossAura or (data.sourceUnit == nil) or not data.isFromPlayerOrPlayerPet + end + }, + ["BOSS_DEBUFFS"] = { + enabled = false, + unit = "player", + filter = "HARMFUL", + anchor = { "CENTER", UIParent, "CENTER", 0, 160 }, + limit = 1, + size = math.floor(1.5 * size), + spacing = spacing, + initialAnchor = "BOTTOMLEFT", + ["growth-x"] = "RIGHT", + ["growth-y"] = "DOWN", + FilterAura = function(element, unit, data) + return data.enabled and data.isBossAura or (data.sourceUnit == nil) + end + }, + ["PLAYER_COOLDOWNS"] = { + enabled = true, + unit = "player", + filter = "COOLDOWN", + caster = "player", + anchor = { "CENTER", UIParent, "BOTTOM", 0, 175 }, + limit = 8, + size = 38, + max_size = 40, + spacing = 3, + initialAnchor = "CENTER", + ["growth-x"] = "CENTER", + ["growth-y"] = "CENTER", + spells = cooldowns + } + } +} diff --git a/core/api.lua b/core/api.lua index ab6cd85..dcbd363 100644 --- a/core/api.lua +++ b/core/api.lua @@ -1,44 +1,13 @@ local _, ns = ... local Filger = ns.Filger -local config = Filger.config -local fonts = Filger.fonts local textures = Filger.textures -- Blizzard local IsAddOnLoaded = C_AddOns and C_AddOns.IsAddOnLoaded or _G.IsAddOnLoaded -- skip it if Tukui exists -if IsAddOnLoaded("Tainted") then - function Filger.SetBorderColor(frame, color) - if frame.Backdrop then - frame.Backdrop:SetBackdropBorderColor(color.r, color.g, color.b, color.a or 1) - end - end - +if IsAddOnLoaded("Tainted") or IsAddOnLoaded("Tukui") then return -elseif IsAddOnLoaded("Tukui") then - function Filger.SetBorderColor(frame, color) - frame:SetBorderColor(color.r, color.g, color.b, color.a or 1) - end - - return -end - ---------------------------------------------------- --- Functions ---------------------------------------------------- -local Resolution = select(1, GetPhysicalScreenSize()).."x"..select(2, GetPhysicalScreenSize()) -local PixelPerfectScale = 768 / string.match(Resolution, "%d+x(%d+)") -local Scale = function(size) - -- Little protection just in case - if size == "" then - size = 1 - end - - local Mult = PixelPerfectScale / GetCVar("uiScale") - local Value = Mult * math.floor(size / Mult + .5) - - return Value end --------------------------------------------------- @@ -95,13 +64,13 @@ end API.CreateBackdrop = function(self, template) if not self.Backdrop then local backdropTexture = textures.blank - local backdropColor = config.general.backdrop.color + local backdropColor = Filger.config.general.backdrop.color local backdropAlpha = (template == "transparent") and 0.70 or 1 local borderTexture = textures.blank - local borderColor = config.general.border.color + local borderColor = Filger.config.general.border.color - local inset = Scale(config.general.border.size or 1) + local inset = Scale(Filger.config.general.border.size or 1) local backdrop = { bgFile = backdropTexture } @@ -148,9 +117,9 @@ function Filger:MergeAPI() while (Object) do local t = Object:GetObjectType() - if (not Object:IsForbidden() and not Handled[Object:GetObjectType()]) then + if (not Object:IsForbidden() and not Handled[t]) then AddAPI(Object) - Handled[Object:GetObjectType()] = true + Handled[t] = true end Object = EnumerateFrames(Object) end diff --git a/core/blacklist.lua b/core/blacklist.lua deleted file mode 100644 index c9f63e4..0000000 --- a/core/blacklist.lua +++ /dev/null @@ -1,911 +0,0 @@ -local _, ns = ... -local Filger = ns.Filger - --- Blizzard -local GetSpellInfo = C_Spell and C_Spell.GetSpellInfo or _G.GetSpellInfo - -local EXPANSION = _G.LE_EXPANSION_LEVEL_CURRENT or -1 -local LE_EXPANSION_CLASSIC = _G.LE_EXPANSION_CLASSIC or 0 -local LE_EXPANSION_BURNING_CRUSADE = _G.LE_EXPANSION_BURNING_CRUSADE or 1 -local LE_EXPANSION_WRATH_OF_THE_LICH_KING = _G.LE_EXPANSION_WRATH_OF_THE_LICH_KING or 2 -local LE_EXPANSION_CATACLYSM = _G.LE_EXPANSION_CATACLYSM or 3 -local LE_EXPANSION_MISTS_OF_PANDARIA = _G.LE_EXPANSION_MISTS_OF_PANDARIA or 4 -local LE_EXPANSION_WARLORDS_OF_DRAENOR = _G.LE_EXPANSION_WARLORDS_OF_DRAENOR or 5 -local LE_EXPANSION_LEGION = _G.LE_EXPANSION_LEGION or 6 -local LE_EXPANSION_BATTLE_FOR_AZEROTH = _G.LE_EXPANSION_BATTLE_FOR_AZEROTH or 7 -local LE_EXPANSION_SHADOWLANDS = _G.LE_EXPANSION_SHADOWLANDS or 8 -local LE_EXPANSION_DRAGONFLIGHT = _G.LE_EXPANSION_DRAGONFLIGHT or 9 -local LE_EXPANSION_WAR_WITHIN = _G.LE_EXPANSION_WAR_WITHIN or 10 - --- Mine -local interface = Filger.interface -local isRetail = Filger.isRetail -local isClassic = Filger.isClassic -local isBCC = Filger.isBCC -local isWrath = Filger.isWrath -local isCata = Filger.isCata - -local import = function(source, dest) - for spellId, enabled in next, source do - if enabled then - if type(spellId) == "string" then - dest[spellId] = true - else - local data = GetSpellInfo(spellId) - if data then - dest[spellId] = true - else - Filger:warn("Blacklist", "Spell " .. spellId .. " do not exists.") - end - end - end - end -end - --------------------------------------------------- --- Black List --------------------------------------------------- -local blacklist = {} - -local general = { - ["Well Fed"] = true, - ["Drink"] = true, - ["Food"] = true, - - -- Lust - [57723] = (EXPANSION >= LE_EXPANSION_WRATH_OF_THE_LICH_KING), -- Exhaustion (Heroism) - [57724] = (EXPANSION >= LE_EXPANSION_WRATH_OF_THE_LICH_KING), -- Sated (Bloodlust) - [80354] = (EXPANSION >= LE_EXPANSION_MISTS_OF_PANDARIA), -- Temporal Displacement (Mage) - [264689] = (EXPANSION >= LE_EXPANSION_SHADOWLANDS), -- Fatigued (Hunter) - [390435] = (EXPANSION >= LE_EXPANSION_DRAGONFLIGHT), -- Exhaustion (Evoker - Fury of the Aspects) - - -- DRUID - ["Mark of the Wild"] = true, - [1126] = true, -- Mark of the Wild - [768] = true, -- Cat Form - [5487] = true, -- Bear Form - [24858] = true, -- Moonkin Form - [114282] = (EXPANSION >= LE_EXPANSION_MISTS_OF_PANDARIA), -- Treant Form - - -- MAGE - ["Arcane Intellect"] = true, - - -- PALADIN - [7294] = (EXPANSION <= LE_EXPANSION_CATACLYSM), -- Retribution Aura - [19746] = (EXPANSION <= LE_EXPANSION_CATACLYSM), -- Concentration Aura - [19891] = (EXPANSION <= LE_EXPANSION_CATACLYSM), -- Resistance Aura - [32223] = (EXPANSION >= LE_EXPANSION_BURNING_CRUSADE), -- Crusader Aura - - -- PRIEST - ["Power Word: Fortitude"] = true, -} - -import(general, blacklist) - --------------------------------------------------- --- Classic --------------------------------------------------- -do - local data = { - -- DRUID - [1126] = true, -- Mark of the Wild (Rank 1) - [5232] = isClassic or isBCC or isWrath, -- Mark of the Wild (Rank 2) - [6756] = isClassic or isBCC or isWrath, -- Mark of the Wild (Rank 3) - [5234] = isClassic or isBCC or isWrath, -- Mark of the Wild (Rank 4) - [8907] = isClassic or isBCC or isWrath, -- Mark of the Wild (Rank 5) - [9884] = isClassic or isBCC or isWrath, -- Mark of the Wild (Rank 6) - [9885] = isClassic or isBCC or isWrath, -- Mark of the Wild (Rank 7) - [26990] = isBCC or isWrath, -- Mark of the Wild (Rank 8) - [48469] = isWrath, -- Mark of the Wild (Rank 9) - - [467] = (EXPANSION < LE_EXPANSION_CATACLYSM), -- Thorns (Rank 1) - [782] = isClassic or isBCC or isWrath, -- Thorns (Rank 2) - [1075] = isClassic or isBCC or isWrath, -- Thorns (Rank 3) - [8914] = isClassic or isBCC or isWrath, -- Thorns (Rank 4) - [9756] = isClassic or isBCC or isWrath, -- Thorns (Rank 5) - [9910] = isClassic or isBCC or isWrath, -- Thorns (Rank 6) - [26992] = isBCC or isWrath, -- Thorns (Rank 7) - [53307] = isWrath, -- Thorns (Rank 8) - - [24907] = (EXPANSION <= LE_EXPANSION_MISTS_OF_PANDARIA), -- Moonkin Aura - - -- HUNTER - [19506] = (EXPANSION <= LE_EXPANSION_MISTS_OF_PANDARIA), -- Trueshot Aura - - -- MAGE - [1459] = true, -- Arcane Intellect (Rank 1) - [1460] = isClassic or isBCC or isWrath, -- Arcane Intellect (Rank 2) - [1461] = isClassic or isBCC or isWrath, -- Arcane Intellect (Rank 3) - [10156] = isClassic or isBCC or isWrath, -- Arcane Intellect (Rank 4) - [10157] = isClassic or isBCC or isWrath, -- Arcane Intellect (Rank 5) - [27126] = isBCC or isWrath, -- Arcane Intellect (Rank 6) - [42995] = isWrath, -- Arcane Intellect (Rank 7) - - -- PALADIN - [19740] = (EXPANSION <= LE_EXPANSION_MISTS_OF_PANDARIA), -- Blessing of Might - - -- PRIEST - [1243] = isClassic or isBCC or isWrath, -- Power Word: Fortitude (Rank 1) - [1244] = isClassic or isBCC or isWrath, -- Power Word: Fortitude (Rank 2) - [1245] = isClassic or isBCC or isWrath, -- Power Word: Fortitude (Rank 3) - [2791] = isClassic or isBCC or isWrath, -- Power Word: Fortitude (Rank 4) - [10937] = isClassic or isBCC or isWrath, -- Power Word: Fortitude (Rank 5) - [10938] = isClassic or isBCC or isWrath, -- Power Word: Fortitude (Rank 6) - [25389] = isBCC or isWrath, -- Power Word: Fortitude (Rank 7) - [48161] = isWrath, -- Power Word: Fortitude (Rank 8) - - [21562] = isClassic, -- Prayer of Fortitude (Rank 1) - [21564] = isClassic, -- Prayer of Fortitude (Rank 2) - - [27681] = isClassic, -- Prayer of Spirit - - -- ROGUE - [1784] = false, -- Stealth - [2823] = true, -- Deadly Poison - [3408] = true, -- Crippling Poison - - -- WARLOCK - [687] = isClassic or isBCC or isWrath or isCata, -- Demon Skin (Rank 1) - [696] = isClassic or isBCC or isWrath, -- Demon Skin (Rank 2) - - [6307] = isClassic or isBCC or isWrath or isCata, -- Blood Pact (Rank 1) - [7804] = isClassic or isBCC or isWrath, -- Blood Pact (Rank 2) - [7805] = isClassic or isBCC or isWrath, -- Blood Pact (Rank 3) - [11766] = isClassic or isBCC or isWrath, -- Blood Pact (Rank 4) - [11787] = isClassic or isBCC or isWrath, -- Blood Pact (Rank 5) - [27267] = isBCC or isWrath, -- Blood Pact (Rank 6) - [47982] = isWrath, -- Blood Pact (Rank 7) - - -- Consumables - [673] = true, -- Elixir of Minor Defense - [2367] = true, -- Elixir of Lion's Strength - [2374] = true, -- Elixir of Minor Agility - [2378] = true, -- Elixir of Minor Fortitude - [3160] = true, -- Elixir of Lesser Agility - [3164] = true, -- Elixir of Ogre's Strength - [3166] = true, -- Elixir of Wisdom - [3220] = true, -- Elixir of Defense - [3593] = true, -- Elixir of Fortitude - [6512] = true, -- Elixir of Detect Lesser Invisibility - [7178] = true, -- Elixir of Water Breathing - [7844] = true, -- Elixir of Fire Power - [8212] = true, -- Elixir of Giant Growth - [11319] = true, -- Elixir of Water Walking - [11328] = true, -- Elixir of Agility - [11334] = true, -- Elixir of Greater Agility - [11348] = true, -- Elixir of Superior Defense - [11349] = true, -- Elixir of Greater Defense - [11389] = true, -- Elixir of Detect Undead - [11390] = true, -- Arcane Elixir - [11396] = true, -- Elixir of Greater Intellect - [11403] = true, -- Elixir of Dream Vision - [11405] = true, -- Elixir of the Giants - [11406] = true, -- Elixir of Demonslaying - [11407] = true, -- Elixir of Detect Demon - [11474] = true, -- Elixir of Shadow Power - [12608] = true, -- Catseye Elixir - [17535] = true, -- Elixir of the Sages - [17537] = true, -- Elixir of Brute Force - [17538] = true, -- Elixir of the Mongoose - [17539] = true, -- Greater Arcane Elixir - [21920] = true, -- Elixir of Frost Power - [22807] = false, -- Elixir Greater Water Breathing - [26276] = true, -- Elixir of Greater Firepower - [26677] = true, -- Elixir of Poison Resistance - - [17624] = false, -- Flask of Petrification - [17626] = true, -- Flask of the Titans - [17627] = true, -- Flask of Distilled Wisdom - [17628] = true, -- Flask od Supreme Power - [17629] = isClassic or isBCC or isCata, -- Flask of Chromatic Resistance - - -- Scrolls - [8091] = isClassic, -- Armor (Scroll of Protection) - [8094] = isClassic, -- Armor (Scroll of Protection II) - [8095] = isClassic, -- Armor (Scroll of Protection III) - [12175] = isClassic, -- Armor (Scroll of Protection IV) - [33079] = isBCC, -- Armor (Scroll of Protection V) - - [8096] = isClassic, -- Intellect (Scroll of Intellect) - [8097] = isClassic, -- Intellect (Scroll of Intellect II) - [8098] = isClassic, -- Intellect (Scroll of Intellect III) - [12176] = isClassic, -- Intellect (Scroll of Intellect IV) - [33078] = isBCC, -- Intellect (Scroll of Intellect V) - - [8099] = isClassic, -- Stamina (Scroll of Stamina) - [8100] = isClassic, -- Stamina (Scroll of Stamina II) - [8101] = isClassic, -- Stamina (Scroll of Stamina III) - [12178] = isClassic, -- Stamina (Scroll of Stamina IV) - [33081] = isBCC, -- Stamina (Scroll of Stamina V) - - [8112] = isClassic, -- Spirit Magic (Scroll of Spirit) - [8113] = isClassic, -- Spirit Magic (Scroll of Spirit II) - [8114] = isClassic, -- Spirit Magic (Scroll of Spirit III) - [12177] = isClassic, -- Spirit Magic (Scroll of Spirit IV) - [33080] = isBCC, -- Spirit Magic (Scroll of Spirit V) - - [8115] = isClassic, -- Agility (Scroll of Agility) - [8116] = isClassic, -- Agility (Scroll of Agility II) - [8117] = isClassic, -- Agility (Scroll of Agility III) - [12174] = isClassic, -- Agility (Scroll of Agility IV) - [33077] = isBCC, -- Agility (Scroll of Agility V) - - [8118] = isClassic, -- Strength (Scroll of Strength) - [8119] = isClassic, -- Strength (Scroll of Strength II) - [8120] = isClassic, -- Strength (Scroll of Strength III) - [12179] = isClassic, -- Strength (Scroll of Strength IV) - [33082] = isBCC, -- Strength (Scroll of Strength V) - - -- Christimas - [26218] = isClassic, -- Mistletoe - - -- Costumes - [8220] = true, -- Flip Out! - [8222] = true, -- Yaaarrrr - [16739] = true, -- Orb of Deception - - -- Items - [17619] = true, -- Alchemist Stone - - -------------------------------------------------- - -- Season of Discovery - -------------------------------------------------- - [349981] = not isRetail, -- Supercharged Chronoboon Displacer - [410935] = isClassic, -- Meditation on the Light - [417316] = isClassic, -- Meditation on the Loa - [418459] = isClassic, -- Meditation on Undeath - [419307] = isClassic, -- Meditation on Elune - [430947] = isClassic, -- Boon of Blackfathom (World Buff) - [436412] = isClassic, -- Discoverer's Delight - } - - import(data, blacklist) -end - --------------------------------------------------- --- The Burning Crusade --------------------------------------------------- -if Filger.isBCC then - local data = { - -- PRIEST - [25431] = true, -- Inner Fire (Rank 7) - [32999] = true, -- Prayer of Spirit (Rank 2) - } - - import(data, blacklist) -end - -if EXPANSION >= LE_EXPANSION_BURNING_CRUSADE then - local data = { - -- Events - [44185] = true, -- Jack-o'-Lanterned! - } - - import(data, blacklist) -end - --------------------------------------------------- --- Wrath of the Lich King --------------------------------------------------- -if Filger.isWrath then - local data = { - -- DEATHKNIGHT - [55610] = true, -- Improved Icy Talons - - -- MAGE - [61316] = true, -- Dalaran Brilliance - - -- PRIEST - [48040] = true, -- Inner Fire (Rank 8) - [48168] = true, -- Inner Fire (Rank 9) - [48074] = true, -- Prayer of Spirit (Rank 3) - [49868] = true, -- Mind Quickening - - -- SHAMAN - [30809] = true, -- Unleashed Rage - [51470] = true, -- Elemental Oath - } - - import(data, blacklist) -end - -if EXPANSION >= LE_EXPANSION_WRATH_OF_THE_LICH_KING then - local data = { - -- Items - [72968] = true, -- Precious's Ribbon - - -- Dungeons - [72221] = true, -- Luck of the Draw - - -- World Buffs - [57940] = true, -- Essence of Wintergrasp - } - import(data, blacklist) -end - --------------------------------------------------- --- Cataclysm --------------------------------------------------- -if Filger.isCata then - local data = { - -- DEATHKNIGHT - [55610] = true, -- Improved Icy Talons - - -- HUNTER - [77769] = true, -- Trap Launcher - - -- MAGE - [61316] = true, -- Dalaran Brilliance - - -- PALADIN - [79102] = true, -- Blessing of Might - [20165] = true, -- Seal of Insight - - -- PRIEST - [588] = true, -- Inner Fire - [49868] = true, -- Mind Quickening - [79107] = true, -- Shadow Protection - [73413] = true, -- Inner Will - - -- SHAMAN - [30809] = true, -- Unleashed Rage - [51470] = true, -- Elemental Oath - [77747] = true, -- Totemic Wrath - } - - import(data, blacklist) -end - -if EXPANSION >= LE_EXPANSION_CATACLYSM then - local data = { - -- WARLOCK - [108503] = true, -- Grimoire of Sacrifice - - -- Items - [93337] = true, -- Champion of Ramkahen - [93795] = true, -- Stormwind Champion - [93806] = true, -- Darnassus Champion - [93825] = true, -- Orgrimmar Champion - [93828] = true, -- Silvermoon Champion - [97341] = true, -- Guild Champion - - -- Customes - [74589] = true, -- Identity Crisis (Faded Wizard Hat) - [96312] = true, -- Kalytha's Haunted Locket - } - import(data, blacklist) -end - --------------------------------------------------- --- Mists of Pandaria --------------------------------------------------- -if Filger.isMoP then - local data = { - -- DEATHKNIGHT - [55610] = true, -- Unholy Aura - - -- HUNTER - [77769] = true, -- Trap Launcher - - -- MAGE - [61316] = true, -- Dalaran Brilliance - - -- MONK - [117666] = true, -- Legacy of the Emperor - [116781] = true, -- Legacy of the White Tiger - - -- PRIEST - [49868] = true, -- Mind Quickening - - -- ROGUE - [113742] = true, -- Swiftblade's Cunning - [112942] = true, -- Shadow Focus - - - - -- SHAMAN - [30809] = true, -- Unleashed Rage - [51470] = true, -- Elemental Oath - [77747] = true, -- Burning Wrath - [116956] = true, -- Grace of Air - - -- WARLOCK - [109773] = true, -- Dark Intent - } - import(data, blacklist) -end - -if EXPANSION >= LE_EXPANSION_MISTS_OF_PANDARIA then - local data = { - -- HUNTER - [109260] = true, -- Aspect of the Iron Hawk - - -- Items - [105689] = true, -- Flask of Spring Blossoms - [105691] = true, -- Flask of the Warn Sun - [105694] = true, -- Flask of the Earth - [105696] = true, -- Flask of Winter's Bite - [126434] = true, -- Tushui Champion - [127230] = true, -- Visions of Insanity - - -- Factions - [119966] = true, -- Blessing of the Pearlfin - - -- Klaxxi - [124529] = true, -- Iron Mantid (Enhancement) - [123075] = true, -- Angel of Death (Enhancement) - [127382] = true, -- Silent Lucidity (Enhancement) - [127794] = true, -- Children of the Grave (Enhancement) - [127375] = true, -- Speed King (Augmentation) - [123219] = true, -- Battle Hymn (Augmentation) - [123211] = true, -- Pain Killer (Augmentation) - [127351] = true, -- Master of Puppets (Augmentation) - - -- World Buff - [130609] = true, -- Valor of the Ancients - - -- Others - [131493] = true, -- B.F.F - [134522] = true, -- Dressed to Kill - [114800] = true, -- Polyformic Acid Potion - [110880] = true, -- 1st Place - } - import(data, blacklist) -end - --------------------------------------------------- --- Warlords of Draenor --------------------------------------------------- -if EXPANSION >= LE_EXPANSION_WARLORDS_OF_DRAENOR then - local data = { - -- World Buffs - [186401] = true, -- Sign of the Skirmisher - [186403] = true, -- Sign of Battle - [186406] = true, -- Sign of the Critter - - -- ??? - [182422] = true, -- Training Gear - } - import(data, blacklist) -end - --------------------------------------------------- --- Legion --------------------------------------------------- -if EXPANSION >= LE_EXPANSION_LEGION then - local data = { - -- PvP - [282559] = true, -- Enlisted - - -- Items - [203533] = true, -- Black Icey Bling - [227723] = true, -- Mana Diving Stone - [245686] = true, -- Fashionable! - [297871] = true, -- Anglers' Water Striders - - -- World Buffs - [225787] = true, -- Sign of of Warrior - [225788] = true, -- Sign of the Emissary - - -- Mythic+ - [206151] = true, -- Challenger's Burden - } - import(data, blacklist) -end - --------------------------------------------------- --- Battle for Azeroth --------------------------------------------------- -if EXPANSION >= LE_EXPANSION_BATTLE_FOR_AZEROTH then - local data = { - -- World Buffs - [335148] = true, -- Sign of the Twisting Nether - [335149] = true, -- Sign of the Scourge - [335150] = true, -- Sign of the Destroyer - [335151] = true, -- Sign of the Mists - [335152] = true, -- Sign of Iron - - -------------------------------------------------- - -- Patch 8.1.0 - -------------------------------------------------- - [147728] = true, -- Severed Crimsonscale Head - - -------------------------------------------------- - -- Patch 8.2.0 - -------------------------------------------------- - [306600] = true, -- Experience Eliminated - - -------------------------------------------------- - -- Patch 8.3.0 - -------------------------------------------------- - -- Horric Visions - [291295] = true, -- Mind Protected - - [307518] = true, -- Vision Hunter - [312583] = true, -- Vision Hunter - [312585] = true, -- Vision Hunter - - [305380] = true, -- Experimental Destabilization - [305381] = true, -- Experimental Destabilization - [305385] = true, -- Experimental Destabilization - [312620] = true, -- Experimental Destabilization - [312621] = true, -- Experimental Destabilization - - [304852] = true, -- Singular Sanitation Expertise - [312545] = true, -- Singular Sanitation Expertise - [312544] = true, -- Singular Sanitation Expertise - [304853] = true, -- Singular Sanitation Expertise - - [312629] = true, -- Clear Sight - [307519] = true, -- Clear Sight - [312628] = true, -- Clear Sight - - [312456] = true, -- Elite Extermination - [310720] = true, -- Elite Extermination - } - import(data, blacklist) -end - --------------------------------------------------- --- Shadowlands --------------------------------------------------- -if EXPANSION >= LE_EXPANSION_SHADOWLANDS then - local data = { - -- World Buffs - [347600] = true, -- Infused Ruby Tracking - [359082] = true, -- Sign of the Legion - - -- Items - [345545] = true, -- Flayedwing Toxin - [368510] = true, -- So'leash's Secret Technique - [368512] = true, -- So'leash's Secret Technique - } - import(data, blacklist) -end - --------------------------------------------------- --- Dragonflight --------------------------------------------------- -if EXPANSION >= LE_EXPANSION_DRAGONFLIGHT then - local data = { - -- DEATHKNIGHT - - -- MONK - [166646] = true, -- Windwalking - - -- PALADIN - [465] = true, -- Devotion Aura - [32223] = true, -- Crusader Aura - - -- PRIEST - [21562] = true, -- Power Word: Fortitude - [280398] = true, -- Sins of the Many - - -- SHAMAN - [395197] = true, -- Mana Spring - - -- WARRIOR - [6673] = true, -- Battle Shout - [202602] = true, -- Into the Fray - - -- Dragons Island - [385081] = true, -- Unstable Blink - [390493] = true, -- Cobalt Boost - [394258] = true, -- Cobalt Cutthroat - - -- Forbiden Reach - [405261] = true, -- Dragonscale's Favor - [405263] = true, -- Iskaara's Favor - [405264] = true, -- Maruukai's Favor - [405265] = true, -- Valdrakken's Favor - - -- Zaralek Cavern - [411060] = true, -- New Niffen No-Sniffin' Tonic - - -- Professions - [382093] = true, -- Alchemically Inspired - - -- Items - [399502] = true, -- Automically Recalibrated - [401518] = true, -- Bronze Resonance (Ominous Chromatic Essence) - [410762] = true, -- The Silent Star (Voice of the Silent Star) - [391594] = true, -- Lemon Silverleaf Tea - - -- Tier Set - [426262] = true, -- Larodar's Fiery Reverie (Priest Discipline / Holy) - [426341] = true, -- Tindral's Fowl Fantasia (Priest Shadow) - [426288] = true, -- Smolderon's Delusions of Gradeour - - -- WoW Remix - [424143] = true, -- WoW Remix: Mists of Pandaria - [440393] = true, -- Timerunner's Advantage - [459337] = true, -- Timerunner's Mastery - - -------------------------------------------------- - -- Patch 10.0.2 - -------------------------------------------------- - -- World Buffs - [397734] = true, -- Word of a Worthy Ally - - -- Professions - [394006] = true, -- Rockin' Mining Gear - - -------------------------------------------------- - -- Patch 10.1.5 - -------------------------------------------------- - -- World Buffs - [417275] = true, -- Greater Encapsulated Destiny - - -- Rifts - [415603] = true, -- Encapsulated Destiny - - -------------------------------------------------- - -- Patch 10.1.7 - -------------------------------------------------- - -- Dreamsourge - [415216] = true, -- Dreamsurge Heartbloom - [415275] = true, -- Dreamsurge Hibernation - [416101] = true, -- Dreamsurge Dreamfall - [418630] = true, -- Dreamsurge Thunderbounce - [418652] = true, -- Dreamsurge Wrathbloom - [418656] = true, -- Dreamsurge Magpies - [418694] = true, -- Dreamsurge Helpers - [418744] = true, -- Dreamsurge Learnings - [418769] = true, -- Dreamsurge Greenwalker - [418810] = true, -- Dreamsurge Lone Wolves - [418813] = true, -- Self Sufficient - [418842] = true, -- Dreamsurge Pack Hunters - [419079] = true, -- Dreamsurge Defenders - [419081] = true, -- Dreamsurge Defenders - [419239] = true, -- Dreaming Winds - [419530] = true, -- Dreamsurge Thorncloak - [426647] = true, -- Best Friends with Pip - [426672] = true, -- Best Friends with Urctos - [426676] = true, -- Best Friends with Aerwynn - - -------------------------------------------------- - -- Patch 10.2.0 - -------------------------------------------------- - -- World Buffs - [420511] = true, -- Going Green - - -------------------------------------------------- - -- Patch 10.2.6 - -------------------------------------------------- - -- World Buffs - [430666] = true, -- Sign of Awakened Storms - [430668] = true, -- Sign of Awakened Embers - [430669] = true, -- Sign of Awakened Dreams - } - - import(data, blacklist) -end - --------------------------------------------------- --- Retail --------------------------------------------------- -if Filger.isRetail then - local data = { - -- Classes - -- DEMONHUNTER - [452550] = true, -- Monster Rising - [453314] = true, -- Enduring Torment - [1214887] = true, -- Cycle of Hatred - - -- EVOKER - [369459] = true, -- Source of Magic - [381753] = true, -- Blessing of the Bronze - [372014] = true, -- Visage - - -- DRUID - [400734] = true, -- After the Wildfire - - -- MAGE - [1217242] = true, -- Enlightened - - -- MONK - [383733] = true, -- Training of Niuzao - [450552] = true, -- Jade Walk - [450572] = true, -- Flow of Chi - [450574] = true, -- Flow of Chi - [443574] = true, -- Ox Stance - [443575] = true, -- Tiger Stance - [166646] = true, -- Windwalking - [129914] = true, -- Combat Wisdom - [450380] = true, -- Chi Wave - - -- PRIEST - [21562] = true, -- Power Word: Fortitude - - -- SHAMAN - [462854] = true, -- Skyfury - - -- WARRIOR - [386196] = true, -- Berserker Stance - - -- Mount - [404464] = true, -- Flight Style: Skyriding - [404468] = true, -- Flight Style: Steady - [456820] = true, -- Ride Along - - -- Mythic+ - [206150] = true, -- Challenger's Might - - -- Items - [447962] = true, -- Stance - Surekian Flourish - [447978] = true, -- Stance - Surekian Decimation - [448036] = true, -- Stance - Surekian Barrage - [448433] = true, -- Surekian Grace - [450696] = true, -- "The 50 Verses of Radiance" (Tome of Light's Devotion) - [450699] = true, -- "The 50 Verses of Radiance" (Tome of Light's Devotion) - [450706] = false, -- Inner Radiance (Tome of Light's Devotion) - [450720] = true, -- Inner Radiance (Tome of Light's Devotion) - [452226] = true, -- Spiderling (Ara-Kara Sacbrood) - [457925] = true, -- Venomous Potential (Seal of the Poisoned Pact) - [451369] = true, -- Empowering Darkness - - -- Costumes - [452533] = true, -- Magical Mischief - - -- Warband - [430191] = true, -- Warband Mentored Leveling - - -- Professions - [442981] = true, -- Weaver's Tutelage - [462810] = true, -- Weaver's Prodigy - - -- Factions - [442983] = true, -- Vizier's Savvy - [462806] = true, -- Vizier's Supremacy - [440645] = true, -- Fire Flies - [443248] = true, -- Azj-Kahet Pheromones - [462821] = true, -- General's Bulwark - - -- Consumables - ["Well Fed"] = true, - ["Hearty Well Fed"] = true, - [454188] = true, -- Hearty Well Fed - [462180] = true, -- Hearty Well Fed - [462181] = true, -- Hearty Well Fed - [462182] = true, -- Hearty Well Fed - [462183] = true, -- Hearty Well Fed - [462184] = true, -- Hearty Well Fed - [462185] = true, -- Hearty Well Fed - [462186] = true, -- Hearty Well Fed - [462187] = true, -- Hearty Well Fed - [462188] = true, -- Hearty Well Fed - [462189] = true, -- Hearty Well Fed - [462190] = true, -- Hearty Well Fed - [462191] = true, -- Hearty Well Fed - [462192] = true, -- Hearty Well Fed - [462193] = true, -- Hearty Well Fed - [462194] = true, -- Hearty Well Fed - [462195] = true, -- Hearty Well Fed - [462196] = true, -- Hearty Well Fed - [462197] = true, -- Hearty Well Fed - [462198] = true, -- Hearty Well Fed - [462199] = true, -- Hearty Well Fed - [462200] = true, -- Hearty Well Fed - [462201] = true, -- Hearty Well Fed - [462202] = true, -- Hearty Well Fed - [462203] = true, -- Hearty Well Fed - [462204] = true, -- Hearty Well Fed - [462205] = true, -- Hearty Well Fed - [462206] = true, -- Hearty Well Fed - [462207] = true, -- Hearty Well Fed - [462208] = true, -- Hearty Well Fed - [462209] = true, -- Hearty Well Fed - [462210] = true, -- Hearty Well Fed - - [431971] = true, -- Flask of Tempered Aggression - [431972] = true, -- Flask of Tempered Swiftness - [431973] = true, -- Flask of Tempered Versatility - [431974] = true, -- Flask of Tempered Mastery - - -------------------------------------------------- - -- Patch 11.0.0 - -------------------------------------------------- - -- Delves - [423852] = true, -- Dormouse Ecila - [448868] = true, -- Lucky Cursed Potion - [459058] = true, -- Miniature - [459059] = true, -- Massive - [459254] = true, -- Loader Signal - - -- Professions - [457674] = true, -- Duskthread Lining - [457666] = true, -- Dawnthread Lining - - -------------------------------------------------- - -- Patch 11.0.2 - -------------------------------------------------- - -- World Buffs - [471521] = true, -- Sign of the Explorer - - -------------------------------------------------- - -- Patch 11.0.5 - -------------------------------------------------- - -- World Buffs - [452307] = true, -- Sign of the Past - [455020] = true, -- WoW's Anniversary - - -- Events - [455050] = true, -- Blessing of the Brozen Drgonflight - - -- Items - [465642] = true, -- Blizzard Bling - - -------------------------------------------------- - -- Patch 11.0.7 - -------------------------------------------------- - -- Items - [1215495] = true, -- Cyrce's Circlet - - -------------------------------------------------- - -- Patch 11.1.5 - -------------------------------------------------- - -- World Buffs - [1214848] = true, -- Winds of Mysterious Fortune - [1227124] = true, -- Sacred Flame's Ward - - -- Horric Visions - [472265] = true, -- Vision Hunter - [472266] = true, -- Vision Hunter - [472267] = true, -- Vision Hunter - [472261] = true, -- Experimental Destabilization - [472263] = true, -- Experimental Destabilization - [472264] = true, -- Experimental Destabilization - [1215082] = true, -- Experimental Destabilization - [471497] = true, -- Singular Sanitation Expertise - [472160] = true, -- Singular Sanitation Expertise - [472152] = true, -- Singular Sanitation Expertise - [472238] = true, -- Clear Sight - [472248] = true, -- Clear Sight - [472246] = true, -- Clear Sight - [472241] = true, -- Elite Extermination - [1215782] = true, -- Elite Extermination - [1215783] = true, -- Elite Extermination - [471317] = true, -- Steeled Mind - [471318] = true, -- Steeled Mind - [471320] = true, -- Steeled Mind - [471321] = true, -- Steeled Mind - [471322] = true, -- Steeled Mind - [1216153] = true, -- Steeled Mind - [1221899] = true, -- Tattered Wold Rider Gear - - -------------------------------------------------- - -- Patch 11.1.7 - -------------------------------------------------- - -- World Buffs - [1223878] = true, -- Sign of Azeroth - - [1250683] = true, -- Collector's Bounty - [1250685] = true, -- Greedy Emisarry - - [1229050] = true, -- Mastery of Timeways - [1220736] = true, -- Mysterious Revivification - [1218497] = true, -- Mysterious Tenacity - [1218388] = true, -- Mysterious Celerity - [1218454] = true, -- Mysterious Swiftstrike - - -------------------------------------------------- - -- Patch 11.2.0 - -------------------------------------------------- - [1244018] = true, -- Tazavesh, the Vailed Market, Hard Mode - [1246366] = true, -- Stree Smart - - -------------------------------------------------- - -- Legion Remix - -------------------------------------------------- - [1232454] = true, -- Initife Power - [1238465] = true, -- Heroic World Tier - [1213439] = true, -- WoW Remix: Legion - - [440361] = true, -- Timeless Scroll of the Wild - - } - - import(data, blacklist) -end - -Filger.blacklist = blacklist diff --git a/core/colors.lua b/core/colors.lua index 038697a..35fb124 100644 --- a/core/colors.lua +++ b/core/colors.lua @@ -44,8 +44,10 @@ local colors = { ["Enrage"] = Filger:CreateColor(0.78, 0.25, 0.25) } -for debuffType, color in next, _G.DebuffTypeColor do - colors[debuffType] = CreateColor(color.r, color.g, color.b) +for debuffType, info in next, AuraUtil.GetDebuffDisplayInfoTable() do + if not colors[debuffType] then + colors[debuffType] = CreateColor(info.color.r, info.color.g, info.color.b) + end end Filger.colors = colors diff --git a/core/cooldowns.lua b/core/cooldowns.lua deleted file mode 100644 index 14eedab..0000000 --- a/core/cooldowns.lua +++ /dev/null @@ -1,1002 +0,0 @@ -local _, ns = ... -local Filger = ns.Filger -local class = Filger.class - --- Blizzard -local GetSpellInfo = C_Spell and C_Spell.GetSpellInfo or _G.GetSpellInfo - -local expansion = _G.LE_EXPANSION_LEVEL_CURRENT -local LE_EXPANSION_CLASSIC = _G.LE_EXPANSION_CLASSIC or 0 -local LE_EXPANSION_BURNING_CRUSADE = _G.LE_EXPANSION_BURNING_CRUSADE or 1 -local LE_EXPANSION_WRATH_OF_THE_LICH_KING = _G.LE_EXPANSION_WRATH_OF_THE_LICH_KING or 2 -local LE_EXPANSION_CATACLYSM = _G.LE_EXPANSION_CATACLYSM or 3 -local LE_EXPANSION_MISTS_OF_PANDARIA = _G.LE_EXPANSION_MISTS_OF_PANDARIA or 4 -local LE_EXPANSION_WARLORDS_OF_DRAENOR = _G.LE_EXPANSION_WARLORDS_OF_DRAENOR or 5 -local LE_EXPANSION_LEGION = _G.LE_EXPANSION_LEGION or 6 -local LE_EXPANSION_BATTLE_FOR_AZEROTH = _G.LE_EXPANSION_BATTLE_FOR_AZEROTH or 7 -local LE_EXPANSION_SHADOWLANDS = _G.LE_EXPANSION_SHADOWLANDS or 8 -local LE_EXPANSION_DRAGONFLIGHT = _G.LE_EXPANSION_DRAGONFLIGHT or 9 -local LE_EXPANSION_WAR_WITHIN = _G.LE_EXPANSION_WAR_WITHIN or 10 - -local cooldowns = {} - -local importData = function(dest, row) - if row.enabled then - local data = GetSpellInfo(row.spellId) - if data then - table.insert(dest, row) - else - Filger:warn("COOLDOWN", "Spell " .. row.spellId .. " do not exists.") - end - end -end - -local import = function(source, dest) - for class, spells in next, source do - if not dest[class] then - dest[class] = {} - end - - for _, row in next, spells do - importData(dest[class], row) - -- if row.enabled then - -- local data = GetSpellInfo(row.spellId) - -- if data then - -- table.insert(dest[class], row) - -- else - -- Filger.warn("COOLDOWN", "Spell " .. row.spellId .. " do not exists.") - -- end - -- end - end - end -end - -local CreateSpellCooldown = function(spellId, enabled) - assert(type(spellId) == "number", "Filger: Invalid cooldown spellId") - if (enabled == nil) then - enabled = true - end - return { spellId = spellId, enabled = enabled } -end - -local CreateSlotCooldown = function(slotId, enabled) - assert(tonumber(slotId), "Filger: Invalid slotId") - if (enabled == nil) then - enabled = true - end - return { slotId = slotId, enabled = enabled } -end - -local racials = { - -- Horde - CreateSpellCooldown(7744), -- Will of the Forsaken (Undead) - CreateSpellCooldown(20549), -- War Stomp (Tauren) - CreateSpellCooldown(20572), -- Blood Fury (Orc) - CreateSpellCooldown(26297), -- Berserking (Troll) - CreateSpellCooldown(28730, expansion >= LE_EXPANSION_BURNING_CRUSADE), -- Arcane Torrent (Blood Elf) - CreateSpellCooldown(255654, expansion >= LE_EXPANSION_LEGION), -- Bull Rush (Highmountain Tauren) - - -- Alliance - CreateSpellCooldown(20594), -- Stoneform (Dwarf) - CreateSpellCooldown(265221, expansion >= LE_EXPANSION_BATTLE_FOR_AZEROTH), -- Fireblood Fury (Dark Iron Dwarf) -} - -local gear = { - CreateSlotCooldown(2), -- Neck - CreateSlotCooldown(6), -- Waist - CreateSlotCooldown(13), -- Trinket 1 - CreateSlotCooldown(14), -- Trinket 2 -} - --------------------------------------------------- --- Classic --------------------------------------------------- -if Filger.isClassic then - local data = { - ["PALADIN"] = { - -- General - CreateSpellCooldown(498), -- Divine Protection - CreateSpellCooldown(642), -- Divine Shield - CreateSpellCooldown(633), -- Lay on Hands - CreateSpellCooldown(1022), -- Blessing of Protection - CreateSpellCooldown(1044), -- Blessing of Freedom - CreateSpellCooldown(6940), -- Blessing of Sacrifice - }, - ["PRIEST"] = { - -- Discipline - CreateSpellCooldown(10060), -- Power Infusion - CreateSpellCooldown(14751), -- Inner Focus - - -- Holy - CreateSpellCooldown(724), -- Lightwell (Rank 1) - CreateSpellCooldown(27870), -- Lightwell (Rank 2) - CreateSpellCooldown(27871), -- Lightwell (Rank 3) - - -- Shadow - CreateSpellCooldown(15286, false), -- Vampiric Embrace - CreateSpellCooldown(15487), -- Silence - - CreateSpellCooldown(586), -- Fade (Rank 1) - CreateSpellCooldown(9578), -- Fade (Rank 2) - CreateSpellCooldown(9579), -- Fade (Rank 3) - CreateSpellCooldown(9592), -- Fade (Rank 4) - CreateSpellCooldown(10941), -- Fade (Rank 5) - CreateSpellCooldown(10942), -- Fade (Rank 6) - - CreateSpellCooldown(8122), -- Psychic Scream (Rank 1) - CreateSpellCooldown(8124), -- Psychic Scream (Rank 2) - CreateSpellCooldown(10888), -- Psychic Scream (Rank 3) - CreateSpellCooldown(10890), -- Psychic Scream (Rank 4) - - -- Night Elf - CreateSpellCooldown(2651), -- Elune's Grace (Rank 1) - CreateSpellCooldown(19289), -- Elune's Grace (Rank 2) - CreateSpellCooldown(19291), -- Elune's Grace (Rank 3) - CreateSpellCooldown(19292), -- Elune's Grace (Rank 4) - CreateSpellCooldown(19293), -- Elune's Grace (Rank 5) - - -- Human - CreateSpellCooldown(13896), -- Feedback (Rank 1) - CreateSpellCooldown(19271), -- Feedback (Rank 2) - CreateSpellCooldown(19273), -- Feedback (Rank 3) - CreateSpellCooldown(19274), -- Feedback (Rank 4) - CreateSpellCooldown(19275), -- Feedback (Rank 5) - - -- Dwarf - CreateSpellCooldown(6346), -- Fear Ward (Rank 1) - - -- Dwarf / Humman - CreateSpellCooldown(13908), -- Desperate Prayer (Rank 1) - CreateSpellCooldown(19236), -- Desperate Prayer (Rank 2) - CreateSpellCooldown(19238), -- Desperate Prayer (Rank 3) - CreateSpellCooldown(19240), -- Desperate Prayer (Rank 4) - CreateSpellCooldown(19241), -- Desperate Prayer (Rank 5) - CreateSpellCooldown(19242), -- Desperate Prayer (Rank 6) - CreateSpellCooldown(19243), -- Desperate Prayer (Rank 7) - - -- Undead - CreateSpellCooldown(2944), -- Devouring Plague(Rank 1) - CreateSpellCooldown(19276), -- Devouring Plague(Rank 2) - CreateSpellCooldown(19277), -- Devouring Plague(Rank 3) - CreateSpellCooldown(19278), -- Devouring Plague(Rank 4) - CreateSpellCooldown(19279), -- Devouring Plague(Rank 5) - CreateSpellCooldown(19280), -- Devouring Plague(Rank 6) - }, - ["WARRIOR"] = { - -- Arms - CreateSpellCooldown(6178), -- Charge - CreateSpellCooldown(7400), -- Mocking Blow - CreateSpellCooldown(20230), -- Retaliation - - -- Fury - CreateSpellCooldown(1161), -- Challenging Shout - CreateSpellCooldown(5246), -- Intimidating Shout - CreateSpellCooldown(18499), -- Berserker Rage - CreateSpellCooldown(20252), -- Intercept - - -- Protection - CreateSpellCooldown(355), -- Taunt - CreateSpellCooldown(676), -- Disarm - CreateSpellCooldown(871), -- Shield Wall - CreateSpellCooldown(1671), -- Shield Bash - CreateSpellCooldown(2687), -- Bloodrage - } - } - import(data, cooldowns) -end - --------------------------------------------------- --- The Burning Crusade --------------------------------------------------- -if Filger.isBCC then - local data = { - ["PRIEST"] = { - -- Discipline - CreateSpellCooldown(10060), -- Power Infusion - CreateSpellCooldown(14751), -- Inner Focus - - -- Holy - CreateSpellCooldown(724), -- Lightwell (Rank 1) - CreateSpellCooldown(27870), -- Lightwell (Rank 2) - CreateSpellCooldown(27871), -- Lightwell (Rank 3) - - -- Shadow - CreateSpellCooldown(15286, false), -- Vampiric Embrace - CreateSpellCooldown(15487), -- Silence - - CreateSpellCooldown(586), -- Fade (Rank 1) - CreateSpellCooldown(9578), -- Fade (Rank 2) - CreateSpellCooldown(9579), -- Fade (Rank 3) - CreateSpellCooldown(9592), -- Fade (Rank 4) - CreateSpellCooldown(10941), -- Fade (Rank 5) - CreateSpellCooldown(10942), -- Fade (Rank 6) - - CreateSpellCooldown(8122), -- Psychic Scream (Rank 1) - CreateSpellCooldown(8124), -- Psychic Scream (Rank 2) - CreateSpellCooldown(10888), -- Psychic Scream (Rank 3) - CreateSpellCooldown(10890), -- Psychic Scream (Rank 4) - - CreateSpellCooldown(6346), -- Fear Ward (Rank 1) - - -- Night Elf - CreateSpellCooldown(2651), -- Elune's Grace - - -- Human - CreateSpellCooldown(13896), -- Feedback (Rank 1) - CreateSpellCooldown(19271), -- Feedback (Rank 2) - CreateSpellCooldown(19273), -- Feedback (Rank 3) - CreateSpellCooldown(19274), -- Feedback (Rank 4) - CreateSpellCooldown(19275), -- Feedback (Rank 5) - CreateSpellCooldown(25441), -- Feedback (Rank 6) - - -- Dwarf / Humman - CreateSpellCooldown(13908), -- Desperate Prayer (Rank 1) - CreateSpellCooldown(19236), -- Desperate Prayer (Rank 2) - CreateSpellCooldown(19238), -- Desperate Prayer (Rank 3) - CreateSpellCooldown(19240), -- Desperate Prayer (Rank 4) - CreateSpellCooldown(19241), -- Desperate Prayer (Rank 5) - CreateSpellCooldown(19242), -- Desperate Prayer (Rank 6) - CreateSpellCooldown(19243), -- Desperate Prayer (Rank 7) - CreateSpellCooldown(25437), -- Desperate Prayer (Rank 8) - - -- Undead - CreateSpellCooldown(2944), -- Devouring Plague(Rank 1) - CreateSpellCooldown(19276), -- Devouring Plague(Rank 2) - CreateSpellCooldown(19277), -- Devouring Plague(Rank 3) - CreateSpellCooldown(19278), -- Devouring Plague(Rank 4) - CreateSpellCooldown(19279), -- Devouring Plague(Rank 5) - CreateSpellCooldown(19280), -- Devouring Plague(Rank 6) - } - } - import(data, cooldowns) -end - --------------------------------------------------- --- Wrath of the Lich King --------------------------------------------------- -if Filger.isWrath then - local data = { - ["PRIEST"] = { - -- Discipline - CreateSpellCooldown(10060), -- Power Infusion - CreateSpellCooldown(14751), -- Inner Focus - - -- Holy - CreateSpellCooldown(724), -- Lightwell (Rank 1) - CreateSpellCooldown(27870), -- Lightwell (Rank 2) - CreateSpellCooldown(27871), -- Lightwell (Rank 3) - - -- Shadow - CreateSpellCooldown(15286, false), -- Vampiric Embrace - CreateSpellCooldown(15487), -- Silence - - CreateSpellCooldown(586), -- Fade (Rank 1) - CreateSpellCooldown(9578), -- Fade (Rank 2) - CreateSpellCooldown(9579), -- Fade (Rank 3) - CreateSpellCooldown(9592), -- Fade (Rank 4) - CreateSpellCooldown(10941), -- Fade (Rank 5) - CreateSpellCooldown(10942), -- Fade (Rank 6) - - CreateSpellCooldown(8122), -- Psychic Scream (Rank 1) - CreateSpellCooldown(8124), -- Psychic Scream (Rank 2) - CreateSpellCooldown(10888), -- Psychic Scream (Rank 3) - CreateSpellCooldown(10890), -- Psychic Scream (Rank 4) - - CreateSpellCooldown(6346), -- Fear Ward (Rank 1) - - CreateSpellCooldown(13908), -- Desperate Prayer (Rank 1) - CreateSpellCooldown(19236), -- Desperate Prayer (Rank 2) - CreateSpellCooldown(19238), -- Desperate Prayer (Rank 3) - CreateSpellCooldown(19240), -- Desperate Prayer (Rank 4) - CreateSpellCooldown(19241), -- Desperate Prayer (Rank 5) - CreateSpellCooldown(19242), -- Desperate Prayer (Rank 6) - CreateSpellCooldown(19243), -- Desperate Prayer (Rank 7) - CreateSpellCooldown(25437), -- Desperate Prayer (Rank 8) - CreateSpellCooldown(48173), -- Desperate Prayer (Rank 9) - - -- Undead - CreateSpellCooldown(2944), -- Devouring Plague(Rank 1) - CreateSpellCooldown(19276), -- Devouring Plague(Rank 2) - CreateSpellCooldown(19277), -- Devouring Plague(Rank 3) - CreateSpellCooldown(19278), -- Devouring Plague(Rank 4) - CreateSpellCooldown(19279), -- Devouring Plague(Rank 5) - CreateSpellCooldown(19280), -- Devouring Plague(Rank 6) - } - } - import(data, cooldowns) -end - --------------------------------------------------- --- Cataclysm --------------------------------------------------- -if Filger.isCata then - local data = { - ["DEATHKNIGHT"] = { - -- All - CreateSpellCooldown(45529), -- Blood Tap - CreateSpellCooldown(47568), -- Empower Rune Weapon - CreateSpellCooldown(48707), -- Anti-Magic Shell - CreateSpellCooldown(48743), -- Death Pact - CreateSpellCooldown(48792), -- Icebound Fortitude - CreateSpellCooldown(49039), -- Lichborne - CreateSpellCooldown(61999), -- Raise Ally - - -- Blood - CreateSpellCooldown(55233), -- Vampiric Blood - CreateSpellCooldown(48982), -- Rune Tap - - -- Frost - - -- Unholy - CreateSpellCooldown(49206), -- Summon Gargoyle - }, - ["PALADIN"] = { - -- All - CreateSpellCooldown(1022), -- Hand of Protection - CreateSpellCooldown(1044), -- Hand of Freedom - CreateSpellCooldown(6940), -- Hand of Sacrifice - - -- Holy - CreateSpellCooldown(31821), -- Aura Mastery - CreateSpellCooldown(31842), -- Divine Favor - CreateSpellCooldown(54428), -- Divine Plea - - -- Protection - CreateSpellCooldown(498), -- Divine Protection - CreateSpellCooldown(642), -- Divine Shield - CreateSpellCooldown(20925), -- Holy Shield - CreateSpellCooldown(31850), -- Ardent Defender - CreateSpellCooldown(70940), -- Divine Guardian - CreateSpellCooldown(86669), -- Guardian of Ancient Kings - - -- Retribution - CreateSpellCooldown(31884), -- Avenging Wrath - }, - ["PRIEST"] = { - -- All - CreateSpellCooldown(586), -- Fade - CreateSpellCooldown(6346), -- Fear Ward - CreateSpellCooldown(8122), -- Psychic Scream - CreateSpellCooldown(34433), -- Shadowfiend - CreateSpellCooldown(64901), -- Hymn of Hope - CreateSpellCooldown(73325), -- Leap of Faith - - -- Discipline - CreateSpellCooldown(10060), -- Power Infusion - CreateSpellCooldown(33206), -- Pain Suppression - CreateSpellCooldown(87151), -- Archangel - CreateSpellCooldown(89485), -- Inner Focus - - -- Holy - CreateSpellCooldown(47788), -- Guardian Spirit - CreateSpellCooldown(64843), -- Divine Hymn - - -- Shadow - CreateSpellCooldown(15286), -- Vampiric Embrace - CreateSpellCooldown(15487), -- Silence - CreateSpellCooldown(47585), -- Dispersion - } - } - - import(data, cooldowns) -end - --------------------------------------------------- --- Mists of Pandaria --------------------------------------------------- -if Filger.isMoP then - local data = { - ["DRUID"] = { - -- General - CreateSpellCooldown(740), -- Tranquility - CreateSpellCooldown(20484), -- Rebirth - CreateSpellCooldown(22812), -- Barkskin - CreateSpellCooldown(29166), -- Innervate - - -- Guardian / Feral - CreateSpellCooldown(61336), -- Survival Instincts - CreateSpellCooldown(102795), -- Bear Hug - CreateSpellCooldown(106922), -- Might of Ursoc - CreateSpellCooldown(106952), -- Berkserk - - -- Restoration - CreateSpellCooldown(102342), -- Ironbark - }, - ["DEATHKNIGHT"] = { - CreateSpellCooldown(57330), -- Horn of Winter - CreateSpellCooldown(48792), -- Icebound Fortitude - CreateSpellCooldown(48707), -- Anti-Magic Shell - CreateSpellCooldown(49028), -- Dancing Rune Weapon - CreateSpellCooldown(49039), -- Lichborne - CreateSpellCooldown(55233), -- Vampiric Blood - CreateSpellCooldown(42650), -- Army of the Dead - CreateSpellCooldown(108200), -- Remorseless Winter - }, - ["HUNTER"] = {}, - ["MAGE"] = {}, - ["MONK"] = { - -- General - CreateSpellCooldown(115078), -- Paralysis - CreateSpellCooldown(115176), -- Zen Meditation - CreateSpellCooldown(117368), -- Grapple Weapon - CreateSpellCooldown(137562), -- Nimble Brew - - -- Talents - CreateSpellCooldown(116844), -- Ring of Peace - CreateSpellCooldown(119392), -- Charging Ox Wave - CreateSpellCooldown(119381), -- Leg Sweep - CreateSpellCooldown(122278), -- Dampen Harm - CreateSpellCooldown(122283), -- Diffuse Magic - CreateSpellCooldown(123904), -- Invoke Xuen, the White Tiger - - -- Brewmaster - CreateSpellCooldown(115203), -- Fortifying Brew - CreateSpellCooldown(115213), -- Avert Harm - CreateSpellCooldown(115308), -- Elusive Brew - CreateSpellCooldown(115315), -- Summon Black Ox Statue - CreateSpellCooldown(115399), -- Chi Brew - CreateSpellCooldown(122057), -- Clash - CreateSpellCooldown(123402), -- Guard - - -- Mistweaver - CreateSpellCooldown(115310), -- Revival - CreateSpellCooldown(116849), -- Life Cocoon - CreateSpellCooldown(116680), -- Thunder Focus Tea - - -- Windwaker - CreateSpellCooldown(122470), -- Touch of Karma - }, - ["PALADIN"] = { - -- General - CreateSpellCooldown(498), -- Divine Protection - CreateSpellCooldown(642), -- Divine Shield - CreateSpellCooldown(633), -- Lay on Hands - CreateSpellCooldown(1022), -- Blessing of Protection - CreateSpellCooldown(1044), -- Blessing of Freedom - CreateSpellCooldown(6940), -- Blessing of Sacrifice - - -- Talents - CreateSpellCooldown(31821), -- Aura Mastery - CreateSpellCooldown(31842), -- Divine Favor - CreateSpellCooldown(31850), -- Ardent Defender - CreateSpellCooldown(31884), -- Avenging Wrath (Holy) - }, - ["PRIEST"] = { - -- General - CreateSpellCooldown(586), -- Fade - CreateSpellCooldown(6346), -- Fear Ward - CreateSpellCooldown(8122), -- Psychic Scream - CreateSpellCooldown(34433), -- Shadowfiend - CreateSpellCooldown(73325), -- Leap of Faith - CreateSpellCooldown(64901), -- Hymn of Hope - - -- Talents - CreateSpellCooldown(10060), -- Power Infusion - - -- Discipline - CreateSpellCooldown(33206), -- Pain Suppression - CreateSpellCooldown(62618), -- Power Word: Barrier - CreateSpellCooldown(81700), -- Archangel - CreateSpellCooldown(89485), -- Inner Focus - CreateSpellCooldown(109964), -- Spirit Shell - - -- Holy - CreateSpellCooldown(64843), -- Divine Hymn - CreateSpellCooldown(47788), -- Guardian Spirit - - -- Shadow - CreateSpellCooldown(15487), -- Silence - CreateSpellCooldown(15286), -- Vampiric Embrace - CreateSpellCooldown(47585), -- Dispersion - CreateSpellCooldown(64044), -- Psychic Horror - CreateSpellCooldown(123040), -- Mind Bender - }, - ["SHAMAN"] = { - -- General - CreateSpellCooldown(8143), -- Tremor Totem - CreateSpellCooldown(32182), -- Heroism - CreateSpellCooldown(79206), -- Spiritwalker's Grace - CreateSpellCooldown(108269), -- Capacitor Totem - CreateSpellCooldown(108280), -- Healing Tide Totem - CreateSpellCooldown(114049), -- Ascendance - CreateSpellCooldown(120668), -- Stormlash Totem - }, - ["WARRIOR"] = { - -- General - CreateSpellCooldown(871), -- Shield Wall - CreateSpellCooldown(1719), -- Recklessness - CreateSpellCooldown(3411), -- Intervene - CreateSpellCooldown(5246), -- Intimidating Shout - CreateSpellCooldown(23920), -- Spell Reflection - CreateSpellCooldown(64382), -- Shattering Throw - CreateSpellCooldown(97462), -- Rallying Cry - CreateSpellCooldown(114192), -- Mocking Banner - CreateSpellCooldown(114203), -- Demoralizing Banner - CreateSpellCooldown(114207), -- Skull Banner - - -- Talents - CreateSpellCooldown(12292), -- Bloodbath - CreateSpellCooldown(46924), -- Bladestorm - CreateSpellCooldown(46968), -- Shockwave - CreateSpellCooldown(55694), -- Enraged Regeneration - CreateSpellCooldown(107570), -- Storm Bolt - CreateSpellCooldown(107574), -- Avatar - CreateSpellCooldown(114028), -- Mass Spell Reflection - CreateSpellCooldown(114030), -- Vigilance - CreateSpellCooldown(118000), -- Dragon Roar - } - } - - import(data, cooldowns) -end - --------------------------------------------------- --- Shadowlands --------------------------------------------------- -if Filger.Shadowlands then - local data = { - ["ALL"] = { - -- Kyrian - CreateSpellCooldown(324739, false), -- Summon Steward - - -- Ventyr - CreateSpellCooldown(323673), -- Mindgames - CreateSpellCooldown(300728), -- Door of Shadows - - -- Necrolords - CreateSpellCooldown(324143), -- Conqueror's Banner - CreateSpellCooldown(324631), -- Fleshcraft - } - } - - import(data, cooldowns) -end - --------------------------------------------------- --- Dragonflight --------------------------------------------------- -if Filger.isDF then - local data = { - ["DRUID"] = { - -- General - CreateSpellCooldown(22812), -- Barkskin - - -- Guardian - CreateSpellCooldown(50334), -- Berserke - CreateSpellCooldown(61336), -- Survival Instincts - }, - ["MAGE"] = { - -- Talents - CreateSpellCooldown(45438), -- Ice Block - }, - ["MONK"] = { - -- Talents - CreateSpellCooldown(115313), -- Summon Jade Serpent Statue - CreateSpellCooldown(115315), -- Summon Bloack Ox Statue - CreateSpellCooldown(116841), -- Tiger Lust - CreateSpellCooldown(116844), -- Ring of Peace - CreateSpellCooldown(388686), -- Summon White Tiger Statue - CreateSpellCooldown(322101, false), -- Expel Harm - CreateSpellCooldown(322109), -- Touch of Death - - -- Mistweaver - CreateSpellCooldown(115310), -- Revival - CreateSpellCooldown(116849), -- Life Cocoon - CreateSpellCooldown(116680), -- Thunder Focus Tea - CreateSpellCooldown(191837), -- Essence Font - CreateSpellCooldown(197908), -- Mana Tea - CreateSpellCooldown(325197), -- Invoke Chi-ji, The Red Crane - CreateSpellCooldown(388193), -- Faeline Stomp - CreateSpellCooldown(388615), -- Restoral - - -- Brewmaster - CreateSpellCooldown(115203), -- Fortifying Brew - CreateSpellCooldown(122278), -- Dumpen Harm - CreateSpellCooldown(122783), -- Diffuse Magic - CreateSpellCooldown(119582), -- Purifiying Brew - CreateSpellCooldown(132578), -- Invoke Niuzao, the Black Ox - CreateSpellCooldown(322507), -- Celestial Brew - CreateSpellCooldown(324312), -- Clash - CreateSpellCooldown(325153), -- Exploding Keg - CreateSpellCooldown(386276), -- Bonedust Brew - CreateSpellCooldown(387184), -- Weapons of Order - }, - ["PALADIN"] = { - CreateSpellCooldown(853), -- Hammer of Justice - CreateSpellCooldown(391054), -- Intercession - - -- Talents - CreateSpellCooldown(498), -- Divine Protection - CreateSpellCooldown(642), -- Divine Shield - CreateSpellCooldown(633), -- Lay on Hands - CreateSpellCooldown(1022), -- Blessing of Protection - CreateSpellCooldown(1044), -- Blessing of Freedom - CreateSpellCooldown(6940), -- Blessing of Sacrifice - CreateSpellCooldown(96231), -- Rebuke - CreateSpellCooldown(105809), -- Holy Avenger - CreateSpellCooldown(190784), -- Divine Steed - CreateSpellCooldown(389539), -- Sanctified Wrath - - -- Protection - CreateSpellCooldown(31850), -- Ardent Defender - CreateSpellCooldown(31884), -- Avenging Wrath: Might - CreateSpellCooldown(86659), -- Guardian of Ancient Kings - CreateSpellCooldown(204018), -- Blessing of Spellwarding - CreateSpellCooldown(327193), -- Moment of Glory - CreateSpellCooldown(375576), -- Divine Toll - CreateSpellCooldown(378974), -- Bastion of Light - CreateSpellCooldown(389539), -- Sentinel - CreateSpellCooldown(387174), -- Eye of Tyr - }, - ["PRIEST"] = { - -- Talents - CreateSpellCooldown(10060), -- Power Infusion - CreateSpellCooldown(19236), -- Desperate Prayer - CreateSpellCooldown(34433), -- Shadowfiendn - CreateSpellCooldown(73325), -- Leap of Faith - CreateSpellCooldown(373481), -- Power Word: Life - - -- Disciplie - CreateSpellCooldown(33206), -- Pain Suppression - CreateSpellCooldown(47536), -- Rapture - CreateSpellCooldown(62618), -- Power Word: Barrier - CreateSpellCooldown(109964), -- Spirit Shell - CreateSpellCooldown(120517), -- Halo - CreateSpellCooldown(194509), -- Power Word: Radiance - CreateSpellCooldown(246287), -- Evangelism - - -- Holy - CreateSpellCooldown(2050), -- Holy Word: Serenity - CreateSpellCooldown(64901), -- Symbol of Hope - CreateSpellCooldown(34861), -- Holy Word: Sanctify - CreateSpellCooldown(33076), -- Prayer of Mending - CreateSpellCooldown(47788), -- Guardian Spirit - CreateSpellCooldown(64843), -- Divine Hymn - CreateSpellCooldown(200183), -- Apotheosis - CreateSpellCooldown(204883, false), -- Circle of Healing - - -- Shadow - CreateSpellCooldown(15286), -- Vampiric Embrace - CreateSpellCooldown(15487), -- Silence - CreateSpellCooldown(47585), -- Dispersion - CreateSpellCooldown(108920), -- Void Tendrils - CreateSpellCooldown(108968), -- Void Shift - CreateSpellCooldown(200174), -- Mindbender - CreateSpellCooldown(228260), -- Void Eruption - CreateSpellCooldown(205385), -- Shadow Crash - CreateSpellCooldown(263165), -- Void Torrent - CreateSpellCooldown(120644), -- Halo - CreateSpellCooldown(205369), -- Mind Bomb - CreateSpellCooldown(375901), -- Mindgames - }, - ["WARRIOR"] = { - -- Talents - CreateSpellCooldown(1161), -- Challenging Shout - CreateSpellCooldown(2565, false), -- Shield Block - CreateSpellCooldown(5246), -- Intimidating Shout - CreateSpellCooldown(3411), -- Intervene - CreateSpellCooldown(6544), -- Heroic Leap - CreateSpellCooldown(18499), -- Berserker Rage - CreateSpellCooldown(46968), -- Shockwave - CreateSpellCooldown(97462), -- Rallying Cry - CreateSpellCooldown(376079), -- Spear of Bastion - CreateSpellCooldown(383762), -- Bitter Immunity - CreateSpellCooldown(384318), -- Thunderous Roar - CreateSpellCooldown(384100), -- Berserker Shout - -- CreateSpellCooldown(401150), -- Avatar - - -- Protection - CreateSpellCooldown(871), -- Shield Wall - CreateSpellCooldown(1160), -- Demoralizing Shout - CreateSpellCooldown(12975), -- Last Stand - CreateSpellCooldown(23920), -- Spell Reflection - CreateSpellCooldown(107570), -- Storm Bolt - CreateSpellCooldown(190456), -- Ignore Pain - CreateSpellCooldown(316834), -- Shield Wall - CreateSpellCooldown(386071), -- Disrupting Shout - CreateSpellCooldown(392966), -- Spell Block - CreateSpellCooldown(228920), -- Ravager - CreateSpellCooldown(385952), -- Shield Charge - } - } - - import(data, cooldowns) -end - -if Filger.isRetail then - local data = { - ["DEMONHUNTER"] = { - -- General - CreateSpellCooldown(187827), -- Metamorphosis - CreateSpellCooldown(196718), -- Darkness - CreateSpellCooldown(204596), -- Sigil of Flames - CreateSpellCooldown(207684), -- Sigil of Misery - CreateSpellCooldown(370965), -- The Hunt - CreateSpellCooldown(390163), -- Sigil of Spite - - -- Havoc - CreateSpellCooldown(196555), -- Netherwalk - CreateSpellCooldown(198589), -- Blur - CreateSpellCooldown(258925), -- Fel Barrage - - -- Vengeance - CreateSpellCooldown(202137), -- Sigil of Silence - CreateSpellCooldown(202138), -- Sigil of Chains - CreateSpellCooldown(204021), -- Fiery Brand - CreateSpellCooldown(207407), -- Soul Carver - CreateSpellCooldown(263648), -- Soul Barrier - CreateSpellCooldown(320341), -- Bulk Extraction - }, - ["DEATHKNIGHT"] = { - -- General - CreateSpellCooldown(48707), -- Anti-Magic Shell - CreateSpellCooldown(61999), -- Raise Ally - - -- Talents - CreateSpellCooldown(51052), -- Anti-Magic Zone - - -- Blood - CreateSpellCooldown(48743), -- Death Pact - CreateSpellCooldown(48792), -- Icebound Fortitude - CreateSpellCooldown(49028), -- Dancing Rune Weapon - CreateSpellCooldown(55233), -- Vampiric Blood - CreateSpellCooldown(219809), -- Tombstone - CreateSpellCooldown(383269), -- Abomination Limb - - -- Frost - CreateSpellCooldown(47568), -- Empower Rune Weapon - CreateSpellCooldown(51271), -- Pillar of Frost - CreateSpellCooldown(152279), -- Breath of Sindragosa - CreateSpellCooldown(196770), -- Remorseless Winter - CreateSpellCooldown(279302), -- Forstwyrm's Fury - - -- Unholy - CreateSpellCooldown(42650), -- Army of the Dead - CreateSpellCooldown(49206), -- Summon Gargoyle - CreateSpellCooldown(455395), -- Rise Abomination - }, - ["DRUID"] = { - -- General - CreateSpellCooldown(20484), -- Rebirth - CreateSpellCooldown(22812), -- Barkskin - - -- Talents - CreateSpellCooldown(29166), -- Innervate - CreateSpellCooldown(102359), -- Mass Entanglement - CreateSpellCooldown(102793), -- Ursol's Vortex - CreateSpellCooldown(108238), -- Renewal - CreateSpellCooldown(124974), -- Mature's Vigil - - -- All - CreateSpellCooldown(391528), -- Convoke the Spirits - - -- Balance - CreateSpellCooldown(78675), -- Solar Beam - CreateSpellCooldown(102560), -- Incarnation: Chosen of Elune - CreateSpellCooldown(194223), -- Celestial Alignment - CreateSpellCooldown(202425, false), -- Warrior of Elune - CreateSpellCooldown(202770), -- Fury of Elune - CreateSpellCooldown(205636), -- Force of Nature - - -- Feral - - -- Guardian - CreateSpellCooldown(50334), -- Berserkl: Ravage - CreateSpellCooldown(61336), -- Survival Instincts - CreateSpellCooldown(80313), -- Pulverize - CreateSpellCooldown(102558), -- Incarnation: Guardian of Ursoc - CreateSpellCooldown(200851), -- Rage of the Sleeper - CreateSpellCooldown(204066), -- Lunar Beam - - -- Restoration - CreateSpellCooldown(740), -- Tranquility - CreateSpellCooldown(33891), -- Incarnation: Tree of Life - CreateSpellCooldown(102342), -- Ironbark - CreateSpellCooldown(132158), -- Nature's Swiftness - CreateSpellCooldown(203651), -- Overgrowth - }, - ["EVOKER"] = {}, - ["MAGE"] = { - -- Talents - CreateSpellCooldown(31661), -- Dragon's Breath - CreateSpellCooldown(45438), -- Ice Block - CreateSpellCooldown(55342), -- Mirror Image - CreateSpellCooldown(80353), -- Time Warp - CreateSpellCooldown(110959), -- Greater Invisibilty - CreateSpellCooldown(157980), -- Supernova - CreateSpellCooldown(382440), -- Shifting Power - CreateSpellCooldown(414660), -- Mass Barrier - - -- Frost - CreateSpellCooldown(12472), -- Icy Veins - CreateSpellCooldown(84714), -- Frozen Orb - CreateSpellCooldown(235219), -- Cold Snap - }, - ["MONK"] = { - -- Talents - CreateSpellCooldown(115203), -- Fortifying Brew - CreateSpellCooldown(116705), -- Spear Hand Strike - CreateSpellCooldown(116841, false), -- Tiger Lust - CreateSpellCooldown(116844), -- Ring of Peace - CreateSpellCooldown(122278), -- Dumpen Harm - CreateSpellCooldown(122783), -- Diffuse Magic - CreateSpellCooldown(123986, false), -- Chi Burst - CreateSpellCooldown(322109), -- Touch of Death - CreateSpellCooldown(324312, false), -- Clash - - -- Mistweaver - CreateSpellCooldown(115310), -- Revival - CreateSpellCooldown(116849), -- Life Cocoon - CreateSpellCooldown(197908), -- Mana Tea - CreateSpellCooldown(322118), -- Invoke Yu'lon, the Jade Serpent - CreateSpellCooldown(325197), -- Invoke Chi-ji, The Red Crane - CreateSpellCooldown(388193), -- Faeline Stomp - CreateSpellCooldown(388615), -- Restoral - - -- Brewmaster - CreateSpellCooldown(119582, false), -- Purifiying Brew - CreateSpellCooldown(132578), -- Invoke Niuzao, the Black Ox - CreateSpellCooldown(115399), -- Black Ox Brew - CreateSpellCooldown(322507), -- Celestial Brew - CreateSpellCooldown(115176), -- Zen Meditation - CreateSpellCooldown(325153), -- Exploding Keg - CreateSpellCooldown(387184), -- Weapons of Order - CreateSpellCooldown(1241059), -- Celestial Infusion - }, - ["PALADIN"] = { - CreateSpellCooldown(633), -- Lay on Hands - CreateSpellCooldown(642), -- Divine Shield - CreateSpellCooldown(853), -- Hammer of Justice - CreateSpellCooldown(391054), -- Intercession - - -- Talents - CreateSpellCooldown(1022), -- Blessing of Protection - CreateSpellCooldown(1044), -- Blessing of Freedom - CreateSpellCooldown(6940), -- Blessing of Sacrifice - CreateSpellCooldown(31884), -- Avenging Wrath (Holy) - CreateSpellCooldown(96231, false), -- Rebuke - CreateSpellCooldown(115750), -- Blinding Light - CreateSpellCooldown(375576), -- Divine Toll - - -- Holy - CreateSpellCooldown(498), -- Divine Protection - CreateSpellCooldown(85222), -- Aura Mastery - CreateSpellCooldown(114165, false), -- Holy Prism - CreateSpellCooldown(148039, false), -- Barrier of Faith - CreateSpellCooldown(200025, false), -- Beacon of Virtue - CreateSpellCooldown(200672), -- Tyr's Deliverance - CreateSpellCooldown(388007), -- Blessim of Summer - CreateSpellCooldown(414273), -- Hand of Divinity - - -- Protection - CreateSpellCooldown(31850), -- Ardent Defender - CreateSpellCooldown(86659), -- Guardian of Ancient Kings - CreateSpellCooldown(204018), -- Blessing of Spellwarding - CreateSpellCooldown(327193), -- Moment of Glory - CreateSpellCooldown(378974), -- Bastion of Light - CreateSpellCooldown(31884), -- Sanctified Wrath - CreateSpellCooldown(389539), -- Sentinel - CreateSpellCooldown(387174), -- Eye of Tyr - - -- Retribution - CreateSpellCooldown(403876), -- Divine Protection - CreateSpellCooldown(31884), -- Avenging Wrath: Might - CreateSpellCooldown(255937, false), -- Wake of Ashes - CreateSpellCooldown(343721), -- Final Reckoning - CreateSpellCooldown(343527, false), -- Execution Sentence - }, - ["PRIEST"] = { - -- All - CreateSpellCooldown(586, false), -- Fade - CreateSpellCooldown(8122, false), -- Psychic Scream - CreateSpellCooldown(19236), -- Desperate Prayer - - -- Talents - CreateSpellCooldown(10060), -- Power Infusion - CreateSpellCooldown(15286), -- Vampiric Embrace - CreateSpellCooldown(32375), -- Mass Dispel - CreateSpellCooldown(34433), -- Shadowfiennd - CreateSpellCooldown(73325), -- Leap of Faith - CreateSpellCooldown(108920), -- Void Tendrils - CreateSpellCooldown(108968), -- Void Shift - CreateSpellCooldown(120517), -- Halo (Disciple / Holy) - CreateSpellCooldown(120644), -- Halo (Shadow) - CreateSpellCooldown(205364), -- Dominate Mind - CreateSpellCooldown(373481, false), -- Power Word: Life - - -- Discipline - CreateSpellCooldown(33206), -- Pain Suppression - CreateSpellCooldown(47536), -- Rapture - CreateSpellCooldown(62618), -- Power Word: Barrier - CreateSpellCooldown(271466), -- Luminous Barrier - CreateSpellCooldown(123040), -- Mind Bender - -- CreateSpellCooldown(246287), -- Evangelism - - -- Holy - CreateSpellCooldown(2050), -- Holy Word: Serenity - CreateSpellCooldown(34861), -- Holy Word: Sanctify - CreateSpellCooldown(47788), -- Guardian Spirit - CreateSpellCooldown(64843), -- Divine Hymn - CreateSpellCooldown(64901), -- Symbol of Hope - CreateSpellCooldown(88625), -- Holy Word: Chastise - CreateSpellCooldown(200183), -- Apotheosis - CreateSpellCooldown(372760), -- Divine Word - CreateSpellCooldown(372835), -- Light Well - - -- Shadow - CreateSpellCooldown(15487), -- Silence - CreateSpellCooldown(47585), -- Dispersion - CreateSpellCooldown(64044), -- Psychic Horror - CreateSpellCooldown(200174), -- Mindbender - CreateSpellCooldown(228260), -- Void Eruption - CreateSpellCooldown(391109), -- Dark Ascension - }, - ["SHAMAN"] = { - -- General - CreateSpellCooldown(8143), -- Tremor Totem - CreateSpellCooldown(79206), -- Spiritwalker's Grace - CreateSpellCooldown(108270), -- Stone Bulwark Totem - CreateSpellCooldown(108271), -- Astral Shift - CreateSpellCooldown(108281), -- Ancestral Guidance - CreateSpellCooldown(108285), -- Totemic Recall - CreateSpellCooldown(192058), -- Capacitator Totem - CreateSpellCooldown(192077), -- Wind Rush Totem - CreateSpellCooldown(198103), -- Earth Elemental - CreateSpellCooldown(383013), -- Poison Cleansing Totem - - -- Elemental - CreateSpellCooldown(114050), -- Ascendance - CreateSpellCooldown(191634), -- Stormkeeper - CreateSpellCooldown(192249), -- Storm Elemental - CreateSpellCooldown(198067), -- Fire Elemental - - -- Restoration - CreateSpellCooldown(16191), -- Mana Tide Totem - CreateSpellCooldown(98008), -- Spirit Link Totem - CreateSpellCooldown(108280), -- Healing Tide Totem - CreateSpellCooldown(114052), -- Ascendance - CreateSpellCooldown(157153), -- Cloudburst Totem - CreateSpellCooldown(198838), -- Eartheb Wall Totem - CreateSpellCooldown(207399), -- Ancestral Protection Totem - - -- Enhancement - CreateSpellCooldown(51533), -- Feral Spirit - CreateSpellCooldown(114051), -- Ascendance - CreateSpellCooldown(197214), -- Sundering - CreateSpellCooldown(384352), -- Doom Winds - }, - ["WARRIOR"] = { - -- Talent - CreateSpellCooldown(97462), -- Rallying Cry - -- CreateSpellCooldown(401150), -- Avatar - CreateSpellCooldown(384318), -- Thunderous Roar - CreateSpellCooldown(376079), -- Champion's Spear - - -- Arms - -- Fury - -- Protection - CreateSpellCooldown(871), -- Shield Wall - CreateSpellCooldown(12975), -- Last Stand - CreateSpellCooldown(228920), -- Ravager - } - } - - import(data, cooldowns) -end - --- make sure the player class cooldown exists, even if empty -if not cooldowns[class] then - cooldowns[class] = {} -end - --- insert racials spells -for i = 1, #racials do - importData(cooldowns[class], racials[i]) -end - --- insert gear slots -for i = 1, #gear do - table.insert(cooldowns[class], gear[i]) -end - -Filger.cooldowns = cooldowns[class] diff --git a/core/data.lua b/core/data.lua new file mode 100644 index 0000000..b228288 --- /dev/null +++ b/core/data.lua @@ -0,0 +1,128 @@ +local _, ns = ... + +------------------------------------------------------------ +-- Data +------------------------------------------------------------ +-- Loaded before core\init.xml: data files only collect tables here. +-- Validation runs in Finalize(), once ns.Filger exists. +local data = {} + +local blacklistSources = {} +local spellSources = {} +local cooldownSources = {} + +function data.CreateSpellPriority(arg1, arg2) + local enabled, priority, stackThreshold = true, 0, 0 + + if type(arg1) == "boolean" then + enabled = arg1 + elseif type(arg1) == "number" then + priority = arg1 + end + + if type(arg2) == "number" then + stackThreshold = arg2 + end + + return { enabled = enabled, priority = priority, stackThreshold = stackThreshold } +end + +function data.CreateSpellCooldown(spellId, enabled) + assert(type(spellId) == "number", "Filger: Invalid cooldown spellId") + if (enabled == nil) then + enabled = true + end + return { spellId = spellId, enabled = enabled } +end + +function data.CreateSlotCooldown(slotId, enabled) + assert(tonumber(slotId), "Filger: Invalid slotId") + if (enabled == nil) then + enabled = true + end + return { slotId = slotId, enabled = enabled } +end + +function data.AddBlacklist(source) + table.insert(blacklistSources, source) +end + +function data.AddSpells(source) + table.insert(spellSources, source) +end + +function data.AddCooldowns(source) + table.insert(cooldownSources, source) +end + +local buildBlacklist = function(Filger) + local blacklist = {} + for _, source in ipairs(blacklistSources) do + for spellId, enabled in next, source do + if enabled then + if type(spellId) == "string" or Filger.GetSpellInfo(spellId) then + blacklist[spellId] = true + else + Filger:warn("Blacklist", "Spell " .. spellId .. " do not exists.") + end + end + end + end + return blacklist +end + +local buildSpells = function(Filger) + local spells = {} + for _, source in ipairs(spellSources) do + for class, list in next, source do + if not spells[class] then + spells[class] = {} + end + + for spellId, info in next, list do + if Filger.GetSpellInfo(spellId) then + spells[class][spellId] = info + else + Filger:warn("SPELLS", "Spell " .. spellId .. " do not exists.") + end + end + end + end + return spells +end + +-- player class rows first, then "ALL" rows (racials, gear), each in source order +local buildCooldowns = function(Filger) + local cooldowns = {} + for _, key in ipairs({ Filger.class, "ALL" }) do + for _, source in ipairs(cooldownSources) do + for _, row in ipairs(source[key] or {}) do + if row.enabled then + if row.slotId or Filger.GetSpellInfo(row.spellId) then + table.insert(cooldowns, row) + else + Filger:warn("COOLDOWN", "Spell " .. row.spellId .. " do not exists.") + end + end + end + end + end + return cooldowns +end + +function data.Finalize() + local Filger = ns.Filger + + Filger.blacklist = buildBlacklist(Filger) + Filger.spells = buildSpells(Filger) + Filger.cooldowns = buildCooldowns(Filger) + + Filger.all = {} + for _, list in next, Filger.spells do + Filger.all = Mixin(Filger.all, list) + end + + blacklistSources, spellSources, cooldownSources = nil, nil, nil +end + +ns.data = data diff --git a/core/init.lua b/core/init.lua index b99b3dc..8bba237 100644 --- a/core/init.lua +++ b/core/init.lua @@ -8,45 +8,31 @@ _G[addon] = frame -- blizzard local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or _G.GetAddOnMetadata -local windowed = Display_DisplayModeDropDown and Display_DisplayModeDropDown:windowedmode() or false -local fullscreen = Display_DisplayModeDropDown and Display_DisplayModeDropDown:fullscreenmode() or false -local physicalScreenWidth, physicalScreenHeight = GetPhysicalScreenSize() +local _, physicalScreenHeight = GetPhysicalScreenSize() -- System -frame.windowed = windowed -frame.fullscreen = fullscreen -frame.screenWidth = physicalScreenWidth -frame.screenHeight = physicalScreenHeight frame.pixelPerfectScale = math.min(1, math.max(0.3, 768 / physicalScreenHeight)) -- addon frame.title = GetAddOnMetadata(addon, "Title") frame.version = GetAddOnMetadata(addon, "Version") -frame.description = GetAddOnMetadata(addon, "Notes") -frame.WelcomeMessage = ("|cffff8000Filger %s|r - /filger help"):format(frame.version) -- interface -- reference: https://warcraft.wiki.gg/wiki/WOW_PROJECT_ID -local interface = select(4, GetBuildInfo()) -frame.interface = interface -frame.isRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) -frame.isClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) -frame.isBCC = (WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC) +frame.isStandard = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) +frame.isVanilla = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) +frame.isTBC = (WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC) frame.isWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC) frame.isCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC) -frame.isMoP = (WOW_PROJECT_ID == WOW_PROJECT_MISTS_CLASSIC) +frame.isMists = (WOW_PROJECT_ID == WOW_PROJECT_MISTS_CLASSIC) +frame.isCamelot = (WOW_PROJECT_ID == WOW_PROJECT_CAMELOT) + +-- game type families, as in TOC [AllowLoadGameType mainline/classic] +frame.isClassic = (frame.isVanilla or frame.isTBC or frame.isWrath or frame.isCata or frame.isMists) +frame.isMainline = not frame.isClassic -- player frame.name = UnitName("player") frame.class = select(2, UnitClass("player")) -if (frame.isClassic) then - local LibStub = _G.LibStub - local LibClassicDurations = LibStub("LibClassicDurations", true) - if (LibClassicDurations) then - LibClassicDurations:Register(addon) - frame.LibClassicDurations = LibClassicDurations - end -end - ns.Filger = frame diff --git a/core/init.xml b/core/init.xml index 330ae74..7ee219f 100644 --- a/core/init.xml +++ b/core/init.xml @@ -3,10 +3,6 @@