Major rework on the M+ end of run panel

This commit is contained in:
Tercio Jose
2024-08-09 20:55:16 -03:00
committed by andrew6180
parent c6fbc67442
commit 065c61c8ff
12 changed files with 816 additions and 289 deletions
+41 -7
View File
@@ -1646,9 +1646,12 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
--fill with icons
local MACRO_ICON_FILENAMES = {}
local SPELLNAMES_CACHE = {}
local SPELLIDS_CACHE = {}
detailsFramework.IconPickFrame:SetScript("OnShow", function()
MACRO_ICON_FILENAMES[1] = "INV_MISC_QUESTIONMARK"
SPELLNAMES_CACHE[1] = "INV_MISC_QUESTIONMARK"
SPELLIDS_CACHE[1] = IS_WOW_PROJECT_MAINLINE and 74008 or 25675
local index = 2
for i = 1, GetNumSpellTabs() do
@@ -1658,10 +1661,11 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
for j = offset, tabEnd - 1 do
--to get spell info by slot, you have to pass in a pet argument
local spellType, ID = GetSpellBookItemInfo(j, "player")
local spellType, ID, si = GetSpellBookItemInfo(j, SPELLBOOK_BANK_PLAYER)
if (spellType ~= "FLYOUT") then
MACRO_ICON_FILENAMES [index] = GetSpellBookItemTexture(j, "player") or 0
SPELLNAMES_CACHE [index] = GetSpellInfo(ID)
MACRO_ICON_FILENAMES [index] = si and si.iconID or GetSpellBookItemTexture(j, SPELLBOOK_BANK_PLAYER) or 0
SPELLNAMES_CACHE [index] = si and si.name or GetSpellInfo(ID)
SPELLIDS_CACHE [index] = si and (si.spellID or si.actionID) or ID
index = index + 1
elseif (spellType == "FLYOUT") then
@@ -1672,6 +1676,7 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
if (isKnown) then
MACRO_ICON_FILENAMES [index] = GetSpellTexture(spellID) or 0
SPELLNAMES_CACHE [index] = GetSpellInfo(spellID)
SPELLIDS_CACHE [index] = spellID
index = index + 1
end
end
@@ -1744,10 +1749,20 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
line.buttons[o].icon:SetTexture(texture)
line.buttons[o].texture = texture
else
line.buttons[o].icon:SetTexture(iconsInThisLine[o])
line.buttons[o].texture = iconsInThisLine[o]
local lineIcon = iconsInThisLine[o]
if type(lineIcon) == "string" and not string.find(lineIcon, "^[Ii]nterface") then
lineIcon = "Interface/ICONS/" .. lineIcon
end
DevTool:AddData(lineIcon, "lineIcon")
line.buttons[o].icon:SetTexture(lineIcon)
line.buttons[o].texture = lineIcon
end
end
for o = #iconsInThisLine+1, 10 do -- cleanup unused
line.buttons[o].icon:SetTexture(nil)
line.buttons[o].texture = nil
end
end
end
end
@@ -1780,7 +1795,26 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
currentTable = t
end
currentTable[index] = SPELLNAMES_CACHE[i]
currentTable[index] = SPELLIDS_CACHE[i] --SPELLNAMES_CACHE[i] --spellName won't work in 11.0, use IDs instead.
index = index + 1
if (index == 11) then
index = nil
end
end
end
for i = 1, #MACRO_ICON_FILENAMES do
if (MACRO_ICON_FILENAMES[i] and type(MACRO_ICON_FILENAMES[i]) == "string" and MACRO_ICON_FILENAMES[i]:lower():find(filter)) then
if (not index) then
index = 1
local t = {}
iconList[#iconList+1] = t
currentTable = t
end
currentTable[index] = MACRO_ICON_FILENAMES[i]
index = index + 1
if (index == 11) then
@@ -1795,7 +1829,7 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
iconList[#iconList+1] = t
for o = i, i+9 do
if (SPELLNAMES_CACHE[o]) then
t[#t+1] = SPELLNAMES_CACHE[o]
t[#t+1] = SPELLIDS_CACHE[o] --SPELLNAMES_CACHE[o] --spellName won't work in 11.0, use IDs instead.
end
end
end