auto query by default

This commit is contained in:
Spit
2025-01-08 02:34:27 +03:00
parent eaabf5b095
commit 78ea8ea0ed
2 changed files with 14 additions and 83 deletions
+12 -65
View File
@@ -1088,6 +1088,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
elseif(dataID=="JEWELCRAFTMENU") then elseif(dataID=="JEWELCRAFTMENU") then
AtlasLoot_JewelcraftingMenu(); AtlasLoot_JewelcraftingMenu();
else else
AtlasLoot_QueryLootPage()
--Iterate through each item object and set its properties --Iterate through each item object and set its properties
for i = 1, 30, 1 do for i = 1, 30, 1 do
--Check for a valid object (that it exists, and that it has a name) --Check for a valid object (that it exists, and that it has a name)
@@ -1195,9 +1196,6 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
end end
if iconFrame:GetTexture() == nil then if iconFrame:GetTexture() == nil then
iconFrame:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark"); iconFrame:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark");
-- itemButton.itemTexture = "Interface\\Icons\\INV_Misc_QuestionMark";
-- else
-- itemButton.itemTexture = iconFrame:GetTexture();
end end
--Set the name and description of the item --Set the name and description of the item
nameFrame:SetText(text); nameFrame:SetText(text);
@@ -1325,25 +1323,16 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
if itemButton.container then if itemButton.container then
border:Show() border:Show()
end end
--itemButton.iteminfo = {};
local spellID local spellID
if isItem then if isItem then
--itemButton.iteminfo.idcore = dataSource[dataID][i][1];
--_, _, _, _, _, _, _, itemButton.iteminfo.icontexture = GetItemInfo(dataSource[dataID][i][1]);
--itemButton.storeID = dataSource[dataID][i][1];
itemButton.dressingroomID = dataSource[dataID][i][1]; itemButton.dressingroomID = dataSource[dataID][i][1];
--itemButton.extraText = getglobal("AtlasLootItem_"..i.."_Extra"):GetText()
elseif isEnchant then elseif isEnchant then
spellID = tonumber(string.sub(dataSource[dataID][i][1], 2)); spellID = tonumber(string.sub(dataSource[dataID][i][1], 2));
--itemButton.iteminfo.idcore = dataSource[dataID][i][2];
--_, _, _, _, _, _, _, _, itemButton.iteminfo.icontexture = GetItemInfo(dataSource[dataID][i][2]);
--itemButton.storeID = dataSource[dataID][i][2];
if GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] and GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= nil and GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= "" then if GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] and GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= nil and GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= "" then
itemButton.dressingroomID = GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]; itemButton.dressingroomID = GetSpellInfoAtlasLootDB["enchants"][spellID]["item"];
else else
itemButton.dressingroomID = spellID; itemButton.dressingroomID = spellID;
end end
--itemButton.extraText = getglobal("AtlasLootItem_"..i.."_Extra"):GetText()
if GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= nil and GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= "" then if GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= nil and GetSpellInfoAtlasLootDB["enchants"][spellID]["item"] ~= "" then
if not GetItemInfo(GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]) then if not GetItemInfo(GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]) then
GameTooltip:SetHyperlink("item:"..GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]..":0:0:0"); GameTooltip:SetHyperlink("item:"..GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]..":0:0:0");
@@ -1351,11 +1340,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
end end
elseif isSpell then elseif isSpell then
spellID = tonumber(string.sub(dataSource[dataID][i][1], 2)); spellID = tonumber(string.sub(dataSource[dataID][i][1], 2));
--itemButton.iteminfo.idcore = dataSource[dataID][i][1];
--_, _, _, _, _, _, _, _, itemButton.iteminfo.icontexture = GetItemInfo(dataSource[dataID][i][1]);
--itemButton.storeID = dataSource[dataID][i][1];
itemButton.dressingroomID = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]; itemButton.dressingroomID = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"];
--itemButton.extraText = getglobal("AtlasLootItem_"..i.."_Extra"):GetText()
if GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"] ~= "" then if GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"] ~= "" then
if not GetItemInfo(GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]) then if not GetItemInfo(GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]) then
GameTooltip:SetHyperlink("item:"..GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]..":0:0:0"); GameTooltip:SetHyperlink("item:"..GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]..":0:0:0");
@@ -1384,14 +1369,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
local droprate = dataSource[dataID][i][5]; local droprate = dataSource[dataID][i][5];
if droprate and string.find(droprate, "%%") then itemButton.droprate = droprate end if droprate and string.find(droprate, "%%") then itemButton.droprate = droprate end
end end
--itemButton.i = 1;
itemButton:Show(); itemButton:Show();
--If the item is not in cache, querying the server may cause a disconnect if MouseIsOver(itemButton) then
--Show a red box around the item to indicate this to the user itemButton:Hide()
if((not GetItemInfo(dataSource[dataID][i][1])) and (dataSource[dataID][i][1] ~= 0) and isItem) then itemButton:Show()
getglobal("AtlasLootItem_"..i.."_Unsafe"):Show();
else
getglobal("AtlasLootItem_"..i.."_Unsafe"):Hide();
end end
else else
getglobal("AtlasLootItem_"..i):Hide(); getglobal("AtlasLootItem_"..i):Hide();
@@ -1458,34 +1439,14 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
end end
local subMenu = nil local subMenu = nil
local bossName = "" local bossName = ""
local category = "" for k in pairs(AtlasLoot_HewdropDown_SubTables) do
for k, v in pairs(AtlasLoot_HewdropDown_SubTables) do
if subMenu then if subMenu then
break break
end end
for i, n in pairs(AtlasLoot_HewdropDown_SubTables[k]) do for _, n in pairs(AtlasLoot_HewdropDown_SubTables[k]) do
if n[2] == dataID then if n[2] == dataID then
subMenu = AtlasLoot_HewdropDown_SubTables[k] subMenu = AtlasLoot_HewdropDown_SubTables[k]
bossName = n[1] bossName = n[1]
-- for k1, v1 in pairs(AtlasLoot_HewdropDown) do
-- for k2, v2 in pairs(AtlasLoot_HewdropDown[k1]) do
-- for k3, v3 in pairs(AtlasLoot_HewdropDown[k1][k2]) do
-- if type(v3[1]) == "string" then
-- if v3[2] == k then
-- category = v3[1]
-- break
-- end
-- elseif type(v3[1] == "table") then
-- for k4, v4 in pairs(v3[1]) do
-- if v4[2] == k then
-- category = v4[1]
-- break
-- end
-- end
-- end
-- end
-- end
-- end
break break
end end
end end
@@ -1499,7 +1460,6 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
AtlasLootDefaultFrame_SubMenu:Disable() AtlasLootDefaultFrame_SubMenu:Disable()
AtlasLootDefaultFrame_SelectedTable:Hide() AtlasLootDefaultFrame_SelectedTable:Hide()
end end
--AtlasLootDefaultFrame_SelectedCategory:SetText(category)
--Anchor the item frame where it is supposed to be --Anchor the item frame where it is supposed to be
AtlasLoot_SetItemInfoFrame(pFrame); AtlasLoot_SetItemInfoFrame(pFrame);
AtlasLootItemsFrameContainer:Hide() AtlasLootItemsFrameContainer:Hide()
@@ -3267,21 +3227,11 @@ function AtlasLootItem_OnEnter()
if( this.droprate ~= nil) then if( this.droprate ~= nil) then
AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0); AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0);
end end
--QuestTest_TooltipUpdate(AtlasLootTooltip,"item:"..this.itemID..":0:0:0")
AtlasLootTooltip:Show();
else else
--[[AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24);
AtlasLootTooltip:ClearLines();
AtlasLootTooltip:AddLine(RED..AL["Item Unavailable"], nil, nil, nil, 1);
AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID, nil, nil, nil, 1);
AtlasLootTooltip:AddLine(AL["This item is unsafe. To view this item without the risk of disconnection, you need to have first seen it in the game world. This is a restriction enforced by Blizzard since Patch 1.10."], nil, nil, nil, 1);
AtlasLootTooltip:AddLine(" ");
AtlasLootTooltip:AddLine(AL["You can right-click to attempt to query the server. You may be disconnected."], nil, nil, nil, 1);
AtlasLootTooltip:Show();]]
AtlasLoot_QueryLootPage() AtlasLoot_QueryLootPage()
getglobal("AtlasLootItem_"..id.."_Unsafe"):Hide(); getglobal("AtlasLootItem_"..id.."_Unsafe"):Hide();
AtlasLootTooltip:Show();
end end
AtlasLootTooltip:Show();
end end
end end
elseif isEnchant then elseif isEnchant then
@@ -3497,11 +3447,7 @@ function AtlasLootItem_OnClick(arg1)
end end
elseif isEnchant then elseif isEnchant then
if IsShiftKeyDown() then if IsShiftKeyDown() then
--[[if ChatFrameEditBox:IsVisible() then
ChatFrameEditBox:Insert(color.."|Henchant:"..string.sub(this.itemID, 2)..":0:0:0|h["..name.."]|h|r");
else]]
AtlasLoot_SayItemReagents(this.itemID) AtlasLoot_SayItemReagents(this.itemID)
--end
elseif(IsAltKeyDown() and (this.itemID ~= 0)) then elseif(IsAltKeyDown() and (this.itemID ~= 0)) then
if dataID == "WishList" then if dataID == "WishList" then
AtlasLoot_DeleteFromWishList(this.itemID); AtlasLoot_DeleteFromWishList(this.itemID);
@@ -3777,14 +3723,15 @@ AtlasLoot_QueryLootPage()
Querys all valid items on the current loot page. Querys all valid items on the current loot page.
]] ]]
function AtlasLoot_QueryLootPage() function AtlasLoot_QueryLootPage()
local i=1; for i = 1, 30 do
while i<31 do
local button = getglobal("AtlasLootItem_"..i); local button = getglobal("AtlasLootItem_"..i);
local queryitem = button.itemID; local queryitem = button.itemID;
if (queryitem) and (queryitem ~= nil) and (queryitem ~= "") and (queryitem ~= 0) and (string.sub(queryitem, 1, 1) ~= "s") and (string.sub(queryitem, 1, 1) ~= "e") then if (queryitem) and (queryitem ~= nil) and (queryitem ~= "") and (queryitem ~= 0) and
(string.sub(queryitem, 1, 1) ~= "s") and (string.sub(queryitem, 1, 1) ~= "e") then
if not GetItemInfo(queryitem) then
GameTooltip:SetHyperlink("item:"..queryitem..":0:0:0"); GameTooltip:SetHyperlink("item:"..queryitem..":0:0:0");
end end
i=i+1; end
end end
end end
-16
View File
@@ -1607,11 +1607,9 @@ AtlasLoot_TableNamesBoss = {
["LKHTrash"] = { AL["Trash Mobs"], "AtlasLootItems" }, ["LKHTrash"] = { AL["Trash Mobs"], "AtlasLootItems" },
["LKHEchants"] = { AL["LKH Enchants"], "AtlasLootItems" }, ["LKHEchants"] = { AL["LKH Enchants"], "AtlasLootItems" },
}, },
------------ ------------
--- Sets --- --- Sets ---
------------ ------------
["Sets"] = { ["Sets"] = {
["DEADMINES"] = { AL["Set: "] .. AL["Defias Leather"], "AtlasLootSetItems" }, ["DEADMINES"] = { AL["Set: "] .. AL["Defias Leather"], "AtlasLootSetItems" },
["WAILING"] = { AL["Set: "] .. AL["Embrace of the Viper"], "AtlasLootSetItems" }, ["WAILING"] = { AL["Set: "] .. AL["Embrace of the Viper"], "AtlasLootSetItems" },
@@ -1764,15 +1762,9 @@ AtlasLoot_TableNamesBoss = {
["T35Warlock"] = { AL["Karazhan"].." - "..AL["Tier 3.5"].." "..AL["Set"], "AtlasLootSetItems" }, ["T35Warlock"] = { AL["Karazhan"].." - "..AL["Tier 3.5"].." "..AL["Set"], "AtlasLootSetItems" },
["T35Warrior"] = { AL["Karazhan"].." - "..AL["Tier 3.5"].." "..AL["Set"], "AtlasLootSetItems" }, ["T35Warrior"] = { AL["Karazhan"].." - "..AL["Tier 3.5"].." "..AL["Set"], "AtlasLootSetItems" },
}, },
------------------------
--- Misc Collections ---
------------------------
-------------------- --------------------
--- World Bosses --- --- World Bosses ---
-------------------- --------------------
["WorldBosses"] = { ["WorldBosses"] = {
["AAzuregos"] = { AL["Azuregos"], "AtlasLootWBItems" }, ["AAzuregos"] = { AL["Azuregos"], "AtlasLootWBItems" },
["ASpiritA"] = { AL["Spirit of Azuregos"], "AtlasLootWBItems" }, ["ASpiritA"] = { AL["Spirit of Azuregos"], "AtlasLootWBItems" },
@@ -1792,7 +1784,6 @@ AtlasLoot_TableNamesBoss = {
["DTrash"] = { AL["Trash Mobs"] .. " (" .. AL["Emerald Dragons"] .. ")", "AtlasLootWBItems" }, ["DTrash"] = { AL["Trash Mobs"] .. " (" .. AL["Emerald Dragons"] .. ")", "AtlasLootWBItems" },
["Clackora"] = { AL["Cla'ckora"], "AtlasLootWBItems" }, ["Clackora"] = { AL["Cla'ckora"], "AtlasLootWBItems" },
}, },
------------------- -------------------
--- Rare Spawns --- --- Rare Spawns ---
------------------- -------------------
@@ -1835,11 +1826,9 @@ AtlasLoot_TableNamesBoss = {
["KinTozo"] = { "Kin'Tozo", "AtlasLootWBItems" }, ["KinTozo"] = { "Kin'Tozo", "AtlasLootWBItems" },
["ProfessorLysander"] = { "Professor Lysander", "AtlasLootWBItems" }, ["ProfessorLysander"] = { "Professor Lysander", "AtlasLootWBItems" },
}, },
-------------- --------------
--- Events --- --- Events ---
-------------- --------------
["World Events"] = { ["World Events"] = {
["AbyssalTemplars"] = { "Abyssal Council - Templars", "AtlasLootWorldEvents" }, ["AbyssalTemplars"] = { "Abyssal Council - Templars", "AtlasLootWorldEvents" },
["AbyssalDukes"] = { "Abyssal Council - Dukes", "AtlasLootWorldEvents" }, ["AbyssalDukes"] = { "Abyssal Council - Dukes", "AtlasLootWorldEvents" },
@@ -1863,7 +1852,6 @@ AtlasLoot_TableNamesBoss = {
["ScourgeInvasionEvent1"] = { AL["Scourge Invasion"], "AtlasLootWorldEvents" }, ["ScourgeInvasionEvent1"] = { AL["Scourge Invasion"], "AtlasLootWorldEvents" },
["ScourgeInvasionEvent2"] = { AL["Scourge Invasion Bosses"], "AtlasLootWorldEvents" }, ["ScourgeInvasionEvent2"] = { AL["Scourge Invasion Bosses"], "AtlasLootWorldEvents" },
}, },
------------------------ ------------------------
--- Classic Factions --- --- Classic Factions ---
------------------------ ------------------------
@@ -1893,7 +1881,6 @@ AtlasLoot_TableNamesBoss = {
["GelkisClan1"] = { AL["Gelkis Clan Centaur"], "AtlasLootRepItems" }, ["GelkisClan1"] = { AL["Gelkis Clan Centaur"], "AtlasLootRepItems" },
--The League of Arathor --The League of Arathor
["LeagueofArathor"] = { AL["The League of Arathor"], "AtlasLootRepItems" }, ["LeagueofArathor"] = { AL["The League of Arathor"], "AtlasLootRepItems" },
--Magram Clan Centaur --Magram Clan Centaur
["MagramClan1"] = { AL["Magram Clan Centaur"], "AtlasLootRepItems" }, ["MagramClan1"] = { AL["Magram Clan Centaur"], "AtlasLootRepItems" },
--Stormpike Guard --Stormpike Guard
@@ -1930,7 +1917,6 @@ AtlasLoot_TableNamesBoss = {
["Dalaran"] = { AL["Dalaran"], "AtlasLootRepItems" }, ["Dalaran"] = { AL["Dalaran"], "AtlasLootRepItems" },
["Wildhammer"] = { AL["Wildhammer Clan"], "AtlasLootRepItems" }, ["Wildhammer"] = { AL["Wildhammer Clan"], "AtlasLootRepItems" },
}, },
-------------- --------------
--- Trades --- --- Trades ---
-------------- --------------
@@ -2109,11 +2095,9 @@ AtlasLoot_TableNamesBoss = {
--Poisons --Poisons
["Poisons1"] = { AL["Rogue"] .. ": " .. AL["Poisons"], "AtlasLootCrafting" }, ["Poisons1"] = { AL["Rogue"] .. ": " .. AL["Poisons"], "AtlasLootCrafting" },
}, },
----------- -----------
--- PvP --- --- PvP ---
----------- -----------
["Battlegrounds"] = { ["Battlegrounds"] = {
--Blood Ring --Blood Ring
["BRRepFriendly"] = { AL["Blood Ring"] .. " " .. AL["Friendly Rewards"], "AtlasLootBGItems" }, ["BRRepFriendly"] = { AL["Blood Ring"] .. " " .. AL["Friendly Rewards"], "AtlasLootBGItems" },