tweaked filter
This commit is contained in:
@@ -135,7 +135,7 @@ function AtlasLoot:OnEnable()
|
|||||||
if not AtlasLootCharDB["QuickLooks"] then AtlasLootCharDB["QuickLooks"] = {} end
|
if not AtlasLootCharDB["QuickLooks"] then AtlasLootCharDB["QuickLooks"] = {} end
|
||||||
if not AtlasLootCharDB.SelectedFilter then AtlasLootCharDB.SelectedFilter = 1 end
|
if not AtlasLootCharDB.SelectedFilter then AtlasLootCharDB.SelectedFilter = 1 end
|
||||||
if not AtlasLootCharDB["SearchResult"] then AtlasLootCharDB["SearchResult"] = {Name = "Search Result" , Type = "Search", Back = true}; end
|
if not AtlasLootCharDB["SearchResult"] then AtlasLootCharDB["SearchResult"] = {Name = "Search Result" , Type = "Search", Back = true}; end
|
||||||
if not AtlasLootFilterDB then AtlasLootFilterDB = {["FilterLists"] = {}} end;
|
if not AtlasLootFilterDB then AtlasLootFilterDB = {["FilterLists"] = {{Name = "Default" }}} end;
|
||||||
if AtlasLootFilterDB and not AtlasLootFilterDB["FilterLists"] then AtlasLootFilterDB = {["FilterLists"] = {{Name = "Default" }}} end;
|
if AtlasLootFilterDB and not AtlasLootFilterDB["FilterLists"] then AtlasLootFilterDB = {["FilterLists"] = {{Name = "Default" }}} end;
|
||||||
if AtlasLoot_Data then
|
if AtlasLoot_Data then
|
||||||
AtlasLoot_Data["EmptyTable"] = {
|
AtlasLoot_Data["EmptyTable"] = {
|
||||||
@@ -824,7 +824,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum)
|
|||||||
|
|
||||||
if dataSource[dataID].Back or ATLASLOOT_BACKENABLED then
|
if dataSource[dataID].Back or ATLASLOOT_BACKENABLED then
|
||||||
_G["AtlasLootItemsFrame_BACK"]:Show();
|
_G["AtlasLootItemsFrame_BACK"]:Show();
|
||||||
else
|
elseif dataID ~= "FilterList" then
|
||||||
AtlasLootItemsFrame.refreshBack = {dataID, dataSource_backup, tablenum};
|
AtlasLootItemsFrame.refreshBack = {dataID, dataSource_backup, tablenum};
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ local FilterTable = {
|
|||||||
{
|
{
|
||||||
Name = AL["Secondary Stats"],
|
Name = AL["Secondary Stats"],
|
||||||
Type = "Stat",
|
Type = "Stat",
|
||||||
{"Attack Power", "ITEM_MOD_ATTACK_POWER_SHORT"},
|
|
||||||
{"Spell Power", "ITEM_MOD_SPELL_POWER_SHORT"},
|
|
||||||
{"Crit", "ITEM_MOD_CRIT_RATING_SHORT"},
|
{"Crit", "ITEM_MOD_CRIT_RATING_SHORT"},
|
||||||
{"Hit", "ITEM_MOD_HIT_RATING_SHORT"},
|
{"Hit", "ITEM_MOD_HIT_RATING_SHORT"},
|
||||||
{"Haste", "ITEM_MOD_HASTE_RATING_SHORT"},
|
{"Haste", "ITEM_MOD_HASTE_RATING_SHORT"},
|
||||||
@@ -67,7 +65,9 @@ local FilterTable = {
|
|||||||
{"Strength", "ITEM_MOD_STRENGTH_SHORT"},
|
{"Strength", "ITEM_MOD_STRENGTH_SHORT"},
|
||||||
{"Agility", "ITEM_MOD_AGILITY_SHORT"},
|
{"Agility", "ITEM_MOD_AGILITY_SHORT"},
|
||||||
{"Intellect", "ITEM_MOD_INTELLECT_SHORT"},
|
{"Intellect", "ITEM_MOD_INTELLECT_SHORT"},
|
||||||
{"Spirit", "ITEM_MOD_SPIRIT_SHORT"}
|
{"Spirit", "ITEM_MOD_SPIRIT_SHORT"},
|
||||||
|
{"Attack Power", "ITEM_MOD_ATTACK_POWER_SHORT"},
|
||||||
|
{"Spell Power", "ITEM_MOD_SPELL_POWER_SHORT"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name = AL["Defensive Stats"],
|
Name = AL["Defensive Stats"],
|
||||||
@@ -92,7 +92,7 @@ AtlasLootFilter["FilterList"] = {};
|
|||||||
function AtlasLoot:HideFilteredItems()
|
function AtlasLoot:HideFilteredItems()
|
||||||
local dataID, dataSource, tablenum = AtlasLootItemsFrame.refreshFilter[1], _G[AtlasLootItemsFrame.refreshFilter[2]], AtlasLootItemsFrame.refreshFilter[3];
|
local dataID, dataSource, tablenum = AtlasLootItemsFrame.refreshFilter[1], _G[AtlasLootItemsFrame.refreshFilter[2]], AtlasLootItemsFrame.refreshFilter[3];
|
||||||
local tablebase = dataSource[dataID][tablenum]
|
local tablebase = dataSource[dataID][tablenum]
|
||||||
if not tablebase or dataID == "WishList" or dataID == "SearchResult" then return end
|
if not tablebase or dataID == "WishList" or dataID == "SearchResult" or AtlasLootCharDB.SelectedFilter == nil then return end
|
||||||
AtlasLootFilter["FilterList"] = {};
|
AtlasLootFilter["FilterList"] = {};
|
||||||
AtlasLootFilter["FilterList"].Type = dataSource[dataID].Type;
|
AtlasLootFilter["FilterList"].Type = dataSource[dataID].Type;
|
||||||
AtlasLootFilter["FilterList"].Name = dataSource[dataID].Name;
|
AtlasLootFilter["FilterList"].Name = dataSource[dataID].Name;
|
||||||
@@ -114,13 +114,25 @@ function AtlasLoot:HideFilteredItems()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function checkNofilter(itemID, filter)
|
||||||
|
if getStats(itemID,filter) then return true end;
|
||||||
|
for i,v in pairs(AtlasLootFilterDB["FilterLists"][AtlasLootCharDB.SelectedFilter]) do
|
||||||
|
for n,t in ipairs(FilterTable) do
|
||||||
|
if t.Type == filter and v[1] then
|
||||||
|
return true;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local count = 0
|
local count = 0
|
||||||
local function getFilterType(itemID)
|
local function getFilterType(itemID)
|
||||||
local filterSelect3, filterSelect2,_ , filterSelect1 = select(6,GetItemInfo(itemID));
|
local filterSelect3, filterSelect2,_ , filterSelect1 = select(6,GetItemInfo(itemID));
|
||||||
local filter1 = AtlasLootFilterDB["FilterLists"][AtlasLootCharDB.SelectedFilter][filterSelect1];
|
local filter1 = AtlasLootFilterDB["FilterLists"][AtlasLootCharDB.SelectedFilter][filterSelect1];
|
||||||
local filter2 = AtlasLootFilterDB["FilterLists"][AtlasLootCharDB.SelectedFilter][filterSelect2];
|
local filter2 = AtlasLootFilterDB["FilterLists"][AtlasLootCharDB.SelectedFilter][filterSelect2];
|
||||||
if (filter1 and filter1[1] and filter1[3] == "InvType" and getStats(itemID,"Stat")) or
|
|
||||||
(filter2 and filter2[1] and filter2[3] == "ArmorType" and getStats(itemID,"Stat"))
|
if (filter1 and filter1[1] and filter1[3] == "InvType" and getStats(itemID,"PrimaryStat") and checkNofilter(itemID, "Stat")) or
|
||||||
|
(filter2 and filter2[1] and filter2[3] == "ArmorType" and getStats(itemID,"PrimaryStat") and checkNofilter(itemID, "Stat"))
|
||||||
then
|
then
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
@@ -269,7 +281,7 @@ function AtlasLoot:OpenFilterCreate()
|
|||||||
filterCatLable:SetPoint("TOP", "AtlasLootItemsFrame", "TOP",-150,-90);
|
filterCatLable:SetPoint("TOP", "AtlasLootItemsFrame", "TOP",-150,-90);
|
||||||
elseif count == 16 then
|
elseif count == 16 then
|
||||||
filterCatLable:SetPoint("TOP", "AtlasLootItemsFrame", "TOP",0,-90);
|
filterCatLable:SetPoint("TOP", "AtlasLootItemsFrame", "TOP",0,-90);
|
||||||
elseif count == 30 then
|
elseif count == 28 then
|
||||||
filterCatLable:SetPoint("TOP", "AtlasLootItemsFrame", "TOP",150,-90);
|
filterCatLable:SetPoint("TOP", "AtlasLootItemsFrame", "TOP",150,-90);
|
||||||
else
|
else
|
||||||
filterCatLable:SetPoint("LEFT", "AtlasLootFilterButton_"..(count - 1), "LEFT",0,-25);
|
filterCatLable:SetPoint("LEFT", "AtlasLootFilterButton_"..(count - 1), "LEFT",0,-25);
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ function AtlasLoot_DisplayHelp()
|
|||||||
WHITE..AL["While on the wishlist screen, just Alt+Left Click on an item to delete it."].."\n\n"..
|
WHITE..AL["While on the wishlist screen, just Alt+Left Click on an item to delete it."].."\n\n"..
|
||||||
ORANGE..AL["What else does the wishlist do?"].."\n"..
|
ORANGE..AL["What else does the wishlist do?"].."\n"..
|
||||||
WHITE..AL["If you Left Click any item on the wishlist, you can jump to the loot page the item comes from. Also, on a loot page any item already in your wishlist is marked with a yellow star."].."\n\n"..
|
WHITE..AL["If you Left Click any item on the wishlist, you can jump to the loot page the item comes from. Also, on a loot page any item already in your wishlist is marked with a yellow star."].."\n\n"..
|
||||||
|
ORANGE..AL["How to set of change a page filter:"].."\n"..
|
||||||
|
WHITE..AL["If you Right Click on the filter check box you will get a drop downmenu with a list of filters. Click the filter you want to use or click add filter set to add new custom filters."].."\n\n"..
|
||||||
ORANGE..AL["HELP!! I have broken the mod somehow!"].."\n"..
|
ORANGE..AL["HELP!! I have broken the mod somehow!"].."\n"..
|
||||||
WHITE..AL["Use the reset buttons available in the options menu, or type '/al reset' in your chat window."].."\n\n"..
|
WHITE..AL["Use the reset buttons available in the options menu, or type '/al reset' in your chat window."].."\n\n"..
|
||||||
GREY..AL["For further help, see our website and forums: "]..GREEN.."https://discord.gg/uYCE2X2FgA"
|
GREY..AL["For further help, see our website and forums: "]..GREEN.."https://discord.gg/uYCE2X2FgA"
|
||||||
|
|||||||
@@ -284,6 +284,9 @@ if AL then
|
|||||||
AL["Ranged weapons:"] = true;
|
AL["Ranged weapons:"] = true;
|
||||||
AL["Relics:"] = true;
|
AL["Relics:"] = true;
|
||||||
AL["Other:"] = true;
|
AL["Other:"] = true;
|
||||||
|
AL["How to set of change a page filter:"] = true;
|
||||||
|
AL["If you Right Click on the filter check box you will get a drop downmenu with a list of filters. Click the filter you want to use or click add filter set to add new custom filters."] = true;
|
||||||
|
|
||||||
|
|
||||||
-- Wishlist
|
-- Wishlist
|
||||||
AL["Close"] = true;
|
AL["Close"] = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user