dont call redundant function

This commit is contained in:
Spit
2026-04-02 09:24:56 +03:00
parent 4f33dbd200
commit f4e95e04f2
2 changed files with 23 additions and 24 deletions
+23 -23
View File
@@ -1355,7 +1355,7 @@ function AtlasLootBoss_OnClick()
else else
-- If an loot table is associated with the button, show it. Note multiple tables need to be checked due to the database structure -- If an loot table is associated with the button, show it. Note multiple tables need to be checked due to the database structure
if ( AtlasLootBossButtons[zoneID] and AtlasLootBossButtons[zoneID][id] and AtlasLootBossButtons[zoneID][id] ~= "" ) then if ( AtlasLootBossButtons[zoneID] and AtlasLootBossButtons[zoneID][id] and AtlasLootBossButtons[zoneID][id] ~= "" ) then
if ( AtlasLoot_IsLootTableAvailable(AtlasLootBossButtons[zoneID][id]) ) then -- if ( AtlasLoot_IsLootTableAvailable(AtlasLootBossButtons[zoneID][id]) ) then
_G[name.."_Selected"]:Show(); _G[name.."_Selected"]:Show();
_G[name.."_Loot"]:Hide(); _G[name.."_Loot"]:Hide();
local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX']*[%) ]*(.*[^%,])[%,]?$"); local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX']*[%) ]*(.*[^%,])[%,]?$");
@@ -1370,9 +1370,9 @@ function AtlasLootBoss_OnClick()
AtlasLootItemsFrame_NEXT:Hide(); AtlasLootItemsFrame_NEXT:Hide();
AtlasLootItemsFrame_PREV:Hide(); AtlasLootItemsFrame_PREV:Hide();
end end
end -- end
elseif ( AtlasLootWBBossButtons[zoneID] and AtlasLootWBBossButtons[zoneID][id] and AtlasLootWBBossButtons[zoneID][id] ~= "" ) then elseif ( AtlasLootWBBossButtons[zoneID] and AtlasLootWBBossButtons[zoneID][id] and AtlasLootWBBossButtons[zoneID][id] ~= "" ) then
if ( AtlasLoot_IsLootTableAvailable(AtlasLootWBBossButtons[zoneID][id]) ) then -- if ( AtlasLoot_IsLootTableAvailable(AtlasLootWBBossButtons[zoneID][id]) ) then
_G[name.."_Selected"]:Show(); _G[name.."_Selected"]:Show();
_G[name.."_Loot"]:Hide(); _G[name.."_Loot"]:Hide();
local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX]*[%) ]*(.*[^%,])[%,]?$"); local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX]*[%) ]*(.*[^%,])[%,]?$");
@@ -1384,9 +1384,9 @@ function AtlasLootBoss_OnClick()
AtlasLootItemsFrame_BACK:Hide(); AtlasLootItemsFrame_BACK:Hide();
AtlasLootItemsFrame_NEXT:Hide(); AtlasLootItemsFrame_NEXT:Hide();
AtlasLootItemsFrame_PREV:Hide(); AtlasLootItemsFrame_PREV:Hide();
end -- end
elseif ( AtlasLootBattlegrounds[zoneID] and AtlasLootBattlegrounds[zoneID][id] and AtlasLootBattlegrounds[zoneID][id] ~= "" ) then elseif ( AtlasLootBattlegrounds[zoneID] and AtlasLootBattlegrounds[zoneID][id] and AtlasLootBattlegrounds[zoneID][id] ~= "" ) then
if ( AtlasLoot_IsLootTableAvailable(AtlasLootBattlegrounds[zoneID][id]) ) then -- if ( AtlasLoot_IsLootTableAvailable(AtlasLootBattlegrounds[zoneID][id]) ) then
_G[name.."_Selected"]:Show(); _G[name.."_Selected"]:Show();
_G[name.."_Loot"]:Hide(); _G[name.."_Loot"]:Hide();
local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%wX]*[%) ]*(.*[^%,])[%,]?$"); local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%wX]*[%) ]*(.*[^%,])[%,]?$");
@@ -1394,7 +1394,7 @@ function AtlasLootBoss_OnClick()
AtlasLootItemsFrame.activeBoss = id; AtlasLootItemsFrame.activeBoss = id;
AtlasLoot_AtlasScrollBar_Update(); AtlasLoot_AtlasScrollBar_Update();
AtlasLootCharDB.LastBoss = AtlasLootBattlegrounds[zoneID][id] AtlasLootCharDB.LastBoss = AtlasLootBattlegrounds[zoneID][id]
end -- end
end end
end end
-- This has been invoked from Atlas, so we remove any claim external mods have on the loot table -- This has been invoked from Atlas, so we remove any claim external mods have on the loot table
@@ -1631,17 +1631,17 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss)
local wlPage, wlPageMax = 1, 1; local wlPage, wlPageMax = 1, 1;
local isItem, isEnchant, isSpell; local isItem, isEnchant, isSpell;
local spellName, spellIcon; local spellName, spellIcon;
if ( dataID == "SearchResult" and dataID == "WishList" ) then -- if ( dataID == "SearchResult" and dataID == "WishList" ) then
AtlasLoot_IsLootTableAvailable(dataID); -- AtlasLoot_IsLootTableAvailable(dataID);
end -- end
-- If the data source has not been passed, throw up a debugging statement -- If the data source has not been passed, throw up a debugging statement
if ( dataSource == nil ) then -- if ( dataSource == nil ) then
DEFAULT_CHAT_FRAME:AddMessage("No dataSource!"); -- DEFAULT_CHAT_FRAME:AddMessage("No dataSource!");
end -- end
-- If the loot table name has not been passed, throw up a debugging statement -- If the loot table name has not been passed, throw up a debugging statement
if ( dataID == nil ) then -- if ( dataID == nil ) then
DEFAULT_CHAT_FRAME:AddMessage("No dataID!"); -- DEFAULT_CHAT_FRAME:AddMessage("No dataID!");
end -- end
local dataSource_backup = dataSource; local dataSource_backup = dataSource;
if ( dataSource ~= "dummy" ) then if ( dataSource ~= "dummy" ) then
if ( dataID == "SearchResult" or dataID == "WishList" ) then if ( dataID == "SearchResult" or dataID == "WishList" ) then
@@ -1866,7 +1866,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss)
if ( (dataID == "SearchResult" or dataID == "WishList") and dataSource[dataID][i][5] ) then if ( (dataID == "SearchResult" or dataID == "WishList") and dataSource[dataID][i][5] ) then
local _, _, wishDataID, wishDataSource = strfind(dataSource[dataID][i][5], "(.+)|(.+)") local _, _, wishDataID, wishDataSource = strfind(dataSource[dataID][i][5], "(.+)|(.+)")
if ( wishDataSource == "AtlasLootRepItems" ) then if ( wishDataSource == "AtlasLootRepItems" ) then
if ( wishDataID and AtlasLoot_IsLootTableAvailable(wishDataID) ) then if ( wishDataID --[[and AtlasLoot_IsLootTableAvailable(wishDataID)]] ) then
for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do
if ( dataSource[dataID][i][1] == v[1] ) then if ( dataSource[dataID][i][1] == v[1] ) then
index = 1 index = 1
@@ -1888,7 +1888,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss)
end end
if ( wishDataSource == "AtlasLootItems" and AtlasLootCharDB.WishlistGroupedByDungeon ) then if ( wishDataSource == "AtlasLootItems" and AtlasLootCharDB.WishlistGroupedByDungeon ) then
-- Set boss -- Set boss
if ( wishDataID and AtlasLoot_IsLootTableAvailable(wishDataID) ) then if ( wishDataID --[[and AtlasLoot_IsLootTableAvailable(wishDataID)]] ) then
for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do
if ( dataSource[dataID][i][1] == v[1] ) then if ( dataSource[dataID][i][1] == v[1] ) then
local boss = AtlasLoot_GetWishListSubheadingBoss(wishDataID) local boss = AtlasLoot_GetWishListSubheadingBoss(wishDataID)
@@ -2538,8 +2538,8 @@ This is the intended API for external mods to use for displaying loot pages.
This function figures out where the loot table is stored, then sends the relevant info to AtlasLoot_ShowItemsFrame This function figures out where the loot table is stored, then sends the relevant info to AtlasLoot_ShowItemsFrame
]] ]]
function AtlasLoot_ShowBossLoot(dataID, boss) function AtlasLoot_ShowBossLoot(dataID, boss)
local tableavailable = AtlasLoot_IsLootTableAvailable(dataID); -- local tableavailable = AtlasLoot_IsLootTableAvailable(dataID);
if ( tableavailable ) then -- if ( tableavailable ) then
AtlasLootItemsFrame:Hide(); AtlasLootItemsFrame:Hide();
-- If the loot table is already being displayed, it is hidden and the current table selection cancelled -- If the loot table is already being displayed, it is hidden and the current table selection cancelled
if ( dataID == AtlasLootItemsFrame.externalBoss and AtlasLootItemsFrame:GetParent() ~= AtlasFrame and AtlasLootItemsFrame:GetParent() ~= AtlasLootDefaultFrame ) then if ( dataID == AtlasLootItemsFrame.externalBoss and AtlasLootItemsFrame:GetParent() ~= AtlasFrame and AtlasLootItemsFrame:GetParent() ~= AtlasLootDefaultFrame ) then
@@ -2551,7 +2551,7 @@ function AtlasLoot_ShowBossLoot(dataID, boss)
AtlasLootItemsFrame.externalBoss = dataID; AtlasLootItemsFrame.externalBoss = dataID;
AtlasLoot_ShowItemsFrame(dataID, dataSource, boss); AtlasLoot_ShowItemsFrame(dataID, dataSource, boss);
end end
end -- end
end end
function AtlasLootOptions_SetupSlider(text, mymin, mymax, step) function AtlasLootOptions_SetupSlider(text, mymin, mymax, step)
@@ -3013,7 +3013,7 @@ function AtlasLootItem_OnClick()
end end
elseif ( (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage ) then elseif ( (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage ) then
local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)"); local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)");
if ( dataID and dataSource and AtlasLoot_IsLootTableAvailable(dataID) ) then if ( dataID and dataSource --[[and AtlasLoot_IsLootTableAvailable(dataID)]] ) then
AtlasLoot_ShowItemsFrame(dataID, dataSource, AtlasLoot_TableNames[dataID][1]); AtlasLoot_ShowItemsFrame(dataID, dataSource, AtlasLoot_TableNames[dataID][1]);
end end
elseif ( this.container ) then elseif ( this.container ) then
@@ -3034,7 +3034,7 @@ function AtlasLootItem_OnClick()
DressUpItemLink("item:"..this.dressingroomID..":0:0:0"); DressUpItemLink("item:"..this.dressingroomID..":0:0:0");
elseif ( (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage ) then elseif ( (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage ) then
local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)"); local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)");
if ( dataID and dataSource and AtlasLoot_IsLootTableAvailable(dataID) ) then if ( dataID and dataSource --[[and AtlasLoot_IsLootTableAvailable(dataID)]] ) then
AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName); AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName);
end end
end end
@@ -3070,7 +3070,7 @@ function AtlasLootItem_OnClick()
DressUpItemLink("item:"..this.dressingroomID..":0:0:0"); DressUpItemLink("item:"..this.dressingroomID..":0:0:0");
elseif ( (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage ) then elseif ( (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage ) then
local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)"); local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)");
if ( dataID and dataSource and AtlasLoot_IsLootTableAvailable(dataID) ) then if ( dataID and dataSource --[[and AtlasLoot_IsLootTableAvailable(dataID)]] ) then
AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName); AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName);
end end
end end
-1
View File
@@ -46,7 +46,6 @@ function AtlasLoot_PrepMenu(backPage, title)
_G["AtlasLootMenuItem_" .. i .. "_Extra"]:Show(); _G["AtlasLootMenuItem_" .. i .. "_Extra"]:Show();
end end
AtlasLoot_BossName:SetText("|cffFFFFFF" .. title); AtlasLoot_BossName:SetText("|cffFFFFFF" .. title);
-- AtlasLoot_SetItemInfoFrame(AtlasLoot_AnchorPoint);
end end
function AtlasLootSetMenu() function AtlasLootSetMenu()