update how category text is shown

This commit is contained in:
Spit
2026-07-20 13:37:05 +03:00
parent aed9661e69
commit c74a5f85d8
3 changed files with 677 additions and 696 deletions
+7 -15
View File
@@ -221,7 +221,7 @@ function AtlasLoot_OnVariablesLoaded()
end end
-- Position relevant UI objects for loot browser and set up menu -- Position relevant UI objects for loot browser and set up menu
AtlasLootDefaultFrame_SelectedCategory:SetPoint("TOP", "AtlasLootDefaultFrame_Menu", "BOTTOM", 0, -4) AtlasLootDefaultFrame_SelectedCategory:SetPoint("TOP", "AtlasLootDefaultFrame_Menu", "BOTTOM", 0, -4)
AtlasLootDefaultFrame_SelectedCategory:SetText(AtlasLootCharDB.LastBossText) AtlasLootDefaultFrame_SelectedCategory:SetText("")
AtlasLootDefaultFrame_SelectedTable:SetPoint("TOP", "AtlasLootDefaultFrame_SubMenu", "BOTTOM", 0, -4) AtlasLootDefaultFrame_SelectedTable:SetPoint("TOP", "AtlasLootDefaultFrame_SubMenu", "BOTTOM", 0, -4)
AtlasLootDefaultFrame_SelectedTable:SetText("") AtlasLootDefaultFrame_SelectedTable:SetText("")
AtlasLootDefaultFrame_SelectedTable:Show() AtlasLootDefaultFrame_SelectedTable:Show()
@@ -716,7 +716,7 @@ function AtlasLootItemsFrame_OnUpdate()
end end
--[[ --[[
AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame): AtlasLoot_ShowItemsFrame(dataID, dataSource, title):
dataID - Name of the loot table dataID - Name of the loot table
dataSource - Table in the database where the loot table is stored dataSource - Table in the database where the loot table is stored
title - Text string to use as a title for the loot page title - Text string to use as a title for the loot page
@@ -734,11 +734,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, title)
end end
if not title then if not title then
if AtlasLoot_TableNames[dataID] and AtlasLoot_TableNames[dataID][1] then if AtlasLoot_TableNames[dataID] and AtlasLoot_TableNames[dataID][1] then
if dataSource == "AtlasLootItems" or dataSource == "AtlasLootWBItems" then
title = gsub(AtlasLoot_TableNames[dataID][1], "^.+ %- ", "")
else
title = AtlasLoot_TableNames[dataID][1] title = AtlasLoot_TableNames[dataID][1]
end
else else
title = "" title = ""
end end
@@ -961,7 +957,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, title)
end end
-- Insert the item description -- Insert the item description
extra = AtlasLoot_FixText(dataSource[dataID][i][4]) extra = AtlasLoot_FixText(dataSource[dataID][i][4])
local iconData = dataSource[dataID][i][2] local iconData = dataSource[dataID][i][2] or ""
-- If there is no data on the texture an item should have, show a big red question mark -- If there is no data on the texture an item should have, show a big red question mark
if strsub(iconData, 1, 5) == "CLASS" then if strsub(iconData, 1, 5) == "CLASS" then
iconFrame:SetTexture("Interface\\AddOns\\AtlasLoot\\Images\\"..strsub(iconData, 6)) iconFrame:SetTexture("Interface\\AddOns\\AtlasLoot\\Images\\"..strsub(iconData, 6))
@@ -1149,12 +1145,12 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, title)
AtlasLoot_HewdropSubMenuRegister(subMenu) AtlasLoot_HewdropSubMenuRegister(subMenu)
AtlasLootDefaultFrame_SubMenu:Enable() AtlasLootDefaultFrame_SubMenu:Enable()
AtlasLootDefaultFrame_SelectedTable:SetText(bossName) AtlasLootDefaultFrame_SelectedTable:SetText(bossName)
AtlasLootDefaultFrame_SelectedTable:Show()
else else
AtlasLootDefaultFrame_SubMenu:Disable() AtlasLootDefaultFrame_SubMenu:Disable()
AtlasLootDefaultFrame_SelectedTable:Hide() AtlasLootDefaultFrame_SelectedTable:SetText("")
end end
-- AtlasLootDefaultFrame_SelectedCategory:SetText() local category = AtlasLoot_TableNames[dataID] and AtlasLoot_TableNames[dataID][3] or ""
AtlasLootDefaultFrame_SelectedCategory:SetText(category)
-- Anchor the item frame where it is supposed to be -- Anchor the item frame where it is supposed to be
AtlasLootItemsFrame:SetParent(_G[AtlasLoot_AnchorPoint[2]]) AtlasLootItemsFrame:SetParent(_G[AtlasLoot_AnchorPoint[2]])
AtlasLootItemsFrame:ClearAllPoints() AtlasLootItemsFrame:ClearAllPoints()
@@ -1180,7 +1176,6 @@ function AtlasLoot_HewdropClick(dataID, text, tabletype)
-- Purge the text label for the submenu and disable the submenu -- Purge the text label for the submenu and disable the submenu
AtlasLootDefaultFrame_SubMenu:Disable() AtlasLootDefaultFrame_SubMenu:Disable()
AtlasLootDefaultFrame_SelectedTable:SetText("") AtlasLootDefaultFrame_SelectedTable:SetText("")
AtlasLootDefaultFrame_SelectedTable:Show()
-- If the button links to a sub menu definition -- If the button links to a sub menu definition
else else
-- Enable the submenu button -- Enable the submenu button
@@ -1192,10 +1187,9 @@ function AtlasLoot_HewdropClick(dataID, text, tabletype)
AtlasLoot_HewdropSubMenuRegister(AtlasLoot_HewdropDown_SubTables[dataID]) AtlasLoot_HewdropSubMenuRegister(AtlasLoot_HewdropDown_SubTables[dataID])
-- Show a text label of what has been selected -- Show a text label of what has been selected
AtlasLootDefaultFrame_SelectedTable:SetText(AtlasLoot_HewdropDown_SubTables[dataID][1][1]) AtlasLootDefaultFrame_SelectedTable:SetText(AtlasLoot_HewdropDown_SubTables[dataID][1][1])
AtlasLootDefaultFrame_SelectedTable:Show()
end end
-- Show the category that has been selected -- Show the category that has been selected
AtlasLootDefaultFrame_SelectedCategory:SetText(text) -- AtlasLootDefaultFrame_SelectedCategory:SetText(text)
AtlasLoot_Hewdrop:Close(1) AtlasLoot_Hewdrop:Close(1)
end end
@@ -1254,7 +1248,6 @@ function AtlasLoot_HewdropRegister()
end, end,
'children', function(level, value) 'children', function(level, value)
if level == 1 then if level == 1 then
if AtlasLoot_HewdropDown then
for k, v in ipairs(AtlasLoot_HewdropDown) do for k, v in ipairs(AtlasLoot_HewdropDown) do
-- If a link to show a submenu -- If a link to show a submenu
if type(v[1]) == "table" and type(v[1][1]) == "string" then if type(v[1]) == "table" and type(v[1][1]) == "string" then
@@ -1292,7 +1285,6 @@ function AtlasLoot_HewdropRegister()
end end
end end
end end
end
elseif level == 2 then elseif level == 2 then
if value then if value then
for k, v in ipairs(value) do for k, v in ipairs(value) do
+1 -18
View File
@@ -169,7 +169,6 @@ do
Iterating through dropdown data tables to search backward for zone name with specified dataID Iterating through dropdown data tables to search backward for zone name with specified dataID
]] ]]
function AtlasLoot_GetWishListSubheading(dataID) function AtlasLoot_GetWishListSubheading(dataID)
if not AtlasLoot_HewdropDown or not AtlasLoot_HewdropDown_SubTables then return end
if cache[dataID] then return cache[dataID] end if cache[dataID] then return cache[dataID] end
local zoneID local zoneID
for subKey, subTable in pairs(AtlasLoot_HewdropDown_SubTables) do for subKey, subTable in pairs(AtlasLoot_HewdropDown_SubTables) do
@@ -188,7 +187,6 @@ end
do do
local cache = {} local cache = {}
function AtlasLoot_GetWishListSubheadingBoss(dataID) function AtlasLoot_GetWishListSubheadingBoss(dataID)
if not AtlasLoot_TableNamesBoss then return end
if cache[dataID] then return cache[dataID] end if cache[dataID] then return cache[dataID] end
local zoneID local zoneID
for i, v in pairs(AtlasLoot_TableNamesBoss) do for i, v in pairs(AtlasLoot_TableNamesBoss) do
@@ -218,21 +216,6 @@ function GetLootTableParent(dataID)
return parentID return parentID
end end
function GetWishListSubheadingDungeon(dataID)
if not AtlasLoot_TableNames then return end
local zoneID
for i, v in pairs(AtlasLoot_TableNamesBoss) do
for j, k in pairs(v) do
if dataID == j then
zoneID = i
break
end
end
end
return zoneID
end
--[[ --[[
AtlasLoot_CategorizeWishList(wlTable): AtlasLoot_CategorizeWishList(wlTable):
Group items with zone/event name etc, and format them by adding subheadings and empty lines Group items with zone/event name etc, and format them by adding subheadings and empty lines
@@ -248,7 +231,7 @@ function AtlasLoot_CategorizeWishList(wlTable)
-- Build subheading table -- Build subheading table
if not subheadings[dataID] then if not subheadings[dataID] then
if AtlasLootCharDB.WishlistGroupedByDungeon then if AtlasLootCharDB.WishlistGroupedByDungeon then
subheadings[dataID] = GetWishListSubheadingDungeon(dataID) subheadings[dataID] = GetLootTableParent(dataID)
else else
subheadings[dataID] = AtlasLoot_GetWishListSubheadingBoss(dataID) subheadings[dataID] = AtlasLoot_GetWishListSubheadingBoss(dataID)
end end
+641 -635
View File
File diff suppressed because it is too large Load Diff