From 2c65f36999ef68447306bdb1e5c762646cd31b88 Mon Sep 17 00:00:00 2001 From: Jason Greer Date: Sat, 11 May 2024 10:47:14 -0400 Subject: [PATCH] war within support --- changelog.md | 5 ++++ tullaRange/tullaRange.lua | 4 +-- tullaRange/tullaRange.toc | 4 +-- tullaRange_Config/tullaRange_Config.toc | 4 +-- tullaRange_Config/widgets/colorSelector.lua | 32 +++++++++++++++------ 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/changelog.md b/changelog.md index 8156e05..482c562 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # tullaRange release notes +## 10.2.5 + +* Added initial War Within support +* Update TOCs for 11.0.0 and 10.2.7 + ## 10.2.4 * Update TOCs diff --git a/tullaRange/tullaRange.lua b/tullaRange/tullaRange.lua index 0d66e57..5491b20 100644 --- a/tullaRange/tullaRange.lua +++ b/tullaRange/tullaRange.lua @@ -23,7 +23,7 @@ function Addon:OnLoad() -- load the options menu when the settings frame is loaded self.frame:SetScript("OnShow", function(frame) - LoadAddOn(AddonName .. "_Config") + C_AddOns.LoadAddOn(AddonName .. "_Config") frame:SetScript("OnShow", nil) end) @@ -46,7 +46,7 @@ function Addon:ADDON_LOADED(event, addonName) -- add a launcher for the addons tray _G[addonName .. '_Launch'] = function() - if LoadAddOn(addonName .. '_Config') then + if C_AddOns.LoadAddOn(addonName .. '_Config') then Settings.OpenToCategory(addonName) end end diff --git a/tullaRange/tullaRange.toc b/tullaRange/tullaRange.toc index a2caaa8..d73db2b 100644 --- a/tullaRange/tullaRange.toc +++ b/tullaRange/tullaRange.toc @@ -1,7 +1,5 @@ -## Interface: 100206 -## Interface-Cata: 40400 +## Interface: 110000, 100207, 40400 ## Interface-Classic: 11502 -## Interface-Wrath: 30403 ## Title: tullaRange ## Author: Tuller ## Notes: Out of range coloring based on RedRange diff --git a/tullaRange_Config/tullaRange_Config.toc b/tullaRange_Config/tullaRange_Config.toc index a409c84..bbb271d 100644 --- a/tullaRange_Config/tullaRange_Config.toc +++ b/tullaRange_Config/tullaRange_Config.toc @@ -1,7 +1,5 @@ -## Interface: 100206 -## Interface-Cata: 40400 +## Interface: 110000, 100207, 40400 ## Interface-Classic: 11502 -## Interface-Wrath: 30403 ## Title: tullaRange Config ## Notes: GUI based configuration for tullaRange ## Author: Tuller diff --git a/tullaRange_Config/widgets/colorSelector.lua b/tullaRange_Config/widgets/colorSelector.lua index 809845c..39ded26 100644 --- a/tullaRange_Config/widgets/colorSelector.lua +++ b/tullaRange_Config/widgets/colorSelector.lua @@ -90,14 +90,30 @@ do local SpellIcons = {} -- generate spell icons - for i = 1, GetNumSpellTabs() do - local _, _, offset, numSlots = GetSpellTabInfo(i) - local tabEnd = offset + numSlots - - for j = offset, tabEnd - 1 do - local texture = GetSpellBookItemTexture(j, 'player') - if texture then - SpellIcons[#SpellIcons + 1] = texture + if type(GetNumSpellTabs) == "function" then + for i = 1, GetNumSpellTabs() do + local _, _, offset, numSlots = GetSpellTabInfo(i) + local tabEnd = offset + numSlots + + for j = offset, tabEnd - 1 do + local texture = GetSpellBookItemTexture(j, 'player') + if texture then + SpellIcons[#SpellIcons + 1] = texture + end + end + end + else + for i = 1, C_SpellBook.GetNumSpellBookSkillLines() do + local skillLineInfo = C_SpellBook.GetSpellBookSkillLineInfo(i) + local offset = skillLineInfo.itemIndexOffset + local numSlots = skillLineInfo.numSpellBookItems + local tabEnd = offset + numSlots + + for j = offset, tabEnd - 1 do + local texture = C_SpellBook.GetSpellBookItemTexture(j, Enum.SpellBookSpellBank.Player) + if texture then + SpellIcons[#SpellIcons + 1] = texture + end end end end