update how category text is shown
This commit is contained in:
+35
-43
@@ -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 = AtlasLoot_TableNames[dataID][1]
|
||||||
title = gsub(AtlasLoot_TableNames[dataID][1], "^.+ %- ", "")
|
|
||||||
else
|
|
||||||
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,41 +1248,39 @@ 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
|
if v[1][3] == "Submenu" then
|
||||||
if v[1][3] == "Submenu" then
|
AtlasLoot_Hewdrop:AddLine(
|
||||||
|
'text', v[1][1],
|
||||||
|
'textR', 1,
|
||||||
|
'textG', 0.82,
|
||||||
|
'textB', 0,
|
||||||
|
'func', AtlasLoot_HewdropClick,
|
||||||
|
'arg1', v[1][2],
|
||||||
|
'arg2', v[1][1],
|
||||||
|
'arg3', v[1][3],
|
||||||
|
'notCheckable', true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local lock = 0
|
||||||
|
-- If an entry linked to a subtable
|
||||||
|
for i, j in pairs(v) do
|
||||||
|
if lock == 0 then
|
||||||
AtlasLoot_Hewdrop:AddLine(
|
AtlasLoot_Hewdrop:AddLine(
|
||||||
'text', v[1][1],
|
'text', i,
|
||||||
'textR', 1,
|
'textR', 1,
|
||||||
'textG', 0.82,
|
'textG', 0.82,
|
||||||
'textB', 0,
|
'textB', 0,
|
||||||
'func', AtlasLoot_HewdropClick,
|
'hasArrow', true,
|
||||||
'arg1', v[1][2],
|
'value', j,
|
||||||
'arg2', v[1][1],
|
'func', AtlasLoot_OpenMenu,
|
||||||
'arg3', v[1][3],
|
'arg1', i,
|
||||||
'notCheckable', true
|
'notCheckable', true
|
||||||
)
|
)
|
||||||
end
|
lock = 1
|
||||||
else
|
|
||||||
local lock = 0
|
|
||||||
-- If an entry linked to a subtable
|
|
||||||
for i, j in pairs(v) do
|
|
||||||
if lock == 0 then
|
|
||||||
AtlasLoot_Hewdrop:AddLine(
|
|
||||||
'text', i,
|
|
||||||
'textR', 1,
|
|
||||||
'textG', 0.82,
|
|
||||||
'textB', 0,
|
|
||||||
'hasArrow', true,
|
|
||||||
'value', j,
|
|
||||||
'func', AtlasLoot_OpenMenu,
|
|
||||||
'arg1', i,
|
|
||||||
'notCheckable', true
|
|
||||||
)
|
|
||||||
lock = 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-18
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user