added search by difficulty
This commit is contained in:
@@ -532,7 +532,7 @@ function Atlasloot_CreateToken(dataID)
|
||||
newTable = rawset(id, 5, v.Name);
|
||||
table.insert(newData[1],newTable);
|
||||
end
|
||||
AtlasLoot.refreshTimer = AtlasLoot:ScheduleTimer("callShowloot", .1);
|
||||
AtlasLoot.refreshTimer = AtlasLoot:ScheduleTimer("callShowloot", .5);
|
||||
end)
|
||||
end
|
||||
end
|
||||
@@ -615,10 +615,6 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
|
||||
|
||||
if(toShow) then
|
||||
IDfound = AL_FindId(dataSource[dataID][tablenum][i][2], ItemindexID) or dataSource[dataID][tablenum][i][2];
|
||||
if ((dataID == "SearchResult") or (dataID == "WishList")) then
|
||||
IDfound = AL_FindId(dataSource[dataID][tablenum][i][2], dataSource[dataID][tablenum][i][AtlasLoot_Difficulty.DIF_SEARCH]) or dataSource[dataID][tablenum][i][2];
|
||||
end
|
||||
|
||||
if string.sub(IDfound, 1, 1) == "s" then
|
||||
isItem = false;
|
||||
else
|
||||
@@ -626,9 +622,6 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
|
||||
end
|
||||
|
||||
if isItem then
|
||||
if ItemindexID == "Bloodforged" then
|
||||
IDfound = "60"..dataSource[dataID][tablenum][i][2];
|
||||
else
|
||||
--Sets ItemindexID to normal(2) if it is nil for min/max difficulties.
|
||||
if not tonumber(ItemindexID) then ItemindexID = AtlasLoot_Difficulty.Normal end;
|
||||
|
||||
@@ -638,10 +631,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
|
||||
end
|
||||
--If something was found in itemID database show that if not show default table item
|
||||
IDfound = AL_FindId(dataSource[dataID][tablenum][i][2], ItemindexID) or dataSource[dataID][tablenum][i][2];
|
||||
if ((dataID == "SearchResult") or (dataID == "WishList")) then
|
||||
IDfound = AL_FindId(dataSource[dataID][tablenum][i][2], dataSource[dataID][tablenum][i][AtlasLoot_Difficulty.DIF_SEARCH]) or dataSource[dataID][tablenum][i][2];
|
||||
|
||||
if ItemindexID ~= "" and dataID == "SearchResult" then
|
||||
IDfound = AL_FindId(dataSource[dataID][tablenum][i][9], ItemindexID) or dataSource[dataID][tablenum][i][2];
|
||||
end
|
||||
end
|
||||
|
||||
itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(IDfound);
|
||||
--If the client has the name of the item in cache, use that instead.
|
||||
@@ -1145,7 +1138,7 @@ function AtlasLoot_QueryLootPage()
|
||||
if item:GetInfo() then
|
||||
AtlasLootTooltip:SetHyperlink("item:"..itemId..":0:0:0:0:0:0:0");
|
||||
end
|
||||
AtlasLoot.refreshTimer = AtlasLoot:ScheduleTimer("callShowloot", .1);
|
||||
AtlasLoot.refreshTimer = AtlasLoot:ScheduleTimer("callShowloot", .5);
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -667,17 +667,17 @@ local function DoSearch(searchText)
|
||||
AtlasLootCharDB.LastSearchedText = searchText;
|
||||
local count = 1;
|
||||
local tablenum = 1;
|
||||
local function AddItemToSearchResult(itemId, itemType, itemName, dataID)
|
||||
local function AddItemToSearchResult(itemId, itemType, itemName, dataID, itemIdBackup)
|
||||
local lootPage = AtlasLoot_Data[dataID].Name or "Argh!";
|
||||
if AtlasLootCharDB["SearchResult"][tablenum] == nil then
|
||||
AtlasLootCharDB["SearchResult"][tablenum] = {Name = "Page "..tablenum};
|
||||
end
|
||||
if count == 30 then
|
||||
table.insert(AtlasLootCharDB["SearchResult"][tablenum], {count, itemId, itemType, itemName, lootPage, "", "", dataID .. "|" .. "\"\""});
|
||||
table.insert(AtlasLootCharDB["SearchResult"][tablenum], {count, itemId, itemType, itemName, lootPage, "", "", dataID .. "|" .. "\"\"", itemIdBackup});
|
||||
tablenum = tablenum + 1
|
||||
count = 1;
|
||||
else
|
||||
table.insert(AtlasLootCharDB["SearchResult"][tablenum], {count, itemId, itemType, itemName, lootPage, "", "", dataID .. "|" .. "\"\""});
|
||||
table.insert(AtlasLootCharDB["SearchResult"][tablenum], {count, itemId, itemType, itemName, lootPage, "", "", dataID .. "|" .. "\"\"", itemIdBackup});
|
||||
count = count + 1;
|
||||
end
|
||||
end
|
||||
@@ -692,21 +692,23 @@ local function DoSearch(searchText)
|
||||
if type(v) == "table" then
|
||||
local _, itemId, itemType, atlasName = unpack(v)
|
||||
if type(itemId) == "number" and itemId > 0 then
|
||||
local itemIdBackup = itemId;
|
||||
itemId = AL_FindId(itemId, ItemindexID) or 2
|
||||
local itemDetails = {GetItemDetails(itemId, atlasName)};
|
||||
--itemDetails[8] = ItemindexID;
|
||||
|
||||
if #searchTerms == 1 and searchTerms[1].name then
|
||||
if nameMatches(atlasName, searchTerms[1].name) then
|
||||
AddItemToSearchResult(itemId, itemType, atlasName, dataID);
|
||||
AddItemToSearchResult(itemId, itemType, atlasName, dataID, itemIdBackup);
|
||||
end
|
||||
elseif ItemMatchesAllTerms(searchTerms, itemDetails) then
|
||||
AddItemToSearchResult(itemId, itemType, atlasName, dataID);
|
||||
AddItemToSearchResult(itemId, itemType, atlasName, dataID, itemIdBackup);
|
||||
end
|
||||
elseif not equipableFilterOn and itemId and itemId ~= "" and string.sub(itemId, 1, 1) == "s" then
|
||||
local spellName = GetSpellName(itemId, atlasName)
|
||||
if nameMatches(spellName, searchText) then
|
||||
spellName = string.sub(atlasName, 1, 4) .. spellName;
|
||||
AddItemToSearchResult(itemId, itemType, spellName, dataID)
|
||||
AddItemToSearchResult(itemId, itemType, spellName, dataID, itemIdBackup)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,11 +55,11 @@ Displays the WishList
|
||||
]]
|
||||
function AtlasLoot_ShowWishList()
|
||||
if lastWishListtyp == "addOwn" then
|
||||
AtlasLoot_ShowItemsFrame("WishList", "WishListPage"..currentPage, AtlasLootWishList["Own"][playerName][lastWishListarg2]["info"][1], pFrame);
|
||||
AtlasLoot_ShowItemsFrame("WishList", AtlasLootWishList, AtlasLootWishList["Own"][playerName][lastWishListarg2]["info"][1], pFrame, 1);
|
||||
elseif lastWishListtyp == "addOther" then
|
||||
AtlasLoot_ShowItemsFrame("WishList", "WishListPage"..currentPage, AtlasLootWishList["Own"][lastWishListarg2][lastWishListarg3]["info"][1], pFrame);
|
||||
AtlasLoot_ShowItemsFrame("WishList", AtlasLootWishList, AtlasLootWishList["Own"][lastWishListarg2][lastWishListarg3]["info"][1], pFrame, 1);
|
||||
elseif lastWishListtyp == "addShared" then
|
||||
AtlasLoot_ShowItemsFrame("WishList", "WishListPage"..currentPage, AtlasLootWishList["Shared"][lastWishListarg2][lastWishListarg3]["info"][1], pFrame);
|
||||
AtlasLoot_ShowItemsFrame("WishList", AtlasLootWishList, AtlasLootWishList["Shared"][lastWishListarg2][lastWishListarg3]["info"][1], pFrame, 1);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -342,7 +342,9 @@ local rows = setmetatable({}, { __index = function(t, i)
|
||||
row:SetCheckedTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight", "ADD");
|
||||
row:SetScript("OnClick", function()
|
||||
ItemindexID = row.itemIndex;
|
||||
if not AtlasLootAdvancedSearch:IsVisible() then
|
||||
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4], AtlasLootItemsFrame.refresh[5]);
|
||||
end
|
||||
AtlasLootDefaultFrame_ScrollFrameUpdate();
|
||||
end)
|
||||
if i == 1 then
|
||||
|
||||
@@ -1881,7 +1881,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
|
||||
{ 13, 28772, "", "=q4=Sunfury Bow of the Phoenix", "=ds=#w2#", "", "9.97%"};
|
||||
{ 16, 29761, "", "=q4=Helm of the Fallen Defender", "=ds=#tt4#", "", "100%", "=LT=T5HEAD"};
|
||||
{ 18, 29434, "", "=q4=Badge of Justice", "=ds=#e15#", "", "100%"};
|
||||
{ 28, 499438, "", "=q4=Smoldering Emberwyrm", "=ds=#e12#", [AtlasLoot_Difficulty.MIN_DIF] = AtlasLoot_Difficulty.Heroic, "" };
|
||||
{ 20, 499438, "", "=q4=Smoldering Emberwyrm", "=ds=#e12#", [AtlasLoot_Difficulty.MIN_DIF] = AtlasLoot_Difficulty.Heroic, "" };
|
||||
};
|
||||
{ --Trash Mobs
|
||||
Name = AL["Trash Mobs"];
|
||||
|
||||
@@ -4432,7 +4432,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 8, 16803, "", "=q4=Felheart Slippers", "=ds="..BabbleBoss["Shazzrah"], "", "15.28%"};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - Tank";
|
||||
{ 1, 16866, "", "=q4=Helm of Might", "=ds="..BabbleBoss["Garr"], "", "11.39%"};
|
||||
{ 2, 16868, "", "=q4=Pauldrons of Might", "=ds="..BabbleBoss["Sulfuron Harbinger"], "", "21.14%"};
|
||||
{ 3, 16865, "", "=q4=Breastplate of Might", "=ds="..BabbleBoss["Golemagg the Incinerator"], "", "15.28%"};
|
||||
@@ -4443,7 +4443,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 8, 16862, "", "=q4=Sabatons of Might", "=ds="..BabbleBoss["Gehennas"], "", "14.48%"};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - DPS";
|
||||
{ 1, 10480, "", "=q4=Faceguard of Might", "=ds="..BabbleBoss["Garr"], ""};
|
||||
{ 2, 10481, "", "=q4=Shoulderpads of Might", "=ds="..BabbleBoss["Sulfuron Harbinger"], ""};
|
||||
{ 3, 10482, "", "=q4=Chesttplate of Might", "=ds="..BabbleBoss["Golemagg the Incinerator"], ""};
|
||||
@@ -4548,7 +4548,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 8, 16927, "", "=q4=Nemesis Boots", "=ds="..BabbleBoss["Broodlord Lashlayer"], "", "15.32%"};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - Tank";
|
||||
{ 1, 16963, "", "=q4=Helm of Wrath", "=ds="..BabbleBoss["Nefarian"], "", "13.65%"};
|
||||
{ 2, 16961, "", "=q4=Pauldrons of Wrath", "=ds="..BabbleBoss["Chromaggus"], "", "16.83%"};
|
||||
{ 3, 16966, "", "=q4=Breastplate of Wrath", "=ds="..BabbleBoss["Nefarian"], "", "15.06%"};
|
||||
@@ -4559,7 +4559,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 8, 16965, "", "=q4=Sabatons of Wrath", "=ds="..BabbleBoss["Broodlord Lashlayer"], "", "16.84%"};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - DPS";
|
||||
{ 1, 10904, "", "=q4=Faceguard of Wrath", "=ds="..BabbleBoss["Nefarian"], "", "13.65%"};
|
||||
{ 2, 10902, "", "=q4=Shoulderpads of Wrath", "=ds="..BabbleBoss["Chromaggus"], "", "16.83%"};
|
||||
{ 3, 10907, "", "=q4=Chestplate of Wrath", "=ds="..BabbleBoss["Nefarian"], "", "15.06%"};
|
||||
@@ -4675,7 +4675,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 9, 23063, "", "=q4=Plagueheart Ring", "=ds="};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - Tank";
|
||||
{ 1, 22418, "", "=q4=Dreadnaught Helmet", "=ds="};
|
||||
{ 2, 22419, "", "=q4=Dreadnaught Pauldrons", "=ds="};
|
||||
{ 3, 22416, "", "=q4=Dreadnaught Breastplate", "=ds="};
|
||||
@@ -4687,7 +4687,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 9, 23059, "", "=q4=Ring of the Dreadnaught", "=ds="};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - DPS";
|
||||
{ 1, 10490, "", "=q4=Dreadborne Helmet", "=ds="};
|
||||
{ 2, 10491, "", "=q4=Dreadborne Pauldrons", "=ds="};
|
||||
{ 3, 10488, "", "=q4=Dreadborne Breastplate", "=ds="};
|
||||
@@ -5059,7 +5059,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 5, 21338, "", "=q4=Doomcaller's Footwraps", ""};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - Tank";
|
||||
{ 1, 21331, "", "=q4=Conqueror's Breastplate", ""};
|
||||
{ 2, 21329, "", "=q4=Conqueror's Crown", ""};
|
||||
{ 3, 21332, "", "=q4=Conqueror's Legguards", ""};
|
||||
@@ -5067,7 +5067,7 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0")
|
||||
{ 5, 21333, "", "=q4=Conqueror's Greaves", ""};
|
||||
};
|
||||
{
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"];
|
||||
Name = LOCALIZED_CLASS_NAMES_MALE["WARRIOR"].." - DPS";
|
||||
{ 1, 10912, "", "=q4=Conqueror's Chestplate", ""};
|
||||
{ 2, 10910, "", "=q4=Conqueror's Headguard", ""};
|
||||
{ 3, 10913, "", "=q4=Conqueror's Platelegs", ""};
|
||||
|
||||
Reference in New Issue
Block a user