diff --git a/AtlasLoot/AtlasLoot.toc b/AtlasLoot/AtlasLoot.toc index c2ce8b1..eb5a1d5 100644 --- a/AtlasLoot/AtlasLoot.toc +++ b/AtlasLoot/AtlasLoot.toc @@ -2,9 +2,10 @@ ## Title: AtlasLoot Ascension Edition ## Notes: Shows the possible loot from the bosses ## Author: v7 Rebuid Done by: Anch, Rvng -## Version: v7.3.9 +## Version: v7.3.15 ## X-eMail: ## X-Credits: Skray, Szyler and others. +## Dependencies: AtlasLoot_Cache ## X-Category: Map ## X-License: GPL v2 ## X-Website: https://discord.gg/uYCE2X2FgA @@ -26,7 +27,7 @@ ## Notes-ruRU: Отображает весю возможную добычу с боссов ## SavedVariables: AtlasLootOptions, AtlasLootDB, AtlasLootWishList, AtlasLootFilterDB ## SavedVariablesPerCharacter: AtlasLootCharDB -## OptionalDeps: LootLink, ItemSync, DewdropLib, FuBarPlugin-3.0, FuBar, Ace3, LibBabble-Boss-3.0, LibBabble-Faction-3.0, LibBabble-Inventory-3.0, LibBabble-Zone-3.0 +## OptionalDeps: LootLink, ItemSync embeds.xml diff --git a/AtlasLoot/Core/AtlasDifficulty.lua b/AtlasLoot/Core/AtlasDifficulty.lua index 5b0ca2d..e8e332f 100644 --- a/AtlasLoot/Core/AtlasDifficulty.lua +++ b/AtlasLoot/Core/AtlasDifficulty.lua @@ -1,19 +1,22 @@ -- table of difficulties and there itemID references - AtlasLoot.Difficultys["Default"] = {}; + AtlasLoot.Difficulties["Default"] = {} - AtlasLoot.Difficultys["ClassicDungeon"] = { + AtlasLoot.Difficulties["ClassicDungeon"] = { {"Normal", 2}, {"Heroic", 3}, {"Mythic", 4}, - }; + Max = 4 + } - AtlasLoot.Difficultys["PVP"] = { + AtlasLoot.Difficulties["PVP"] = { {"Normal", 2}, {"Bloodforged", 1}, - }; + {"Heroic Bloodforged", 100}, + Max = 2 + } - AtlasLoot.Difficultys["ClassicDungeonExt"] = { + AtlasLoot.Difficulties["ClassicDungeonExt"] = { {"Bloodforged", 1}, {"Heroic Bloodforged", 100}, {"Normal", 2}, @@ -27,18 +30,20 @@ {"Mythic 26", 30 }, {"Mythic 27", 31 }, {"Mythic 28", 32 }, {"Mythic 29", 33 }, {"Mythic 30", 34 }, {"Mythic 31", 35 }, {"Mythic 32", 36 }, {"Mythic 33", 37 }, {"Mythic 34", 38 }, {"Mythic 35", 39 }, {"Mythic 36", 40 }, {"Mythic 37", 41 }, {"Mythic 38", 42 }, {"Mythic 39", 43 }, {"Mythic 40", 44 }, - }; + Max = 44 + } - AtlasLoot.Difficultys["ClassicRaid"] = { - {"Normal", 2}, - {"Heroic", 3}, - {"Mythic", 5}, - {"Ascended", 4}, - {"Bloodforged", 1}, - {"Heroic Bloodforged", 100}, - }; + AtlasLoot.Difficulties["ClassicRaid"] = { + {"Normal Raid", 2}, + {"Heroic Raid", 3}, + {"Mythic Raid", 4}, + {"Ascended Raid", 5}, + {"Bloodforged", 1}, + {"Heroic Bloodforged", 100}, + Max = 5 + } - AtlasLoot.Difficultys["BCDungeon"] = { + AtlasLoot.Difficulties["BCDungeon"] = { {"Bloodforged", 1}, {"Heroic Bloodforged", 100}, {"Normal/Heroic", 2}, @@ -51,47 +56,63 @@ {"Mythic 26", 30 }, {"Mythic 27", 31 }, {"Mythic 28", 32 }, {"Mythic 29", 33 }, {"Mythic 30", 34 }, {"Mythic 31", 35 }, {"Mythic 32", 36 }, {"Mythic 33", 37 }, {"Mythic 34", 38 }, {"Mythic 35", 39 }, {"Mythic 36", 40 }, {"Mythic 37", 41 }, {"Mythic 38", 42 }, {"Mythic 39", 43 }, {"Mythic 40", 44 }, - }; + Max = 44 + } - AtlasLoot.Difficultys["BCRaid"] = { - {"Normal", 2}, - {"Heroic", 3}, - {"Mythic", 5}, - {"Ascended", 4}, + AtlasLoot.Difficulties["BCRaid"] = { + {"Normal Raid", 2}, + {"Heroic Raid", 3}, + {"Mythic Raid", 4}, + {"Ascended Raid", 5}, {"Bloodforged", 1}, {"Heroic Bloodforged", 100}, - }; + Max = 5 + } - AtlasLoot.Difficultys["WrathDungeon"] = { + AtlasLoot.Difficulties["WrathDungeon"] = { + {"Bloodforged", 1}, + {"Heroic Bloodforged", 100}, {"Normal/Heroic", 2}, {"Mythic", 4}, - {"Bloodforged", 1}, - {"Heroic Bloodforged", 100}, {"Mythic 1", 5 }, {"Mythic 2", 6 }, {"Mythic 3", 7 }, {"Mythic 4", 8 }, {"Mythic 5", 9 }, {"Mythic 6", 10 }, {"Mythic 7", 11 }, {"Mythic 8", 12 }, {"Mythic 9", 13 }, {"Mythic 10", 14 }, {"Mythic 11", 15 }, {"Mythic 12", 16 }, {"Mythic 13", 17 }, {"Mythic 14", 18 }, {"Mythic 15", 19 }, {"Mythic 16", 20 }, {"Mythic 17", 21 }, {"Mythic 18", 22 }, {"Mythic 19", 23 }, {"Mythic 20", 24 }, - }; + Max = 24 + } - AtlasLoot.Difficultys["WrathRaid"] = { - {"Normal", 2}, - {"Heroic", 3}, - {"Mythic", 4}, - {"Ascended", 5}, + AtlasLoot.Difficulties["WrathRaid"] = { + {"Normal Raid", 2}, + {"Heroic Raid", 3}, + {"Mythic Raid", 4}, + {"Ascended Raid", 5}, {"Bloodforged", 1}, {"Heroic Bloodforged", 100}, - }; + Max = 5 + } - AtlasLoot.Difficultys["Crafting"] = { + AtlasLoot.Difficulties["ClassicCrafting"] = { {"Normal", 2 }, - }; + Max = 2 + } - AtlasLoot.Difficultys["Search"] = { + AtlasLoot.Difficulties["BCCrafting"] = { + {"Normal", 2 }, + Max = 2 + } + + AtlasLoot.Difficulties["WrathCrafting"] = { + {"Normal", 2 }, + Max = 2 + } + + AtlasLoot.Difficulties["Search"] = { {"Bloodforged", 1}, + {"Heroic Bloodforged", 100}, {"Normal", 2}, {"Heroic", 3}, {"Mythic", 4}, - {"Mythic 1/Ascended", 5 }, {"Mythic 2", 6 }, {"Mythic 3", 7 }, {"Mythic 4", 8 }, {"Mythic 5", 9 }, + {"Mythic 1/Ascended Raid", 5 }, {"Mythic 2", 6 }, {"Mythic 3", 7 }, {"Mythic 4", 8 }, {"Mythic 5", 9 }, {"Mythic 6", 10 }, {"Mythic 7", 11 }, {"Mythic 8", 12 }, {"Mythic 9", 13 }, {"Mythic 10", 14 }, {"Mythic 11", 15 }, {"Mythic 12", 16 }, {"Mythic 13", 17 }, {"Mythic 14", 18 }, {"Mythic 15", 19 }, {"Mythic 16", 20 }, {"Mythic 17", 21 }, {"Mythic 18", 22 }, {"Mythic 19", 23 }, {"Mythic 20", 24 }, @@ -99,24 +120,24 @@ {"Mythic 26", 30 }, {"Mythic 27", 31 }, {"Mythic 28", 32 }, {"Mythic 29", 33 }, {"Mythic 30", 34 }, {"Mythic 31", 35 }, {"Mythic 32", 36 }, {"Mythic 33", 37 }, {"Mythic 34", 38 }, {"Mythic 35", 39 }, {"Mythic 36", 40 }, {"Mythic 37", 41 }, {"Mythic 38", 42 }, {"Mythic 39", 43 }, {"Mythic 40", 44 }, - }; + } --Enums for comparisons in code - AtlasLoot.Difficultys.Bloodforged = 1; - AtlasLoot.Difficultys.Normal = 2; - AtlasLoot.Difficultys.Heroic = 3; - AtlasLoot.Difficultys.Mythic = 4; - AtlasLoot.Difficultys.Ascended = 4; - AtlasLoot.Difficultys["Heroic Bloodforged"] = 100; + AtlasLoot.Difficulties.Bloodforged = 1 + AtlasLoot.Difficulties["Heroic Bloodforged"] = 2 + AtlasLoot.Difficulties.Normal = 3 + AtlasLoot.Difficulties.Heroic = 4 + AtlasLoot.Difficulties.Mythic = 5 + AtlasLoot.Difficulties.Ascended = 5 - AtlasLoot.Difficultys.MythicPlus = { + AtlasLoot.Difficulties.MythicPlus = { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 - }; --Usage AtlasLoot_Difficulty.MythicPlus[1-40]; + } --Usage AtlasLoot_Difficulty.MythicPlus[1-40] - AtlasLoot.Difficultys.DIF_SEARCH = 16; - AtlasLoot.Difficultys.DUPLICATE = 17; - AtlasLoot.Difficultys.MIN_DIF = 18; - AtlasLoot.Difficultys.MAX_DIF = 19; \ No newline at end of file + AtlasLoot.Difficulties.DIF_SEARCH = 16 + AtlasLoot.Difficulties.DUPLICATE = 17 + AtlasLoot.Difficulties.MIN_DIF = 18 + AtlasLoot.Difficulties.MAX_DIF = 19 \ No newline at end of file diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index 3d30293..bf39e0d 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -16,8 +16,6 @@ AtlasLoot:SetFavorites(number) AtlasLoot:AddTooltip(frameb, tooltiptext) ]] -AtlasLoot = LibStub("AceAddon-3.0"):NewAddon("AtlasLoot", "AceEvent-3.0", "AceTimer-3.0") - local AL = LibStub("AceLocale-3.0"):GetLocale("AtlasLoot") local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0") @@ -37,7 +35,7 @@ AtlasLoot.filterEnable = false AtlasLoot.CurrentType = "Default" AtlasLoot.type = {} AtlasLoot.backEnabled = false -AtlasLoot.Difficultys = {} +AtlasLoot.Difficulties = {} -- Colours stored for code readability local GREY = "|cff999999" @@ -136,6 +134,25 @@ StaticPopupDialogs["ATLASLOOT_SETUP"] = { hideOnEscape = 1 } +--[[ +AtlasLoot:OnInitialize() +Performs inital setup of the mod and registers it for further setup when +the required resources are in place +]] +function AtlasLoot:OnInitialize() + --Enable the use of /al or /atlasloot to open the loot browser + SLASH_ATLASLOOT1 = "/atlasloot" + SLASH_ATLASLOOT2 = "/al" + SlashCmdList["ATLASLOOT"] = function(msg) + self:SlashCommand(msg) + end + + --Sets the default loot tables for the current expansion enabled on the server. + local xpaclist = {"CLASSIC", "TBC", "WRATH"} + self.Expac = xpaclist[GetAccountExpansionLevel()+1] +end + + --[[ AtlasLoot:OnEnable(): Invoked by the VARIABLES_LOADED event. Now that we are sure all the assets @@ -145,6 +162,7 @@ function AtlasLoot:OnEnable() self.db = LibStub("AceDB-3.0"):New("AtlasLootDB") self.db:RegisterDefaults(AtlasLootDBDefaults) setupSettingsDB() + AtlasLootItemCache = AtlasLootItemCache or {} if AtlasLoot_Data then AtlasLoot_Data["EmptyTable"] = { Name = AL["Select a Loot Table..."], @@ -205,7 +223,7 @@ function AtlasLoot:OnEnable() else AtlasLootItemsFrame_Wishlist_UnLock:Enable() end - self:LoadItemIDsDatabase() + self:LoadMissingIDs() self:LoadTradeskillRecipes() self:PopulateProfessions() self:CreateVanityCollection() @@ -246,157 +264,24 @@ msg - takes the argument for the /atlasloot command so that the appropriate acti If someone types /atlasloot, bring up the options box ]] function AtlasLoot:SlashCommand(msg) - if msg == AL["reset"] then + msg = msg or "" + + local cmd, arg1, arg2 = string.split(" ", msg, 3) + cmd = string.lower(cmd or "") + + if cmd == AL["reset"] then self:Reset("frames") - elseif msg == AL["options"] then + elseif cmd == AL["options"] then self:OptionsToggle() + elseif cmd == "updatecache" then + self:UpdateItemIDsDatabase(tonumber(arg1), tonumber(arg2)) + elseif cmd == "clearcache" then + wipe(AtlasLootItemCache) else AtlasLootDefaultFrame:Show() end end ---[[ -AtlasLoot:OnInitialize() -Performs inital setup of the mod and registers it for further setup when -the required resources are in place -]] -function AtlasLoot:OnInitialize() - --Enable the use of /al or /atlasloot to open the loot browser - SLASH_ATLASLOOT1 = "/atlasloot" - SLASH_ATLASLOOT2 = "/al" - SlashCmdList["ATLASLOOT"] = function(msg) - self:SlashCommand(msg) - end - - --Sets the default loot tables for the current expansion enabled on the server. - local xpaclist = {"CLASSIC", "TBC", "WRATH"} - self.Expac = xpaclist[GetAccountExpansionLevel()+1] -end - -function AtlasLoot:RecipeSource(spellID) - if not spellID then return end - local cData = AtlasLoot_CraftingData - local data = {} - -- extra information on where to find the recipe - -- trainer learnt - local trainer = cData["Trainer"][spellID] - if trainer then tinsert(data, {AL["Source"]..": "..WHITE..trainer}) end - -- aquire type - local aquireType = cData["AquireType"][spellID] - if aquireType then - tinsert(data, {AL["Source"]..": "..WHITE..cData[aquireType[1]][aquireType[2]][1]}) - end - -- vendor recipe - local vendor = cData["Vendor"][spellID] - if vendor then - tinsert(data, {AL["Source"]..": "..WHITE..AL["Vendor"]}) - for _,v in pairs(vendor) do - local vendor = AtlasLoot_CraftingData["VendorList"][v] - tinsert(data, {vendor[1], vendor[2], cords = {vendor[3], vendor[4]}, fac = vendor[5]}) - end - end - -- vendor recipe - local recipeRepVendor = cData["RecipeRepVendor"][spellID] - if recipeRepVendor then - tinsert(data, {AL["Source"]..": "..WHITE..AL["Vendor"]}) - local vendor = AtlasLoot_CraftingData["VendorList"][spellID] - for i = 3, 6 do - if vendor and vendor[i] then - tinsert(data, {vendor[1], vendor[2], fac = vendor[i]}) - end - end - end - --limited vendor recipes - local limitedVendor = cData["LimitedVendor"][spellID] - if limitedVendor then - tinsert(data, {AL["Source"]..": "..WHITE..AL["Limited Stock"]}) - local sort = {} - local limited = false - for i,v in pairs(limitedVendor) do - if limited then - tinsert(sort[i-1],v) - limited = false - else - sort[i] = {v} - limited = true - end - end - for _,v in pairs(sort) do - local vendor = AtlasLoot_CraftingData["VendorList"][v[1]] - tinsert(data, {vendor[1], vendor[2], cords = {vendor[3], vendor[4]}, fac = vendor[5], limited = v[2]}) - end - end - --mob drop - local mobDrop = cData["MobDrop"][spellID] - if mobDrop then - tinsert(data, {AL["Source"]..": "..WHITE..AL["Mob Drop"]}) - for _,v in pairs(mobDrop) do - local mob = AtlasLoot_CraftingData["MobList"][v] - local cords = nil - if mob[3] ~= 0 and mob[4] ~= 0 then - cords = {mob[3], mob[4]} - end - tinsert(data, {mob[1], WHITE..mob[2], cords}) - end - end - -- World Drop - local worldDrop = cData["WorldDrop"][spellID] - if worldDrop then - tinsert(data, {AL["Source"]..": "..WHITE..AL["World Drop"]}) - local text = worldDrop[1] - if worldDrop[2] then - text = text.." / "..worldDrop[2] - end - tinsert(data, {text}) - end - --quest - local questDrop = cData["QuestDrop"][spellID] - if questDrop then - tinsert(data, {AL["Source"]..": "..WHITE..AL["Quest"]}) - for _,v in pairs(questDrop) do - local quest = AtlasLoot_CraftingData["QuestList"][v] - tinsert(data, {quest[1], quest[2], cords = {quest[3], quest[4]}, fac = quest[5]}) - end - end - --rep vendor - local repVendor = cData["RepVendor"][spellID] - if repVendor then - tinsert(data, {AL["Source"]..": "..WHITE..AL["Reputation Vendor"]}) - local line1, line2 - local list = {} - for i,v in pairs(repVendor) do - if type(v) == "table" then - for i,v in pairs(v) do - if i == 1 then - line1 = AL["Faction"]..": "..WHITE..v - elseif i == 2 then - line2 = AL["Required Reputation"]..": "..WHITE..v - else - tinsert(list,AtlasLoot_CraftingData["VendorList"][v]) - end - end - else - if i == 1 then - line1 = AL["Faction"]..": "..WHITE..v - elseif i == 2 then - line2 = AL["Required Reputation"]..": "..WHITE..v - else - tinsert(list,AtlasLoot_CraftingData["VendorList"][v]) - end - end - end - tinsert(data, {line1, line2}) - for _,v in pairs(list) do - local cords - if v[3] ~= 0 and v[4] ~= 0 then - cords = {v[3], v[4]} - end - tinsert(data, {v[1], WHITE..v[2], cords, fac = v[5]}) - end - end - return data -end - --Creates tables for raid tokens from the collections tables function AtlasLoot:CreateToken(dataID) local itemType, slotType, itemName, itemType2 @@ -427,7 +312,7 @@ function AtlasLoot:CreateToken(dataID) end local count = #AtlasLoot_Data[dataID][1] * #AtlasLoot_Data[dataID] local function addItem(itemID, desc) - if itemType == select(9, GetItemInfo(itemID)) or itemType2 == select(9, GetItemInfo(itemID)) then + if itemType == select(9, AtlasLoot:GetItemInfo(itemID)) or itemType2 == select(9, AtlasLoot:GetItemInfo(itemID)) then table.insert(AtlasLoot_TokenData[orgID][1], {itemID = itemID, desc = desc}) end if count == 1 then @@ -439,14 +324,7 @@ function AtlasLoot:CreateToken(dataID) for _, t in ipairs(AtlasLoot_Data[dataID]) do for _, v in ipairs(t) do if type(v) == "table" then - local item = Item:CreateFromID(v.itemID) - if v.itemID and not item:GetInfo() then - self:ItemsLoading(1) - item:ContinueOnLoad(function() - self:ItemsLoading(-1) - addItem(v.itemID, t.Name) - end) - else + if v.itemID then addItem(v.itemID, t.Name) end end @@ -468,7 +346,7 @@ function AtlasLoot:CreateOnDemandLootTable(typeL) INVTYPE_LEGS = BabbleInventory["Legs"], INVTYPE_FEET = BabbleInventory["Feet"], INVTYPE_FINGER = BabbleInventory["Ring"], INVTYPE_CLOAK = BabbleInventory["Back"], INVTYPE_NECK = BabbleInventory["Neck"], INVTYPE_WEAPONOFFHAND = BabbleInventory["Off Hand"], INVTYPE_WEAPONMAINHAND = "Mainhand", INVTYPE_TRINKET = "Trinket", INVTYPE_HOLDABLE = "Caster Offhand"} - + local function correctText(text) text = gsub(text, "Cloth Armor %- Back", "Back") text = gsub(text, "Miscellaneous Armor %- " , "") @@ -476,7 +354,7 @@ function AtlasLoot:CreateOnDemandLootTable(typeL) text = gsub(text, "Weapon %- " , WHITE.."%- ") return text end - + -- Combind robes with chest local function getEquip(equipLoc) if equipLoc == "INVTYPE_ROBE" then @@ -527,22 +405,11 @@ function AtlasLoot:CreateOnDemandLootTable(typeL) -- Load items to cache and check they are either an armor or weapon local function processItem(itemData) if not itemData then return end - local item = Item:CreateFromID(itemData.itemID) if itemData.itemID then - if not item:GetInfo() then - item:ContinueOnLoad(function() - self:ItemsLoading(-1) - local armorType, armorSubType, _, equipLoc = select(6,GetItemInfo(itemData.itemID)) - if (armorType == "Armor" or armorType == "Weapon") then - sortItem(itemData, armorSubType, equipLoc, armorType) - end - end) - else - self:ItemsLoading(-1) - local armorType, armorSubType, _, equipLoc = select(6,GetItemInfo(itemData.itemID)) - if (armorType == "Armor" or armorType == "Weapon") then - sortItem(itemData, armorSubType, equipLoc, armorType) - end + self:ItemsLoading(-1) + local armorType, armorSubType, _, equipLoc = select(6,AtlasLoot:GetItemInfo(itemData.itemID)) + if (armorType == "Armor" or armorType == "Weapon") then + sortItem(itemData, armorSubType, equipLoc, armorType) end end end @@ -550,12 +417,13 @@ function AtlasLoot:CreateOnDemandLootTable(typeL) --Fills table with items local itemList = {} local checkList = {} - for _, data in pairs(AtlasLoot_Data) do + for dataID, data in pairs(AtlasLoot_Data) do if data.Type == typeL then - for _, t in ipairs(data) do + for tableNum, t in ipairs(data) do for _, itemData in pairs(t) do if type(itemData) == "table" and itemData.itemID and not checkList[itemData.itemID] then itemData.dropLoc = {data.DisplayName or data.Name, t.Name} + itemData.lootTable = {{dataID, "AtlasLoot_Data", tableNum}, "Source"} checkList[itemData.itemID] = true tinsert(itemList, {itemData}) end @@ -640,7 +508,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) local difType = false -- Checks to see if type is the same - if self.CurrentType and self.CurrentType ~= dataSource[dataID].Type then + if self.CurrentType and dataSource[dataID].Type and self.CurrentType ~= dataSource[dataID].Type then ItemindexID = self.type[dataSource[dataID].Type] or 2 difType = true end @@ -652,7 +520,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) -- Set current type self.CurrentType = dataSource[dataID].Type or "Default" - -- Loads the difficultys into the scrollFrame + -- Loads the Difficulties into the scrollFrame if dataSource[dataID].ListType then self:ScrollFrameUpdate(nil,dataSource[dataID].ListType) else @@ -662,7 +530,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) -- Finds the tablenumber to set where the difficulty slider should be. local typeNumber = 1 local function findTypeNumber() - for i,v in ipairs(self.Difficultys[dataSource[dataID].Type]) do + for i,v in ipairs(self.Difficulties[dataSource[dataID].Type]) do if v[2] == ItemindexID then typeNumber = i return i @@ -675,9 +543,9 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) end -- Moves the difficulty scrollslider if the difficulty has changed - if dataSource[dataID].Type and difType and #self.Difficultys[dataSource[dataID].Type] > 5 and findTypeNumber() > 5 then + if dataSource[dataID].Type and difType and #self.Difficulties[dataSource[dataID].Type] > 5 and findTypeNumber() > 5 then local min, max = AtlasLootDefaultFrameScrollScrollBar:GetMinMaxValues() - AtlasLootDefaultFrameScrollScrollBar:SetValue(typeNumber * (max / #self.Difficultys[dataSource[dataID].Type])) + AtlasLootDefaultFrameScrollScrollBar:SetValue(typeNumber * (max / #self.Difficulties[dataSource[dataID].Type])) end -- Moves the difficulty scrollslider if wishlist @@ -731,24 +599,23 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) if item and item.itemID then itemID = item.itemID isValid = true - - if(item[self.Difficultys.MIN_DIF]) then - if item[self.Difficultys.MIN_DIF] > itemDif then + local itemType = item.Type or dataSource[dataID].Type + if(item[self.Difficulties.MIN_DIF]) then + if item[self.Difficulties.MIN_DIF] > itemDif then toShow = false end - itemID = self:FindId(item.itemID, min(self:getMaxDifficulty(item.Type or dataSource[dataID].Type), itemDif), item.Type or dataSource[dataID].Type, dataSource[dataID].Type ) or item.itemID + itemID = self:FindId(item.itemID, min(self:getMaxDifficulty(itemType), itemDif), itemType) or item.itemID end if toShow then --Sets ItemindexID to normal(2) if it is nil for min/max difficulties. - if not tonumber(itemDif) then itemDif = self.Difficultys.Normal end - + if not tonumber(itemDif) then itemDif = self.Difficulties.Normal end --Checks if an item has a Maximum difficulty, this is to correct some items that have an entry for higher difficulties then they really do - if item[self.Difficultys.MAX_DIF] then - if tonumber(item[self.Difficultys.MAX_DIF]) < itemDif then itemDif = item[self.Difficultys.MAX_DIF] end + if itemDif ~= 100 and self.Difficulties[itemType] and self.Difficulties[itemType].Max and self.Difficulties[itemType].Max < itemDif then + itemDif = self.Difficulties[itemType].Max end --If something was found in itemID database show that if not show default table item - itemID = self:FindId(item.itemID, itemDif, item.Type or dataSource[dataID].Type, dataSource[dataID].Type) or item.itemID + itemID = self:FindId(item.itemID, itemDif, itemType) or item.itemID end elseif item and (item.spellID or item.icon) or item and itemID then isValid = true @@ -762,9 +629,13 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) end -- Setup the button for the to be displayed item/spell - local function setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup, item) + local function setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup) local text, extra - local itemName, itemQuality, itemSubType, itemEquipLoc, itemColor + local itemName, itemQuality, itemSubType, itemEquipLoc, itemIcon + if itemID then + itemName, _, itemQuality, _, _, _, itemSubType, _, itemEquipLoc, itemIcon = AtlasLoot:GetItemInfo(itemID) + end + local spellName, spellIcon --Use shortcuts for easier reference to parts of the item button local itemButton = _G["AtlasLootItem_"..i] @@ -783,7 +654,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) text = self:FixText(text) end if itemID then - text = select(4,GetItemQualityColor(item:GetQuality()))..text + text = select(4,GetItemQualityColor(itemQuality))..text end --Adds button highlights if you know a recipe or have a char that knows one if CA_IsSpellKnown(spellID) then @@ -800,21 +671,13 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) end elseif itemID then - itemName, _, itemQuality, _, _, _, itemSubType, _, itemEquipLoc, _ = GetItemInfo(itemID) - itemName = itemName or item:GetName() - itemSubType = itemSubType or AtlasLoot_ExtraData["ArmorConversion"][item:GetSubClassID()] - if not itemName then - itemID = orgItemID - itemName, _, itemQuality, _, _, _, itemSubType, _, itemEquipLoc, _ = GetItemInfo(itemID) - end --If the client has the name of the item in cache, use that instead. if dataSource[dataID][tablenum][i].name then --If it has a manuel entry use that text = dataSource[dataID][tablenum][i].name text = self:FixText(text) elseif itemName then - itemQuality = itemQuality or item:GetQuality() - text = itemQuality and select(4,GetItemQualityColor(itemQuality))..itemName or itemName + text = select(4,GetItemQualityColor(itemQuality))..itemName else text = "" end @@ -856,9 +719,11 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) local lvls = AtlasLoot_CraftingData["CraftingLevels"][spellID] extra = LIMEGREEN .. "L-Click:|r "..WHITE..dataSource[dataID].Name.." ( "..ORANGE..lvls[1].."|r "..YELLOW..lvls[2].."|r "..GREEN..lvls[3].."|r "..GREY..lvls[4]..WHITE.." )" elseif dataSource[dataID][tablenum][i].lootTable and dataSource[dataID][tablenum][i].lootTable[2] == "Token" then - extra = "#setToken#" - elseif itemEquipLoc and itemSubType then + extra = AL["Set Token (Click)"] + elseif itemEquipLoc and itemEquipLoc ~= "" and itemSubType then extra = "=ds="..itemEquipLoc..", "..itemSubType + elseif itemSubType then + extra = "=ds="..itemSubType else extra = "" end @@ -894,12 +759,9 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) elseif dataSource[dataID][tablenum][i].icon then iconFrame:SetTexture("Interface\\Icons\\"..dataSource[dataID][tablenum][i].icon) elseif dataSource[dataID][tablenum][i].itemID then - iconFrame:SetTexture(GetItemIcon(dataSource[dataID][tablenum][i].itemID)) + iconFrame:SetTexture(itemIcon) elseif spellIcon then iconFrame:SetTexture(spellIcon) - elseif dataSource[dataID][tablenum][i].itemID then - local icon = item:GetIcon() - iconFrame:SetTexture(icon) end if iconFrame:GetTexture() == nil and dataSource[dataID][tablenum][i].icon ~= "Blank" then @@ -942,7 +804,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) itemButton.dressingroomID = itemID end - itemButton.craftingData = self:RecipeSource(spellID) + itemButton.craftingData = self:GetRecipeSource(spellID) itemButton.tablenum = tablenum itemButton.dataID = dataID itemButton.dataSource = dataSource_backup @@ -959,8 +821,8 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) itemButton.sourcePage = nil end - if dataSource[dataID][tablenum][i][self.Difficultys.DIF_SEARCH] then - itemButton.difficulty = dataSource[dataID][tablenum][i][self.Difficultys.DIF_SEARCH] + if dataSource[dataID][tablenum][i][self.Difficulties.DIF_SEARCH] then + itemButton.difficulty = dataSource[dataID][tablenum][i][self.Difficulties.DIF_SEARCH] else itemButton.difficulty = ItemindexID end @@ -973,7 +835,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) self:ItemsLoading(1) item:ContinueOnLoad(function(itemID) self:ItemsLoading(-1) - setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup, item) + setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup) end) end @@ -994,11 +856,11 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) if not item:GetInfo() then getItemData(itemID, i, orgItemID, item) end - setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup, item) + setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup) elseif recipeID then getItemData(recipeID, i, nil, Item:CreateFromID(recipeID)) else - setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup, Item:CreateFromID(itemID)) + setupButton(itemID, i, dataSource, dataID, tablenum, dataSource_backup) end else itemButton:Hide() @@ -1137,11 +999,6 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) if self.filterEnable and dataID ~= "FilterList" then self:HideFilteredItems() end - if dataID ~= "SearchResult" and dataSource_backup ~= "AtlasLoot_OnDemand" then - --preload items from the rest of the instance table - self:PreLoadLootTable(dataSource, dataID, ItemindexID) - end - end -- List of Moduel Names @@ -1205,57 +1062,6 @@ function AtlasLoot:SetFavorites(num) end end --- Used to precache all the items in a raid/instance -local isLoaded = {} -function AtlasLoot:PreLoadLootTable(dataSource, dataID, ItemindexID) - if isLoaded[dataID] and isLoaded[dataID][ItemindexID] then return end - for _, instance in ipairs(dataSource[dataID]) do - for _, boss in pairs(instance) do - if type(boss) == "table" then - local itemID = ItemIDsDatabase[boss.itemID] and ItemIDsDatabase[boss.itemID][ItemindexID] or boss.itemID - if itemID then - local item = Item:CreateFromID(itemID) - if item and not item:GetInfo() then - self:ItemsLoading(1) - item:ContinueOnLoad(function(itemID) - self:ItemsLoading(-1) - end) - end - end - end - end - end - if not isLoaded[dataID] then isLoaded[dataID] = {} end - isLoaded[dataID][ItemindexID] = true -end - - - - --- Loads the Item Variations into a table from the data content folder -function AtlasLoot:LoadItemIDsDatabase() - local content = C_ContentLoader:Load("ItemVariationData") - content:SetParser(function(index, data) - -- run for each item in the data - if index ~= 0 and data.Normal ~= 0 and not ItemIDsDatabase[data.Normal] then - ItemIDsDatabase[data.Normal] = {} - ItemIDsDatabase[data.Normal]["MythicRaid"] = tonumber("13"..data.Normal) - table.insert(ItemIDsDatabase[data.Normal],data.Bloodforged) - table.insert(ItemIDsDatabase[data.Normal],data.HeroicBloodforged) - table.insert(ItemIDsDatabase[data.Normal],data.Normal) - if data.Heroic ~= 0 then table.insert(ItemIDsDatabase[data.Normal],data.Heroic) end - for _,v in ipairs(data["Mythic"]) do - if v ~= 0 then - table.insert(ItemIDsDatabase[data.Normal],v) - end - end - end - end) - - -- This will run over time (usually about 30s for a file this size), but will maintain playable fps while running. - content:ParseAsync() -end - function AtlasLoot:UNIT_SPELLCAST_SUCCEEDED(event, arg1, arg2 , arg3) if arg1 == "player" and arg2 == "Learning" then self:PopulateProfessions() diff --git a/AtlasLoot/Core/Filter.lua b/AtlasLoot/Core/Filter.lua index e8589fd..6f5b951 100644 --- a/AtlasLoot/Core/Filter.lua +++ b/AtlasLoot/Core/Filter.lua @@ -15,12 +15,12 @@ local FilterTable = { {"Agility", "ITEM_MOD_AGILITY_SHORT"}, {"Intellect", "ITEM_MOD_INTELLECT_SHORT"}, {"Spirit", "ITEM_MOD_SPIRIT_SHORT"}, - {"Attack Power", "ITEM_MOD_ATTACK_POWER_SHORT"}, - {"Spell Power", "ITEM_MOD_SPELL_POWER_SHORT"} }, { Name = AL["Secondary Stats"], Type = "Stat", + {"Attack Power", "ITEM_MOD_ATTACK_POWER_SHORT"}, + {"Spell Power", "ITEM_MOD_SPELL_POWER_SHORT"}, {"Crit", "ITEM_MOD_CRIT_RATING_SHORT"}, {"Hit", "ITEM_MOD_HIT_RATING_SHORT"}, {"Haste", "ITEM_MOD_HASTE_RATING_SHORT"}, @@ -60,7 +60,7 @@ AtlasLootFilter = { FilterList = {} } function AtlasLoot:HideFilteredItems() local dataID, dataSource, tablenum = AtlasLootItemsFrame.refreshFilter[1], _G[AtlasLootItemsFrame.refreshFilter[2]], AtlasLootItemsFrame.refreshFilter[3] local tablebase = dataSource[dataID][tablenum] - if not tablebase or dataID == "WishList" or dataID == "SearchResult" then return end + if not tablebase or dataID == "WishList" then return end local source = dataSource[dataID] AtlasLootFilter["FilterList"] = { Type = source.Type, diff --git a/AtlasLoot/Core/Launchers.lua b/AtlasLoot/Core/Launchers.lua index e63847b..ddfafe5 100644 --- a/AtlasLoot/Core/Launchers.lua +++ b/AtlasLoot/Core/Launchers.lua @@ -23,18 +23,9 @@ function minimap.OnLeave() GameTooltip:Hide() end --- handle minimap tooltip -local function GetTipAnchor(frame) - local x, y = frame:GetCenter() - if not x or not y then return 'TOPLEFT', 'BOTTOMLEFT' end - local hhalf = (x > UIParent:GetWidth() * 2 / 3) and 'RIGHT' or (x < UIParent:GetWidth() / 3) and 'LEFT' or '' - local vhalf = (y > UIParent:GetHeight() / 2) and 'TOP' or 'BOTTOM' - return vhalf .. hhalf, frame, (vhalf == 'TOP' and 'BOTTOM' or 'TOP') .. hhalf -end - function minimap.OnEnter(frame) GameTooltip:SetOwner(frame, 'ANCHOR_NONE') - GameTooltip:SetPoint(GetTipAnchor(frame)) + GameTooltip:SetPoint(AtlasLoot:GetTipAnchor(frame)) GameTooltip:ClearLines() GameTooltip:AddLine("AtlasLoot") GameTooltip:AddLine("|cff1eff00Left-Click|r Browse Loot Tables") diff --git a/AtlasLoot/Core/LootButtons.lua b/AtlasLoot/Core/LootButtons.lua index ae0565c..1fb352a 100644 --- a/AtlasLoot/Core/LootButtons.lua +++ b/AtlasLoot/Core/LootButtons.lua @@ -62,7 +62,9 @@ function AtlasLoot:SetDroprateTooltip(data) elseif ItemindexID == 4 then dropIndex = 5 end - GameTooltip:AddLine(AL["Drop Rate: "]..data.droprate[dropIndex], 1, 1, 0) + if data.droprate[dropIndex] then + GameTooltip:AddLine(AL["Drop Rate: "]..data.droprate[dropIndex], 1, 1, 0) + end else GameTooltip:AddLine(AL["Drop Rate: "]..data.droprate, 1, 1, 0) end @@ -234,7 +236,7 @@ function AtlasLoot:ItemOnClick(item, button) if IsShiftKeyDown() then ChatEdit_InsertLink(self:GetEnchantLink(spellID)) elseif button=="RightButton" then - self:ItemContextMenu(item, "spell") + self:ItemContextMenu(item, "spell", recipeData) elseif IsAltKeyDown() then if AtlasLootItemsFrame.refresh[2] == "AtlasLoot_CurrentWishList" then self:DeleteFromWishList(item.number) @@ -356,7 +358,7 @@ function AtlasLoot:AddWayPoint(waypoint) end end -function AtlasLoot:ItemContextMenu(data, Type) +function AtlasLoot:ItemContextMenu(data, Type, recipeData) local craftingData = data.craftingData local itemID = data.itemID local linkID = itemID @@ -409,7 +411,45 @@ function AtlasLoot:ItemContextMenu(data, Type) 'textWidth', 12, "notCheckable", true ) - + if AuctionFrame and AuctionFrame:IsVisible() then + self:AddDividerLine(35) + self.Dewdrop:AddLine( + 'text', AL["Auction House Search"], + 'notCheckable', true, + 'isTitle', true, + 'textHeight', 13, + 'textWidth', 13 + ) + if recipeData then + self.Dewdrop:AddLine( + "text", AL["Created Item"], + "func", function() self:SearchAuctionHouse(self:GetItemInfo(recipeData[1][1])) end, + 'closeWhenClicked', true, + 'textHeight', 12, + 'textWidth', 12, + "notCheckable", true + ) + if recipeData.Recipe then + self.Dewdrop:AddLine( + "text", AL["Recipe"], + "func", function() self:SearchAuctionHouse(self:GetItemInfo(recipeData.Recipe)) end, + 'closeWhenClicked', true, + 'textHeight', 12, + 'textWidth', 12, + "notCheckable", true + ) + end + else + self.Dewdrop:AddLine( + "text", AL["Item"], + "func", function() self:SearchAuctionHouse(self:GetItemInfo(itemID)) end, + 'closeWhenClicked', true, + 'textHeight', 12, + 'textWidth', 12, + "notCheckable", true + ) + end + end if not AtlasLoot_PopupFrame or AtlasLoot_PopupFrame and not AtlasLoot_PopupFrame:IsVisible() then self:AddDividerLine(35) self.Dewdrop:AddLine( diff --git a/AtlasLoot/Core/Search.lua b/AtlasLoot/Core/Search.lua index 22f987b..816693b 100644 --- a/AtlasLoot/Core/Search.lua +++ b/AtlasLoot/Core/Search.lua @@ -2,6 +2,7 @@ local RED = "|cffff0000" local WHITE = "|cffFFFFFF" local GREEN = "|cff1eff00" local ORANGE = "|cffFF8400" +local YELLOW = "|cffFFd200" local AL = LibStub("AceLocale-3.0"):GetLocale("AtlasLoot") @@ -10,6 +11,27 @@ local OP_AND = "&" -- multi-character patterns must come before single-character patterns local RELATIONAL_OPERATORS = {">=", "<=", "<>", "<", ">", "="} +local searchCategories = { + { + Name = "Classic", + {"Dungeon", "ClassicDungeonExt", "AtlasLoot_OriginalWoW"}, + {"Raid", "ClassicRaid", "AtlasLoot_OriginalWoW"}, + {"Crafting", "ClassicCrafting", "AtlasLoot_Crafting_OriginalWoW"}, + }, + { + Name = "BurningCrusade", + {"Dungeon", "BCDungeon", "AtlasLoot_BurningCrusade"}, + {"Raid", "BCRaid", "AtlasLoot_BurningCrusade"}, + {"Crafting", "BCCrafting", "AtlasLoot_Crafting_TBC"}, + }, + { + Name = "Wrath", + {"Dungeon", "WrathDungeon", "AtlasLoot_WrathoftheLichKing"}, + {"Raid", "WrathRaid", "AtlasLoot_WrathoftheLichKing"}, + {"Crafting", "WrathCrafting", "AtlasLoot_Crafting_Wrath"}, + } +} + -- Supported Stat Filters local STAT_FILTERS = { -- Base Stats @@ -596,7 +618,7 @@ end function AtlasLoot:GetItemDetails(itemId) -- Name, Link, Quality(num), iLvl(num), minLvl(num), itemType(localized string), itemSubType(localized string), stackCount(num), itemEquipLoc(enum), texture(link to a local file), displayId(num) - local itemName, _, itemQuality, itemLvl, minLvl, _, itemSubType, _, itemEquipLoc = GetItemInfo(itemId) + local itemName, _, itemQuality, itemLvl, minLvl, _, itemSubType, _, itemEquipLoc = self:GetItemInfo(itemId) return itemName, itemQuality, itemLvl, minLvl, itemEquipLoc, itemSubType, GetItemStats("item:" .. itemId) end @@ -679,7 +701,7 @@ end local itemList = {} function AtlasLoot:DoSearch(searchText) - AtlasLootCharDB["SearchResult"] = {Name = "Search Result" , Type = "Search", Back = true} + AtlasLootCharDB["SearchResult"] = {Name = "Search Result" , Type = "Search"} count = 0 tablenum = 1 showSearch = false @@ -688,16 +710,13 @@ function AtlasLoot:DoSearch(searchText) local searchTerms = ParseQuery(searchText) for dataID, data in pairs(AtlasLoot_Data) do - if self.db.profile.SearchOn.All or self.db.profile.SearchOn[data.Module] or (self.db.profile.SearchAscensionVanity and data.Module == "AtlasLoot_Ascension_Vanity") then + if self.db.profile.SearchOn[data.Type] and self.db.profile.SearchOn[data.Type][1] or (self.db.profile.SearchAscensionVanity and data.Module == "AtlasLoot_Ascension_Vanity") then for tableNum, t in ipairs(data) do for _, itemData in pairs(t) do if type(itemData) == "table" then if itemData.itemID or itemData.spellID then if data.Type then itemData.Type = data.Type - if not itemData[self.Difficultys.MAX_DIF] then - itemData[self.Difficultys.MAX_DIF] = #self.Difficultys[data.Type] - end end if self.db.profile.showdropLocationOnSearch then itemData.dropLoc = {data.DisplayName or data.Name, t.Name} @@ -747,10 +766,10 @@ function AtlasLoot:Search(text) end -- Decide if we need load all modules or just specified ones - local allDisabled = not self.db.profile.SearchOn.All + local allDisabled = true if allDisabled then - for _, module in ipairs(self.dataModules) do - if self.db.profile.SearchOn[module] == true or self.db.profile.SearchAscensionVanity then + for _, module in pairs(self.db.profile.SearchOn) do + if module and module[1] or self.db.profile.SearchAscensionVanity then allDisabled = false break end @@ -760,61 +779,39 @@ function AtlasLoot:Search(text) DEFAULT_CHAT_FRAME:AddMessage(RED .. AL["AtlasLoot"] .. ": " .. WHITE .. AL["You don't have any module selected to search on. Right click search to select modules the more selected the longer it will take to search"]) return end - if self.db.profile.SearchOn.All then - self:LoadAllModules() - else - for k, v in pairs(self.db.profile.SearchOn) do - if k ~= "All" and v == true and not IsAddOnLoaded(k) and LoadAddOn(k) and self.db.profile.LoDNotify then - DEFAULT_CHAT_FRAME:AddMessage(GREEN .. AL["AtlasLoot"] .. ": " .. ORANGE .. k .. WHITE .. " " .. AL["sucessfully loaded."]) - end + + for _, cat in pairs(self.db.profile.SearchOn) do + if type(cat) == "table" and cat[1] and not IsAddOnLoaded(cat[2]) then + LoadAddOn(cat[2]) end end self:DoSearch(text) - --local success, message = pcall(self:DoSearch, text) - - -- if not success then - -- message = message:match("[^:]+: (.*)") or message -- strip stack location - -- DEFAULT_CHAT_FRAME:AddMessage(RED .. AL["AtlasLoot"] .. ": " .. WHITE .. message) - -- elseif #AtlasLootCharDB["SearchResult"] == 0 then - -- local itemFilterErrorMessage = "" - -- if operator then - -- itemFilterErrorMessage = [[ - -- Please check if you have a typo in the filter. - -- For help, type "/atlasloothelp". - -- You might also have to query the server for item informations to load them into your client's Cache.]] - -- end - -- DEFAULT_CHAT_FRAME:AddMessage(RED .. AL["AtlasLoot"] .. ": " .. WHITE .. AL["No match found for"] .. " \"" .. text .. "\"." .. itemFilterErrorMessage) - -- else - -- self:ShowItemsFrame("SearchResult", "AtlasLootCharDB", 1) - -- end end -function AtlasLoot:ShowSearchOptions(button) +function AtlasLoot:ShowSearchOptions(button, point) if self.Dewdrop:IsOpen(button) then self.Dewdrop:Close(1) else local setOptions = function() - self.Dewdrop:AddLine("text", AL["Search on"], "isTitle", true, "notCheckable", true) - self.Dewdrop:AddLine("text", AL["All modules"], "checked", not self.db.profile.SearchAscensionDB and self.db.profile.SearchOn.All, "tooltipTitle", AL["All modules"], "tooltipText", - AL["If checked, AtlasLoot will load and search across all the modules."], "func", function() - self.db.profile.SearchOn.All = not self.db.profile.SearchOn.All - end) - for _, module in ipairs(self.dataModules) do - if IsAddOnLoadOnDemand(module) then - local title = GetAddOnMetadata(module, "title") - local notes = GetAddOnMetadata(module, "notes") - self.Dewdrop:AddLine("text", title, "checked", not self.db.profile.SearchAscensionDB and self.db.profile.SearchOn.All or self.db.profile.SearchOn[module], "disabled", self.db.profile.SearchAscensionDB or self.db.profile.SearchOn.All, "tooltipTitle", title, - "tooltipText", notes, "func", function() - self.db.profile.SearchOn[module] = not self.db.profile.SearchOn[module] - end) - end + self.Dewdrop:AddLine("text", WHITE.."Search Categories", "isTitle", true, "notCheckable", true) + for expac, cat in pairs(searchCategories) do + self.Dewdrop:AddLine( "text", YELLOW..cat.Name, "isTitle", true, "notCheckable", true) + for _, data in ipairs(cat) do + self.db.profile.SearchOn[data[2]] = self.db.profile.SearchOn[data[2]] or {false, data[3]} + self.Dewdrop:AddLine( + "text", data[1], + "checked", self.db.profile.SearchOn[data[2]] and self.db.profile.SearchOn[data[2]][1], + "func", function() + self.db.profile.SearchOn[data[2]][1] = not self.db.profile.SearchOn[data[2]][1] + end) + end end + self.Dewdrop:AddLine("text", AL["Search options"], "isTitle", true, "notCheckable", true) self.Dewdrop:AddLine("text", AL["Ascension Vanity Collection"], "checked", self.db.profile.SearchAscensionVanity, "tooltipTitle", AL["Ascension Vanity Collection"], "tooltipText", AL["If checked, AtlasLoot will search Ascension Vanity Collection"], "func", function() self.db.profile.SearchAscensionVanity = not self.db.profile.SearchAscensionVanity end) - self.Dewdrop:AddLine("text", AL["Search options"], "isTitle", true, "notCheckable", true) self.Dewdrop:AddLine("text", AL["Partial matching"], "checked", self.db.profile.PartialMatching, "tooltipTitle", AL["Partial matching"], "tooltipText", AL["If checked, AtlasLoot search item names for a partial match."], "func", function() self.db.profile.PartialMatching = not self.db.profile.PartialMatching @@ -825,7 +822,11 @@ function AtlasLoot:ShowSearchOptions(button) end) end self.Dewdrop:Open(button, 'point', function(parent) - return "BOTTOMLEFT", "BOTTOMRIGHT" + if point then + return point[1] , point[2] + else + return "BOTTOMLEFT", "BOTTOMRIGHT" + end end, "children", setOptions) end end \ No newline at end of file diff --git a/AtlasLoot/Core/SearchAdvanced.lua b/AtlasLoot/Core/SearchAdvanced.lua index 28c5f07..546a906 100644 --- a/AtlasLoot/Core/SearchAdvanced.lua +++ b/AtlasLoot/Core/SearchAdvanced.lua @@ -12,48 +12,6 @@ local FrameMenuList = { } local AdvancedSearchMenus = { - ["Difficulty"] = { - [1] = {{"Normal", "difficulty", AtlasLoot.Difficultys.Normal}}, - [2] = {{"Heroic", "difficulty", AtlasLoot.Difficultys.Heroic}}, - [3] = {{"Mythic/Ascended", "difficulty", AtlasLoot.Difficultys.Mythic}}, - [4] = { - ["Mythic+ 1-10"] = {{"Mythic 1", "difficulty", AtlasLoot.Difficultys.MythicPlus[1]}, {"Mythic 2", "difficulty", AtlasLoot.Difficultys.MythicPlus[2]}, - {"Mythic 3", "difficulty", AtlasLoot.Difficultys.MythicPlus[3]}, {"Mythic 4", "difficulty", AtlasLoot.Difficultys.MythicPlus[4]}, - {"Mythic 5", "difficulty", AtlasLoot.Difficultys.MythicPlus[5]}, {"Mythic 6", "difficulty", AtlasLoot.Difficultys.MythicPlus[6]}, - {"Mythic 7", "difficulty", AtlasLoot.Difficultys.MythicPlus[7]}, {"Mythic 8", "difficulty", AtlasLoot.Difficultys.MythicPlus[8]}, - {"Mythic 9", "difficulty", AtlasLoot.Difficultys.MythicPlus[9]}, {"Mythic 10", "difficulty", AtlasLoot.Difficultys.MythicPlus[10]}} - }, - [5] = { - ["Mythic+ 11-20"] = {{"Mythic 11", "difficulty", AtlasLoot.Difficultys.MythicPlus[11]}, {"Mythic 12", "difficulty", AtlasLoot.Difficultys.MythicPlus[12]}, - {"Mythic 13", "difficulty", AtlasLoot.Difficultys.MythicPlus[13]}, {"Mythic 14", "difficulty", AtlasLoot.Difficultys.MythicPlus[14]}, - {"Mythic 15", "difficulty", AtlasLoot.Difficultys.MythicPlus[15]}, {"Mythic 16", "difficulty", AtlasLoot.Difficultys.MythicPlus[16]}, - {"Mythic 17", "difficulty", AtlasLoot.Difficultys.MythicPlus[17]}, {"Mythic 18", "difficulty", AtlasLoot.Difficultys.MythicPlus[18]}, - {"Mythic 19", "difficulty", AtlasLoot.Difficultys.MythicPlus[19]}, {"Mythic 20", "difficulty", AtlasLoot.Difficultys.MythicPlus[20]}} - }, - [6] = { - ["Mythic+ 21-30"] = {{"Mythic 21", "difficulty", AtlasLoot.Difficultys.MythicPlus[21]}, {"Mythic 22", "difficulty", AtlasLoot.Difficultys.MythicPlus[22]}, - {"Mythic 23", "difficulty", AtlasLoot.Difficultys.MythicPlus[23]}, {"Mythic 24", "difficulty", AtlasLoot.Difficultys.MythicPlus[24]}, - {"Mythic 25", "difficulty", AtlasLoot.Difficultys.MythicPlus[25]}, {"Mythic 26", "difficulty", AtlasLoot.Difficultys.MythicPlus[26]}, - {"Mythic 27", "difficulty", AtlasLoot.Difficultys.MythicPlus[27]}, {"Mythic 28", "difficulty", AtlasLoot.Difficultys.MythicPlus[28]}, - {"Mythic 29", "difficulty", AtlasLoot.Difficultys.MythicPlus[29]}, {"Mythic 30", "difficulty", AtlasLoot.Difficultys.MythicPlus[30]}} - }, - [7] = {{"Bloodforged", "difficulty", AtlasLoot.Difficultys.Bloodforged}}, - [8] = {{RED .. "Reset", "difficulty", "reset"}} - }, - - ["Quality"] = { - -- [1] = { - -- {AtlasLoot:FixText("=q0=").."Poor", "quality", "poor"}, - -- }, - -- [2] = { - -- {AtlasLoot:FixText("=q1=").."Common", "quality", "common"}, - -- }, - [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"}} - }, ["Equip"] = { [1] = {{"Head", "equip", "head", "EquipSubMenu", "ArmorType"}}, @@ -161,14 +119,12 @@ local AdvancedSearchArguments = { } local AdvSearchOptions = { - ["quality"] = "", ["equip"] = "", ["type"] = "", ["difficulty"] = "" } function AtlasLoot:AdvancedSearchSetup() - self:AdvancedSearchRegister(self.Dewdrop, AtlasLootDefaultFrame_AdvancedSearchPanel_QualityButton, AdvancedSearchMenus["Quality"]) self:AdvancedSearchRegister(self.Dewdrop, AtlasLootDefaultFrame_AdvancedSearchPanel_EquipButton, AdvancedSearchMenus["Equip"]) for n = 1, MAX_ARGUMENTS do @@ -218,7 +174,6 @@ end function AtlasLoot:AdvancedSearchReset() AdvSearchOptions = { - ["quality"] = "", ["equip"] = "", ["type"] = "", ["difficulty"] = "" @@ -238,8 +193,6 @@ function AtlasLoot:AdvancedSearchReset() AtlasLootDefaultFrame_AdvancedSearchPanel_iLevelMin:SetText("") AtlasLootDefaultFrame_AdvancedSearchPanel_iLevelMax:SetText("") - AtlasLootDefaultFrame_AdvancedSearchPanel_QualityButton:SetText("Select Quality") - AtlasLootDefaultFrame_AdvancedSearchPanel_EquipButton:SetText("Select Item Type") AtlasLootDefaultFrame_AdvancedSearchPanel_EquipSubButton:Disable() AtlasLootDefaultFrame_AdvancedSearchPanel_EquipSubButton:SetText("Select Option") @@ -293,7 +246,6 @@ function AtlasLoot:AdvSearchArgButtonToggle() end local AdvSearchDefaultText = { - ["quality"] = "Select Quality", ["equip"] = "Select Item Type", ["type"] = "Select Option", ["difficulty"] = "Select Difficulty" @@ -532,10 +484,6 @@ function AtlasLoot:AdvancedSearch(Text) return "ranged" end - if AdvSearchOptions["quality"] ~= "" then - advSearchString = AppendSearchString(advSearchString, "quality=" .. AdvSearchOptions["quality"]) - end - if AdvSearchOptions["equip"] ~= "" then if AdvSearchOptions["equip"] == "ranged" and AdvSearchOptions["type"] ~= "" then AdvSearchOptions["equip"] = FixRangedSlot(AdvSearchOptions["type"]) diff --git a/AtlasLoot/Core/TextParsing.lua b/AtlasLoot/Core/TextParsing.lua index f4ce844..ab6395c 100644 --- a/AtlasLoot/Core/TextParsing.lua +++ b/AtlasLoot/Core/TextParsing.lua @@ -33,782 +33,170 @@ AtlasLoot.FixedItemText = { [400751] = AL["Token"], } - - -function AtlasLoot:FixText(text) - - if not string.find(string.lower(text), string.lower("INVTYPE")) then - text = gsub(text, ", Leather", "Leather") - text = gsub(text, ", Cloth", "Cloth") - end - - -- Classes - text = gsub(text, "#c1#", "Druid") - text = gsub(text, "#c2#", LOCALIZED_CLASS_NAMES_MALE["HUNTER"]) - text = gsub(text, "#c3#", LOCALIZED_CLASS_NAMES_MALE["MAGE"]) - text = gsub(text, "#c4#", LOCALIZED_CLASS_NAMES_MALE["PALADIN"]) - text = gsub(text, "#c5#", LOCALIZED_CLASS_NAMES_MALE["PRIEST"]) - text = gsub(text, "#c6#", LOCALIZED_CLASS_NAMES_MALE["ROGUE"]) - text = gsub(text, "#c7#", LOCALIZED_CLASS_NAMES_MALE["SHAMAN"]) - text = gsub(text, "#c8#", LOCALIZED_CLASS_NAMES_MALE["WARLOCK"]) - text = gsub(text, "#c9#", LOCALIZED_CLASS_NAMES_MALE["WARRIOR"]) - text = gsub(text, "#c10#", LOCALIZED_CLASS_NAMES_MALE["DEATHKNIGHT"]) - - -- Reputation - text = gsub(text, "#r1#", BabbleFaction["Neutral"]) - text = gsub(text, "#r2#", BabbleFaction["Friendly"]) - text = gsub(text, "#r3#", BabbleFaction["Honored"]) - text = gsub(text, "#r4#", BabbleFaction["Revered"]) - text = gsub(text, "#r5#", BabbleFaction["Exalted"]) - +local txtSubstitution = { -- Body Slot - text = gsub(text, "INVTYPE_HEAD", BabbleInventory["Head"]) - text = gsub(text, "INVTYPE_NECK, Miscellaneous", BabbleInventory["Neck"]) - text = gsub(text, "INVTYPE_SHOULDER", BabbleInventory["Shoulder"]) - text = gsub(text, "INVTYPE_CLOAK, Cloth", BabbleInventory["Back"]) - text = gsub(text, "INVTYPE_CHEST", BabbleInventory["Chest"]) - text = gsub(text, "INVTYPE_BODY", BabbleInventory["Shirt"]) - text = gsub(text, "INVTYPE_ROBE", BabbleInventory["Chest"]) - text = gsub(text, "INVTYPE_TABARD, Miscellaneous", BabbleInventory["Tabard"]) - text = gsub(text, "INVTYPE_WRIST", BabbleInventory["Wrist"]) - text = gsub(text, "INVTYPE_HAND", BabbleInventory["Hands"]) - text = gsub(text, "INVTYPE_WAIST", BabbleInventory["Waist"]) - text = gsub(text, "INVTYPE_LEGS", BabbleInventory["Legs"]) - text = gsub(text, "INVTYPE_FEET", BabbleInventory["Feet"]) - text = gsub(text, "INVTYPE_FINGER, Miscellaneous", BabbleInventory["Ring"]) - text = gsub(text, "INVTYPE_TRINKET, Miscellaneous", BabbleInventory["Trinket"]) - text = gsub(text, "INVTYPE_RELIC, Miscellaneous", BabbleInventory["Relic"]) + { "INVTYPE_HEAD", BabbleInventory["Head"] }, + { "INVTYPE_NECK, Miscellaneous", BabbleInventory["Neck"] }, + { "INVTYPE_SHOULDER", BabbleInventory["Shoulder"] }, + { "INVTYPE_CLOAK, Cloth", BabbleInventory["Back"] }, + { "INVTYPE_CHEST", BabbleInventory["Chest"] }, + { "INVTYPE_BODY", BabbleInventory["Shirt"] }, + { "INVTYPE_ROBE", BabbleInventory["Chest"] }, + { "INVTYPE_TABARD, Miscellaneous", BabbleInventory["Tabard"] }, + { "INVTYPE_WRIST", BabbleInventory["Wrist"] }, + { "INVTYPE_HAND", BabbleInventory["Hands"] }, + { "INVTYPE_WAIST", BabbleInventory["Waist"] }, + { "INVTYPE_LEGS", BabbleInventory["Legs"] }, + { "INVTYPE_FEET", BabbleInventory["Feet"] }, + { "INVTYPE_FINGER, Miscellaneous", BabbleInventory["Ring"] }, + { "INVTYPE_TRINKET, Miscellaneous", BabbleInventory["Trinket"] }, + { "INVTYPE_RELIC, Miscellaneous", BabbleInventory["Relic"] }, -- Weapon Weilding - text = gsub(text, "INVTYPE_WEAPON, ", "") - text = gsub(text, "INVTYPE_2HWEAPON, ", "") - text = gsub(text, "INVTYPE_WEAPONMAINHAND, ", "") - text = gsub(text, "INVTYPE_WEAPONOFFHAND, ", "") - text = gsub(text, "INVTYPE_RANGED, ", "") - text = gsub(text, "INVTYPE_SHIELD, ", "") - text = gsub(text, "INVTYPE_HOLDABLE, Miscellaneous", BabbleInventory["Off Hand"]) - text = gsub(text, "INVTYPE_THROWN, ", "") - - text = gsub(text, ", Jewelcrafting", BabbleInventory["Jewelcrafting"]) - text = gsub(text, ", Enchanting", BabbleInventory["Enchanting"]) - text = gsub(text, ", Tailoring", BabbleInventory["Tailoring"]) - text = gsub(text, ", Blacksmithing", BabbleInventory["Blacksmithing"]) - text = gsub(text, ", Leatherworking", BabbleInventory["Leatherworking"]) - text = gsub(text, ", Alchemy", BabbleInventory["Alchemy"]) - text = gsub(text, ", Engineering", BabbleInventory["Engineering"]) - text = gsub(text, ", Cooking", BabbleInventory["Cooking"]) - text = gsub(text, ", Mining", AL["Mining"]) - text = gsub(text, ", Herbalism", AL["Herbalism"]) - + { "INVTYPE_WEAPON, ", "" }, + { "INVTYPE_2HWEAPON, ", "" }, + { "INVTYPE_WEAPONMAINHAND, One%-Handed Swords", AL["Main-Hand Sword"] }, + { "INVTYPE_WEAPONMAINHAND, One%-Handed Maces", AL["Main-Hand Mace"] }, + { "INVTYPE_WEAPONMAINHAND, Daggers", AL["Main-Hand Dagger"] }, + { "INVTYPE_WEAPONMAINHAND, Fist Weapons", AL["Main-Hand Fist Weapon"] }, + { "INVTYPE_WEAPONOFFHAND, One%-Handed Swords", AL["Off-Hand Sword"] }, + { "INVTYPE_WEAPONOFFHAND, Fist Weapons", AL["Off-Hand Fist Weapon"] }, + { "INVTYPE_WEAPONOFFHAND, ", "" }, + { "INVTYPE_RANGED, ", "" }, + { "INVTYPE_SHIELD, ", "" }, + { "INVTYPE_HOLDABLE, Miscellaneous", BabbleInventory["Off Hand"] }, + { "INVTYPE_THROWN, ", "" }, -- Weapon Type - text = gsub(text, "Axes", BabbleInventory["Axe"]) - text = gsub(text, "Bows", BabbleInventory["Bow"]) - text = gsub(text, "INVTYPE_RANGEDRIGHT, Crossbows", BabbleInventory["Crossbow"]) - text = gsub(text, "INVTYPE_RANGEDRIGHT, Gun", BabbleInventory["Gun"]) - text = gsub(text, "Daggers", BabbleInventory["Dagger"]) - text = gsub(text, "Guns", BabbleInventory["Gun"]) - text = gsub(text, "INVTYPE_AMMO, Bullet", BabbleInventory["Bullet"]) - text = gsub(text, "INVTYPE_AMMO, Arrow", BabbleInventory["Arrow"]) - text = gsub(text, "One%-Handed Maces", AL["One-Handed Mace"]) - text = gsub(text, "Two%-Handed Maces", AL["Two-Handed Mace"]) - text = gsub(text, "Polearms", BabbleInventory["Polearm"]) - text = gsub(text, "Shields", BabbleInventory["Shield"]) - text = gsub(text, "Staves", BabbleInventory["Staff"]) - text = gsub(text, "One%-Handed Swords", AL["One-Handed Sword"]) - text = gsub(text, "Two%-Handed Swords", AL["Two-Handed Sword"]) - text = gsub(text, "INVTYPE_RANGEDRIGHT, Wands", BabbleInventory["Wand"]) - text = gsub(text, "Fist Weapons", BabbleInventory["Fist Weapon"]) - text = gsub(text, "INVTYPE_RELIC, Idols", BabbleInventory["Idol"]) - text = gsub(text, "INVTYPE_RELIC, Totem", BabbleInventory["Totem"]) - text = gsub(text, "INVTYPE_RELIC, Libram", BabbleInventory["Libram"]) - text = gsub(text, "INVTYPE_BAG, Bag", BabbleInventory["Bag"]) - text = gsub(text, "INVTYPE_BAG, Soul Bag", BabbleInventory["Soul Bag"]) - text = gsub(text, "#w21#", AL["Sigil"]) + { "INVTYPE_RANGEDRIGHT, Crossbows", BabbleInventory["Crossbow"] }, + { "INVTYPE_RANGEDRIGHT, Gun", BabbleInventory["Gun"] }, + { "INVTYPE_RANGEDRIGHT, Wands", BabbleInventory["Wand"] }, + { "INVTYPE_RELIC, Idols", BabbleInventory["Idol"] }, + { "INVTYPE_RELIC, Totem", BabbleInventory["Totem"] }, + { "INVTYPE_RELIC, Libram", BabbleInventory["Libram"] }, + { "INVTYPE_BAG, Bag", BabbleInventory["Bag"] }, + { "INVTYPE_BAG, Soul Bag", BabbleInventory["Soul Bag"] }, + { "INVTYPE_AMMO, Junk", "Ammo (Obsolete ),"}, + { "Axes", BabbleInventory["Axe"] }, + { "Bows", BabbleInventory["Bow"] }, + { "Daggers", BabbleInventory["Dagger"] }, + { "Guns", BabbleInventory["Gun"] }, + { "One%-Handed Maces", AL["One-Handed Mace"] }, + { "Two%-Handed Maces", AL["Two-Handed Mace"] }, + { "Polearms", BabbleInventory["Polearm"] }, + { "Shields", BabbleInventory["Shield"] }, + { "Staves", BabbleInventory["Staff"] }, + { "One%-Handed Swords", AL["One-Handed Sword"] }, + { "Two%-Handed Swords", AL["Two-Handed Sword"] }, + { "Fist Weapons", BabbleInventory["Fist Weapon"] }, - text = gsub(text, ", Pet", BabbleInventory["Pet"]) - text = gsub(text, ", Money", AL["Currency"]) - text = gsub(text, ", Consumable", BabbleInventory["Consumable"]) - text = gsub(text, ", Mount", BabbleInventory["Mount"]) - text = gsub(text, ", Quest", BabbleInventory["Quest"]) - text = gsub(text, ", Key", BabbleInventory["Key"]) - text = gsub(text, ", Book", BabbleInventory["Book"]) - text = gsub(text, ", Materials", BabbleInventory["Reagent"]) - text = gsub(text, ", Flask", BabbleInventory["Flask"]) - text = gsub(text, ", Other", AL["Misc"]) - text = gsub(text, ", Junk", AL["Misc"]) - text = gsub(text, "%(OBSOLETE%)", "") - text = gsub(text, ", Food & Drink", BabbleInventory["Food & Drink"]) - - text = gsub(text, ", Red", AL["Red Gem"]) - text = gsub(text, ", Blue", AL["Blue Gem"]) - text = gsub(text, ", Yellow", AL["Yellow Gem"]) - text = gsub(text, ", Purple", AL["Purple Gem"]) - text = gsub(text, ", Orange", AL["Orange Gem"]) - text = gsub(text, ", Green", AL["Green Gem"]) - - -- Misc Inventory related words - text = gsub(text, "#e1#", BabbleInventory["Bag"]) - text = gsub(text, "#e2#", BabbleInventory["Potion"]) - text = gsub(text, "#e3#", BabbleInventory["Food"]) - text = gsub(text, "#e4#", BabbleInventory["Drink"]) - text = gsub(text, "#e5#", BabbleInventory["Bandage"]) - text = gsub(text, "#e6#", BabbleInventory["Trade Goods"]) - text = gsub(text, "#e7#", BabbleInventory["Gem"]) - text = gsub(text, "#e8#", BabbleInventory["Reagent"]) - text = gsub(text, "#e9#", BabbleInventory["Key"]) - text = gsub(text, "#e10#", BabbleInventory["Book"]) - text = gsub(text, "#e11#", AL["Scope"]) - text = gsub(text, "#e12#", BabbleInventory["Mount"]) - text = gsub(text, "#e13#", BabbleInventory["Pet"]) - text = gsub(text, "#e14#", AL["Banner"]) - text = gsub(text, "#e15#", AL["Token"]) - text = gsub(text, "#e16#", AL["Darkmoon Faire Card"]) - text = gsub(text, "#e17#", AL["Enchant"]) - text = gsub(text, "#e18#", AL["Skinning Knife"]) - text = gsub(text, "#e19#", AL["Herbalism Knife"]) - text = gsub(text, "#e20#", BabbleInventory["Fishing Pole"]) - text = gsub(text, "#e21#", AL["Fish"]) - text = gsub(text, "#e22#", AL["Combat Pet"]) - text = gsub(text, "#e23#", AL["Fireworks"]) - text = gsub(text, "#e24#", AL["Fishing Lure"]) - text = gsub(text, "#e25#", AL["Crafting Reagent"]) - - -- Labels for Loot Descriptions - text = gsub(text, "#m1#", AL["Classes:"]) - text = gsub(text, "#m2#", AL["This Item Begins a Quest"]) - text = gsub(text, "#m3#", AL["Quest Item"]) - text = gsub(text, "#m4#", AL["Quest Reward"]) - text = gsub(text, "#m5#", AL["Shared"]) - text = gsub(text, "#m6#", BabbleFaction["Horde"]) - text = gsub(text, "#m7#", BabbleFaction["Alliance"]) - text = gsub(text, "#m8#", AL["Unique"]) - text = gsub(text, "#m9#", AL["Right Half"]) - text = gsub(text, "#m10#", AL["Left Half"]) - text = gsub(text, "#m11#", AL["28 Slot Soul Shard"]) - text = gsub(text, "#m12#", AL["10 Slot"]) - text = gsub(text, "#m13#", AL["16 Slot"]) - text = gsub(text, "#m14#", AL["18 Slot"]) - text = gsub(text, "#m15#", AL["20 Slot"]) - text = gsub(text, "#m16#", AL["(has random enchantment)"]) - text = gsub(text, "#m17#", AL["Currency"]) - text = gsub(text, "#m18#", AL["Currency (Alliance)"]) - text = gsub(text, "#m19#", AL["Currency (Horde)"]) - text = gsub(text, "#m20#", AL["Misc"]) - text = gsub(text, "#m21#", AL["Tier 4"]) - text = gsub(text, "#m22#", AL["Tier 5"]) - text = gsub(text, "#m23#", AL["Tier 6"]) - text = gsub(text, "#m24#", AL["Card Game Item"]) - text = gsub(text, "#m25#", AL["Arena Reward"]) - text = gsub(text, "#m26#", AL["Conjured Item"]) - text = gsub(text, "#m27#", AL["Used to summon boss"]) - text = gsub(text, "#m28#", AL["Feast of Winter Veil"]) - text = gsub(text, "#m29#", AL["Tradable against sunmote + item above"]) - text = gsub(text, "#m30#", AL["Tier 1"]) - text = gsub(text, "#m31#", AL["Tier 2"]) - text = gsub(text, "#m32#", AL["Achievement Reward"]) - text = gsub(text, "#m33#", AL["Old Quest Item"]) - text = gsub(text, "#m34#", AL["Old Quest Reward"]) - text = gsub(text, "#m35#", AL["Tier 3"]) - text = gsub(text, "#m36#", AL["NOT AVAILABLE ANYMORE"]) - - -- Misc - text = gsub(text, "#j1#", AL["Normal Mode"]) - text = gsub(text, "#j2#", AL["Raid"]) - text = gsub(text, "#j3#", AL["Heroic Mode"]) - text = gsub(text, "#j5#", AL["Dungeon Set 2 Summonable"]) - text = gsub(text, "#j6#", AL["Dungeon Set 1"]) - text = gsub(text, "#j7#", AL["Dungeon Set 2"]) - text = gsub(text, "#j8#", AL["Token Hand-Ins"]) - text = gsub(text, "#j9#", AL["Level 60"]) - text = gsub(text, "#j10#", AL["Level 70"]) - text = gsub(text, "#j11#", AL["Fire Resistance Gear"]) - text = gsub(text, "#j12#", AL["Arcane Resistance Gear"]) - text = gsub(text, "#j13#", AL["Nature Resistance Gear"]) - text = gsub(text, "#j14#", AL["Frost Resistance Gear"]) - text = gsub(text, "#j15#", AL["Shadow Resistance Gear"]) - text = gsub(text, "#j16#", AL["Phase 1"]) - text = gsub(text, "#j17#", AL["Phase 2"]) - text = gsub(text, "#j18#", AL["Phase 3"]) - text = gsub(text, "#j19#", AL["Fire"]) - text = gsub(text, "#j20#", AL["Water"]) - text = gsub(text, "#j21#", AL["Wind"]) - text = gsub(text, "#j22#", AL["Earth"]) - text = gsub(text, "#j23#", AL["Master Angler"]) - text = gsub(text, "#j24#", AL["First Prize"]) - text = gsub(text, "#j25#", AL["Rare Fish Rewards"]) - text = gsub(text, "#j26#", AL["Rare Fish"]) - text = gsub(text, "#j27#", AL["Additional Heroic Loot"]) - text = gsub(text, "#j28#", AL["Entrance"]) - text = gsub(text, "#j29#", AL["Unattainable Tabards"]) - text = gsub(text, "#j30#", AL["Mounts"]) - text = gsub(text, "#j31#", AL["Card Game Mounts"]) - text = gsub(text, "#j32#", AL["Crafted Mounts"]) - text = gsub(text, "#j33#", AL["Event Mounts"]) - text = gsub(text, "#j34#", AL["PvP Mounts"]) - text = gsub(text, "#j35#", AL["Rare Mounts"]) - text = gsub(text, "#j37#", AL["10 Man"]) - text = gsub(text, "#j38#", AL["25 Man"]) - text = gsub(text, "#j46#", AL["Hard Mode"]) - text = gsub(text, "#j47#", AL["Heroic"]) - text = gsub(text, "#j50#", AL["Weapons"]) - text = gsub(text, "#j51#", AL["Accessories"]) - text = gsub(text, "#j52#", AL["Heirloom"]) - text = gsub(text, "#j53#", AL["Hard Mode"]) - text = gsub(text, "#j54#", AL["Level 80"]) - - -- Upper Deck Card Game - text = gsub(text, "#ud1#", AL["Heroes of Azeroth"]) - text = gsub(text, "#ud2#", AL["Through The Dark Portal"]) - text = gsub(text, "#ud3#", AL["Fires of Outland"]) - text = gsub(text, "#ud4#", AL["Loot Card Items"]) - text = gsub(text, "#ud5#", AL["UDE Items"]) - text = gsub(text, "#ud6#", AL["Landro Longshot"]) - text = gsub(text, "#ud7#", AL["Thunderhead Hippogryph"]) - text = gsub(text, "#ud8#", AL["Saltwater Snapjaw"]) - text = gsub(text, "#ud9#", AL["King Mukla"]) - text = gsub(text, "#ud10#", AL["Rest and Relaxation"]) - text = gsub(text, "#ud11#", AL["Fortune Telling"]) - text = gsub(text, "#ud12#", AL["Goblin Gumbo"]) - text = gsub(text, "#ud13#", AL["Gone Fishin'"]) - text = gsub(text, "#ud14#", AL["Spectral Tiger"]) - text = gsub(text, "#ud15#", AL["March of the Legion"]) - text = gsub(text, "#ud16#", AL["Kiting"]) - text = gsub(text, "#ud17#", AL["Robotic Homing Chicken"]) - text = gsub(text, "#ud18#", AL["Paper Airplane"]) - text = gsub(text, "#ud19#", AL["Servants of the Betrayer"]) - text = gsub(text, "#ud20#", AL["Papa Hummel's Old-fashioned Pet Biscuit"]) - text = gsub(text, "#ud21#", AL["Personal Weather Machine"]) - text = gsub(text, "#ud22#", AL["X-51 Nether-Rocket"]) - text = gsub(text, "#ud23#", AL["Hunt for Illidan"]) - text = gsub(text, "#ud24#", AL["The Footsteps of Illidan"]) - text = gsub(text, "#ud25#", AL["Disco Inferno!"]) - text = gsub(text, "#ud26#", AL["Ethereal Plunderer"]) - text = gsub(text, "#ud27#", AL["Drums of War"]) - text = gsub(text, "#ud28#", AL["The Red Bearon"]) - text = gsub(text, "#ud29#", AL["Owned!"]) - text = gsub(text, "#ud30#", AL["Slashdance"]) - text = gsub(text, "#ud31#", AL["Blood of Gladiators"]) - text = gsub(text, "#ud32#", AL["Center of Attention"]) - text = gsub(text, "#ud33#", AL["Foam Sword Rack"]) - text = gsub(text, "#ud34#", AL["Sandbox Tiger"]) - text = gsub(text, "#ud35#", AL["Fields of Honor"]) - text = gsub(text, "#ud36#", AL["Path of Cenarius"]) - text = gsub(text, "#ud37#", AL["Pinata"]) - text = gsub(text, "#ud38#", AL["El Pollo Grande"]) - text = gsub(text, "#ud39#", AL["Scourgewar"]) - text = gsub(text, "#ud40#", AL["Tiny"]) - text = gsub(text, "#ud41#", AL["Tuskarr Kite"]) - text = gsub(text, "#ud42#", AL["Spectral Kitten"]) - text = gsub(text, "#ud39#", AL["Scourgewar"]) - text = gsub(text, "#ud43#", AL["Wrathgate"]) - text = gsub(text, "#ud44#", AL["Landro's Gift"]) - text = gsub(text, "#ud45#", AL["Statue Generator"]) - text = gsub(text, "#ud46#", AL["Blazing Hippogryph"]) - text = gsub(text, "#ud47#", AL["Icecrown"]) - text = gsub(text, "#ud48#", AL["Wooly White Rhino"]) - text = gsub(text, "#ud49#", AL["Ethereal Portal"]) - text = gsub(text, "#ud50#", AL["Paint Bomb"]) - - -- ZG Tokens - text = gsub(text, "#zgt1#", AL["Primal Hakkari Kossack"]) - text = gsub(text, "#zgt2#", AL["Primal Hakkari Shawl"]) - text = gsub(text, "#zgt3#", AL["Primal Hakkari Bindings"]) - text = gsub(text, "#zgt4#", AL["Primal Hakkari Sash"]) - text = gsub(text, "#zgt5#", AL["Primal Hakkari Stanchion"]) - text = gsub(text, "#zgt6#", AL["Primal Hakkari Aegis"]) - text = gsub(text, "#zgt7#", AL["Primal Hakkari Girdle"]) - text = gsub(text, "#zgt8#", AL["Primal Hakkari Armsplint"]) - text = gsub(text, "#zgt9#", AL["Primal Hakkari Tabard"]) - - -- AQ20 Tokens - text = gsub(text, "#aq20t1#", AL["Qiraji Ornate Hilt"]) - text = gsub(text, "#aq20t2#", AL["Qiraji Martial Drape"]) - text = gsub(text, "#aq20t3#", AL["Qiraji Magisterial Ring"]) - text = gsub(text, "#aq20t4#", AL["Qiraji Ceremonial Ring"]) - text = gsub(text, "#aq20t5#", AL["Qiraji Regal Drape"]) - text = gsub(text, "#aq20t6#", AL["Qiraji Spiked Hilt"]) - - -- Battleground Factions - text = gsub(text, "#b1#", BabbleFaction["Stormpike Guard"]) - text = gsub(text, "#b2#", BabbleFaction["Frostwolf Clan"]) - text = gsub(text, "#b3#", BabbleFaction["Silverwing Sentinels"]) - text = gsub(text, "#b4#", BabbleFaction["Warsong Outriders"]) - text = gsub(text, "#b5#", BabbleFaction["The League of Arathor"]) - text = gsub(text, "#b6#", BabbleFaction["The Defilers"]) - - -- BRD Arena Mini Bosses - text = gsub(text, "#brd1#", BabbleBoss["Anub'shiah"]) - text = gsub(text, "#brd2#", BabbleBoss["Eviscerator"]) - text = gsub(text, "#brd3#", BabbleBoss["Gorosh the Dervish"]) - text = gsub(text, "#brd4#", BabbleBoss["Grizzle"]) - text = gsub(text, "#brd5#", BabbleBoss["Hedrum the Creeper"]) - text = gsub(text, "#brd6#", BabbleBoss["Ok'thor the Breaker"]) - - -- Sunken Temple Troll Mini Bosses - text = gsub(text, "#st1#", BabbleBoss["Gasher"]) - text = gsub(text, "#st2#", BabbleBoss["Hukku"]) - text = gsub(text, "#st3#", BabbleBoss["Loro"]) - text = gsub(text, "#st4#", BabbleBoss["Mijan"]) - text = gsub(text, "#st5#", BabbleBoss["Zolo"]) - text = gsub(text, "#st6#", BabbleBoss["Zul'Lor"]) - - -- NPC Names - text = gsub(text, "#n1#", BabbleBoss["Lord Cobrahn"]) - text = gsub(text, "#n2#", BabbleBoss["Lady Anacondra"]) - text = gsub(text, "#n3#", BabbleBoss["Lord Serpentis"]) - text = gsub(text, "#n4#", AL["Druid of the Fang"]) - text = gsub(text, "#n5#", BabbleBoss["Lord Pythas"]) - text = gsub(text, "#n6#", BabbleBoss["Edwin VanCleef"]) - text = gsub(text, "#n7#", BabbleBoss["Captain Greenskin"]) - text = gsub(text, "#n8#", AL["Defias Strip Miner"]) - text = gsub(text, "#n9#", AL["Defias Overseer/Taskmaster"]) - text = gsub(text, "#n10#", AL["Scarlet Defender/Myrmidon"]) - text = gsub(text, "#n11#", AL["Trash Mobs"]) - text = gsub(text, "#n12#", AL["Scarlet Champion"]) - text = gsub(text, "#n13#", AL["Scarlet Centurion"]) - text = gsub(text, "#n14#", AL["Herod/Mograine"]) - text = gsub(text, "#n15#", AL["Scarlet Protector/Guardsman"]) - text = gsub(text, "#n16#", BabbleBoss["Lord Valthalak"]) - text = gsub(text, "#n17#", AL["Theldren"]) - text = gsub(text, "#n18#", AL["Sothos and Jarien"]) - text = gsub(text, "#n19#", BabbleBoss["Halycon"]) - text = gsub(text, "#n20#", BabbleBoss["Isalien"]) - text = gsub(text, "#n21#", BabbleBoss["Mor Grayhoof"]) - text = gsub(text, "#n22#", BabbleBoss["Kormok"]) - text = gsub(text, "#n23#", BabbleBoss["The Beast"]) - text = gsub(text, "#n24#", BabbleBoss["Postmaster Malown"]) - text = gsub(text, "#n25#", AL["Shadow of Doom"]) - text = gsub(text, "#n26#", AL["Bone Witch"]) - text = gsub(text, "#n27#", AL["Lumbering Horror"]) - text = gsub(text, "#n28#", BabbleBoss["High Priest Thekal"]) - text = gsub(text, "#n29#", BabbleBoss["High Priestess Mar'li"]) - text = gsub(text, "#n30#", BabbleBoss["High Priestess Arlokk"]) - text = gsub(text, "#n31#", BabbleBoss["High Priestess Jeklik"]) - text = gsub(text, "#n32#", BabbleBoss["High Priest Venoxis"]) - text = gsub(text, "#n33#", BabbleBoss["Bloodlord Mandokir"]) - text = gsub(text, "#n34#", BabbleBoss["Hakkar"]) - text = gsub(text, "#n35#", BabbleBoss["Ragnaros"]) - text = gsub(text, "#n36#", BabbleBoss["Onyxia"]) - text = gsub(text, "#n37#", AL["Highlord Kruul"]) - text = gsub(text, "#n38#", BabbleBoss["Magmadar"]) - text = gsub(text, "#n39#", BabbleBoss["Azuregos"]) - text = gsub(text, "#n40#", BabbleBoss["Warchief Rend Blackhand"]) - text = gsub(text, "#n41#", BabbleBoss["Crystal Fang"]) - text = gsub(text, "#n42#", BabbleBoss["Mother Smolderweb"]) - text = gsub(text, "#n43#", AL["Scarlet Trainee"]) - text = gsub(text, "#n44#", AL["Shadowforge Flame Keeper"]) - text = gsub(text, "#n45#", BabbleBoss["Baelog"]) - text = gsub(text, "#n46#", AL["Eric 'The Swift'"]) - text = gsub(text, "#n47#", AL["Olaf"]) - text = gsub(text, "#n48#", BabbleBoss["Hurley Blackbreath"]) - text = gsub(text, "#n49#", BabbleBoss["Phalanx"]) - text = gsub(text, "#n50#", BabbleBoss["Ribbly Screwspigot"]) - text = gsub(text, "#n51#", BabbleBoss["Plugger Spazzring"]) - text = gsub(text, "#n52#", BabbleBoss["Baron Rivendare"]) - text = gsub(text, "#n53#", BabbleBoss["Attumen the Huntsman"]) - text = gsub(text, "#n54#", AL["Nexus Stalker"]) - text = gsub(text, "#n55#", AL["Auchenai Monk"]) - text = gsub(text, "#n56#", AL["Cabal Fanatic"]) - text = gsub(text, "#n57#", AL["Unchained Doombringer"]) - text = gsub(text, "#n58#", BabbleBoss["Anzu"]) - text = gsub(text, "#n59#", BabbleBoss["Kael'thas Sunstrider"]) - text = gsub(text, "#n60#", AL["Crimson Sorcerer"]) - text = gsub(text, "#n61#", AL["Thuzadin Shadowcaster"]) - text = gsub(text, "#n62#", AL["Crimson Inquisitor"]) - text = gsub(text, "#n63#", AL["Crimson Battle Mage"]) - text = gsub(text, "#n64#", AL["Ghoul Ravener"]) - text = gsub(text, "#n65#", AL["Spectral Citizen"]) - text = gsub(text, "#n66#", AL["Spectral Researcher"]) - text = gsub(text, "#n67#", AL["Scholomance Adept"]) - text = gsub(text, "#n68#", AL["Scholomance Dark Summoner"]) - text = gsub(text, "#n69#", AL["Blackhand Elite"]) - text = gsub(text, "#n70#", AL["Blackhand Assassin"]) - text = gsub(text, "#n71#", AL["Firebrand Pyromancer"]) - text = gsub(text, "#n72#", AL["Firebrand Invoker"]) - text = gsub(text, "#n75#", AL["Firebrand Grunt"]) - text = gsub(text, "#n76#", AL["Firebrand Legionnaire"]) - text = gsub(text, "#n73#", AL["Spirestone Warlord"]) - text = gsub(text, "#n74#", AL["Spirestone Mystic"]) - text = gsub(text, "#n75#", AL["Anvilrage Captain"]) - text = gsub(text, "#n76#", AL["Anvilrage Marshal"]) - text = gsub(text, "#n77#", AL["Doomforge Arcanasmith"]) - text = gsub(text, "#n78#", AL["Weapon Technician"]) - text = gsub(text, "#n79#", AL["Doomforge Craftsman"]) - text = gsub(text, "#n80#", AL["Murk Worm"]) - text = gsub(text, "#n81#", AL["Atal'ai Witch Doctor"]) - text = gsub(text, "#n82#", AL["Raging Skeleton"]) - text = gsub(text, "#n83#", AL["Ethereal Priest"]) - text = gsub(text, "#n84#", AL["Sethekk Ravenguard"]) - text = gsub(text, "#n85#", AL["Time-Lost Shadowmage"]) - text = gsub(text, "#n86#", AL["Coilfang Sorceress"]) - text = gsub(text, "#n87#", AL["Coilfang Oracle"]) - text = gsub(text, "#n88#", AL["Shattered Hand Centurion"]) - text = gsub(text, "#n89#", AL["Eredar Deathbringer"]) - text = gsub(text, "#n90#", AL["Arcatraz Sentinel"]) - text = gsub(text, "#n91#", AL["Gargantuan Abyssal"]) - text = gsub(text, "#n92#", AL["Sunseeker Botanist"]) - text = gsub(text, "#n93#", AL["Sunseeker Astromage"]) - text = gsub(text, "#n94#", AL["Durnholde Rifleman"]) - text = gsub(text, "#n95#", AL["Rift Keeper/Rift Lord"]) - text = gsub(text, "#n96#", AL["Crimson Templar"]) - text = gsub(text, "#n97#", AL["Azure Templar"]) - text = gsub(text, "#n98#", AL["Hoary Templar"]) - text = gsub(text, "#n99#", AL["Earthen Templar"]) - text = gsub(text, "#n100#", AL["The Duke of Cynders"]) - text = gsub(text, "#n101#", AL["The Duke of Fathoms"]) - text = gsub(text, "#n102#", AL["The Duke of Zephyrs"]) - text = gsub(text, "#n103#", AL["The Duke of Shards"]) - text = gsub(text, "#n104#", BabbleBoss["Prince Skaldrenox"]) - text = gsub(text, "#n105#", BabbleBoss["Lord Skwol"]) - text = gsub(text, "#n106#", BabbleBoss["High Marshal Whirlaxis"]) - text = gsub(text, "#n107#", BabbleBoss["Baron Kazum"]) - text = gsub(text, "#n108#", BabbleBoss["Baron Charr"]) - text = gsub(text, "#n109#", BabbleBoss["Princess Tempestria"]) - text = gsub(text, "#n110#", BabbleBoss["Avalanchion"]) - text = gsub(text, "#n111#", BabbleBoss["The Windreaver"]) - text = gsub(text, "#n112#", AL["Aether-tech Assistant"]) - text = gsub(text, "#n113#", AL["Aether-tech Adept"]) - text = gsub(text, "#n114#", AL["Aether-tech Master"]) - text = gsub(text, "#n115#", BabbleBoss["Lord Kri"]) - text = gsub(text, "#n116#", BabbleBoss["Vem"]) - text = gsub(text, "#n117#", BabbleBoss["Princess Yauj"]) - text = gsub(text, "#n118#", AL["Trelopades"]) - text = gsub(text, "#n119#", AL["King Dorfbruiser"]) - text = gsub(text, "#n120#", AL["Gorgolon the All-seeing"]) - text = gsub(text, "#n121#", AL["Matron Li-sahar"]) - text = gsub(text, "#n122#", AL["Solus the Eternal"]) - text = gsub(text, "#n123#", AL["Balzaphon"]) - text = gsub(text, "#n124#", AL["Lord Blackwood"]) - text = gsub(text, "#n125#", AL["Revanchion"]) - text = gsub(text, "#n126#", AL["Scorn"]) - text = gsub(text, "#n127#", AL["Sever"]) - text = gsub(text, "#n128#", AL["Lady Falther'ess"]) - text = gsub(text, "#n129#", AL["Smokywood Pastures Vendor"]) - text = gsub(text, "#n130#", BabbleBoss["Nalorakk"]) - text = gsub(text, "#n131#", AL["Barleybrew Brewery"]) - text = gsub(text, "#n132#", AL["Thunderbrew Brewery"]) - text = gsub(text, "#n133#", AL["Gordok Brewery"]) - text = gsub(text, "#n134#", AL["Drohn's Distillery"]) - text = gsub(text, "#n135#", AL["T'chali's Voodoo Brewery"]) - text = gsub(text, "#n136#", AL["Headless Horseman"]) - text = gsub(text, "#n137#", BabbleBoss["Illidan Stormrage"]) - text = gsub(text, "#n138#", BabbleBoss["Vexallus"]) - text = gsub(text, "#n139#", BabbleBoss["Aeonus"]) - text = gsub(text, "#n150#", AL["Coren Direbrew"]) - text = gsub(text, "#n151#", BabbleBoss["Skadi the Ruthless"]) - text = gsub(text, "#n152#", BabbleBoss["Infinite Corruptor"]) - text = gsub(text, "#n153#", BabbleBoss["Sartharion"]) - text = gsub(text, "#n154#", BabbleBoss["Malygos"]) - text = gsub(text, "#n155#", AL["Time-Lost Proto Drake"]) - - -- Zone Names - text = gsub(text, "#z1#", BabbleZone["The Deadmines"]) - text = gsub(text, "#z2#", BabbleZone["Wailing Caverns"]) - text = gsub(text, "#z3#", BabbleZone["Scarlet Monastery"]) - text = gsub(text, "#z4#", BabbleZone["Blackrock Depths"]) - text = gsub(text, "#z5#", BabbleZone["Scholomance"]) - text = gsub(text, "#z6#", BabbleZone["Stratholme"]) - text = gsub(text, "#z7#", AL["Various Locations"]) - text = gsub(text, "#z8#", BabbleZone["Zul'Gurub"]) - text = gsub(text, "#z9#", BabbleZone["Upper Blackrock Spire"]) - text = gsub(text, "#z10#", BabbleZone["Lower Blackrock Spire"]) - text = gsub(text, "#z11#", BabbleZone["Ahn'Qiraj"]) - text = gsub(text, "#z12#", BabbleZone["Karazhan"]) - text = gsub(text, "#z13#", BabbleZone["Dire Maul (East)"]) - text = gsub(text, "#z14#", BabbleZone["Molten Core"]) - text = gsub(text, "#z15#", BabbleZone["Onyxia's Lair"]) - text = gsub(text, "#z16#", BabbleZone["Sethekk Halls"]) - text = gsub(text, "#z17#", AL["World Drop"]) - text = gsub(text, "#z18#", BabbleZone["Black Temple"]) - text = gsub(text, "#z19#", BabbleZone["The Eye"]) - text = gsub(text, "#z20#", BabbleZone["Un'Goro Crater"]) - text = gsub(text, "#z21#", BabbleZone["Winterspring"]) - text = gsub(text, "#z22#", BabbleZone["Azshara"]) - text = gsub(text, "#z23#", BabbleZone["Silithus"]) - text = gsub(text, "#z24#", BabbleZone["Azeroth"]) - text = gsub(text, "#z25#", BabbleZone["Outland"]) - text = gsub(text, "#z26#", BabbleZone["Shadowfang Keep"]) - text = gsub(text, "#z27#", BabbleZone["Razorfen Downs"]) - text = gsub(text, "#z28#", BabbleZone["Graveyard"]) - text = gsub(text, "#z29#", BabbleZone["Zul'Aman"]) - text = gsub(text, "#z30#", BabbleZone["Magisters' Terrace"]) - text = gsub(text, "#z31#", BabbleZone["Shattrath City"]) - text = gsub(text, "#z32#", AL["Sunwell Isle"]) - text = gsub(text, "#z33#", BabbleZone["The Black Morass"]) - text = gsub(text, "#z34#", BabbleZone["Hyjal Summit"]) - text = gsub(text, "#z35#", BabbleZone["Utgarde Pinnacle"]) - text = gsub(text, "#z36#", BabbleZone["Old Stratholme"]) - text = gsub(text, "#z37#", BabbleZone["The Storm Peaks"]) - text = gsub(text, "#z38#", BabbleZone["The Obsidian Sanctum"]) - text = gsub(text, "#z39#", BabbleZone["The Eye of Eternity"]) - text = gsub(text, "#z40#", BabbleZone["Northrend"]) - - -- Factions - text = gsub(text, "#f1#", BabbleFaction["Lower City"]) - text = gsub(text, "#f2#", BabbleFaction["The Sha'tar"]) - text = gsub(text, "#f3#", BabbleFaction["Thrallmar"]) - text = gsub(text, "#f4#", BabbleFaction["Honor Hold"]) - text = gsub(text, "#f5#", BabbleFaction["Keepers of Time"]) - text = gsub(text, "#f6#", BabbleFaction["Cenarion Expedition"]) - text = gsub(text, "#f7#", BabbleFaction["The Sons of Hodir"]) - text = gsub(text, "#f8#", BabbleFaction["The Wyrmrest Accord"]) - text = gsub(text, "#f9#", AL["Argent Tournament"]) - - -- Tier Tokens - text = gsub(text, "#setToken#", AL["Set Token (Click)"]) --Accessory tokens - - -- Tier 7 Sets - text = gsub(text, "#t7s1_1#", AL["Dreamwalker Garb"]) - text = gsub(text, "#t7s1_2#", AL["Dreamwalker Battlegear"]) - text = gsub(text, "#t7s1_3#", AL["Dreamwalker Regalia"]) - text = gsub(text, "#t7s2#", AL["Cryptstalker Battlegear"]) - text = gsub(text, "#t7s3#", AL["Frostfire Garb"]) - text = gsub(text, "#t7s4_1#", AL["Redemption Regalia"]) - text = gsub(text, "#t7s4_2#", AL["Redemption Battlegear"]) - text = gsub(text, "#t7s4_3#", AL["Redemption Plate"]) - text = gsub(text, "#t7s5_1#", AL["Regalia of Faith"]) - text = gsub(text, "#t7s5_2#", AL["Garb of Faith"]) - text = gsub(text, "#t7s6#", AL["Bonescythe Battlegear"]) - text = gsub(text, "#t7s7_1#", AL["Earthshatter Garb"]) - text = gsub(text, "#t7s7_2#", AL["Earthshatter Battlegear"]) - text = gsub(text, "#t7s7_3#", AL["Earthshatter Regalia"]) - text = gsub(text, "#t7s8#", AL["Plagueheart Garb"]) - text = gsub(text, "#t7s9_1#", AL["Dreadnaught Battlegear"]) - text = gsub(text, "#t7s9_2#", AL["Dreadnaught Plate"]) - text = gsub(text, "#t7s10_1#", AL["Scourgeborne Battlegear"]) - text = gsub(text, "#t7s10_2#", AL["Scourgeborne Plate"]) - - -- Tier 8 Sets - text = gsub(text, "#t8s1_1#", AL["Nightsong Garb"]) - text = gsub(text, "#t8s1_2#", AL["Nightsong Battlegear"]) - text = gsub(text, "#t8s1_3#", AL["Nightsong Regalia"]) - text = gsub(text, "#t8s2#", AL["Scourgestalker Battlegear"]) - text = gsub(text, "#t8s3#", AL["Kirin Tor Garb"]) - text = gsub(text, "#t8s4_1#", AL["Aegis Regalia"]) - text = gsub(text, "#t8s4_2#", AL["Aegis Battlegear"]) - text = gsub(text, "#t8s4_3#", AL["Aegis Plate"]) - text = gsub(text, "#t8s5_1#", AL["Sanctification Regalia"]) - text = gsub(text, "#t8s5_2#", AL["Sanctification Garb"]) - text = gsub(text, "#t8s6#", AL["Terrorblade Battlegear"]) - text = gsub(text, "#t8s7_1#", AL["Worldbreaker Garb"]) - text = gsub(text, "#t8s7_2#", AL["Worldbreaker Battlegear"]) - text = gsub(text, "#t8s7_3#", AL["Worldbreaker Regalia"]) - text = gsub(text, "#t8s8#", AL["Deathbringer Garb"]) - text = gsub(text, "#t8s9_1#", AL["Siegebreaker Battlegear"]) - text = gsub(text, "#t8s9_2#", AL["Siegebreaker Plate"]) - text = gsub(text, "#t8s10_1#", AL["Darkruned Battlegear"]) - text = gsub(text, "#t8s10_2#", AL["Darkruned Plate"]) - - -- Tier 9 Sets - text = gsub(text, "#t9s1_1a#", AL["Malfurion's Garb"]) - text = gsub(text, "#t9s1_1h#", AL["Runetotem's Garb"]) - text = gsub(text, "#t9s1_2a#", AL["Malfurion's Battlegear"]) - text = gsub(text, "#t9s1_2h#", AL["Runetotem's Battlegear"]) - text = gsub(text, "#t9s1_3a#", AL["Malfurion's Regalia"]) - text = gsub(text, "#t9s1_3h#", AL["Runetotem's Regalia"]) - text = gsub(text, "#t9s2_a#", AL["Windrunner's Battlegear"]) - text = gsub(text, "#t9s2_h#", AL["Windrunner's Pursuit"]) - text = gsub(text, "#t9s3_a#", AL["Khadgar's Regalia"]) - text = gsub(text, "#t9s3_h#", AL["Sunstrider's Regalia"]) - text = gsub(text, "#t9s4_1a#", AL["Turalyon's Garb"]) - text = gsub(text, "#t9s4_1h#", AL["Liadrin's Garb"]) - text = gsub(text, "#t9s4_2a#", AL["Turalyon's Battlegear"]) - text = gsub(text, "#t9s4_2h#", AL["Liadrin's Battlegear"]) - text = gsub(text, "#t9s4_3a#", AL["Turalyon's Plate"]) - text = gsub(text, "#t9s4_3h#", AL["Liadrin's Plate"]) - text = gsub(text, "#t9s5_1a#", AL["Velen's Regalia"]) - text = gsub(text, "#t9s5_1h#", AL["Zabra's Regalia"]) - text = gsub(text, "#t9s5_2a#", AL["Velen's Raiment"]) - text = gsub(text, "#t9s5_2h#", AL["Zabra's Raiment"]) - text = gsub(text, "#t9s6_a#", AL["VanCleef's Battlegear"]) - text = gsub(text, "#t9s6_h#", AL["Garona's Battlegear"]) - text = gsub(text, "#t9s7_1a#", AL["Nobundo's Garb"]) - text = gsub(text, "#t9s7_1h#", AL["Thrall's Garb"]) - text = gsub(text, "#t9s7_2a#", AL["Nobundo's Battlegear"]) - text = gsub(text, "#t9s7_2h#", AL["Thrall's Battlegear"]) - text = gsub(text, "#t9s7_3a#", AL["Nobundo's Regalia"]) - text = gsub(text, "#t9s7_3h#", AL["Thrall's Regalia"]) - text = gsub(text, "#t9s8_a#", AL["Kel'Thuzad's Regalia"]) - text = gsub(text, "#t9s8_h#", AL["Gul'dan's Regalia"]) - text = gsub(text, "#t9s9_1a#", AL["Wrynn's Battlegear"]) - text = gsub(text, "#t9s9_1h#", AL["Hellscream's Battlegear"]) - text = gsub(text, "#t9s9_2a#", AL["Wrynn's Plate"]) - text = gsub(text, "#t9s9_2h#", AL["Hellscream's Plate"]) - text = gsub(text, "#t9s10_1a#", AL["Thassarian's Plate"]) - text = gsub(text, "#t9s10_1h#", AL["Koltira's Plate"]) - text = gsub(text, "#t9s10_2a#", AL["Thassarian's Battlegear"]) - text = gsub(text, "#t9s10_2h#", AL["Koltira's Battlegear"]) - - -- Tier 10 Sets - text = gsub(text, "#t10s1_1#", AL["Lasherweave's Garb"]) - text = gsub(text, "#t10s1_2#", AL["Lasherweave's Battlegear"]) - text = gsub(text, "#t10s1_3#", AL["Lasherweave's Regalia"]) - text = gsub(text, "#t10s2#", AL["Ahn'Kahar Blood Hunter's Battlegear"]) - text = gsub(text, "#t10s3#", AL["Bloodmage's Regalia"]) - text = gsub(text, "#t10s4_1#", AL["Lightsworn Garb"]) - text = gsub(text, "#t10s4_2#", AL["Lightsworn Battlegear"]) - text = gsub(text, "#t10s4_3#", AL["Lightsworn Plate"]) - text = gsub(text, "#t10s5_1#", AL["Crimson Acolyte's Regalia"]) - text = gsub(text, "#t10s5_2#", AL["Crimson Acolyte's Raiment"]) - text = gsub(text, "#t10s6#", AL["Shadowblade's Battlegear"]) - text = gsub(text, "#t10s7_1#", AL["Frost Witch's Garb"]) - text = gsub(text, "#t10s7_2#", AL["Frost Witch's Battlegear"]) - text = gsub(text, "#t10s7_3#", AL["Frost Witch's Regalia"]) - text = gsub(text, "#t10s8#", AL["Dark Coven's Garb"]) - text = gsub(text, "#t10s9_1#", AL["Ymirjar Lord's Battlegear"]) - text = gsub(text, "#t10s9_2#", AL["Ymirjar Lord's Plate"]) - text = gsub(text, "#t10s10_1#", AL["Scourgelord's Battlegear"]) - text = gsub(text, "#t10s10_2#", AL["Scourgelord's Plate"]) - - -- Outland Faction Reputation PvP Sets - text = gsub(text, "#pvprep701_1#", AL["Dragonhide Battlegear"]) - text = gsub(text, "#pvprep701_2#", AL["Wyrmhide Battlegear"]) - text = gsub(text, "#pvprep701_3#", AL["Kodohide Battlegear"]) - text = gsub(text, "#pvprep702#", AL["Stalker's Chain Battlegear"]) - text = gsub(text, "#pvprep703#", AL["Evoker's Silk Battlegear"]) - text = gsub(text, "#pvprep704_1#", AL["Crusader's Scaled Battledgear"]) - text = gsub(text, "#pvprep704_2#", AL["Crusader's Ornamented Battledgear"]) - text = gsub(text, "#pvprep705_1#", AL["Satin Battlegear"]) - text = gsub(text, "#pvprep705_2#", AL["Mooncloth Battlegear"]) - text = gsub(text, "#pvprep706#", AL["Opportunist's Battlegear"]) - text = gsub(text, "#pvprep707_1#", AL["Seer's Linked Battlegear"]) - text = gsub(text, "#pvprep707_2#", AL["Seer's Mail Battlegear"]) - text = gsub(text, "#pvprep707_3#", AL["Seer's Ringmail Battlegear"]) - text = gsub(text, "#pvprep708#", AL["Dreadweave Battlegear"]) - text = gsub(text, "#pvprep709#", AL["Savage's Plate Battlegear"]) - - -- Arena Epic Sets - text = gsub(text, "#reqrating#", AL["Rating:"]) - text = gsub(text, "#arenas1_1#", AL["Gladiator's Sanctuary"]) - text = gsub(text, "#arenas1_2#", AL["Gladiator's Wildhide"]) - text = gsub(text, "#arenas1_3#", AL["Gladiator's Refuge"]) - text = gsub(text, "#arenas2#", AL["Gladiator's Pursuit"]) - text = gsub(text, "#arenas3#", AL["Gladiator's Regalia"]) - text = gsub(text, "#arenas4_1#", AL["Gladiator's Aegis"]) - text = gsub(text, "#arenas4_2#", AL["Gladiator's Vindication"]) - text = gsub(text, "#arenas4_3#", AL["Gladiator's Redemption"]) - text = gsub(text, "#arenas5_1#", AL["Gladiator's Raiment"]) - text = gsub(text, "#arenas5_2#", AL["Gladiator's Investiture"]) - text = gsub(text, "#arenas6#", AL["Gladiator's Vestments"]) - text = gsub(text, "#arenas7_1#", AL["Gladiator's Earthshaker"]) - text = gsub(text, "#arenas7_2#", AL["Gladiator's Thunderfist"]) - text = gsub(text, "#arenas7_3#", AL["Gladiator's Wartide"]) - text = gsub(text, "#arenas8_1#", AL["Gladiator's Dreadgear"]) - text = gsub(text, "#arenas8_2#", AL["Gladiator's Felshroud"]) - text = gsub(text, "#arenas9#", AL["Gladiator's Battlegear"]) - text = gsub(text, "#arenas10#", AL["Gladiator's Desecration"]) - - -- PVP Seasons - - text = gsub(text, "#arenas1L#", AL["Arena Season 1"]) - text = gsub(text, "#arenas2L#", AL["Arena Season 2"]) - text = gsub(text, "#arenas3L#", AL["Arena Season 3"]) - text = gsub(text, "#arenas4L#", AL["Arena Season 4"]) + { "Pet", BabbleInventory["Pet"] }, + { "Money", AL["Currency"] }, + { "Consumable", BabbleInventory["Consumable"] }, + { "Mount", BabbleInventory["Mount"] }, + { "Quest", BabbleInventory["Quest"] }, + { "Key", BabbleInventory["Key"] }, + { "Book", BabbleInventory["Book"] }, + { "Materials", BabbleInventory["Reagent"] }, + { "Flask", BabbleInventory["Flask"] }, + { "Other", AL["Misc"] }, + { "Junk", AL["Misc"] }, + { "%(OBSOLETE%)", ""}, + { "Food & Drink", BabbleInventory["Food & Drink"] }, -- Crafting - text = gsub(text, "#sr#", AL["Skill Required:"]) - text = gsub(text, "#source#", AL["Source"]..": "..WHITE) - text = gsub(text, "#zone#", AL["Zone"]..": "..WHITE) + { "Jewelcrafting", BabbleInventory["Jewelcrafting"] }, + { "Enchanting", BabbleInventory["Enchanting"] }, + { "Tailoring", BabbleInventory["Tailoring"] }, + { "Blacksmithing", BabbleInventory["Blacksmithing"] }, + { "Leatherworking", BabbleInventory["Leatherworking"] }, + { "Alchemy", BabbleInventory["Alchemy"] }, + { "Engineering", BabbleInventory["Engineering"] }, + { "Cooking", BabbleInventory["Cooking"] }, + { "Mining", AL["Mining"] }, + { "Herbalism", AL["Herbalism"] }, - -- Misc PvP Set Text - text = gsub(text, "#pvps1#", AL["Epic Set"]) - text = gsub(text, "#pvps2#", AL["Superior Rare Set"]) - text = gsub(text, "#pvps3#", AL["Rare Set"]) - text = gsub(text, "#pvps4#", AL["Superior Epic Set"]) + -- Gems + { "Red", AL["Red Gem"] }, + { "Blue", AL["Blue Gem"] }, + { "Yellow", AL["Yellow Gem"] }, + { "Purple", AL["Purple Gem"] }, + { "Orange", AL["Orange Gem"] }, + { "Green", AL["Green Gem"] }, -- Text Colouring - text = gsub(text, "=q0=", "|cff9d9d9d") - text = gsub(text, "=q1=", "|cffFFFFFF") - text = gsub(text, "=q2=", "|cff1eff00") - text = gsub(text, "=q3=", "|cff0070dd") - text = gsub(text, "=q4=", "|cffa335ee") - text = gsub(text, "=q5=", "|cffFF8000") - text = gsub(text, "=q6=", "|cffFF0000") - text = gsub(text, "=q7=", "|cffe6cc80") - text = gsub(text, "=ec1=", "|cffFF8400") - text = gsub(text, "=ds=", "|cffFFd200") - - -- Months - text = gsub(text, "#month1#", AL["January"]) - text = gsub(text, "#month2#", AL["February"]) - text = gsub(text, "#month3#", AL["March"]) - text = gsub(text, "#month4#", AL["April"]) - text = gsub(text, "#month5#", AL["May"]) - text = gsub(text, "#month6#", AL["June"]) - text = gsub(text, "#month7#", AL["July"]) - text = gsub(text, "#month8#", AL["August"]) - text = gsub(text, "#month9#", AL["September"]) - text = gsub(text, "#month10#", AL["October"]) - text = gsub(text, "#month11#", AL["November"]) - text = gsub(text, "#month12#", AL["December"]) + { "=q0=", "|cff9d9d9d" }, + { "=q1=", "|cffFFFFFF" }, + { "=q2=", "|cff1eff00" }, + { "=q3=", "|cff0070dd" }, + { "=q4=", "|cffa335ee" }, + { "=q5=", "|cffFF8000" }, + { "=q6=", "|cffFF0000" }, + { "=q7=", "|cffe6cc80" }, + { "=ec1=", "|cffFF8400" }, + { "=ds=", "|cffFFd200" }, -- Currency Icons - text = gsub(text, "#gold#", "|TInterface\\AddOns\\AtlasLoot\\Images\\gold:0|t") - text = gsub(text, "#silver#", "|TInterface\\AddOns\\AtlasLoot\\Images\\silver:0|t") - text = gsub(text, "#copper#", "|TInterface\\AddOns\\AtlasLoot\\Images\\bronze:0|t") - text = gsub(text, "#wsg#", "|TInterface\\Icons\\INV_Misc_Rune_07:0|t") - text = gsub(text, "#ab#", "|TInterface\\Icons\\INV_Jewelry_Amulet_07:0|t") - text = gsub(text, "#av#", "|TInterface\\Icons\\INV_Jewelry_Necklace_21:0|t") - text = gsub(text, "#eos#", "|TInterface\\Icons\\Spell_Nature_EyeOfTheStorm:0|t") - text = gsub(text, "#arena#", "|TInterface\\PVPFrame\\PVP-ArenaPoints-Icon:14:14:2:-1|t") - text = gsub(text, "#markthrallmar#", "|TInterface\\Icons\\INV_Misc_Token_Thrallmar:0|t") - text = gsub(text, "#markhhold#", "|TInterface\\Icons\\INV_Misc_Token_HonorHold:0|t") - text = gsub(text, "#halaabattle#", "|TInterface\\Icons\\INV_Misc_Rune_08:0|t") - text = gsub(text, "#halaaresearch#", "|TInterface\\Icons\\INV_Misc_Rune_09:0|t") - text = gsub(text, "#spiritshard#", "|TInterface\\Icons\\INV_Jewelry_FrostwolfTrinket_04:0|t") - text = gsub(text, "#wintergrasp#", "|TInterface\\Icons\\INV_Misc_Platnumdisks:0|t") - text = gsub(text, "#tokenofprestige#", "|TInterface\\Icons\\Spell_Holy_MindSooth:0|t") - text = gsub(text, "#marks#", "|TInterface\\Icons\\Mail_GMIcon:0|t") - text = gsub(text, "#bazaar#", "|TInterface\\Icons\\Spell_Shadow_Teleport:0|t") - text = gsub(text, "#wintergraspmark#", "|TInterface\\Icons\\INV_Jewelry_Ring_66:0|t") - text = gsub(text, "#venturecoin#", "|TInterface\\Icons\\INV_Misc_Coin_16:0|t") - text = gsub(text, "#heroic#", "|TInterface\\Icons\\Spell_Holy_ChampionsBond:0|t") - text = gsub(text, "#eofvalor#", "|TInterface\\Icons\\Spell_Holy_ProclaimChampion_02:0|t") - text = gsub(text, "#eofheroism#", "|TInterface\\Icons\\Spell_Holy_ProclaimChampion:0|t") - text = gsub(text, "#eofconquest#", "|TInterface\\Icons\\Spell_Holy_ChampionsGrace:0|t") - text = gsub(text, "#eoftriumph#", "|TInterface\\Icons\\spell_holy_summonchampion:0|t") - text = gsub(text, "#eoffrost#", "|TInterface\\Icons\\inv_misc_frostemblem_01:0|t") - text = gsub(text, "#trophyofthecrusade#", "|TInterface\\Icons\\INV_Misc_Trophy_Argent:0|t") - text = gsub(text, "#darkmoon#", "|TInterface\\Icons\\INV_Misc_Ticket_Darkmoon_01:0|t") - text = gsub(text, "#noblegarden#", "|TInterface\\Icons\\Achievement_Noblegarden_Chocolate_Egg:0|t") - text = gsub(text, "#brewfest#", "|TInterface\\Icons\\INV_Misc_Coin_01:0|t") - text = gsub(text, "#ccombat#", "|TInterface\\Icons\\INV_Jewelry_Talisman_06:0|t") - text = gsub(text, "#champseal#", "|TInterface\\Icons\\Ability_Paladin_ArtofWar:0|t") - text = gsub(text, "#champwrit#", "|TInterface\\Icons\\INV_Scroll_11:0|t") - text = gsub(text, "#ctactical#", "|TInterface\\Icons\\INV_Jewelry_Amulet_02:0|t") - text = gsub(text, "#clogistics#", "|TInterface\\Icons\\INV_Jewelry_Necklace_16:0|t") - text = gsub(text, "#cremulos#", "|TInterface\\Icons\\INV_Jewelry_Necklace_14:0|t") - text = gsub(text, "#ccenarius#", "|TInterface\\Icons\\INV_Jewelry_Necklace_12:0|t") - text = gsub(text, "#zandalar#", "|TInterface\\Icons\\INV_Misc_Coin_08:0|t") - text = gsub(text, "#glowcap#", "|TInterface\\Icons\\INV_Mushroom_02:0|t") - text = gsub(text, "#ogrilashard#", "|TInterface\\Icons\\INV_Misc_Apexis_Shard:0|t") - text = gsub(text, "#ogrilacrystal#", "|TInterface\\Icons\\INV_Misc_Apexis_Crystal:0|t") - text = gsub(text, "#winterfinclam#", "|TInterface\\Icons\\INV_Misc_Shell_03:0|t") - text = gsub(text, "#horde#", "|TInterface\\AddOns\\AtlasLoot\\Images\\Horde:14:14:0:-1|t") - text = gsub(text, "#alliance#", "|TInterface\\AddOns\\AtlasLoot\\Images\\Alliance:16:16:0:-2|t") - text = gsub(text, "#fireflower#", "|TInterface\\Icons\\INV_SummerFest_FireFlower:0|t") - text = gsub(text, "#t10mark#", "|TInterface\\Icons\\ability_paladin_shieldofthetemplar:0|t") - text = gsub(text, "#valentineday#", "|TInterface\\Icons\\inv_valentinescard01:0|t") - text = gsub(text, "#valentineday2#", "|TInterface\\Icons\\inv_jewelry_necklace_43:0|t") + { "#gold#", "|TInterface\\AddOns\\AtlasLoot\\Images\\gold:0|t" }, + { "#silver#", "|TInterface\\AddOns\\AtlasLoot\\Images\\silver:0|t" }, + { "#copper#", "|TInterface\\AddOns\\AtlasLoot\\Images\\bronze:0|t" }, + { "#wsg#", "|TInterface\\Icons\\INV_Misc_Rune_07:0|t" }, + { "#ab#", "|TInterface\\Icons\\INV_Jewelry_Amulet_07:0|t" }, + { "#av#", "|TInterface\\Icons\\INV_Jewelry_Necklace_21:0|t" }, + { "#eos#", "|TInterface\\Icons\\Spell_Nature_EyeOfTheStorm:0|t" }, + { "#arena#", "|TInterface\\PVPFrame\\PVP-ArenaPoints-Icon:14:14:2:-1|t" }, + { "#markthrallmar#", "|TInterface\\Icons\\INV_Misc_Token_Thrallmar:0|t" }, + { "#markhhold#", "|TInterface\\Icons\\INV_Misc_Token_HonorHold:0|t" }, + { "#halaabattle#", "|TInterface\\Icons\\INV_Misc_Rune_08:0|t" }, + { "#halaaresearch#", "|TInterface\\Icons\\INV_Misc_Rune_09:0|t" }, + { "#spiritshard#", "|TInterface\\Icons\\INV_Jewelry_FrostwolfTrinket_04:0|t" }, + { "#wintergrasp#", "|TInterface\\Icons\\INV_Misc_Platnumdisks:0|t" }, + { "#tokenofprestige#", "|TInterface\\Icons\\Spell_Holy_MindSooth:0|t" }, + { "#marks#", "|TInterface\\Icons\\Mail_GMIcon:0|t" }, + { "#bazaar#", "|TInterface\\Icons\\Spell_Shadow_Teleport:0|t" }, + { "#wintergraspmark#", "|TInterface\\Icons\\INV_Jewelry_Ring_66:0|t" }, + { "#venturecoin#", "|TInterface\\Icons\\INV_Misc_Coin_16:0|t" }, + { "#heroic#", "|TInterface\\Icons\\Spell_Holy_ChampionsBond:0|t" }, + { "#eofvalor#", "|TInterface\\Icons\\Spell_Holy_ProclaimChampion_02:0|t" }, + { "#eofheroism#", "|TInterface\\Icons\\Spell_Holy_ProclaimChampion:0|t" }, + { "#eofconquest#", "|TInterface\\Icons\\Spell_Holy_ChampionsGrace:0|t" }, + { "#eoftriumph#", "|TInterface\\Icons\\spell_holy_summonchampion:0|t" }, + { "#eoffrost#", "|TInterface\\Icons\\inv_misc_frostemblem_01:0|t" }, + { "#trophyofthecrusade#", "|TInterface\\Icons\\INV_Misc_Trophy_Argent:0|t" }, + { "#darkmoon#", "|TInterface\\Icons\\INV_Misc_Ticket_Darkmoon_01:0|t" }, + { "#noblegarden#", "|TInterface\\Icons\\Achievement_Noblegarden_Chocolate_Egg:0|t" }, + { "#brewfest#", "|TInterface\\Icons\\INV_Misc_Coin_01:0|t" }, + { "#ccombat#", "|TInterface\\Icons\\INV_Jewelry_Talisman_06:0|t" }, + { "#champseal#", "|TInterface\\Icons\\Ability_Paladin_ArtofWar:0|t" }, + { "#champwrit#", "|TInterface\\Icons\\INV_Scroll_11:0|t" }, + { "#ctactical#", "|TInterface\\Icons\\INV_Jewelry_Amulet_02:0|t" }, + { "#clogistics#", "|TInterface\\Icons\\INV_Jewelry_Necklace_16:0|t" }, + { "#cremulos#", "|TInterface\\Icons\\INV_Jewelry_Necklace_14:0|t" }, + { "#ccenarius#", "|TInterface\\Icons\\INV_Jewelry_Necklace_12:0|t" }, + { "#zandalar#", "|TInterface\\Icons\\INV_Misc_Coin_08:0|t" }, + { "#glowcap#", "|TInterface\\Icons\\INV_Mushroom_02:0|t" }, + { "#ogrilashard#", "|TInterface\\Icons\\INV_Misc_Apexis_Shard:0|t" }, + { "#ogrilacrystal#", "|TInterface\\Icons\\INV_Misc_Apexis_Crystal:0|t" }, + { "#winterfinclam#", "|TInterface\\Icons\\INV_Misc_Shell_03:0|t" }, + { "#horde#", "|TInterface\\AddOns\\AtlasLoot\\Images\\Horde:14:14:0:-1|t" }, + { "#alliance#", "|TInterface\\AddOns\\AtlasLoot\\Images\\Alliance:16:16:0:-2|t" }, + { "#fireflower#", "|TInterface\\Icons\\INV_SummerFest_FireFlower:0|t" }, + { "#t10mark#", "|TInterface\\Icons\\ability_paladin_shieldofthetemplar:0|t" }, + { "#valentineday#", "|TInterface\\Icons\\inv_valentinescard01:0|t" }, + { "#valentineday2#", "|TInterface\\Icons\\inv_jewelry_necklace_43:0|t" }, + + { "Herb", "Herbalism" }, + { "Item Enhancement", "Enchant" }, + { "Weapon Enchantment", "Enchanting" }, + { "Armor Enchantment", "Enchanting" }, + { "Simple", "Gems" }, +} + +function AtlasLoot:FixText(text) + for _, subTable in pairs (txtSubstitution) do + text = gsub(text, subTable[1], subTable[2]) + end - text = gsub(text, ", Herb", "Herbalism") - text = gsub(text, ", Meat", "Meat") - text = gsub(text, ", Item Enhancement", "Enchant") - text = gsub(text, ", Weapon Enchantment", "Enchanting") - text = gsub(text, ", Armor Enchantment", "Enchanting") - text = gsub(text, ", Scroll", "Scroll") - text = gsub(text, ", Holiday", "Holiday") - text = gsub(text, ", Metal & Stone", "Metal & Stone") - text = gsub(text, ", Potion", "Potion") - text = gsub(text, ", Engineering", "Parts") - text = gsub(text, ", Simple", "Gems") - text = gsub(text, ", Elemental", "Elemental") - text = gsub(text, ", Elixir", "Elixir") - text = gsub(text, ", Reagent", "Reagent") - text = gsub(text, ", Devices", "Devices") - text = gsub(text, ", Trade Goods", "Trade Goods") - local englishFaction, _ = UnitFactionGroup("player") if englishFaction == "Horde" then text = gsub(text, "#faction#", "|TInterface\\AddOns\\AtlasLoot\\Images\\Horde:14:14:0:-1|t") diff --git a/AtlasLoot/Core/Utils.lua b/AtlasLoot/Core/Utils.lua index 8c44345..ec0b6ee 100644 --- a/AtlasLoot/Core/Utils.lua +++ b/AtlasLoot/Core/Utils.lua @@ -120,54 +120,45 @@ function AtlasLoot:OpenDB(frame, type, text) self:OpenDewdropMenu(frame, menuList) end ---[[ -AtlasLoot:FindId(id, difficulty) -Finds the Ids of other difficulties based on the normal id of the item and the difficulty parameter given. -On the form of {ID, {normal, heroic, mythic, mythic1, mythic2, ... ,mythicN}} -]] -function AtlasLoot:FindId(id, difficulty, type, sourceType) - if not ItemIDsDatabase[id] then return nil, false end - if difficulty == 100 then - local newIDs = { - (id < 1000000 and (id) + 6300000), - (id < 1000000 and (id) + 7800000), - (id > 1000000 and (id - 1500000) + 6300000), - (id > 1000000 and (id - 1500000) + 7800000), - } - for _, newID in ipairs(newIDs) do - local ogName = GetItemInfoInstant(id) - local newName = GetItemInfoInstant(newID) - if newName and ogName and string.find(newName.name, ogName.name) then - return newID, true - end - end - return ItemIDsDatabase[id]["HeroicBloodforged"], true - end - - if difficulty == 1 then - local newIDs = { - (id < 1000000 and (id) + 6000000), - (id < 1000000 and (id) + 7500000), - (id > 1000000 and (id - 1500000) + 6000000), - (id > 1000000 and (id - 1500000) + 7500000), - } - for _, newID in ipairs(newIDs) do - local ogName = GetItemInfoInstant(id) - local newName = GetItemInfoInstant(newID) - if newName and ogName and string.find(newName.name, ogName.name) then - return newID, true - end +local itemEquipLocConversion = { + "INVTYPE_HEAD", + "INVTYPE_NECK", + "INVTYPE_SHOULDER", + "INVTYPE_BODY", + "INVTYPE_CHEST", + "INVTYPE_WAIST", + "INVTYPE_LEGS", + "INVTYPE_FEET", + "INVTYPE_WRIST", + "INVTYPE_HAND", + "INVTYPE_FINGER", + "INVTYPE_TRINKET", + "INVTYPE_WEAPON", + "INVTYPE_SHIELD", + "INVTYPE_RANGED", + "INVTYPE_CLOAK", + "INVTYPE_2HWEAPON", + "INVTYPE_BAG", + "INVTYPE_TABARD", + "INVTYPE_ROBE", + "INVTYPE_WEAPONMAINHAND", + "INVTYPE_WEAPONOFFHAND", + "INVTYPE_HOLDABLE", + "INVTYPE_AMMO", + "INVTYPE_THROWN", + "INVTYPE_RANGEDRIGHT", + "INVTYPE_QUIVER", + "INVTYPE_RELIC", +} +function AtlasLoot:GetItemInfo(itemID) + local itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(itemID) + if not itemName then + local item = GetItemInfoInstant(itemID) + if item then + itemName, itemSubType, itemEquipLoc, itemTexture, itemQuality = item.name, _G["ITEM_SUBCLASS_"..item.classID.."_"..item.subclassID], itemEquipLocConversion[item.inventoryType], item.icon, item.quality end end - - if (difficulty == 4 and (type == "BCRaid" or type == "ClassicRaid") and sourceType == "Search") or - (difficulty == 5 and (type == "BCRaid" or type == "ClassicRaid") and sourceType ~= "Search") then - return ItemIDsDatabase[id]["MythicRaid"], true - end - if (difficulty == 5 and (type == "BCRaid" or type == "ClassicRaid") and sourceType == "Search") then - difficulty = 4 - end - return ItemIDsDatabase[id][difficulty], true + return itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice end -- Create enchant tooltip @@ -210,8 +201,9 @@ function AtlasLoot:GetRecipeData(recipeID, idType) for _,recipe in pairs(cat) do if (idType == "spell" and recipeID == recipe.SpellEntry) or (idType == "item" and recipeID == recipe.RecipeItemEntry) then local info = {{recipe.CreatedItemEntry}, "blank", "blank", "blank", "blank", "blank",spellID = recipe.SpellEntry, skillIndex = recipe.SkillIndex} - if ItemIDsDatabase[recipe.CreatedItemEntry] and ItemIDsDatabase[recipe.CreatedItemEntry][1] then - info[2] = {ItemIDsDatabase[recipe.CreatedItemEntry][1]} + local bloodForgedID = self:FindId(recipe.CreatedItemEntry, 1, nil, "Bloodforged") + if bloodForgedID then + info[2] = {bloodForgedID} end if recipe.RecipeItemEntry and recipe.RecipeItemEntry ~= 0 then local number = 3 @@ -219,7 +211,7 @@ function AtlasLoot:GetRecipeData(recipeID, idType) number = 2 end info[number] = {recipe.RecipeItemEntry} - + info.Recipe = recipe.RecipeItemEntry end for _,v in pairs(recipe.Reagents) do tinsert(info, v) @@ -365,7 +357,7 @@ function AtlasLoot:PopoupItemFrame(frame, data) self:ItemsLoading(-1) end) end - local itemData = {GetItemInfo(itemID)} + local itemData = {self:GetItemInfo(itemID)} SetItemButtonTexture(button, itemData[10]) SetItemButtonQuality(button, itemData[3]) @@ -373,14 +365,14 @@ function AtlasLoot:PopoupItemFrame(frame, data) button.itemTexture = frame.itemTexture local recipe = self:GetRecipeData(itemID, "item") if recipe then - button.craftingData = self:RecipeSource(recipe.spellID) + button.craftingData = self:GetRecipeSource(recipe.spellID) end - if item[2] then - SetItemButtonCount(button, item[2]) - else - SetItemButtonCount(button) - end - button:Show() + if item[2] then + SetItemButtonCount(button, item[2]) + else + SetItemButtonCount(button) + end + button:Show() end numberBtns = i end @@ -553,4 +545,166 @@ local function TooltipHandlerItem(tooltip) SetTooltip(itemID, tooltip) end -GameTooltip:HookScript("OnTooltipSetItem", TooltipHandlerItem) \ No newline at end of file +GameTooltip:HookScript("OnTooltipSetItem", TooltipHandlerItem) + +function AtlasLoot:StripTextColor(txt) + local txt = txt or "" + txt = string.gsub( txt, "|c%x%x%x%x%x%x%x%x", "" ) + txt = string.gsub( txt, "|c%x%x %x%x%x%x%x", "" ) -- the trading parts colour has a space instead of a zero for some weird reason + txt = string.gsub( txt, "|r", "" ) + return txt +end + +function AtlasLoot:CheckIfEmptyTable(table) + if next(table) then + return false + else + return true + end +end + +function AtlasLoot:GetRecipeSource(spellID) + if not spellID then return end + local cData = AtlasLoot_CraftingData + local data = {} + -- extra information on where to find the recipe + -- trainer learnt + local trainer = cData["Trainer"][spellID] + if trainer then tinsert(data, {AL["Source"]..": "..WHITE..trainer}) end + -- aquire type + local aquireType = cData["AquireType"][spellID] + if aquireType then + tinsert(data, {AL["Source"]..": "..WHITE..cData[aquireType[1]][aquireType[2]][1]}) + end + -- vendor recipe + local vendor = cData["Vendor"][spellID] + if vendor then + tinsert(data, {AL["Source"]..": "..WHITE..AL["Vendor"]}) + for _,v in pairs(vendor) do + local vendor = AtlasLoot_CraftingData["VendorList"][v] + tinsert(data, {vendor[1], vendor[2], cords = {vendor[3], vendor[4]}, fac = vendor[5]}) + end + end + -- vendor recipe + local recipeRepVendor = cData["RecipeRepVendor"][spellID] + if recipeRepVendor then + tinsert(data, {AL["Source"]..": "..WHITE..AL["Vendor"]}) + local vendor = AtlasLoot_CraftingData["VendorList"][spellID] + for i = 3, 6 do + if vendor and vendor[i] then + tinsert(data, {vendor[1], vendor[2], fac = vendor[i]}) + end + end + end + --limited vendor recipes + local limitedVendor = cData["LimitedVendor"][spellID] + if limitedVendor then + tinsert(data, {AL["Source"]..": "..WHITE..AL["Limited Stock"]}) + local sort = {} + local limited = false + for i,v in pairs(limitedVendor) do + if limited then + tinsert(sort[i-1],v) + limited = false + else + sort[i] = {v} + limited = true + end + end + for _,v in pairs(sort) do + local vendor = AtlasLoot_CraftingData["VendorList"][v[1]] + tinsert(data, {vendor[1], vendor[2], cords = {vendor[3], vendor[4]}, fac = vendor[5], limited = v[2]}) + end + end + --mob drop + local mobDrop = cData["MobDrop"][spellID] + if mobDrop then + tinsert(data, {AL["Source"]..": "..WHITE..AL["Mob Drop"]}) + for _,v in pairs(mobDrop) do + local mob = AtlasLoot_CraftingData["MobList"][v] + local cords = nil + if mob[3] ~= 0 and mob[4] ~= 0 then + cords = {mob[3], mob[4]} + end + tinsert(data, {mob[1], WHITE..mob[2], cords}) + end + end + -- World Drop + local worldDrop = cData["WorldDrop"][spellID] + if worldDrop then + tinsert(data, {AL["Source"]..": "..WHITE..AL["World Drop"]}) + local text = worldDrop[1] + if worldDrop[2] then + text = text.." / "..worldDrop[2] + end + tinsert(data, {text}) + end + --quest + local questDrop = cData["QuestDrop"][spellID] + if questDrop then + tinsert(data, {AL["Source"]..": "..WHITE..AL["Quest"]}) + for _,v in pairs(questDrop) do + local quest = AtlasLoot_CraftingData["QuestList"][v] + tinsert(data, {quest[1], quest[2], cords = {quest[3], quest[4]}, fac = quest[5]}) + end + end + --rep vendor + local repVendor = cData["RepVendor"][spellID] + if repVendor then + tinsert(data, {AL["Source"]..": "..WHITE..AL["Reputation Vendor"]}) + local line1, line2 + local list = {} + for i,v in pairs(repVendor) do + if type(v) == "table" then + for i,v in pairs(v) do + if i == 1 then + line1 = AL["Faction"]..": "..WHITE..v + elseif i == 2 then + line2 = AL["Required Reputation"]..": "..WHITE..v + else + tinsert(list,AtlasLoot_CraftingData["VendorList"][v]) + end + end + else + if i == 1 then + line1 = AL["Faction"]..": "..WHITE..v + elseif i == 2 then + line2 = AL["Required Reputation"]..": "..WHITE..v + else + tinsert(list,AtlasLoot_CraftingData["VendorList"][v]) + end + end + end + tinsert(data, {line1, line2}) + for _,v in pairs(list) do + local cords + if v[3] ~= 0 and v[4] ~= 0 then + cords = {v[3], v[4]} + end + tinsert(data, {v[1], WHITE..v[2], cords, fac = v[5]}) + end + end + return data +end + +-- handle minimap tooltip +function AtlasLoot:GetTipAnchor(frame) + local x, y = frame:GetCenter() + if not x or not y then return 'TOPLEFT', 'BOTTOMLEFT' end + local hhalf = (x > UIParent:GetWidth() * 2 / 3) and 'RIGHT' or (x < UIParent:GetWidth() / 3) and 'LEFT' or '' + local vhalf = (y > UIParent:GetHeight() / 2) and 'TOP' or 'BOTTOM' + return vhalf .. hhalf, frame, (vhalf == 'TOP' and 'BOTTOM' or 'TOP') .. hhalf +end + +-- Search Auction House for crafting patern/enchant +function AtlasLoot:SearchAuctionHouse(text) + if not text then return end + if BrowseName:IsVisible() then + BrowseName:SetText(text) + BrowseSearchButton:Click() + elseif Atr_Search_Box:IsVisible() then + Atr_Search_Box:SetText(text) + Atr_Search_Button:Click() + end + +end \ No newline at end of file diff --git a/AtlasLoot/Databases/DatabaseFunctions.lua b/AtlasLoot/Databases/DatabaseFunctions.lua new file mode 100644 index 0000000..e49b8d2 --- /dev/null +++ b/AtlasLoot/Databases/DatabaseFunctions.lua @@ -0,0 +1,209 @@ +local difficultyList = { + ["Heroic"] = 3, + ["Mythic"] = 4, + ["Heroic Raid"] = 3, + ["Mythic Raid"] = 4, + ["Ascended Raid"] = 5, + ["Heroic Bloodforged"] = 100, + ["Bloodforged"] = 1, + ["Mythic 1"] = 5, ["Mythic 2"] = 6, ["Mythic 3"] = 7, ["Mythic 4"] = 8, ["Mythic 5"] = 9, + ["Mythic 6"] = 10, ["Mythic 7"] = 11, ["Mythic 8"] = 12, ["Mythic 9"] = 13, ["Mythic 10"] = 14, + ["Mythic 11"] = 15, ["Mythic 12"] = 16, ["Mythic 13"] = 17, ["Mythic 14"] = 18, ["Mythic 15"] = 19, + ["Mythic 16"] = 20, ["Mythic 17"] = 21, ["Mythic 18"] = 22, ["Mythic 19"] = 23, ["Mythic 20"] = 24, + ["Mythic 21"] = 25, ["Mythic 22"] = 26, ["Mythic 23"] = 27, ["Mythic 24"] = 28, ["Mythic 25"] = 29, + ["Mythic 26"] = 30, ["Mythic 27"] = 31, ["Mythic 28"] = 32, ["Mythic 29"] = 33, ["Mythic 30"] = 34, + ["Mythic 31"] = 35, ["Mythic 32"] = 36, ["Mythic 33"] = 37, ["Mythic 34"] = 38, ["Mythic 35"] = 39, + ["Mythic 36"] = 40, ["Mythic 37"] = 41, ["Mythic 38"] = 42, ["Mythic 39"] = 43, ["Mythic 40"] = 44, +}; + +function AtlasLoot:GetDifficulty(item) + if not item then return end + local _, description, _ = string.split("@", item.description, 3) + if description then + return self:StripTextColor(description) + end +end + +function AtlasLoot:CheckItemID(newIDs, ID, dif) + if not newIDs then return end + if type(newIDs) ~= "table" then newIDs = {newIDs} end + for _, newID in ipairs(newIDs) do + local ogName = GetItemInfoInstant(ID) + local newName = GetItemInfoInstant(newID) + if newName and ogName and newName.name and ogName.name then + ogName.name = ogName.name:gsub( "%W", "" ) + newName.name = newName.name:gsub( "%W", "" ) + if dif == "Bloodforged" or dif == "Heroic Bloodforged" then + ogName.name = "Bloodforged"..ogName.name + end + local description = self:GetDifficulty(newName) + if description then + if (not dif or (dif and (dif == description))) then + if ogName.name == newName.name then + return newID + end + end + end + end + end +end + +local updateFrameCreated +function AtlasLoot:CreateUpdateText() + if updateFrameCreated then return end + local updateCounterFrame = CreateFrame("Frame", "AtlasLootDbUpdate", UIParrnt, nil) + updateCounterFrame:SetPoint("CENTER",0,200) + updateCounterFrame:SetSize(400,50) + updateCounterFrame:Hide() + updateCounterFrame.cText = updateCounterFrame:CreateFontString("AtlasLootDbUpdateText","OVERLAY","GameFontNormal") + updateCounterFrame.cText:Show() + updateCounterFrame.cText:SetPoint("CENTER",0,0) + updateCounterFrame.lastIDText = updateCounterFrame:CreateFontString("AtlasLootIDUpdateText","OVERLAY","GameFontNormal") + updateCounterFrame.lastIDText:Show() + updateCounterFrame.lastIDText:SetPoint("TOP", updateCounterFrame.cText, "BOTTOM" ,10,0) + updateFrameCreated = true +end + +local itemTypeIgnore = {[18] = true, [19] = true, [24] = true} + +local unknownIDs = {} +function AtlasLoot:UpdateItemIDsDatabase(firstID, lastID) + AtlasLootItemCache = ItemIDsDatabase + self:IsLootTableAvailable("AtlasLootOriginalWoW") + self:IsLootTableAvailable("AtlasLootBurningCrusade") + self:IsLootTableAvailable("AtlasLootWotLK") + for dataID, data in pairs(AtlasLoot_Data) do + if data.Type then + for tableNum, t in ipairs(data) do + for _, itemData in pairs(t) do + if type(itemData) == "table" then + if itemData.itemID then + for _, dif in ipairs(self.Difficulties[data.Type]) do + local itemType = GetItemInfoInstant(itemData.itemID) or nil + if dif[2] ~= 100 and dif[2] ~= 1 and dif[2] ~= 2 and itemType then + unknownIDs[dif[1]] = unknownIDs[dif[1]] or {} + unknownIDs[dif[1]][itemType.name:gsub( "%W", "" )] = itemData.itemID + end + end + end + end + end + end + end + end + + if self:CheckIfEmptyTable(unknownIDs) then return end + self:CreateUpdateText() + AtlasLootDbUpdate:Show() + + local maxDuration = 500/GetFramerate() + local startTime = debugprofilestop() + firstID = firstID or 1 + lastID = lastID or 10000000 + AtlasLootDbUpdateText:SetText("Updating AtlasLoot Item Cache\n"..firstID.." / ".. lastID) + + local function checkID(item, difficulty) + if difficulty and item and item.name then + local foundName = item.name:gsub( "%W", "" ) + if foundName then + local orignalID = unknownIDs[difficulty] and unknownIDs[difficulty][foundName] + if orignalID then + ItemIDsDatabase[orignalID] = ItemIDsDatabase[orignalID] or {} + ItemIDsDatabase[orignalID][difficultyList[difficulty]] = item.itemID + AtlasLootIDUpdateText:SetText("Last ItemID Added: "..firstID) + end + end + end + AtlasLootDbUpdateText:SetText("Updating AtlasLoot Item Cache\n"..firstID.." / ".. lastID) + end + + local function continue() + if self:CheckIfEmptyTable(unknownIDs) then + return + end + startTime = debugprofilestop() + while (firstID ~= lastID) do + local item = GetItemInfoInstant(firstID) + local difficulty = self:GetDifficulty(item) + if item and difficulty then + checkID(item, difficulty) + end + firstID = firstID + 1 + AtlasLootDbUpdateText:SetText("Updating AtlasLoot Item Cache\n"..firstID.." / ".. lastID) + if (debugprofilestop() - startTime > maxDuration) then + collectgarbage("collect") + Timer.After(0, continue) + return + end + end + AtlasLootDbUpdateText:SetText("Updating AtlasLoot Item Cache\nUpdate Complete Reloadui To Save") + end + + return continue() +end + +--[[ +AtlasLoot:FindId(id, difficulty) +Finds the Ids of other difficulties based on the normal id of the item and the difficulty parameter given. +On the form of {ID, {normal, heroic, mythic, mythic1, mythic2, ... ,mythicN}} +]] +function AtlasLoot:FindId(id, difficulty, type, Difficultiestring) + local hasID + if self.Difficulties[type] then + for _, dif in ipairs (self.Difficulties[type]) do + if dif[2] == difficulty then + Difficultiestring = dif[1] + end + end + end + if difficulty == 2 then return end + -- Create Heroic Bloodforged Id + if difficulty == 100 then + local newIDs = { + (id < 1000000 and (id) + 6300000), + (id < 1000000 and (id) + 7800000), + (id > 1000000 and (id - 1500000) + 6300000), + (id > 1000000 and (id - 1500000) + 7800000), + } + hasID = self:CheckItemID(newIDs, id, Difficultiestring) + if hasID then return hasID, true end + end + -- Create Bloodforged Id + if difficulty == 1 then + local newIDs = { + (id < 1000000 and (id) + 6000000), + (id < 1000000 and (id) + 7500000), + (id > 1000000 and (id - 1500000) + 6000000), + (id > 1000000 and (id - 1500000) + 7500000), + } + hasID = self:CheckItemID(newIDs, id, Difficultiestring) + if hasID then return hasID, true end + end + if ItemIDsDatabase[id] and ItemIDsDatabase[id][difficulty] then + return ItemIDsDatabase[id][difficulty], true + end +end + +--Updates the ItemIDsDatabase with any missing or incorrect items +function AtlasLoot:LoadMissingIDs() + --loads any items in the saved varriables cache + if AtlasLootItemCache and not self:CheckIfEmptyTable(AtlasLootItemCache) then + for normalID, item in pairs(AtlasLootItemCache) do + for itemDif, itemID in pairs(item) do + ItemIDsDatabase[normalID] = ItemIDsDatabase[normalID] or {} + ItemIDsDatabase[normalID][itemDif] = itemID + end + end + end + -- loads ids that have been manuely corrected + if ItemIDManuelCorrections then + for normalID, item in pairs(ItemIDManuelCorrections) do + for itemDif, itemID in pairs(item) do + ItemIDsDatabase[normalID] = ItemIDsDatabase[normalID] or {} + ItemIDsDatabase[normalID][itemDif] = itemID + end + end + end + ItemIDManuelCorrections = nil + collectgarbage("collect") +end \ No newline at end of file diff --git a/AtlasLoot/Databases/Databases.lua b/AtlasLoot/Databases/Databases.lua index e1256ad..f18c534 100644 --- a/AtlasLoot/Databases/Databases.lua +++ b/AtlasLoot/Databases/Databases.lua @@ -1,3 +1,5 @@ +AtlasLoot = LibStub("AceAddon-3.0"):NewAddon("AtlasLoot", "AceEvent-3.0", "AceTimer-3.0") + local AL = LibStub("AceLocale-3.0"):GetLocale("AtlasLoot"); local BabbleBoss = AtlasLoot_GetLocaleLibBabble("LibBabble-Boss-3.0") local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0") @@ -81,14 +83,6 @@ AtlasLoot_CraftingData["Seasonal"] = { [6] = { AL["Day of the Dead"] }; -- Day of the Dead } - -AtlasLoot_ExtraData["ArmorConversion"] = { - "Cloth", - "Leather", - "Mail", - "Plate" -} - ---------------------- --- Heirloom Items --- ---------------------- diff --git a/AtlasLoot/Databases/Databases.xml b/AtlasLoot/Databases/Databases.xml index a0ded38..bef41e6 100644 --- a/AtlasLoot/Databases/Databases.xml +++ b/AtlasLoot/Databases/Databases.xml @@ -2,6 +2,7 @@ ..\FrameXML\UI.xsd">