diff --git a/Core/AtlasLoot.lua b/Core/AtlasLoot.lua index e76e2b2..65feb8b 100644 --- a/Core/AtlasLoot.lua +++ b/Core/AtlasLoot.lua @@ -239,7 +239,7 @@ AtlasLootDefaultFrame_OnShow: Called whenever the loot browser is shown and sets up buttons and loot tables ]] function AtlasLootDefaultFrame_OnShow() - --Definition of where I want the loot table to be shown + --Definition of where I want the loot table to be shown pFrame = { "TOPLEFT", "AtlasLootDefaultFrame_LootBackground", "TOPLEFT", "2", "-2" }; --Having the Atlas and loot browser frames shown at the same time would --cause conflicts, so I hide the Atlas frame when the loot browser appears @@ -604,7 +604,7 @@ end --[[ AtlasLoot_AtlasScrollBar_Update: -Hooks the Atlas scroll frame. +Hooks the Atlas scroll frame. Required as the Atlas function cannot deal with the AtlasLoot button template or the added Atlasloot entries ]] function AtlasLoot_AtlasScrollBar_Update() @@ -830,7 +830,7 @@ function AtlasLoot_Atlas_OnShow() AtlasLootPanel:Hide(); else AtlasLootPanel:Show(); - end + end pFrame = AtlasFrame; end @@ -860,7 +860,7 @@ function AtlasLootBoss_OnClick(name) getglobal(name.."_Loot"):Show(); AtlasLootItemsFrame:Hide(); AtlasLootItemsFrame.activeBoss = nil; - else + else --If an loot table is associated with the button, show it. Note multiple tables need to be checked due to the database structure if (AtlasLootBossButtons[zoneID] ~= nil and AtlasLootBossButtons[zoneID][id] ~= nil and AtlasLootBossButtons[zoneID][id] ~= "") then if AtlasLoot_IsLootTableAvailable(AtlasLootBossButtons[zoneID][id]) then @@ -1232,7 +1232,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) else quantityFrame = getglobal("AtlasLootItem_"..i.."_Quantity"); quantityFrame:SetText("") - end + end end --Store data about the state of the items frame to allow minor tweaks or a recall of the current loot page AtlasLootItemsFrame.refresh = {dataID, dataSource_backup, boss, pFrame}; @@ -1530,7 +1530,7 @@ Called when a button in AtlasLoot_Dewdrop is clicked function AtlasLoot_DewDropClick(tablename, text, tabletype) --Definition of where I want the loot table to be shown pFrame = { "TOPLEFT", "AtlasLootDefaultFrame_LootBackground", "TOPLEFT", "2", "-2" }; - + --If the button clicked was linked to a loot table if tabletype == "Table" then --Show the loot table @@ -2041,7 +2041,7 @@ AtlasLootButton_UpdatePosition: Function to move the minimap button around the minimap. ]] function AtlasLootMinimapButton_UpdatePosition() - AtlasLootMinimapButtonFrame:SetPoint( + AtlasLootMinimapButtonFrame:SetPoint( "TOPLEFT", "Minimap", "TOPLEFT", @@ -2100,10 +2100,10 @@ AtlasLootButton_BeingDragged: Function to move the minimap button around the minimap. ]] function AtlasLootMinimapButton_BeingDragged() - local xpos,ypos = GetCursorPosition() - local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom() - xpos = xmin-xpos/UIParent:GetScale()+70 - ypos = ypos/UIParent:GetScale()-ymin-70 + local xpos,ypos = GetCursorPosition() + local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom() + xpos = xmin-xpos/UIParent:GetScale()+70 + ypos = ypos/UIParent:GetScale()-ymin-70 AtlasLootMinimapButton_SetPosition(math.deg(math.atan2(ypos,xpos))); end @@ -2158,34 +2158,34 @@ end AtlasLoot_DewDropDown = { [1] = { [AL["Dungeons & Raids"]] = { - [1] = { + [1] = { { AL["Ragefire Chasm"], "RagefireChasm", "Submenu" }, }, - [2] = { + [2] = { { AL["Wailing Caverns"], "WailingCaverns", "Submenu" }, }, - [3] = { + [3] = { { AL["The Deadmines"], "Deadmines", "Submenu" }, }, - [4] = { + [4] = { { AL["Shadowfang Keep"], "ShadowfangKeep", "Submenu" }, }, - [5] = { + [5] = { { AL["Blackfathom Deeps"], "BlackfathomDeeps", "Submenu" }, }, - [6] = { + [6] = { { AL["The Stockade"], "TheStockade", "Submenu" }, }, - [7] = { + [7] = { { AL["Gnomeregan"], "Gnomeregan", "Submenu" }, }, - [8] = { + [8] = { { AL["Razorfen Kraul"], "RazorfenKraul", "Submenu" }, }, - [9] = { + [9] = { { AL["The Crescent Grove"], "TheCrescentGrove", "Submenu" }, }, - [10] = { + [10] = { [AL["Scarlet Monastery"]] = { { AL["Scarlet Monastery"].." "..AL["Graveyard"], "SMGraveyard", "Submenu" }, { AL["Scarlet Monastery"].." "..AL["Library"], "SMLibrary", "Submenu" }, @@ -2193,74 +2193,74 @@ AtlasLoot_DewDropDown = { { AL["Scarlet Monastery"].." "..AL["Cathedral"], "SMCathedral", "Submenu" }, }, }, - [11] = { + [11] = { { AL["Razorfen Downs"], "RazorfenDowns", "Submenu" }, }, - [12] = { + [12] = { { AL["Uldaman"], "Uldaman", "Submenu" }, }, - [13] = { + [13] = { { AL["Maraudon"], "Maraudon", "Submenu" }, }, - [14] = { + [14] = { { AL["Zul'Farrak"], "ZulFarrak", "Submenu" }, }, - [15] = { + [15] = { { AL["The Sunken Temple"], "SunkenTemple", "Submenu" }, }, - [16] = { + [16] = { { AL["Hateforge Quarry"], "HateforgeQuarry", "Submenu" }, }, - [17] = { + [17] = { { AL["Blackrock Depths"], "BlackrockDepths", "Submenu" }, }, - [18] = { + [18] = { [AL["Dire Maul"]] = { { AL["Dire Maul"].." "..AL["East"], "DireMaulEast", "Submenu" }, { AL["Dire Maul"].." "..AL["West"], "DireMaulWest", "Submenu" }, { AL["Dire Maul"].." "..AL["North"], "DireMaulNorth", "Submenu" }, - }, + }, }, - [19] = { + [19] = { { AL["Scholomance"], "Scholomance", "Submenu" }, }, - [20] = { + [20] = { { AL["Stratholme"], "Stratholme", "Submenu" }, }, - [21] = { + [21] = { { AL["Lower Blackrock Spire"], "LowerBlackrock", "Submenu" }, }, - [22] = { + [22] = { { AL["Upper Blackrock Spire"], "UpperBlackrock", "Submenu" }, }, - [23] = { + [23] = { { AL["Karazhan Crypt"], "KarazhanCrypt", "Submenu" }, }, - [24] = { + [24] = { { AL["Caverns of Time: Black Morass"], "CavernsOfTimeBlackMorass", "Submenu" }, }, - [25] = { + [25] = { { AL["Stormwind Vault"], "StormwindVault", "Submenu" }, }, - [26] = { + [26] = { { AL["Zul'Gurub"], "ZulGurub", "Submenu" }, }, - [27] = { + [27] = { { AL["Ruins of Ahn'Qiraj"], "RuinsofAQ", "Submenu" }, }, - [28] = { + [28] = { { AL["Molten Core"], "MoltenCore", "Submenu" }, }, - [29] = { + [29] = { { AL["Onyxia's Lair"], "Onyxia", "Submenu" }, }, - [30] = { + [30] = { { AL["Blackwing Lair"], "BlackwingLair", "Submenu" }, }, - [31] = { + [31] = { { AL["Temple of Ahn'Qiraj"], "TempleofAQ", "Submenu" }, }, - [32] = { + [32] = { { AL["Naxxramas"], "Naxxramas", "Submenu" }, }, }, @@ -2273,65 +2273,65 @@ AtlasLoot_DewDropDown = { }, [4] = { [AL["PvP Rewards"]] = { - [1] = { + [1] = { { AL["PvP Armor Sets"], "PvPArmorSets", "Submenu" }, }, - [2] = { + [2] = { { AL["PvP Accessories"], "PvP60Accessories1", "Table" }, }, - [3] = { + [3] = { { AL["Rank 14 Weapons"], "PVPWeapons1", "Table" }, }, - [4] = { + [4] = { { AL["PvP Mounts"], "PvPMountsPvP", "Table" }, }, - [5] = { + [5] = { { AL["Blood Ring"], "BRRewards", "Submenu" }, }, - [6] = { + [6] = { { AL["Alterac Valley"], "AVRewards", "Submenu" }, }, - [7] = { + [7] = { { AL["Arathi Basin"], "ABRewards", "Submenu" }, }, - [8] = { + [8] = { { AL["Warsong Gulch"], "WSGRewards", "Submenu" }, }, }, }, [5] = { [AL["Sets/Collections"]] = { - [1] = { + [1] = { { AL["Pre 60 Sets"], "Pre60Sets", "Submenu" }, }, - [2] = { + [2] = { { AL["Dungeon 1/2 Sets"], "DungeonSets12", "Submenu" }, }, - [3] = { + [3] = { { AL["Ruins of Ahn'Qiraj Sets"], "AQ20Sets", "Submenu" }, }, - [4] = { + [4] = { { AL["Temple of Ahn'Qiraj Sets"], "AQ40Sets", "Submenu" }, }, - [5] = { + [5] = { { AL["Zul'Gurub Sets"], "ZGSets", "Submenu" }, }, - [6] = { + [6] = { { AL["Tier 1 Sets"], "T1Sets", "Submenu" }, }, - [7] = { + [7] = { { AL["Tier 2 Sets"], "T2Sets", "Submenu" }, }, - [8] = { + [8] = { { AL["Tier 3 Sets"], "T3Sets", "Submenu" }, }, - [9] = { + [9] = { { AL["Legendary Items"], "Legendaries", "Table" }, }, [10] = { { AL["Rare Pets"], "RarePets1", "Table" }, }, - [11] = { + [11] = { { AL["Rare Mounts"], "RareMounts", "Table" }, }, [12] = { @@ -2353,43 +2353,43 @@ AtlasLoot_DewDropDown = { }, [7] = { [AL["World Events"]] = { - [1] = { + [1] = { { AL["Abyssal Council"], "AbyssalCouncil1", "Submenu" }, }, - [2] = { + [2] = { { AL["Children's Week"], "ChildrensWeek", "Table" }, }, - [3] = { + [3] = { { AL["Elemental Invasion"], "ElementalInvasion", "Table" }, }, - [4] = { + [4] = { { AL["Feast of Winter Veil"], "Winterviel1", "Table" }, }, - [5] = { + [5] = { { AL["Gurubashi Arena Booty Run"], "GurubashiArena", "Table" }, }, - [6] = { + [6] = { { AL["Hallow's End"], "Halloween1", "Table" }, }, - [7] = { + [7] = { { AL["Harvest Festival"], "HarvestFestival", "Table" }, }, - [8] = { + [8] = { { AL["Love is in the Air"], "Valentineday", "Table" }, }, - [9] = { + [9] = { { AL["Lunar Festival"], "LunarFestival1", "Table" }, }, - [10] = { + [10] = { { AL["Midsummer Fire Festival"], "MidsummerFestival", "Table" }, }, - [11] = { + [11] = { { AL["Noblegarden"], "Noblegarden", "Table" }, }, - [12] = { + [12] = { { AL["Scourge Invasion"], "ScourgeInvasionEvent1", "Table" }, }, - [13] = { + [13] = { { AL["Stranglethorn Fishing Extravaganza"], "FishingExtravaganza", "Table" }, }, }, @@ -2408,12 +2408,12 @@ AtlasLoot_DewDropDown = { [10] = { { (AL["First Aid"]), "FirstAid1", "Table" }, }, [11] = { { (AL["Survival"]), "Survival1", "Table" }, }, [12] = { { (AL["Poisons"]), "Poisons1", "Table" }, }, - [13] = { + [13] = { [AL["Crafted Sets"]] = { { (AL["Blacksmithing"]), "CraftSetBlacksmith", "Submenu" }, { (AL["Leatherworking"]), "CraftSetLeatherwork", "Submenu" }, { (AL["Tailoring"]), "CraftSetTailoring", "Submenu" }, - }, + }, }, [14] = { { AL["Crafted Epic Weapons"], "CraftedWeapons1", "Table" }, }, }, @@ -2760,7 +2760,7 @@ AtlasLoot_DewDropDown_SubTables = { { AL["Lord Hel'nurath"].." ("..AL["Rare"]..")", "DMWHelnurath" }, { AL["Prince Tortheldrin"], "DMWPrinceTortheldrin" }, { AL["Trash Mobs"], "DMWTrash" }, - { AL["Dire Maul Books"], "DMBooks" }, + { AL["Dire Maul Books"], "DMBooks" }, }, ["DireMaulNorth"] = { { AL["Guard Mol'dar"], "DMNGuardMoldar" }, @@ -3423,7 +3423,7 @@ function AtlasLootItem_OnClick(arg1) elseif(iteminfo and IsShiftKeyDown()) and this.itemID ~= 0 then if WIM_EditBoxInFocus then WIM_EditBoxInFocus:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..name.."]|h|r"); - elseif ( ChatFrameEditBox:IsVisible() ) then + elseif ( ChatFrameEditBox:IsVisible() ) then ChatFrameEditBox:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..name.."]|h|r"); end elseif IsShiftKeyDown() and iteminfo and this.itemID ~= 0 then @@ -3513,7 +3513,7 @@ function AtlasLootItem_OnClick(arg1) chatnumber = ChatFrameEditBox.tellTarget elseif channel == "CHANNEL" then chatnumber = ChatFrameEditBox.channelTarget - end + end SendChatMessage(AtlasLoot_GetChatLink(GetSpellInfoVanillaDB["craftspells"][tonumber(string.sub(this.itemID, 2))]["craftItem"]),channel,nil,chatnumber); end end @@ -3557,7 +3557,7 @@ local function idFromLink(itemlink) local _,_,id = string.find(itemlink, "|Hitem:([^:]+)%:") return tonumber(id) end - return nil + return nil end function AtlasLoot_CheckBagsForItems(id, qty) @@ -3594,18 +3594,20 @@ function AtlasLoot_SayItemReagents(id, color, name, safe) if not id then return end local chatline = ""; local itemCount = 0; - + local tListActivity = {} local tCount = 0 - for key in WIM_IconItems do - table.insert(tListActivity, key) - tCount = tCount + 1 - end + if (WIM_IconItems and WIM_Icon_SortByActivity) then + for key in WIM_IconItems do + table.insert(tListActivity, key) + tCount = tCount + 1 + end - table.sort(tListActivity, WIM_Icon_SortByActivity) + table.sort(tListActivity, WIM_Icon_SortByActivity) + end - if tListActivity[1] and WIM_Windows[tListActivity[1]].is_visible then + if tListActivity[1] and WIM_Windows and WIM_Windows[tListActivity[1]].is_visible then channel = "WHISPER"; chatnumber = tListActivity[1]; else @@ -3722,7 +3724,7 @@ local localversion = tonumber(major*10000 + minor*100 + fix) local remoteversion = tonumber(AtlasLoot_updateavailable) or 0 local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" } local groupchannels = { "BATTLEGROUND", "RAID" } - + AtlasLoot_updater = CreateFrame("Frame") AtlasLoot_updater:RegisterEvent("CHAT_MSG_ADDON") AtlasLoot_updater:RegisterEvent("PLAYER_ENTERING_WORLD")