Skip to content

Commit

Permalink
fix: update for The War Within
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainrider committed Jul 24, 2024
1 parent 6df14ba commit 061b8cd
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 44 deletions.
113 changes: 97 additions & 16 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,107 @@ exclude_files = {

read_globals = {
-- Addons and Libraries
"AceGUIWidgetLSMlists", "AdiButtonAuras", "AdiDebug", "LibStub",
'AceGUIWidgetLSMlists',
'AdiButtonAuras',
'AdiDebug',
'LibStub',

-- ABA API
"AddRuleFor", "BuffAliases", "BuildAuraHandler_FirstOf", "BuildAuraHandler_Longest", "BuildAuraHandler_Single",
"BuildDispelHandler", "BuildDesc", "BuildKey", "Configure", "DebuffAliases", "Debug",
"DescribeAllSpells", "DescribeAllTokens", "DescribeFilter", "DescribeHighlight",
"DescribeLPSSource", "GetBuff", "GetDebuff", "GetLib", "GetPlayerBuff", "GetPlayerDebuff",
"ImportPlayerSpells", "IterateBuffs", "IterateDebuffs", "IteratePlayerBuffs",
"IteratePlayerDebuffs", "L", "LongestDebuffOf", "PassiveModifier", "PetBuffs", "PLAYER_CLASS",
"SelfBuffAliases", "SelfBuffs", "SharedSimpleBuffs", "SharedSimpleDebuffs", "ShowDispellable",
"ShowHealth", "ShowPower", "ShowStacks", "SimpleBuffs", "SimpleDebuffs",
'AddRuleFor',
'BuffAliases',
'BuildAuraHandler_FirstOf',
'BuildAuraHandler_Longest',
'BuildAuraHandler_Single',
'BuildDispelHandler',
'BuildDesc',
'BuildKey',
'Configure',
'DebuffAliases',
'Debug',
'DescribeAllSpells',
'DescribeAllTokens',
'DescribeFilter',
'DescribeHighlight',
'DescribeLPSSource',
'GetBuff',
'GetDebuff',
'GetLib',
'GetPlayerBuff',
'GetPlayerDebuff',
'ImportPlayerSpells',
'IterateBuffs',
'IterateDebuffs',
'IteratePlayerBuffs',
'IteratePlayerDebuffs',
'L',
'LongestDebuffOf',
'PassiveModifier',
'PetBuffs',
'PLAYER_CLASS',
'SelfBuffAliases',
'SelfBuffs',
'SharedSimpleBuffs',
'SharedSimpleDebuffs',
'ShowDispellable',
'ShowHealth',
'ShowPower',
'ShowStacks',
'SimpleBuffs',
'SimpleDebuffs',

-- WoW API
"GetNumGroupMembers", "GetPetTimeRemaining", "GetRuneCooldown", "GetShapeshiftFormID", "GetSpellBonusHealing",
"GetSpellCharges", "GetSpellCount", "GetSpellInfo", "GetTime", "GetTotemInfo", "GetWeaponEnchantInfo",
"HasPetSpells", "IsPlayerSpell", "UnitCanAttack", "UnitCastingInfo", "UnitChannelInfo", "UnitClass", "UnitGUID",
"UnitHealth", "UnitHealthMax", "UnitIsDeadOrGhost", "UnitIsPlayer", "UnitName", "UnitPower", "UnitPowerMax",
"UnitStagger",
C_Spell = {
fields = {
'GetSpellCharges',
'GetSpellCastCount',
'GetSpellInfo',
'GetSpellLink',
'GetSpellName',
},
},
C_SpellBook = {
fields = {
'HasPetSpells',
},
},
'GetNumGroupMembers',
'GetPetTimeRemaining',
'GetRuneCooldown',
'GetShapeshiftFormID',
'GetSpellBonusHealing',
'GetTime',
'GetTotemInfo',
'GetWeaponEnchantInfo',
'IsPlayerSpell',
'UnitCanAttack',
'UnitCastingInfo',
'UnitChannelInfo',
'UnitClass',
'UnitGUID',
'UnitHealth',
'UnitHealthMax',
'UnitIsDeadOrGhost',
'UnitIsPlayer',
'UnitName',
'UnitPower',
'UnitPowerMax',
'UnitStagger',

-- Lua API
"bit", "ceil", "floor", "format", "ipairs", "math", "max", "min", "pairs", "print", "select", "string", "table",
"tinsert", "type",
'bit',
'ceil',
'floor',
'format',
'ipairs',
'math',
'max',
'min',
'pairs',
'print',
'select',
'string',
'strmatch',
'table',
'tinsert',
'type',
}
2 changes: 1 addition & 1 deletion AdiButtonAuras.toc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with AdiButtonAuras. If not, see <http://www.gnu.org/licenses/>.

## Interface: 100205
## Interface: 110000

## Title: AdiButtonAuras
## Notes: Display auras on action buttons.
Expand Down
7 changes: 0 additions & 7 deletions config/Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ along with AdiButtonAuras. If not, see <http://www.gnu.org/licenses/>.

local _, private = ...

local _G = _G

AdiButtonAuras:CreateConfig(function(addonName, addon)

local GetItemInfo = _G.GetItemInfo
local GetSpellInfo = _G.GetSpellInfo
local strmatch = _G.strmatch

local AceConfig = addon.GetLib('AceConfig-3.0')
local AceConfigDialog = addon.GetLib('AceConfigDialog-3.0')
local LibSpellbook = addon.GetLib('LibSpellbook-1.0')
Expand Down
7 changes: 4 additions & 3 deletions config/Debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function private.GetDebugOptions(addon, addonName)
local GetCVarBool = _G.GetCVarBool
local GetItemIcon = _G.GetItemIcon
local GetItemInfo = _G.GetItemInfo
local GetSpellInfo = _G.GetSpellInfo
local GetSpellInfo = C_Spell.GetSpellInfo
local IsAddOnLoaded = _G.IsAddOnLoaded
local pairs = _G.pairs
local strjoin = _G.strjoin
Expand All @@ -51,9 +51,10 @@ function private.GetDebugOptions(addon, addonName)
local idType, id = strmatch(idstr, "^(%w+):(%d+)$")
id = tonumber(id)
if id then
local _, name, icon
local name, icon
if idType == "spell" then
name, _, icon = GetSpellInfo(id)
local info = GetSpellInfo(id)
name, icon = info.name, info.iconID
elseif idType == "item" then
name = GetItemInfo(id)
icon = GetItemIcon(id)
Expand Down
4 changes: 2 additions & 2 deletions config/Spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function private.GetSpellOptions(addon, addonName)
local GameTooltip = _G.GameTooltip
local GameTooltip_SetDefaultAnchor = _G.GameTooltip_SetDefaultAnchor
local GetItemInfo = _G.GetItemInfo
local GetSpellInfo = _G.GetSpellInfo
local GetSpellName = C_Spell.GetSpellName
local hooksecurefunc = _G.hooksecurefunc
local ipairs = _G.ipairs
local IsShiftKeyDown = _G.IsShiftKeyDown
Expand Down Expand Up @@ -160,7 +160,7 @@ function private.GetSpellOptions(addon, addonName)
local type_, id = self.overlay.actionType, self.overlay.actionId
self.conf, self.enabled, self.key = addon:GetActionConfiguration(type_, id)
if type_ == "spell" then
self.name = GetSpellInfo(id)
self.name = GetSpellName(id)
elseif type_ == "item" then
type_ = GetItemInfo(id)
end
Expand Down
16 changes: 8 additions & 8 deletions core/DebugTooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ local GetMacroInfo = _G.GetMacroInfo
local GetMacroItem = _G.GetMacroItem
local GetMacroSpell = _G.GetMacroSpell
local GetPetActionInfo = _G.GetPetActionInfo
local GetSpellInfo = _G.GetSpellInfo
local select = _G.select
local TooltipDataProcessor = _G.TooltipDataProcessor
local UnitAura = _G.UnitAura
Expand All @@ -47,19 +46,20 @@ end
local function AddSpellInfo(tooltip, source, id, addEmptyLine)
if not id or IsDisabled() or tooltip:IsForbidden() then return end

local name, _, _, _, _, _, spellId = GetSpellInfo(id)
if not name then return end
local info = C_Spell.GetSpellInfo(id)
if not info then return end

if addEmptyLine then
tooltip:AddLine(" ")
end

tooltip:AddDoubleLine("Spell id ("..source.."):", BreakUpLargeNumbers(spellId))
local resolvedName, _, _, _, _, _, resolvedId = GetSpellInfo(name)
if resolvedName and resolvedId ~= spellId then
tooltip:AddDoubleLine("Actual spell name:", resolvedName)
tooltip:AddDoubleLine("Actual spell id:", BreakUpLargeNumbers(resolvedId))
tooltip:AddDoubleLine("Spell id ("..source.."):", BreakUpLargeNumbers(id))

if (id ~= info.spellID) then
tooltip:AddDoubleLine("Actual spell name:", info.name)
tooltip:AddDoubleLine("Actual spell id:", BreakUpLargeNumbers(info.spellID))
end

tooltip:Show()
end

Expand Down
4 changes: 2 additions & 2 deletions core/Description.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local addonName, addon = ...

local _G = _G
local format = _G.format
local GetSpellInfo = _G.GetSpellInfo
local GetSpellName = C_Spell.GetSpellName
local gsub = _G.gsub
local tostring = _G.tostring
local type = _G.type
Expand Down Expand Up @@ -75,7 +75,7 @@ end

local function DescribeAllSpells(id, ...)
if id ~= nil then
local name = type(id) == "number" and GetSpellInfo(id) or tostring(id)
local name = type(id) == "number" and GetSpellName(id) or tostring(id)
return name, DescribeAllSpells(...)
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/Overlays.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local GetPetActionCooldown = _G.GetPetActionCooldown
local GetPetActionInfo = _G.GetPetActionInfo
local GetShapeshiftFormCooldown = _G.GetShapeshiftFormCooldown
local GetShapeshiftFormInfo = _G.GetShapeshiftFormInfo
local GetSpellLink = _G.GetSpellLink
local GetSpellLink = C_Spell.GetSpellLink
local GetTime = _G.GetTime
local gsub = _G.gsub
local ipairs = _G.ipairs
Expand Down
6 changes: 3 additions & 3 deletions core/RuleDSL.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ local error = _G.error
local floor = _G.floor
local format = _G.format
local GetItemInfo = _G.GetItemInfo
local GetSpellInfo = _G.GetSpellInfo
local GetSpellLink = _G.GetSpellLink
local GetSpellLink = C_Spell.GetSpellLink
local GetSpellName = C_Spell.GetSpellName
local gsub = _G.gsub
local ipairs = _G.ipairs
local math = _G.math
Expand Down Expand Up @@ -93,7 +93,7 @@ local descriptions = addon.descriptions
local function SpellOrItemId(value, callLevel)
local spellId = tonumber(type(value) == "string" and strmatch(value, "spell:(%d+)") or value)
if spellId then
local name = GetSpellInfo(spellId)
local name = GetSpellName(spellId)
if not name then
error(format("Invalid spell identifier: %s", tostring(value)), callLevel+1)
end
Expand Down
2 changes: 1 addition & 1 deletion modules/AdiButtonAuras_Config/AdiButtonAuras_Config.toc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with AdiButtonAuras. If not, see <http://www.gnu.org/licenses/>.

## Interface: 100205
## Interface: 110000

## Title: AdiButtonAuras - Configuration
## Notes: Load-on-demand configuration GUI.
Expand Down

0 comments on commit 061b8cd

Please sign in to comment.