Implement ExpansionLevel for min/max lvl in search

This commit is contained in:
merstrax
2022-03-13 05:45:32 -04:00
parent 051d143e30
commit b15151c614
+146 -427
View File
@@ -29,69 +29,38 @@ AdvSearchSubMenuText = "";
AdvSearchSetup = false;
AtlasLoot_FrameMenuList = {
["EquipSubMenu"] = {AtlasLoot_EquipSubMenu, "AtlasLootAdvancedSearch_EquipSub", "Select Option", "type", ""};
["EquipSubMenu"] = {AtlasLoot_EquipSubMenu, "AtlasLootAdvancedSearch_EquipSub", "Select Option", "type", ""}
}
AtlasLoot_AdvancedSearchMenus = {
["Difficulty"] = {
[1] = {
{"Normal", "difficulty", AtlasLoot_Difficulty.Normal},
},
[2] = {
{"Heroic", "difficulty", AtlasLoot_Difficulty.Heroic},
},
[3] = {
{"Mythic/Ascended", "difficulty", AtlasLoot_Difficulty.Mythic},
},
[1] = {{"Normal", "difficulty", AtlasLoot_Difficulty.Normal}},
[2] = {{"Heroic", "difficulty", AtlasLoot_Difficulty.Heroic}},
[3] = {{"Mythic/Ascended", "difficulty", AtlasLoot_Difficulty.Mythic}},
[4] = {
["Mythic+ 1-10"] = {
{"Mythic 1", "difficulty", AtlasLoot_Difficulty.MythicPlus[1]},
{"Mythic 2", "difficulty", AtlasLoot_Difficulty.MythicPlus[2]},
{"Mythic 3", "difficulty", AtlasLoot_Difficulty.MythicPlus[3]},
{"Mythic 4", "difficulty", AtlasLoot_Difficulty.MythicPlus[4]},
{"Mythic 5", "difficulty", AtlasLoot_Difficulty.MythicPlus[5]},
{"Mythic 6", "difficulty", AtlasLoot_Difficulty.MythicPlus[6]},
{"Mythic 7", "difficulty", AtlasLoot_Difficulty.MythicPlus[7]},
{"Mythic 8", "difficulty", AtlasLoot_Difficulty.MythicPlus[8]},
{"Mythic 9", "difficulty", AtlasLoot_Difficulty.MythicPlus[9]},
{"Mythic 10", "difficulty", AtlasLoot_Difficulty.MythicPlus[10]},
},
["Mythic+ 1-10"] = {{"Mythic 1", "difficulty", AtlasLoot_Difficulty.MythicPlus[1]}, {"Mythic 2", "difficulty", AtlasLoot_Difficulty.MythicPlus[2]},
{"Mythic 3", "difficulty", AtlasLoot_Difficulty.MythicPlus[3]}, {"Mythic 4", "difficulty", AtlasLoot_Difficulty.MythicPlus[4]},
{"Mythic 5", "difficulty", AtlasLoot_Difficulty.MythicPlus[5]}, {"Mythic 6", "difficulty", AtlasLoot_Difficulty.MythicPlus[6]},
{"Mythic 7", "difficulty", AtlasLoot_Difficulty.MythicPlus[7]}, {"Mythic 8", "difficulty", AtlasLoot_Difficulty.MythicPlus[8]},
{"Mythic 9", "difficulty", AtlasLoot_Difficulty.MythicPlus[9]}, {"Mythic 10", "difficulty", AtlasLoot_Difficulty.MythicPlus[10]}}
},
[5] = {
["Mythic+ 11-20"] = {
{"Mythic 11", "difficulty", AtlasLoot_Difficulty.MythicPlus[11]},
{"Mythic 12", "difficulty", AtlasLoot_Difficulty.MythicPlus[12]},
{"Mythic 13", "difficulty", AtlasLoot_Difficulty.MythicPlus[13]},
{"Mythic 14", "difficulty", AtlasLoot_Difficulty.MythicPlus[14]},
{"Mythic 15", "difficulty", AtlasLoot_Difficulty.MythicPlus[15]},
{"Mythic 16", "difficulty", AtlasLoot_Difficulty.MythicPlus[16]},
{"Mythic 17", "difficulty", AtlasLoot_Difficulty.MythicPlus[17]},
{"Mythic 18", "difficulty", AtlasLoot_Difficulty.MythicPlus[18]},
{"Mythic 19", "difficulty", AtlasLoot_Difficulty.MythicPlus[19]},
{"Mythic 20", "difficulty", AtlasLoot_Difficulty.MythicPlus[20]},
},
["Mythic+ 11-20"] = {{"Mythic 11", "difficulty", AtlasLoot_Difficulty.MythicPlus[11]}, {"Mythic 12", "difficulty", AtlasLoot_Difficulty.MythicPlus[12]},
{"Mythic 13", "difficulty", AtlasLoot_Difficulty.MythicPlus[13]}, {"Mythic 14", "difficulty", AtlasLoot_Difficulty.MythicPlus[14]},
{"Mythic 15", "difficulty", AtlasLoot_Difficulty.MythicPlus[15]}, {"Mythic 16", "difficulty", AtlasLoot_Difficulty.MythicPlus[16]},
{"Mythic 17", "difficulty", AtlasLoot_Difficulty.MythicPlus[17]}, {"Mythic 18", "difficulty", AtlasLoot_Difficulty.MythicPlus[18]},
{"Mythic 19", "difficulty", AtlasLoot_Difficulty.MythicPlus[19]}, {"Mythic 20", "difficulty", AtlasLoot_Difficulty.MythicPlus[20]}}
},
[6] = {
["Mythic+ 21-30"] = {
{"Mythic 21", "difficulty", AtlasLoot_Difficulty.MythicPlus[21]},
{"Mythic 22", "difficulty", AtlasLoot_Difficulty.MythicPlus[22]},
{"Mythic 23", "difficulty", AtlasLoot_Difficulty.MythicPlus[23]},
{"Mythic 24", "difficulty", AtlasLoot_Difficulty.MythicPlus[24]},
{"Mythic 25", "difficulty", AtlasLoot_Difficulty.MythicPlus[25]},
{"Mythic 26", "difficulty", AtlasLoot_Difficulty.MythicPlus[26]},
{"Mythic 27", "difficulty", AtlasLoot_Difficulty.MythicPlus[27]},
{"Mythic 28", "difficulty", AtlasLoot_Difficulty.MythicPlus[28]},
{"Mythic 29", "difficulty", AtlasLoot_Difficulty.MythicPlus[29]},
{"Mythic 30", "difficulty", AtlasLoot_Difficulty.MythicPlus[30]},
["Mythic+ 21-30"] = {{"Mythic 21", "difficulty", AtlasLoot_Difficulty.MythicPlus[21]}, {"Mythic 22", "difficulty", AtlasLoot_Difficulty.MythicPlus[22]},
{"Mythic 23", "difficulty", AtlasLoot_Difficulty.MythicPlus[23]}, {"Mythic 24", "difficulty", AtlasLoot_Difficulty.MythicPlus[24]},
{"Mythic 25", "difficulty", AtlasLoot_Difficulty.MythicPlus[25]}, {"Mythic 26", "difficulty", AtlasLoot_Difficulty.MythicPlus[26]},
{"Mythic 27", "difficulty", AtlasLoot_Difficulty.MythicPlus[27]}, {"Mythic 28", "difficulty", AtlasLoot_Difficulty.MythicPlus[28]},
{"Mythic 29", "difficulty", AtlasLoot_Difficulty.MythicPlus[29]}, {"Mythic 30", "difficulty", AtlasLoot_Difficulty.MythicPlus[30]}}
},
[7] = {{"Bloodforged", "difficulty", AtlasLoot_Difficulty.Bloodforged}},
[8] = {{RED .. "Reset", "difficulty", "reset"}}
},
[7] = {
{"Bloodforged", "difficulty", AtlasLoot_Difficulty.Bloodforged},
},
[8] = {
{RED.."Reset", "difficulty", "reset"},
},
};
["Quality"] = {
-- [1] = {
@@ -100,265 +69,115 @@ AtlasLoot_AdvancedSearchMenus = {
-- [2] = {
-- {AtlasLoot_FixText("=q1=").."Common", "quality", "common"},
-- },
[1] = {
{AtlasLoot_FixText("=q2=").."Uncommon", "quality", "uncommon"},
[1] = {{AtlasLoot_FixText("=q2=") .. "Uncommon", "quality", "uncommon"}},
[2] = {{AtlasLoot_FixText("=q3=") .. "Rare", "quality", "rare"}},
[3] = {{AtlasLoot_FixText("=q4=") .. "Epic", "quality", "epic"}},
[4] = {{AtlasLoot_FixText("=q5=") .. "Legendary", "quality", "legendary"}},
[5] = {{RED .. "Reset", "quality", "reset"}}
},
[2] = {
{AtlasLoot_FixText("=q3=").."Rare", "quality", "rare"},
},
[3] = {
{AtlasLoot_FixText("=q4=").."Epic", "quality", "epic"},
},
[4] = {
{AtlasLoot_FixText("=q5=").."Legendary", "quality", "legendary"},
},
[5] = {
{RED.."Reset", "quality", "reset"},
},
};
["Equip"] = {
[1] = {
{"Head", "equip", "head", "EquipSubMenu", "ArmorType"},
},
[2] = {
{"Shoulder", "equip", "shoulder", "EquipSubMenu", "ArmorType"},
},
[3] = {
{"Chest", "equip", "chest", "EquipSubMenu", "ArmorType"},
},
[4] = {
{"Wrist", "equip", "wrist", "EquipSubMenu", "ArmorType"},
},
[5] = {
{"Hands", "equip", "hand", "EquipSubMenu", "ArmorType"},
},
[6] = {
{"Waist", "equip", "waist", "EquipSubMenu", "ArmorType"},
},
[7] = {
{"Legs", "equip", "legs", "EquipSubMenu", "ArmorType"},
},
[8] = {
{"Feet", "equip", "feet", "EquipSubMenu", "ArmorType"},
},
[1] = {{"Head", "equip", "head", "EquipSubMenu", "ArmorType"}},
[2] = {{"Shoulder", "equip", "shoulder", "EquipSubMenu", "ArmorType"}},
[3] = {{"Chest", "equip", "chest", "EquipSubMenu", "ArmorType"}},
[4] = {{"Wrist", "equip", "wrist", "EquipSubMenu", "ArmorType"}},
[5] = {{"Hands", "equip", "hand", "EquipSubMenu", "ArmorType"}},
[6] = {{"Waist", "equip", "waist", "EquipSubMenu", "ArmorType"}},
[7] = {{"Legs", "equip", "legs", "EquipSubMenu", "ArmorType"}},
[8] = {{"Feet", "equip", "feet", "EquipSubMenu", "ArmorType"}},
[9] = {
["Accessories"] = {
{"Necklace", "equip", "neck", "EquipSubMenu", "Disable"},
{"Back", "equip", "cloak", "EquipSubMenu", "Disable"},
{"Ring", "equip", "finger", "EquipSubMenu", "Disable"},
{"Trinket", "equip", "trinket", "EquipSubMenu", "Disable"},
},
["Accessories"] = {{"Necklace", "equip", "neck", "EquipSubMenu", "Disable"}, {"Back", "equip", "cloak", "EquipSubMenu", "Disable"}, {"Ring", "equip", "finger", "EquipSubMenu", "Disable"},
{"Trinket", "equip", "trinket", "EquipSubMenu", "Disable"}}
},
[10] = {
["Weapons"] = {
{"One-Hand", "equip", "weapon", "EquipSubMenu", "WeaponType1H"},
{"Two-Hand", "equip", "2h", "EquipSubMenu", "WeaponType2H"},
{"Main Hand", "equip", "mainhand", "EquipSubMenu", "WeaponType1H"},
{"Off Hand", "equip", "offhand", "EquipSubMenu", "WeaponType1H"},
{"Ranged", "equip", "ranged", "EquipSubMenu", "WeaponTypeRanged"},
{"Relic", "equip", "relic", "EquipSubMenu", "RelicType"},
},
["Weapons"] = {{"One-Hand", "equip", "weapon", "EquipSubMenu", "WeaponType1H"}, {"Two-Hand", "equip", "2h", "EquipSubMenu", "WeaponType2H"},
{"Main Hand", "equip", "mainhand", "EquipSubMenu", "WeaponType1H"}, {"Off Hand", "equip", "offhand", "EquipSubMenu", "WeaponType1H"},
{"Ranged", "equip", "ranged", "EquipSubMenu", "WeaponTypeRanged"}, {"Relic", "equip", "relic", "EquipSubMenu", "RelicType"}}
},
[11] = {
["Off-Hand"] = {
{"Shield", "equip", "shield", "EquipSubMenu", "Disable"},
{"Held in Off-Hand", "equip", "holdable", "EquipSubMenu", "Disable"},
}
["Off-Hand"] = {{"Shield", "equip", "shield", "EquipSubMenu", "Disable"}, {"Held in Off-Hand", "equip", "holdable", "EquipSubMenu", "Disable"}}
},
[12] = {
{RED.."Reset", "equip", "reset", "EquipSubMenu", "Disable"},
[12] = {{RED .. "Reset", "equip", "reset", "EquipSubMenu", "Disable"}}
},
};
["ArmorType"] = {
[1] = {
{"Cloth", "type", "Cloth"},
[1] = {{"Cloth", "type", "Cloth"}},
[2] = {{"Leather", "type", "Leather"}},
[3] = {{"Mail", "type", "Mail"}},
[4] = {{"Plate", "type", "Plate"}},
[5] = {{RED .. "Reset", "type", "reset"}}
},
[2] = {
{"Leather", "type", "Leather"},
},
[3] = {
{"Mail", "type", "Mail"},
},
[4] = {
{"Plate", "type", "Plate"},
},
[5] = {
{RED.."Reset", "type", "reset"},
},
};
["RelicType"] = {
[1] = {
{"Idols", "type", "idol"},
[1] = {{"Idols", "type", "idol"}},
[2] = {{"Libram", "type", "libram"}},
[3] = {{"Totem", "type", "totem"}},
[4] = {{"Sigil", "type", "sigil"}},
[5] = {{RED .. "Reset", "type", "reset"}}
},
[2] = {
{"Libram", "type", "libram"},
},
[3] = {
{"Totem", "type", "totem"},
},
[4] = {
{"Sigil", "type", "sigil"},
},
[5] = {
{RED.."Reset", "type", "reset"},
},
};
["WeaponType1H"] = {
[1] = {
{"Axe", "type", "axe1h"}
[1] = {{"Axe", "type", "axe1h"}},
[2] = {{"Mace", "type", "mace1h"}},
[3] = {{"Sword", "type", "sword1h"}},
[4] = {{"Dagger", "type", "dagger"}},
[5] = {{"Fist Weapon", "type", "fist"}},
[6] = {{RED .. "Reset", "type", "reset"}}
},
[2] = {
{"Mace", "type", "mace1h"}
},
[3] = {
{"Sword", "type", "sword1h"}
},
[4] = {
{"Dagger", "type", "dagger"}
},
[5] = {
{"Fist Weapon", "type", "fist"}
},
[6] = {
{RED.."Reset", "type", "reset"},
},
};
["WeaponType2H"] = {
[1] = {
{"Axe", "type", "axe2h"}
},
[2] = {
{"Mace", "type", "mace2h"}
},
[3] = {
{"Sword", "type", "sword2h"}
},
[4] = {
{"Polearm", "type", "polearm"}
},
[5] = {
{"Staff", "type", "staff"}
},
[6] = {
{RED.."Reset", "type", "reset"},
},
[1] = {{"Axe", "type", "axe2h"}},
[2] = {{"Mace", "type", "mace2h"}},
[3] = {{"Sword", "type", "sword2h"}},
[4] = {{"Polearm", "type", "polearm"}},
[5] = {{"Staff", "type", "staff"}},
[6] = {{RED .. "Reset", "type", "reset"}}
};
},
["WeaponTypeRanged"] = {
[1] = {
{"Bow", "type", "bows"}
},
[2] = {
{"Gun", "type", "guns"}
},
[3] = {
{"Crossbow", "type", "crossbows"}
},
[4] = {
{"Wand", "type", "wand"}
},
[5] = {
{"Thrown", "type", "thrown"}
},
[6] = {
{RED.."Reset", "type", "reset"},
},
};
[1] = {{"Bow", "type", "bows"}},
[2] = {{"Gun", "type", "guns"}},
[3] = {{"Crossbow", "type", "crossbows"}},
[4] = {{"Wand", "type", "wand"}},
[5] = {{"Thrown", "type", "thrown"}},
[6] = {{RED .. "Reset", "type", "reset"}}
}
}
AtlasLoot_AdvancedSearchArguments = {
["Arguments"] = {
[1] = {
["Primary Stats"] = {
{"Stamina", "sta"},
{"Strength", "str"},
{"Agility", "agi"};
{"Intellect", "int"},
{"Spirit", "spi"},
}
};
["Primary Stats"] = {{"Stamina", "sta"}, {"Strength", "str"}, {"Agility", "agi"}, {"Intellect", "int"}, {"Spirit", "spi"}}
},
[2] = {
["Secondary Stats"] = {
{"Attack Power", "ap"};
{"Spell Power", "sp"};
{"Crit", "crit"};
{"Hit", "hit"};
{"Haste", "haste"};
{"Expertise", "exp"};
{"Armor Pen", "arp"};
{"Spell Pen", "spp"};
}
};
["Secondary Stats"] = {{"Attack Power", "ap"}, {"Spell Power", "sp"}, {"Crit", "crit"}, {"Hit", "hit"}, {"Haste", "haste"}, {"Expertise", "exp"}, {"Armor Pen", "arp"}, {"Spell Pen", "spp"}}
},
[3] = {
["Defensive Stats"] = {
{"Defense", "def"};
{"Dodge", "dodge"};
{"Parry", "parry"};
{"Block", "block"};
{"Block Value", "bv"};
{"Resilience", "res"};
}
};
["Defensive Stats"] = {{"Defense", "def"}, {"Dodge", "dodge"}, {"Parry", "parry"}, {"Block", "block"}, {"Block Value", "bv"}, {"Resilience", "res"}}
},
[4] = {
["Resistances"] = {
{"Armor", "armor"};
{"Holy Resist", "resholy"};
{"Fire Resist", "resfire"};
{"Nature Resist", "resnat"};
{"Frost Resist", "resfrost"};
{"Shadow Resist", "resshad"};
{"Arcane Resist", "resarc"};
}
};
["Resistances"] = {{"Armor", "armor"}, {"Holy Resist", "resholy"}, {"Fire Resist", "resfire"}, {"Nature Resist", "resnat"}, {"Frost Resist", "resfrost"}, {"Shadow Resist", "resshad"},
{"Arcane Resist", "resarc"}}
},
[5] = {
["Sockets"] = {
{"Any", "socket"};
{"Red Socket", "socketred"};
{"Blue Socket", "socketblue"};
{"Yellow Socket", "socketyellow"};
{"Meta Socket", "socketmeta"};
}
};
["Sockets"] = {{"Any", "socket"}, {"Red Socket", "socketred"}, {"Blue Socket", "socketblue"}, {"Yellow Socket", "socketyellow"}, {"Meta Socket", "socketmeta"}}
},
[6] = {
["Other"] = {
{"Required Level", "minlvl"};
{"Item Level", "ilvl"};
}
};
["Other"] = {{"Required Level", "minlvl"}, {"Item Level", "ilvl"}}
},
[7] = {
{RED.."Reset", "reset"}
}
};
[7] = {{RED .. "Reset", "reset"}}
},
["Operators"] = {
[1] = {
{"Equals", "=", true};
},
[2] = {
{"Greater Than", ">", true}
},
[3] = {
{"Greater Than Or Equal", ">=", true}
},
[4] = {
{"Less Than", "<", true}
},
[5] = {
{"Less Than Or Equal", "<=", true}
},
[6] = {
{"Not Equal", "<>", true}
},
[7] = {
{RED.."Reset", "reset", true}
}
[1] = {{"Equals", "=", true}},
[2] = {{"Greater Than", ">", true}},
[3] = {{"Greater Than Or Equal", ">=", true}},
[4] = {{"Less Than", "<", true}},
[5] = {{"Less Than Or Equal", "<=", true}},
[6] = {{"Not Equal", "<>", true}},
[7] = {{RED .. "Reset", "reset", true}}
}
}
@@ -366,7 +185,7 @@ AdvancedSearchOptions = {
["quality"] = "",
["equip"] = "",
["type"] = "",
["difficulty"] = "",
["difficulty"] = ""
}
function AtlasLoot_AdvancedSearchSetup()
@@ -432,7 +251,8 @@ function AtlasLoot_AdvancedSearchSetup()
txt:Hide();
AtlasLoot_AdvancedSearchArgumentRegister(AtlasLoot_ArgumentMenus[n], _G["AtlasLootAdvancedSearch_ArgumentContainer" .. tostring(n)], tostring(n), AtlasLoot_AdvancedSearchArguments["Arguments"]);
AtlasLoot_AdvancedSearchArgumentRegister(AtlasLoot_ArgumentSubMenus[n], _G["AtlasLootAdvancedSearch_ArgumentContainer"..tostring(n).."Sub"], tostring(n), AtlasLoot_AdvancedSearchArguments["Operators"]);
AtlasLoot_AdvancedSearchArgumentRegister(AtlasLoot_ArgumentSubMenus[n], _G["AtlasLootAdvancedSearch_ArgumentContainer" .. tostring(n) .. "Sub"], tostring(n),
AtlasLoot_AdvancedSearchArguments["Operators"]);
end
-- Reset Search options to defualt
@@ -449,7 +269,9 @@ function AtlasLoot_AdvancedSearchShow()
pFrame = {"TOPLEFT", "AtlasLootDefaultFrame_LootBackground", "TOPLEFT", "2", "-2"};
if not (AdvSearchSetup) then AtlasLoot_AdvancedSearchSetup() end
if not (AdvSearchSetup) then
AtlasLoot_AdvancedSearchSetup()
end
-- Hide all elements that could be in the AtlasTable
getglobal("AtlasLootItemsFrame_NEXT"):Hide();
@@ -530,7 +352,7 @@ function AtlasLoot_AdvancedSearchReset()
["quality"] = "",
["equip"] = "",
["type"] = "",
["difficulty"] = "",
["difficulty"] = ""
}
for i = 1, MAX_ARGUMENTS do
@@ -540,8 +362,10 @@ function AtlasLoot_AdvancedSearchReset()
RemoveArgumentContainer();
end
AtlasLootAdvancedSearch_LevelMin:SetText(UnitLevel("player"));
AtlasLootAdvancedSearch_LevelMax:SetText(UnitLevel("player"));
local expansionLevels = {60, 70, 80}
AtlasLootAdvancedSearch_LevelMin:SetText(expansionLevels[GetAccountExpansionLevel() + 1]);
AtlasLootAdvancedSearch_LevelMax:SetText(expansionLevels[GetAccountExpansionLevel() + 1]);
AtlasLootAdvancedSearch_ILevelMin:SetText("");
AtlasLootAdvancedSearch_ILevelMax:SetText("");
@@ -555,7 +379,10 @@ function AtlasLoot_AdvancedSearchReset()
end
function AddArgumentContainer()
if ACTIVE_ARGUMENT == MAX_ARGUMENTS then AdvSearchArgButtonToggle() return end
if ACTIVE_ARGUMENT == MAX_ARGUMENTS then
AdvSearchArgButtonToggle()
return
end
ACTIVE_ARGUMENT = ACTIVE_ARGUMENT + 1;
@@ -567,7 +394,10 @@ function AddArgumentContainer()
end
function RemoveArgumentContainer()
if ACTIVE_ARGUMENT == 0 then AdvSearchArgButtonToggle() return end
if ACTIVE_ARGUMENT == 0 then
AdvSearchArgButtonToggle()
return
end
AdvancedSearchOptions["arg" .. tostring(ACTIVE_ARGUMENT)] = "";
AdvancedSearchOptions["arg" .. tostring(ACTIVE_ARGUMENT) .. "op"] = "";
@@ -643,45 +473,24 @@ function AtlasLoot_AdvancedSearchMenuClick(Object, VariableToSet, VariableValue,
end
function AtlasLoot_AdvancedSearchRegister(DropDown, DropDownObject, MenuOption)
DropDown:Register(DropDownObject,
'point', function(parent)
DropDown:Register(DropDownObject, 'point', function(parent)
return "TOP", "BOTTOM"
end,
'children', function(level, value)
end, 'children', function(level, value)
if level == 1 then
if AtlasLoot_AdvancedSearchMenus then
for k, v in ipairs(MenuOption) do
-- If a link to show a submenu
if (type(v[1]) == "table") and (type(v[1][1]) == "string") then
if v[1][1] ~= "" then
DropDown:AddLine(
'text', v[1][1],
'textR', 1,
'textG', 0.82,
'textB', 0,
'func', AtlasLoot_AdvancedSearchMenuClick,
'arg1', {DropDownObject, DropDown, v[1][1]},
'arg2', v[1][2],
'arg3', v[1][3],
'arg4', v[1][4],
'arg5', v[1][5],
'notCheckable', true
)
DropDown:AddLine('text', v[1][1], 'textR', 1, 'textG', 0.82, 'textB', 0, 'func', AtlasLoot_AdvancedSearchMenuClick, 'arg1', {DropDownObject, DropDown, v[1][1]}, 'arg2',
v[1][2], 'arg3', v[1][3], 'arg4', v[1][4], 'arg5', v[1][5], '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
DropDown:AddLine(
'text', i,
'textR', 1,
'textG', 0.82,
'textB', 0,
'hasArrow', true,
'value', j,
'notCheckable', true
)
DropDown:AddLine('text', i, 'textR', 1, 'textG', 0.82, 'textB', 0, 'hasArrow', true, 'value', j, 'notCheckable', true)
lock = 1;
end
end
@@ -689,36 +498,18 @@ function AtlasLoot_AdvancedSearchRegister(DropDown, DropDownObject, MenuOption)
end
end
-- Close button
DropDown:AddLine(
'text', AL["Close Menu"],
'textR', 0,
'textG', 1,
'textB', 1,
'func', function() DropDown:Close() end,
'notCheckable', true
)
DropDown:AddLine('text', AL["Close Menu"], 'textR', 0, 'textG', 1, 'textB', 1, 'func', function()
DropDown:Close()
end, 'notCheckable', true)
elseif level == 2 then
if value then
for k, v in ipairs(value) do
DropDown:AddLine(
'text', v[1],
'textR', 1,
'textG', 0.82,
'textB', 0,
'func', AtlasLoot_AdvancedSearchMenuClick,
'arg1', {DropDownObject, DropDown, v[1]},
'arg2', v[2],
'arg3', v[3],
'arg4', v[4],
'arg5', v[5],
'notCheckable', true
)
DropDown:AddLine('text', v[1], 'textR', 1, 'textG', 0.82, 'textB', 0, 'func', AtlasLoot_AdvancedSearchMenuClick, 'arg1', {DropDownObject, DropDown, v[1]}, 'arg2', v[2], 'arg3',
v[3], 'arg4', v[4], 'arg5', v[5], 'notCheckable', true)
end
end
end
end,
'dontHook', true
)
end, 'dontHook', true)
end
function AtlasLoot_AdvancedSearchArgumentClick(Object, VariableToSet, VariableValue, IsOperator)
@@ -764,11 +555,9 @@ function AtlasLoot_AdvancedSearchArgumentClick(Object, VariableToSet, VariableVa
end
function AtlasLoot_AdvancedSearchArgumentRegister(DropDown, DropDownObject, ArgumentCount, ArgumentMenu)
DropDown:Register(DropDownObject,
'point', function(parent)
DropDown:Register(DropDownObject, 'point', function(parent)
return "TOP", "BOTTOM"
end,
'children', function(level, value)
end, 'children', function(level, value)
if level == 1 then
if AtlasLoot_AdvancedSearchArguments then
for k, v in ipairs(ArgumentMenu) do
@@ -776,46 +565,18 @@ function AtlasLoot_AdvancedSearchArgumentRegister(DropDown, DropDownObject, Argu
if (type(v[1]) == "table") and (type(v[1][1]) == "string") then
local checked = false;
if v[1][3] == "Submenu" then
DropDown:AddLine(
'text', v[1][1],
'textR', 1,
'textG', 0.82,
'textB', 0,
'func', AtlasLoot_AdvancedSearchArgumentClick,
'arg1', {DropDownObject, DropDown, v[1][1]},
'arg2', ArgumentCount,
'arg3', v[1][2],
'arg4', v[1][3],
'notCheckable', true
)
DropDown:AddLine('text', v[1][1], 'textR', 1, 'textG', 0.82, 'textB', 0, 'func', AtlasLoot_AdvancedSearchArgumentClick, 'arg1', {DropDownObject, DropDown, v[1][1]}, 'arg2',
ArgumentCount, 'arg3', v[1][2], 'arg4', v[1][3], 'notCheckable', true)
elseif v[1][1] ~= "" then
DropDown:AddLine(
'text', v[1][1],
'textR', 1,
'textG', 0.82,
'textB', 0,
'func', AtlasLoot_AdvancedSearchArgumentClick,
'arg1', {DropDownObject, DropDown, v[1][1]},
'arg2', ArgumentCount,
'arg3', v[1][2],
'arg4', v[1][3],
'notCheckable', true
)
DropDown:AddLine('text', v[1][1], 'textR', 1, 'textG', 0.82, 'textB', 0, 'func', AtlasLoot_AdvancedSearchArgumentClick, 'arg1', {DropDownObject, DropDown, v[1][1]}, 'arg2',
ArgumentCount, 'arg3', v[1][2], 'arg4', 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
DropDown:AddLine(
'text', i,
'textR', 1,
'textG', 0.82,
'textB', 0,
'hasArrow', true,
'value', j,
'notCheckable', true
)
DropDown:AddLine('text', i, 'textR', 1, 'textG', 0.82, 'textB', 0, 'hasArrow', true, 'value', j, 'notCheckable', true)
lock = 1;
end
end
@@ -823,14 +584,9 @@ function AtlasLoot_AdvancedSearchArgumentRegister(DropDown, DropDownObject, Argu
end
end
-- Close button
DropDown:AddLine(
'text', AL["Close Menu"],
'textR', 0,
'textG', 1,
'textB', 1,
'func', function() DropDown:Close() end,
'notCheckable', true
)
DropDown:AddLine('text', AL["Close Menu"], 'textR', 0, 'textG', 1, 'textB', 1, 'func', function()
DropDown:Close()
end, 'notCheckable', true)
elseif level == 2 then
if value then
for k, v in ipairs(value) do
@@ -839,65 +595,30 @@ function AtlasLoot_AdvancedSearchArgumentRegister(DropDown, DropDownObject, Argu
local checked = false;
-- If an entry to show a submenu
if v[4] == "Header" then
DropDown:AddLine(
'text', v[1],
'textR', 0.2,
'textG', 0.82,
'textB', 0.5,
'func', AtlasLoot_AdvancedSearchArgumentClick,
'arg1', {DropDownObject, DropDown, v[1]},
'arg2', ArgumentCount,
'arg3', v[2],
'arg4', v[3],
'notCheckable', true
)
DropDown:AddLine('text', v[1], 'textR', 0.2, 'textG', 0.82, 'textB', 0.5, 'func', AtlasLoot_AdvancedSearchArgumentClick, 'arg1', {DropDownObject, DropDown, v[1]},
'arg2', ArgumentCount, 'arg3', v[2], 'arg4', v[3], 'notCheckable', true)
elseif v[3] == "Submenu" then
DropDown:AddLine(
'text', v[1],
'textR', 1,
'textG', 0.82,
'textB', 0,
'func', AtlasLoot_AdvancedSearchArgumentClick,
'arg1', {DropDownObject, DropDown, v[1]},
'arg2', ArgumentCount,
'arg3', v[2],
'arg4', v[3],
'notCheckable', true
)
DropDown:AddLine('text', v[1], 'textR', 1, 'textG', 0.82, 'textB', 0, 'func', AtlasLoot_AdvancedSearchArgumentClick, 'arg1', {DropDownObject, DropDown, v[1]}, 'arg2',
ArgumentCount, 'arg3', v[2], 'arg4', v[3], 'notCheckable', true)
else
DropDown:AddLine(
'text', v[1],
'textR', 1,
'textG', 0.82,
'textB', 0,
'func', AtlasLoot_AdvancedSearchArgumentClick,
'arg1', {DropDownObject, DropDown, v[1]},
'arg2', ArgumentCount,
'arg3', v[2],
'arg4', v[3],
'notCheckable', true
)
DropDown:AddLine('text', v[1], 'textR', 1, 'textG', 0.82, 'textB', 0, 'func', AtlasLoot_AdvancedSearchArgumentClick, 'arg1', {DropDownObject, DropDown, v[1]}, 'arg2',
ArgumentCount, 'arg3', v[2], 'arg4', v[3], 'notCheckable', true)
end
end
end
end
end
DropDown:AddLine(
'text', AL["Close Menu"],
'textR', 0,
'textG', 1,
'textB', 1,
'func', function() DropDown:Close() end,
'notCheckable', true
)
DropDown:AddLine('text', AL["Close Menu"], 'textR', 0, 'textG', 1, 'textB', 1, 'func', function()
DropDown:Close()
end, 'notCheckable', true)
end
end,
'dontHook', true
)
end, 'dontHook', true)
end
function AtlasLoot:AdvancedSearch(Text)
if not Text then return end
if not Text then
return
end
Text = strtrim(Text);
local advSearchString = Text or "";
@@ -973,7 +694,5 @@ function AtlasLoot:AdvancedSearch(Text)
end
end
AtlasLoot:Search(string.lower(advSearchString));
end