diff --git a/Core/AtlasLoot.lua b/Core/AtlasLoot.lua index a253e06..6231f81 100644 --- a/Core/AtlasLoot.lua +++ b/Core/AtlasLoot.lua @@ -21,63 +21,63 @@ BINDING_NAME_ATLASLOOT_WISHLIST = "WishList" AtlasLoot = AceLibrary("AceAddon-2.0"):new("AceDB-2.0") -- Instance required libraries -local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); +local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") -- Establish version number and compatible version of Atlas local ver = string.gsub(GetAddOnMetadata("AtlasLoot", "Version"), "%.", "0") -_,_, ver = string.find(ver, "(%d+)") +_, _, ver = string.find(ver, "(%d+)") local version = tonumber(ver) -ATLASLOOT_VERSION = "|cffFF8400AtlasLoot TW Edition v"..GetAddOnMetadata("AtlasLoot", "Version").."|r"; +ATLASLOOT_VERSION = "|cffFF8400AtlasLoot TW Edition v"..GetAddOnMetadata("AtlasLoot", "Version").."|r" -- Compatibility with old EquipCompare/EQCompare -ATLASLOOT_OPTIONS_EQUIPCOMPARE = AL["Use EquipCompare"]; -ATLASLOOT_OPTIONS_EQUIPCOMPARE_DISABLED = AL["|cff9d9d9dUse EquipCompare|r"]; +ATLASLOOT_OPTIONS_EQUIPCOMPARE = AL["Use EquipCompare"] +ATLASLOOT_OPTIONS_EQUIPCOMPARE_DISABLED = AL["|cff9d9d9dUse EquipCompare|r"] -- Make the Hewdrop menu in the standalone loot browser accessible here -AtlasLoot_Hewdrop = AceLibrary("Hewdrop-2.0"); -AtlasLoot_HewdropSubMenu = AceLibrary("Hewdrop-2.0"); +AtlasLoot_Hewdrop = AceLibrary("Hewdrop-2.0") +AtlasLoot_HewdropSubMenu = AceLibrary("Hewdrop-2.0") -- Colours stored for code readability -local GREY = "|cff999999"; -local RED = "|cffff0000"; -local WHITE = "|cffFFFFFF"; -local GREEN = "|cff1eff00"; -local PURPLE = "|cff9F3FFF"; -local BLUE = "|cff0070dd"; -local ORANGE = "|cffFF8400"; -local DEFAULT = "|cffFFd200"; +local GREY = "|cff999999" +local RED = "|cffff0000" +local WHITE = "|cffFFFFFF" +local GREEN = "|cff1eff00" +local PURPLE = "|cff9F3FFF" +local BLUE = "|cff0070dd" +local ORANGE = "|cffFF8400" +local DEFAULT = "|cffFFd200" -- Establish number of boss lines in the Atlas frame for scrolling -local ATLAS_LOOT_BOSS_LINES = 24; +local ATLAS_LOOT_BOSS_LINES = 24 local Anchor_Atlas = { "TOPLEFT", "AtlasFrame", "TOPLEFT", 18, -84 } local Anchor_AlphaMap = { "TOPLEFT", "AlphaMapAlphaMapFrame", "TOPLEFT", 0, 0 } local Anchor_Default = { "TOPLEFT", "AtlasLootDefaultFrame", "TOPLEFT", 45, -85 } -- Variables to hold hooked Atlas functions -local Original_Atlas_Refresh; -local Original_Atlas_OnShow; -local Original_AtlasScrollBar_Update; +local Original_Atlas_Refresh +local Original_Atlas_OnShow +local Original_AtlasScrollBar_Update -AtlasLootCharDB = {}; +AtlasLootCharDB = {} -AtlasLoot:RegisterDB("AtlasLootDB"); +AtlasLoot:RegisterDB("AtlasLootDB") -- Popup Box for first time users StaticPopupDialogs["ATLASLOOT_SETUP"] = { text = AL["Welcome to Atlasloot Enhanced. Please take a moment to set your preferences."], button1 = AL["Setup"], OnAccept = function() - AtlasLootOptions_Toggle(); + AtlasLootOptions_Toggle() end, timeout = 0, whileDead = 1, hideOnEscape = 1 -}; +} AtlasLoot_Data["AtlasLootFallback"] = { - EmptyInstance = {}; -}; + EmptyInstance = {} +} AtlasLoot_MenuList = { ["DUNGEONSMENU1"] = "AtlasLoot_DungeonsMenu1", @@ -111,156 +111,167 @@ AtlasLoot_MenuList = { ["CRAFTSET"] = "AtlasLootCraftedSetMenu", ["WORLDBOSSMENU"] = "AtlasLoot_WorldBossMenu", ["TMHSET"] = "AtlasLootTMHSetMenu", -}; +} -- This is a multi-layer table defining the main loot listing. -- Entries have the text to display, loot table or sub table to link to and if the link is to a loot table or sub table AtlasLoot_HewdropDown = { - {[AL["Dungeons & Raids"]] = { - {{ WHITE.."[13-18]|r "..AL["Ragefire Chasm"], "RagefireChasm", "Submenu" },}, - {{ WHITE.."[13-20]|r "..AL["Frostmane Hollow"], "FrostmaneHollow", "Submenu" },}, - {{ WHITE.."[17-24]|r "..AL["Wailing Caverns"], "WailingCaverns", "Submenu" },}, - {{ WHITE.."[17-24]|r "..AL["The Deadmines"], "Deadmines", "Submenu" },}, - {{ WHITE.."[22-30]|r "..AL["Shadowfang Keep"], "ShadowfangKeep", "Submenu" },}, - {{ WHITE.."[23-32]|r "..AL["Blackfathom Deeps"], "BlackfathomDeeps", "Submenu" },}, - {{ WHITE.."[25-33]|r "..AL["Windhorn Canyon"], "WindhornCanyon", "Submenu" },}, - {{ WHITE.."[22-30]|r "..AL["The Stockade"], "TheStockade", "Submenu" },}, - {{ WHITE.."[26-35]|r "..AL["Dragonmaw Retreat"], "DragonmawRetreat", "Submenu" },}, - {{ WHITE.."[29-38]|r "..AL["Gnomeregan"], "Gnomeregan", "Submenu" },}, - {{ WHITE.."[29-38]|r "..AL["Razorfen Kraul"], "RazorfenKraul", "Submenu" },}, - {{ WHITE.."[32-38]|r "..AL["The Crescent Grove"], "TheCrescentGrove", "Submenu" },}, - {[ WHITE.."[27-45]|r "..AL["Scarlet Monastery"]] = { + { + [AL["Dungeons & Raids"]] = { + { { WHITE.."[13-18]|r "..AL["Ragefire Chasm"], "RagefireChasm", "Submenu" }, }, + { { WHITE.."[13-20]|r "..AL["Frostmane Hollow"], "FrostmaneHollow", "Submenu" }, }, + { { WHITE.."[17-24]|r "..AL["Wailing Caverns"], "WailingCaverns", "Submenu" }, }, + { { WHITE.."[17-24]|r "..AL["The Deadmines"], "Deadmines", "Submenu" }, }, + { { WHITE.."[22-30]|r "..AL["Shadowfang Keep"], "ShadowfangKeep", "Submenu" }, }, + { { WHITE.."[23-32]|r "..AL["Blackfathom Deeps"], "BlackfathomDeeps", "Submenu" }, }, + { { WHITE.."[25-33]|r "..AL["Windhorn Canyon"], "WindhornCanyon", "Submenu" }, }, + { { WHITE.."[22-30]|r "..AL["The Stockade"], "TheStockade", "Submenu" }, }, + { { WHITE.."[26-35]|r "..AL["Dragonmaw Retreat"], "DragonmawRetreat", "Submenu" }, }, + { { WHITE.."[29-38]|r "..AL["Gnomeregan"], "Gnomeregan", "Submenu" }, }, + { { WHITE.."[29-38]|r "..AL["Razorfen Kraul"], "RazorfenKraul", "Submenu" }, }, + { { WHITE.."[32-38]|r "..AL["The Crescent Grove"], "TheCrescentGrove", "Submenu" }, }, + { + [WHITE.."[27-45]|r "..AL["Scarlet Monastery"]] = { { WHITE.."[27-36]|r "..AL["Scarlet Monastery (Graveyard)"], "SMGraveyard", "Submenu" }, { WHITE.."[28-39]|r "..AL["Scarlet Monastery (Library)"], "SMLibrary", "Submenu" }, { WHITE.."[32-41]|r "..AL["Scarlet Monastery (Armory)"], "SMArmory", "Submenu" }, { WHITE.."[35-45]|r "..AL["Scarlet Monastery (Cathedral)"], "SMCathedral", "Submenu" }, - },}, - {{ WHITE.."[32-44]|r "..AL["Stormwrought Ruins"], "StormwroughtRuins", "Submenu" },}, - {{ WHITE.."[36-46]|r "..AL["Razorfen Downs"], "RazorfenDowns", "Submenu" },}, - {{ WHITE.."[40-51]|r "..AL["Uldaman"], "Uldaman", "Submenu" },}, - {{ WHITE.."[42-50]|r "..AL["Gilneas City"], "GilneasCity", "Submenu" },}, - {{ WHITE.."[45-55]|r "..AL["Maraudon"], "Maraudon", "Submenu" },}, - {{ WHITE.."[44-54]|r "..AL["Zul'Farrak"], "ZulFarrak", "Submenu" },}, - {{ WHITE.."[50-60]|r "..AL["The Sunken Temple"], "SunkenTemple", "Submenu" },}, - {{ WHITE.."[50-60]|r "..AL["Hateforge Quarry"], "HateforgeQuarry", "Submenu" },}, - {{ WHITE.."[52-60]|r "..AL["Blackrock Depths"], "BlackrockDepths", "Submenu" },}, - {[ WHITE.."[55-60]|r "..AL["Dire Maul"]] = { + }, + }, + { { WHITE.."[32-44]|r "..AL["Stormwrought Ruins"], "StormwroughtRuins", "Submenu" }, }, + { { WHITE.."[36-46]|r "..AL["Razorfen Downs"], "RazorfenDowns", "Submenu" }, }, + { { WHITE.."[40-51]|r "..AL["Uldaman"], "Uldaman", "Submenu" }, }, + { { WHITE.."[42-50]|r "..AL["Gilneas City"], "GilneasCity", "Submenu" }, }, + { { WHITE.."[45-55]|r "..AL["Maraudon"], "Maraudon", "Submenu" }, }, + { { WHITE.."[44-54]|r "..AL["Zul'Farrak"], "ZulFarrak", "Submenu" }, }, + { { WHITE.."[50-60]|r "..AL["The Sunken Temple"], "SunkenTemple", "Submenu" }, }, + { { WHITE.."[50-60]|r "..AL["Hateforge Quarry"], "HateforgeQuarry", "Submenu" }, }, + { { WHITE.."[52-60]|r "..AL["Blackrock Depths"], "BlackrockDepths", "Submenu" }, }, + { + [WHITE.."[55-60]|r "..AL["Dire Maul"]] = { { WHITE.."[55-60]|r "..AL["Dire Maul (East)"], "DireMaulEast", "Submenu" }, { WHITE.."[57-60]|r "..AL["Dire Maul (West)"], "DireMaulWest", "Submenu" }, { WHITE.."[57-60]|r "..AL["Dire Maul (North)"], "DireMaulNorth", "Submenu" }, - },}, - {{ WHITE.."[58-60]|r "..AL["Scholomance"], "Scholomance", "Submenu" },}, - {{ WHITE.."[58-60]|r "..AL["Stratholme"], "Stratholme", "Submenu" },}, - {{ WHITE.."[55-60]|r "..AL["Lower Blackrock Spire"], "LowerBlackrock", "Submenu" },}, - {{ WHITE.."[58-60]|r "..AL["Upper Blackrock Spire"], "UpperBlackrock", "Submenu" },}, - {{ WHITE.."[58-60]|r "..AL["Karazhan Crypt"], "KarazhanCrypt", "Submenu" },}, - {{ WHITE.."[60]|r "..AL["Caverns of Time: Black Morass"], "CavernsOfTimeBlackMorass", "Submenu" },}, - {{ WHITE.."[60]|r "..AL["Stormwind Vault"], "StormwindVault", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Zul'Gurub"], "ZulGurub", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Ruins of Ahn'Qiraj"], "RuinsofAQ", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Molten Core"], "MoltenCore", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Onyxia's Lair"], "Onyxia", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Lower Karazhan Halls"], "LowerKara", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Blackwing Lair"], "BlackwingLair", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Emerald Sanctum"], "EmeraldSanctum", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Timbermaw Hold"], "TimbermawHold", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Temple of Ahn'Qiraj"], "TempleofAQ", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Naxxramas"], "Naxxramas", "Submenu" },}, - {{ RED.."[RAID]|r "..AL["Upper Karazhan Halls"], "UpperKara", "Submenu" },}, - }, - }, - {[AL["World Bosses"]] = { - {{AL["Azuregos"], "AAzuregos", "Table" },}, - {{AL["Emeriss"], "DEmeriss", "Table" },}, - {{AL["Lethon"], "DLethon", "Table" },}, - {{AL["Taerar"], "DTaerar", "Table" },}, - {{AL["Ysondre"], "DYsondre", "Table" },}, - {{AL["Lord Kazzak"], "KKazzak", "Table" },}, - {{AL["Nerubian Overseer"], "Nerubian", "Table" },}, - {{AL["Dark Reaver of Karazhan"], "Reaver", "Table" },}, - {{AL["Ostarius"], "Ostarius", "Table" },}, - {{AL["Concavius"], "Concavius", "Table" },}, - {{AL["Moo"], "CowKing", "Table" },}, - {{AL["Cla'ckora"], "Clackora", "Table"},}, - }, - }, - {[AL["PvP Rewards"]] = { - {{ AL["PvP Armor Sets"], "PVPSET", "Table" },}, - {{ AL["PvP Accessories"], "PvP60Accessories1", "Table" },}, - {{ AL["Rank 14 Weapons"], "PVPWeapons1", "Table" },}, - {{ AL["PvP Mounts"], "PvPMountsPvP", "Table" },}, - {{ AL["Blood Ring"], "BRRepMenu", "Table" },}, - {{ AL["Alterac Valley"], "AVRepMenu", "Table" },}, - {{ AL["Arathi Basin"], "ABRepMenu", "Table" },}, - {{ AL["Warsong Gulch"], "WSGRepMenu", "Table" },}, - }, - }, - {[AL["Collections"]] = { - {{ AL["Sets"], "PRE60SET", "Table" },}, - {{ AL["Zul'Gurub Sets"], "ZGSET", "Table" },}, - {{ AL["Ruins of Ahn'Qiraj Sets"], "AQ20SET", "Table" },}, - {{ AL["Temple of Ahn'Qiraj Sets"], "AQ40SET", "Table" },}, - {{ AL["Karazhan Sets"], "KARASET", "Table" },}, - {{ AL["Dungeon 1/2 Sets"], "T0SET", "Table" },}, - {{ AL["Tier 1 Sets"], "T1SET", "Table" },}, - {{ AL["Tier 2 Sets"], "T2SET", "Table" },}, - {{ AL["Tier 3 Sets"], "T3SET", "Table" },}, - {{ AL["Legendary Items"], "Legendaries", "Table" },}, - {{ AL["World Epics"], "WorldEpics1", "Table" },}, - {{ AL["Rare Pets"], "RarePets1", "Table" },}, - {{ AL["Rare Mounts"], "RareMounts", "Table" },}, - {{ AL["Tabards"], "Tabards", "Table" },}, + }, }, + { { WHITE.."[58-60]|r "..AL["Scholomance"], "Scholomance", "Submenu" }, }, + { { WHITE.."[58-60]|r "..AL["Stratholme"], "Stratholme", "Submenu" }, }, + { { WHITE.."[55-60]|r "..AL["Lower Blackrock Spire"], "LowerBlackrock", "Submenu" }, }, + { { WHITE.."[58-60]|r "..AL["Upper Blackrock Spire"], "UpperBlackrock", "Submenu" }, }, + { { WHITE.."[58-60]|r "..AL["Karazhan Crypt"], "KarazhanCrypt", "Submenu" }, }, + { { WHITE.."[60]|r "..AL["Caverns of Time: Black Morass"], "CavernsOfTimeBlackMorass", "Submenu" }, }, + { { WHITE.."[60]|r "..AL["Stormwind Vault"], "StormwindVault", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Zul'Gurub"], "ZulGurub", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Ruins of Ahn'Qiraj"], "RuinsofAQ", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Molten Core"], "MoltenCore", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Onyxia's Lair"], "Onyxia", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Lower Karazhan Halls"], "LowerKara", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Blackwing Lair"], "BlackwingLair", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Emerald Sanctum"], "EmeraldSanctum", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Timbermaw Hold"], "TimbermawHold", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Temple of Ahn'Qiraj"], "TempleofAQ", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Naxxramas"], "Naxxramas", "Submenu" }, }, + { { RED.."[RAID]|r "..AL["Upper Karazhan Halls"], "UpperKara", "Submenu" }, }, }, - {[AL["Factions"]] = { - {{ AL["Argent Dawn"], "Argent1" , "Table" },}, - {{ AL["Brood of Nozdormu"], "AQBroodRings", "Table" },}, - {{ AL["Darkmoon Faire"], "Darkmoon", "Table" },}, - {{ AL["Hydraxian Waterlords"], "WaterLords1", "Table" },}, - {{ AL["Thorium Brotherhood"], "Thorium1", "Table" },}, - {{ AL["Cenarion Circle"], "Cenarion1", "Table" }}, - {{ AL["Shen'dralar"], "Shendralar", "Table" },}, - {{ AL["Draenei Exiles"], "DraeneiExiles", "Table" },}, - {{ AL["Bloodsail Buccaneers"], "Bloodsail1", "Table" },}, - {{ AL["Zandalar Tribe"], "Zandalar1", "Table" },}, - {{ AL["Timbermaw Hold"], "Timbermaw", "Table" },}, - {{ AL["Wardens of Time"], "Wardens1", "Table" },}, - {{ AL["Gelkis Clan Centaur"], "GelkisClan1", "Table" },}, - {{ AL["Magram Clan Centaur"], "MagramClan1", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Stormwind"], "Stormwind", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Ironforge"], "Ironforge", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Gnomeregan Exiles"], "GnomereganExiles", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Darnassus"], "Darnassus", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Silvermoon Remnant"], "Helf", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Dalaran"], "Dalaran", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Wintersaber Trainers"], "Wintersaber1", "Table" },}, - {{ BLUE.."["..AL["Alliance"].."]|r "..AL["Wildhammer Clan"], "Wildhammer", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Orgrimmar"], "Orgrimmar", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Darkspear Trolls"], "DarkspearTrolls", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Thunder Bluff"], "ThunderBluff", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Undercity"], "Undercity", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Durotar Labor Union"], "DurotarLaborUnion", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Revantusk Trolls"], "Revantusk", "Table" },}, - {{ RED.."["..AL["Horde"].."]|r "..AL["Earthen Ring"], "EarthenRing", "Table" },}, - }, + }, + { + [AL["World Bosses"]] = { + { { AL["Azuregos"], "AAzuregos", "Table" }, }, + { { AL["Emeriss"], "DEmeriss", "Table" }, }, + { { AL["Lethon"], "DLethon", "Table" }, }, + { { AL["Taerar"], "DTaerar", "Table" }, }, + { { AL["Ysondre"], "DYsondre", "Table" }, }, + { { AL["Lord Kazzak"], "KKazzak", "Table" }, }, + { { AL["Nerubian Overseer"], "Nerubian", "Table" }, }, + { { AL["Dark Reaver of Karazhan"], "Reaver", "Table" }, }, + { { AL["Ostarius"], "Ostarius", "Table" }, }, + { { AL["Concavius"], "Concavius", "Table" }, }, + { { AL["Moo"], "CowKing", "Table" }, }, + { { AL["Cla'ckora"], "Clackora", "Table" }, }, }, - {[AL["World Events"]] = { - {{ AL["Abyssal Council"], "AbyssalTemplars", "Table" },}, - {{ AL["Children's Week"], "ChildrensWeek", "Table" },}, - {{ AL["Elemental Invasion"], "ElementalInvasion", "Table" },}, - {{ AL["Feast of Winter Veil"], "Winterviel1", "Table" },}, - {{ AL["Gurubashi Arena"], "GurubashiArena", "Table" },}, - {{ AL["Hallow's End"], "Halloween1", "Table" },}, - {{ AL["Harvest Festival"], "HarvestFestival", "Table" },}, - {{ AL["Love is in the Air"], "Valentineday", "Table" },}, - {{ AL["Lunar Festival"], "LunarFestival1", "Table" },}, - {{ AL["Midsummer Fire Festival"], "MidsummerFestival", "Table" },}, - {{ AL["Noblegarden"], "Noblegarden", "Table" },}, - {{ AL["Scourge Invasion"], "ScourgeInvasionEvent1", "Table" },}, - {{ AL["Stranglethorn Fishing Extravaganza"], "FishingExtravaganza", "Table" },}, - }, + }, + { + [AL["PvP Rewards"]] = { + { { AL["PvP Armor Sets"], "PVPSET", "Table" }, }, + { { AL["PvP Accessories"], "PvP60Accessories1", "Table" }, }, + { { AL["Rank 14 Weapons"], "PVPWeapons1", "Table" }, }, + { { AL["PvP Mounts"], "PvPMountsPvP", "Table" }, }, + { { AL["Blood Ring"], "BRRepMenu", "Table" }, }, + { { AL["Alterac Valley"], "AVRepMenu", "Table" }, }, + { { AL["Arathi Basin"], "ABRepMenu", "Table" }, }, + { { AL["Warsong Gulch"], "WSGRepMenu", "Table" }, }, }, - {[AL["Crafting"]] = { + }, + { + [AL["Collections"]] = { + { { AL["Sets"], "PRE60SET", "Table" }, }, + { { AL["Zul'Gurub Sets"], "ZGSET", "Table" }, }, + { { AL["Ruins of Ahn'Qiraj Sets"], "AQ20SET", "Table" }, }, + { { AL["Temple of Ahn'Qiraj Sets"], "AQ40SET", "Table" }, }, + { { AL["Karazhan Sets"], "KARASET", "Table" }, }, + { { AL["Dungeon 1/2 Sets"], "T0SET", "Table" }, }, + { { AL["Tier 1 Sets"], "T1SET", "Table" }, }, + { { AL["Tier 2 Sets"], "T2SET", "Table" }, }, + { { AL["Tier 3 Sets"], "T3SET", "Table" }, }, + { { AL["Legendary Items"], "Legendaries", "Table" }, }, + { { AL["World Epics"], "WorldEpics1", "Table" }, }, + { { AL["Rare Pets"], "RarePets1", "Table" }, }, + { { AL["Rare Mounts"], "RareMounts", "Table" }, }, + { { AL["Tabards"], "Tabards", "Table" }, }, + }, + }, + { + [AL["Factions"]] = { + { { AL["Argent Dawn"], "Argent1", "Table" }, }, + { { AL["Brood of Nozdormu"], "AQBroodRings", "Table" }, }, + { { AL["Darkmoon Faire"], "Darkmoon", "Table" }, }, + { { AL["Hydraxian Waterlords"], "WaterLords1", "Table" }, }, + { { AL["Thorium Brotherhood"], "Thorium1", "Table" }, }, + { { AL["Cenarion Circle"], "Cenarion1", "Table" } }, + { { AL["Shen'dralar"], "Shendralar", "Table" }, }, + { { AL["Draenei Exiles"], "DraeneiExiles", "Table" }, }, + { { AL["Bloodsail Buccaneers"], "Bloodsail1", "Table" }, }, + { { AL["Zandalar Tribe"], "Zandalar1", "Table" }, }, + { { AL["Timbermaw Hold"], "Timbermaw", "Table" }, }, + { { AL["Wardens of Time"], "Wardens1", "Table" }, }, + { { AL["Gelkis Clan Centaur"], "GelkisClan1", "Table" }, }, + { { AL["Magram Clan Centaur"], "MagramClan1", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Stormwind"], "Stormwind", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Ironforge"], "Ironforge", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Gnomeregan Exiles"], "GnomereganExiles", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Darnassus"], "Darnassus", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Silvermoon Remnant"], "Helf", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Dalaran"], "Dalaran", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Wintersaber Trainers"], "Wintersaber1", "Table" }, }, + { { BLUE.."["..AL["Alliance"].."]|r "..AL["Wildhammer Clan"], "Wildhammer", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Orgrimmar"], "Orgrimmar", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Darkspear Trolls"], "DarkspearTrolls", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Thunder Bluff"], "ThunderBluff", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Undercity"], "Undercity", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Durotar Labor Union"], "DurotarLaborUnion", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Revantusk Trolls"], "Revantusk", "Table" }, }, + { { RED.."["..AL["Horde"].."]|r "..AL["Earthen Ring"], "EarthenRing", "Table" }, }, + }, + }, + { + [AL["World Events"]] = { + { { AL["Abyssal Council"], "AbyssalTemplars", "Table" }, }, + { { AL["Children's Week"], "ChildrensWeek", "Table" }, }, + { { AL["Elemental Invasion"], "ElementalInvasion", "Table" }, }, + { { AL["Feast of Winter Veil"], "Winterviel1", "Table" }, }, + { { AL["Gurubashi Arena"], "GurubashiArena", "Table" }, }, + { { AL["Hallow's End"], "Halloween1", "Table" }, }, + { { AL["Harvest Festival"], "HarvestFestival", "Table" }, }, + { { AL["Love is in the Air"], "Valentineday", "Table" }, }, + { { AL["Lunar Festival"], "LunarFestival1", "Table" }, }, + { { AL["Midsummer Fire Festival"], "MidsummerFestival", "Table" }, }, + { { AL["Noblegarden"], "Noblegarden", "Table" }, }, + { { AL["Scourge Invasion"], "ScourgeInvasionEvent1", "Table" }, }, + { { AL["Stranglethorn Fishing Extravaganza"], "FishingExtravaganza", "Table" }, }, + }, + }, + { + [AL["Crafting"]] = { { { AL["Alchemy"], "ALCHEMYMENU", "Table" }, }, { { AL["Blacksmithing"], "SMITHINGMENU", "Table" }, }, { { AL["Enchanting"], "ENCHANTINGMENU", "Table" }, }, @@ -275,12 +286,12 @@ AtlasLoot_HewdropDown = { { { AL["Survival"], "SurvivalApprentice1", "Table" }, }, { { AL["Gardening"], "Gardening1", "Table" }, }, { { AL["Poisons"], "Poisons1", "Table" }, }, - { { AL["Crafted Sets"], "CRAFTSET", "Table" },}, + { { AL["Crafted Sets"], "CRAFTSET", "Table" }, }, { { AL["Crafted Epic Weapons"], "CraftedWeapons1", "Table" }, }, }, }, - {{ "Rare Spawns", "RareSpawns", "Submenu" },}, -}; + { { "Rare Spawns", "RareSpawns", "Submenu" }, }, +} -- This table defines all the subtables needed for the full menu -- Each sub table entry contains the text entry and the loot table that goes wih it @@ -426,13 +437,13 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Trash Mobs"], "BWLTrashMobs" }, }, ["Deadmines"] = { - { AL["Jared Voss"], "DMJaredVoss" }, + { AL["Jared Voss"], "DMJaredVoss" }, { AL["Rhahk'Zor"], "DMRhahkZor" }, { AL["Miner Johnson"].." ("..AL["Rare"]..")", "DMMinerJohnson" }, { AL["Sneed"], "DMSneed" }, { AL["Sneed's Shredder"], "DMSneedsShredder" }, { AL["Gilnid"], "DMGilnid" }, - { AL["Masterpiece Harvester"], "DMHarvester" }, + { AL["Masterpiece Harvester"], "DMHarvester" }, { AL["Mr. Smite"], "DMMrSmite" }, { AL["Cookie"], "DMCookie" }, { AL["Captain Greenskin"], "DMCaptainGreenskin" }, @@ -493,7 +504,7 @@ AtlasLoot_HewdropDown_SubTables = { }, ["SMGraveyard"] = { { AL["Interrogator Vishas"], "SMVishas" }, - { AL["Duke Dreadmoore"], "SMDukeDreadmoore" }, + { AL["Duke Dreadmoore"], "SMDukeDreadmoore" }, { AL["Scorn"].." ("..AL["Scourge Invasion"]..")", "SMScorn" }, { AL["Ironspine"].." ("..AL["Rare"]..")", "SMIronspine" }, { AL["Azshir the Sleepless"].." ("..AL["Rare"]..")", "SMAzshir" }, @@ -503,13 +514,13 @@ AtlasLoot_HewdropDown_SubTables = { }, ["SMLibrary"] = { { AL["Houndmaster Loksey"], "SMHoundmasterLoksey" }, - { AL["Brother Wystan"], "SMBrotherWystan" }, + { AL["Brother Wystan"], "SMBrotherWystan" }, { AL["Arcanist Doan"], "SMDoan" }, { AL["Trash Mobs"], "SMLTrash" }, }, ["SMArmory"] = { { AL["Herod"], "SMHerod" }, - { AL["Armory Quartermaster Daghelm"], "SMQuartermaster" }, + { AL["Armory Quartermaster Daghelm"], "SMQuartermaster" }, { AL["Trash Mobs"], "SMATrash" }, }, ["SMCathedral"] = { @@ -551,7 +562,7 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Arugal's Voidwalker"], "SFKArugalsVoidwalker" }, { AL["Wolf Master Nandos"], "SFKWolfMasterNandos" }, { AL["Archmage Arugal"], "SFKArchmageArugal" }, - { AL["Prelate Ironmane"], "SFKPrelate"}, + { AL["Prelate Ironmane"], "SFKPrelate" }, { AL["Trash Mobs"], "SFKTrash" }, }, ["TheStockade"] = { @@ -598,7 +609,7 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Jammal'an the Prophet"], "STJammalan" }, { AL["Ogom the Wretched"], "STOgom" }, { AL["Dreamscythe"], "STDreamscythe" }, - { AL["Weaver"], "STWeaver"}, + { AL["Weaver"], "STWeaver" }, { AL["Morphaz"], "STMorphaz" }, { AL["Hazzas"], "STHazzas" }, { AL["Shade of Eranikus"], "STEranikus" }, @@ -650,7 +661,7 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Lady Sarevess"], "BFDLadySarevess" }, { AL["Gelihast"], "BFDGelihast" }, { AL["Baron Aquanis"], "BFDBaronAquanis" }, - { AL["Velthelaxx the Defiler"], "BFDVelthelaxx"}, + { AL["Velthelaxx the Defiler"], "BFDVelthelaxx" }, { AL["Twilight Lord Kelris"], "BFDTwilightLordKelris" }, { AL["Old Serra'kis"], "BFDOldSerrakis" }, { AL["Aku'mai"], "BFDAkumai" }, @@ -770,10 +781,10 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Lady Anacondra"], "WCLadyAnacondra" }, { AL["Kresh"], "WCKresh" }, { AL["Deviate Faerie Dragon"].." ("..AL["Rare"]..")", "WCDeviateFaerieDragon" }, - { AL["Zandara Windhoof"], "WCZandara" }, + { AL["Zandara Windhoof"], "WCZandara" }, { AL["Lord Pythas"], "WCLordPythas" }, { AL["Skum"], "WCSkum" }, - { AL["Vangros"], "WCVangros" }, + { AL["Vangros"], "WCVangros" }, { AL["Lord Serpentis"], "WCLordSerpentis" }, { AL["Verdan the Everliving"], "WCVerdan" }, { AL["Mutanus the Devourer"], "WCMutanus" }, @@ -807,7 +818,7 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Trash Mobs"], "LKHTrash" }, { AL["LKH Enchants"], "LKHEnchants" }, }, - ["UpperKara"] = { + ["UpperKara"] = { { AL["Keeper Gnarlmoon"], "UKHGnarlmoon" }, { AL["Ley-Watcher Incantagos"], "UKHIncantagos" }, { AL["Anomalus"], "UKHAnomalus" }, @@ -822,10 +833,10 @@ AtlasLoot_HewdropDown_SubTables = { ["WorldBosses"] = { { AL["Azuregos"], "AAzuregos" }, { AL["Emeriss"], "DEmeriss" }, - { AL["Lethon"], "DLethon"}, + { AL["Lethon"], "DLethon" }, { AL["Taerar"], "DTaerar" }, { AL["Ysondre"], "DYsondre" }, - { AL["Lord Kazzak"], "KKazzak"}, + { AL["Lord Kazzak"], "KKazzak" }, { AL["Nerubian Overseer"], "Nerubian" }, { AL["Dark Reaver of Karazhan"], "Reaver" }, { AL["Ostarius"], "Ostarius" }, @@ -834,43 +845,43 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Cla'ckora"], "Clackora" }, }, ["RareSpawns"] = { - { WHITE.."[17]"..DEFAULT.." "..AL["Earthcaller Rezengal"] .." "..WHITE.."("..AL["Stonetalon Mountains"]..")", "EarthcallerRezengal" }, - { WHITE.."[17]"..DEFAULT.." "..AL["Shade Mage"] .." "..WHITE.."("..AL["Tirisfal Glades"] ..")", "ShadeMage" }, - { WHITE.."[18]"..DEFAULT.." "..AL["Graypaw Alpha"] .." "..WHITE.."("..AL["Tirisfal Glades"] ..")", "GraypawAlpha" }, - { WHITE.."[24]"..DEFAULT.." "..AL["Blazespark"] .." "..WHITE.."("..AL["Stonetalon Mountains"]..")", "Blazespark" }, - { WHITE.."[35]"..DEFAULT.." "..AL["Witch Doctor Tan'zo"] .." "..WHITE.."("..AL["Arathi Highlands"] ..")", "WitchDoctorTanzo" }, - { WHITE.."[40]"..DEFAULT.." "..AL["Widow of the Woods"] .." "..WHITE.."("..AL["Gilneas"] ..")", "WidowoftheWoods" }, - { WHITE.."[40]"..DEFAULT.." "..AL["Dawnhowl"] .." "..WHITE.."("..AL["Gilneas"] ..")", "Dawnhowl" }, - { WHITE.."[43]"..DEFAULT.." "..AL["Maltimor's Prototype"] .." "..WHITE.."("..AL["Gilneas"] ..")", "MaltimorsPrototype" }, - { WHITE.."[44]"..DEFAULT.." "..AL["Bonecruncher"] .." "..WHITE.."("..AL["Gilneas"] ..")", "Bonecruncher" }, - { WHITE.."[44]"..DEFAULT.." "..AL["Duskskitter"] .." "..WHITE.."("..AL["Gilneas"] ..")", "Duskskitter" }, - { WHITE.."[45]"..DEFAULT.." "..AL["Baron Perenolde"] .." "..WHITE.."("..AL["Gilneas"] ..")", "BaronPerenolde" }, - { WHITE.."[45]"..DEFAULT.." "..AL["Kin'Tozo"] .." "..WHITE.."("..AL["Stranglethorn Vale"] ..")", "KinTozo" }, - { WHITE.."[47]"..DEFAULT.." "..AL["Grug'thok the Seer"] .." "..WHITE.."("..AL["Feralas"] ..")", "Grugthok" }, - { WHITE.."[47]"..DEFAULT.." "..AL["M-0L1Y"] .." "..WHITE.."("..AL["Dun Morogh"] ..")", "M0L1Y" }, - { WHITE.."[49]"..DEFAULT.." "..AL["Explorer Ashbeard"] .." "..WHITE.."("..AL["Searing Gorge"] ..")", "Ashbeard" }, - { WHITE.."[50]"..DEFAULT.." "..AL["Jal'akar"] .." "..WHITE.."("..AL["Hinterlands"] ..")", "Jalakar" }, - { WHITE.."[51]"..DEFAULT.." "..AL["Embereye"] .." "..WHITE.."("..AL["Gilijim Isle"] ..")", "Embereye" }, - { WHITE.."[51]"..DEFAULT.." "..AL["Ruk'thok the Pyromancer"].." "..WHITE.."("..AL["Lapidis Isle"] ..")", "Rukthok" }, - { WHITE.."[51]"..DEFAULT.." "..AL["Tarangos"] .." "..WHITE.."("..AL["Azshara"] ..")", "Tarangos" }, - { WHITE.."[51]"..DEFAULT.." "..AL["Ripjaw"] .." "..WHITE.."("..AL["Lapidis Isle"] ..")", "Ripjaw" }, - { WHITE.."[53]"..DEFAULT.." "..AL["Xalvic Blackclaw"] .." "..WHITE.."("..AL["Felwood"] ..")", "Xalvic" }, - { WHITE.."[54]"..DEFAULT.." "..AL["Aquitus"] .." "..WHITE.."("..AL["Gilijim Isle"] ..")", "Aquitus" }, - { WHITE.."[55]"..DEFAULT.." "..AL["Firstborn of Arugal"] .." "..WHITE.."("..AL["Gilneas"] ..")", "FirstbornofArugal" }, - { WHITE.."[55]"..DEFAULT.." "..AL["Letashaz"] .." "..WHITE.."("..AL["Gilijim Isle"] ..")", "Letashaz" }, - { WHITE.."[55]"..DEFAULT.." "..AL["Margon the Mighty"] .." "..WHITE.."("..AL["Lapidis Isle"] ..")", "MargontheMighty" }, - { WHITE.."[55]"..DEFAULT.." "..AL["The Wandering Knight"] .." "..WHITE.."("..AL["Western Plaguelands"] ..")", "WanderingKnight" }, - { WHITE.."[56]"..DEFAULT.." "..AL["Stoneshell"] .." "..WHITE.."("..AL["Tel'abim"] ..")", "Stoneshell" }, - { WHITE.."[57]"..DEFAULT.." "..AL["Zareth Terrorblade"] .." "..WHITE.."("..AL["Blasted Lands"] ..")", "Zareth" }, - { WHITE.."[58]"..DEFAULT.." "..AL["Highvale Silverback"] .." "..WHITE.."("..AL["Tel'abim"] ..")", "HighvaleSilverback" }, - { WHITE.."[58]"..DEFAULT.." "..AL["Mallon The Moontouched"] .." "..WHITE.."("..AL["Winterspring"] ..")", "Mallon" }, - { WHITE.."[59]"..DEFAULT.." "..AL["Blademaster Kargron"] .." "..WHITE.."("..AL["Burning Steppes"] ..")", "Kargron" }, - { WHITE.."[59]"..DEFAULT.." "..AL["Professor Lysander"] .." "..WHITE.."("..AL["Eastern Plaguelands"] ..")", "ProfessorLysander" }, - { WHITE.."[60]"..DEFAULT.." "..AL["Admiral Barean Westwind"].." "..WHITE.."("..AL["Scarlet Enclave"] ..")", "AdmiralBareanWestwind" }, - { WHITE.."[60]"..DEFAULT.." "..AL["Azurebeak"] .." "..WHITE.."("..AL["Hyjal"] ..")", "Azurebeak" }, - { WHITE.."[60]"..DEFAULT.." "..AL["Barkskin Fisher"] .." "..WHITE.."("..AL["Hyjal"] ..")", "BarkskinFisher" }, - { WHITE.."[61]"..DEFAULT.." "..AL["Crusader Larsarius"] .." "..WHITE.."("..AL["Eastern Plaguelands"] ..")", "CrusaderLarsarius" }, - { WHITE.."[61]"..DEFAULT.." "..AL["Shadeflayer Goliath"] .." "..WHITE.."("..AL["Hyjal"] ..")", "ShadeflayerGoliath" }, + { WHITE.."[17]"..DEFAULT.." "..AL["Earthcaller Rezengal"].." "..WHITE.."("..AL["Stonetalon Mountains"]..")", "EarthcallerRezengal" }, + { WHITE.."[17]"..DEFAULT.." "..AL["Shade Mage"].." "..WHITE.."("..AL["Tirisfal Glades"]..")", "ShadeMage" }, + { WHITE.."[18]"..DEFAULT.." "..AL["Graypaw Alpha"].." "..WHITE.."("..AL["Tirisfal Glades"]..")", "GraypawAlpha" }, + { WHITE.."[24]"..DEFAULT.." "..AL["Blazespark"].." "..WHITE.."("..AL["Stonetalon Mountains"]..")", "Blazespark" }, + { WHITE.."[35]"..DEFAULT.." "..AL["Witch Doctor Tan'zo"].." "..WHITE.."("..AL["Arathi Highlands"]..")", "WitchDoctorTanzo" }, + { WHITE.."[40]"..DEFAULT.." "..AL["Widow of the Woods"].." "..WHITE.."("..AL["Gilneas"]..")", "WidowoftheWoods" }, + { WHITE.."[40]"..DEFAULT.." "..AL["Dawnhowl"].." "..WHITE.."("..AL["Gilneas"]..")", "Dawnhowl" }, + { WHITE.."[43]"..DEFAULT.." "..AL["Maltimor's Prototype"].." "..WHITE.."("..AL["Gilneas"]..")", "MaltimorsPrototype" }, + { WHITE.."[44]"..DEFAULT.." "..AL["Bonecruncher"].." "..WHITE.."("..AL["Gilneas"]..")", "Bonecruncher" }, + { WHITE.."[44]"..DEFAULT.." "..AL["Duskskitter"].." "..WHITE.."("..AL["Gilneas"]..")", "Duskskitter" }, + { WHITE.."[45]"..DEFAULT.." "..AL["Baron Perenolde"].." "..WHITE.."("..AL["Gilneas"]..")", "BaronPerenolde" }, + { WHITE.."[45]"..DEFAULT.." "..AL["Kin'Tozo"].." "..WHITE.."("..AL["Stranglethorn Vale"]..")", "KinTozo" }, + { WHITE.."[47]"..DEFAULT.." "..AL["Grug'thok the Seer"].." "..WHITE.."("..AL["Feralas"]..")", "Grugthok" }, + { WHITE.."[47]"..DEFAULT.." "..AL["M-0L1Y"].." "..WHITE.."("..AL["Dun Morogh"]..")", "M0L1Y" }, + { WHITE.."[49]"..DEFAULT.." "..AL["Explorer Ashbeard"].." "..WHITE.."("..AL["Searing Gorge"]..")", "Ashbeard" }, + { WHITE.."[50]"..DEFAULT.." "..AL["Jal'akar"].." "..WHITE.."("..AL["Hinterlands"]..")", "Jalakar" }, + { WHITE.."[51]"..DEFAULT.." "..AL["Embereye"].." "..WHITE.."("..AL["Gilijim Isle"]..")", "Embereye" }, + { WHITE.."[51]"..DEFAULT.." "..AL["Ruk'thok the Pyromancer"].." "..WHITE.."("..AL["Lapidis Isle"]..")", "Rukthok" }, + { WHITE.."[51]"..DEFAULT.." "..AL["Tarangos"].." "..WHITE.."("..AL["Azshara"]..")", "Tarangos" }, + { WHITE.."[51]"..DEFAULT.." "..AL["Ripjaw"].." "..WHITE.."("..AL["Lapidis Isle"]..")", "Ripjaw" }, + { WHITE.."[53]"..DEFAULT.." "..AL["Xalvic Blackclaw"].." "..WHITE.."("..AL["Felwood"]..")", "Xalvic" }, + { WHITE.."[54]"..DEFAULT.." "..AL["Aquitus"].." "..WHITE.."("..AL["Gilijim Isle"]..")", "Aquitus" }, + { WHITE.."[55]"..DEFAULT.." "..AL["Firstborn of Arugal"].." "..WHITE.."("..AL["Gilneas"]..")", "FirstbornofArugal" }, + { WHITE.."[55]"..DEFAULT.." "..AL["Letashaz"].." "..WHITE.."("..AL["Gilijim Isle"]..")", "Letashaz" }, + { WHITE.."[55]"..DEFAULT.." "..AL["Margon the Mighty"].." "..WHITE.."("..AL["Lapidis Isle"]..")", "MargontheMighty" }, + { WHITE.."[55]"..DEFAULT.." "..AL["The Wandering Knight"].." "..WHITE.."("..AL["Western Plaguelands"]..")", "WanderingKnight" }, + { WHITE.."[56]"..DEFAULT.." "..AL["Stoneshell"].." "..WHITE.."("..AL["Tel'abim"]..")", "Stoneshell" }, + { WHITE.."[57]"..DEFAULT.." "..AL["Zareth Terrorblade"].." "..WHITE.."("..AL["Blasted Lands"]..")", "Zareth" }, + { WHITE.."[58]"..DEFAULT.." "..AL["Highvale Silverback"].." "..WHITE.."("..AL["Tel'abim"]..")", "HighvaleSilverback" }, + { WHITE.."[58]"..DEFAULT.." "..AL["Mallon The Moontouched"].." "..WHITE.."("..AL["Winterspring"]..")", "Mallon" }, + { WHITE.."[59]"..DEFAULT.." "..AL["Blademaster Kargron"].." "..WHITE.."("..AL["Burning Steppes"]..")", "Kargron" }, + { WHITE.."[59]"..DEFAULT.." "..AL["Professor Lysander"].." "..WHITE.."("..AL["Eastern Plaguelands"]..")", "ProfessorLysander" }, + { WHITE.."[60]"..DEFAULT.." "..AL["Admiral Barean Westwind"].." "..WHITE.."("..AL["Scarlet Enclave"]..")", "AdmiralBareanWestwind" }, + { WHITE.."[60]"..DEFAULT.." "..AL["Azurebeak"].." "..WHITE.."("..AL["Hyjal"]..")", "Azurebeak" }, + { WHITE.."[60]"..DEFAULT.." "..AL["Barkskin Fisher"].." "..WHITE.."("..AL["Hyjal"]..")", "BarkskinFisher" }, + { WHITE.."[61]"..DEFAULT.." "..AL["Crusader Larsarius"].." "..WHITE.."("..AL["Eastern Plaguelands"]..")", "CrusaderLarsarius" }, + { WHITE.."[61]"..DEFAULT.." "..AL["Shadeflayer Goliath"].." "..WHITE.."("..AL["Hyjal"]..")", "ShadeflayerGoliath" }, }, ["DragonmawRetreat"] = { { AL["Gowlfang"], "DMRGowlfang" }, @@ -878,7 +889,7 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Web Master Torkon"], "DMRWebMaster" }, { AL["Garlok Flamekeeper"], "DMRGarlok" }, { AL["Halgan Redbrand"], "DMRHalgan" }, - { AL["Slagfist Destroyer"],"DMRSlagfist" }, + { AL["Slagfist Destroyer"], "DMRSlagfist" }, { AL["Overlord Blackheart"], "DMROverlord" }, { AL["Elder Hollowblood"], "DMRElderHollowblood" }, { AL["Searistrasz"], "DMRSearistrasz" }, @@ -900,7 +911,7 @@ AtlasLoot_HewdropDown_SubTables = { { AL["Mergothid"], "SWRMergothid" }, { AL["Trash Mobs"], "SWRTrash" }, }, -}; +} --[[ AtlasLootDefaultFrame_OnShow: @@ -908,28 +919,28 @@ 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 - AtlasLoot_AnchorPoint = Anchor_Default; + AtlasLoot_AnchorPoint = Anchor_Default -- 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 if AtlasFrame then - AtlasFrame:Hide(); + AtlasFrame:Hide() end -- Remove the selection of a loot table in Atlas - AtlasLootItemsFrame.activeBoss = nil; + AtlasLootItemsFrame.activeBoss = nil -- Set the item table to the loot table - -- AtlasLoot_SetItemInfoFrame(AtlasLoot_AnchorPoint); + -- AtlasLoot_SetItemInfoFrame(AtlasLoot_AnchorPoint) -- Show the last displayed loot table - if AtlasLootCharDB.LastBoss == "WishList" then - AtlasLoot_ShowWishList() - return - elseif AtlasLootCharDB.LastBoss == "SearchResult" then - AtlasLoot:ShowSearchResult() - return - end + if AtlasLootCharDB.LastBoss == "WishList" then + AtlasLoot_ShowWishList() + return + elseif AtlasLootCharDB.LastBoss == "SearchResult" then + AtlasLoot:ShowSearchResult() + return + end if AtlasLootItemsFrame.refresh then AtlasLoot_ShowBossLoot(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[3]) else - AtlasLoot_ShowBossLoot(AtlasLootCharDB.LastBoss, AtlasLootCharDB.LastBossText); + AtlasLoot_ShowBossLoot(AtlasLootCharDB.LastBoss, AtlasLootCharDB.LastBossText) end end @@ -943,7 +954,7 @@ function AtlasLoot_OnEvent() -- Addons all loaded if event == "ADDON_LOADED" and arg1 == "AtlasLoot" then this:UnregisterEvent("ADDON_LOADED") - AtlasLoot_OnVariablesLoaded(); + AtlasLoot_OnVariablesLoaded() end end @@ -958,81 +969,81 @@ function AtlasLoot_OnVariablesLoaded() if not AtlasLootCharDB["QuickLooks"] then AtlasLootCharDB["QuickLooks"] = {} end if not AtlasLootCharDB["SearchResult"] then AtlasLootCharDB["SearchResult"] = {} end -- Add the loot browser to the special frames tables to enable closing wih the ESC key - tinsert(UISpecialFrames, "AtlasLootDefaultFrame"); + tinsert(UISpecialFrames, "AtlasLootDefaultFrame") tinsert(UISpecialFrames, "AtlasLootOptionsFrame") -- Set up options frame - AtlasLootOptions_OnLoad(); + AtlasLootOptions_OnLoad() -- Legacy code for those using the ultimately failed attempt at making Atlas load on demand if AtlasButton_LoadAtlas then - AtlasButton_LoadAtlas(); + AtlasButton_LoadAtlas() end -- Hook the necessary Atlas functions - Original_Atlas_Refresh = Atlas_Refresh; - Atlas_Refresh = AtlasLoot_Refresh; - Original_Atlas_OnShow = Atlas_OnShow; - Atlas_OnShow = AtlasLoot_Atlas_OnShow; + Original_Atlas_Refresh = Atlas_Refresh + Atlas_Refresh = AtlasLoot_Refresh + Original_Atlas_OnShow = Atlas_OnShow + Atlas_OnShow = AtlasLoot_Atlas_OnShow -- Instead of hooking, replace the scrollbar driver function - Original_AtlasScrollBar_Update = AtlasScrollBar_Update; - AtlasScrollBar_Update = AtlasLoot_AtlasScrollBar_Update; + Original_AtlasScrollBar_Update = AtlasScrollBar_Update + AtlasScrollBar_Update = AtlasLoot_AtlasScrollBar_Update -- Disable options that don't have the supporting mods - if not LootLink_SetTooltip and (AtlasLootCharDB.LootlinkTT == true ) then - AtlasLootCharDB.LootlinkTT = false; - AtlasLootCharDB.DefaultTT = true; + if not LootLink_SetTooltip and (AtlasLootCharDB.LootlinkTT == true) then + AtlasLootCharDB.LootlinkTT = false + AtlasLootCharDB.DefaultTT = true end if not ItemSync and (AtlasLootCharDB.ItemSyncTT == true) then - AtlasLootCharDB.ItemSyncTT = false; - AtlasLootCharDB.DefaultTT = true; + AtlasLootCharDB.ItemSyncTT = false + AtlasLootCharDB.DefaultTT = true end if (not IsAddOnLoaded("EQCompare") and not IsAddOnLoaded("EquipCompare")) and (AtlasLootCharDB.EquipCompare == true) then - AtlasLootCharDB.EquipCompare = false; + AtlasLootCharDB.EquipCompare = false end -- If using an opaque items frame, change the alpha value of the backing texture if AtlasLootCharDB.Opaque then - AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 1); + AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 1) else - AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 0.65); + AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 0.65) end -- If Atlas is installed, set up for Atlas if Original_Atlas_Refresh then - AtlasLoot_SetupForAtlas(); + AtlasLoot_SetupForAtlas() -- If a first time user, set up options if AtlasLootCharDB.FirstTime == nil or AtlasLootCharDB.FirstTime == true then - StaticPopup_Show ("ATLASLOOT_SETUP"); - AtlasLootCharDB.FirstTime = false; + StaticPopup_Show("ATLASLOOT_SETUP") + AtlasLootCharDB.FirstTime = false end -- If an older version if AtlasLootCharDB.FirstTime == nil and version < 40500 then - -- AtlasLootCharDB.SafeLinks = true; - -- AtlasLootCharDB.AllLinks = false; - StaticPopup_Show ("ATLASLOOT_SETUP"); - AtlasLootCharDB.FirstTime = false; + -- AtlasLootCharDB.SafeLinks = true + -- AtlasLootCharDB.AllLinks = false + StaticPopup_Show("ATLASLOOT_SETUP") + AtlasLootCharDB.FirstTime = false end - Original_Atlas_Refresh(); + Original_Atlas_Refresh() else -- If we are not using Atlas, keep the items frame out of the way - AtlasLootItemsFrame:Hide(); + AtlasLootItemsFrame:Hide() end - for k, v in pairs(AtlasLootCharDB["WishList"]) do - if type(v[2]) == "table" then - v[2] = v[2][3] or "INV_Misc_QuestionMark" - break - end - end + for k, v in pairs(AtlasLootCharDB["WishList"]) do + if type(v[2]) == "table" then + v[2] = v[2][3] or "INV_Misc_QuestionMark" + break + end + end -- Adds an AtlasLoot button to the Feature Frame in Cosmos if EarthFeature_AddButton then EarthFeature_AddButton( { - id = string.sub(ATLASLOOT_VERSION, 11, 28); - name = string.sub(ATLASLOOT_VERSION, 11, 28); - subtext = string.sub(ATLASLOOT_VERSION, 30, 39); - tooltip = ""; - icon = "Interface\\Icons\\INV_Box_01"; - callback = AtlasLoot_ShowMenu; - test = nil; + id = string.sub(ATLASLOOT_VERSION, 11, 28), + name = string.sub(ATLASLOOT_VERSION, 11, 28), + subtext = string.sub(ATLASLOOT_VERSION, 30, 39), + tooltip = "", + icon = "Interface\\Icons\\INV_Box_01", + callback = AtlasLoot_ShowMenu, + test = nil, } - ); - -- Adds AtlasLoot to old style Cosmos installations + ) + -- Adds AtlasLoot to old style Cosmos installations elseif Cosmos_RegisterButton then Cosmos_RegisterButton( string.sub(ATLASLOOT_VERSION, 11, 28), @@ -1040,28 +1051,28 @@ function AtlasLoot_OnVariablesLoaded() "", "Interface\\Icons\\INV_Box_01", AtlasLoot_ShowMenu - ); + ) end -- Set up the menu in the loot browser - AtlasLoot_HewdropRegister(); + AtlasLoot_HewdropRegister() -- Enable or disable AtlasLootFu based on seleced options -- If EquipCompare is available, use it if IsAddOnLoaded("EquipCompare") and AtlasLootCharDB.EquipCompare == true then - EquipCompare_RegisterTooltip(AtlasLootTooltip); - EquipCompare_RegisterTooltip(AtlasLootTooltip2); + EquipCompare_RegisterTooltip(AtlasLootTooltip) + EquipCompare_RegisterTooltip(AtlasLootTooltip2) end if IsAddOnLoaded("EQCompare") and (AtlasLootCharDB.EquipCompare == true) then - EQCompare:RegisterTooltip(AtlasLootTooltip); - EQCompare:RegisterTooltip(AtlasLootTooltip2); + EQCompare:RegisterTooltip(AtlasLootTooltip) + EQCompare:RegisterTooltip(AtlasLootTooltip2) end -- Position relevant UI objects for loot browser and set up menu - AtlasLootDefaultFrame_SelectedCategory:SetPoint("TOP", "AtlasLootDefaultFrame_Menu", "BOTTOM", 0, -4); - AtlasLootDefaultFrame_SelectedTable:SetPoint("TOP", "AtlasLootDefaultFrame_SubMenu", "BOTTOM", 0, -4); - AtlasLootDefaultFrame_SelectedCategory:SetText(AtlasLootCharDB.LastBossText); - AtlasLootDefaultFrame_SelectedTable:SetText(""); - AtlasLootDefaultFrame_SelectedCategory:Show(); - AtlasLootDefaultFrame_SelectedTable:Show(); - AtlasLootDefaultFrame_SubMenu:Disable(); + AtlasLootDefaultFrame_SelectedCategory:SetPoint("TOP", "AtlasLootDefaultFrame_Menu", "BOTTOM", 0, -4) + AtlasLootDefaultFrame_SelectedTable:SetPoint("TOP", "AtlasLootDefaultFrame_SubMenu", "BOTTOM", 0, -4) + AtlasLootDefaultFrame_SelectedCategory:SetText(AtlasLootCharDB.LastBossText) + AtlasLootDefaultFrame_SelectedTable:SetText("") + AtlasLootDefaultFrame_SelectedCategory:Show() + AtlasLootDefaultFrame_SelectedTable:Show() + AtlasLootDefaultFrame_SubMenu:Disable() end --[[ @@ -1071,19 +1082,19 @@ Function is loaded when the addon is loaded function AtlasLootOptions_OnLoad() -- Disable checkboxes of missing addons if not LootLink_SetTooltip then - AtlasLootOptionsFrameLootlinkTT:Disable(); - AtlasLootOptionsFrameLootlinkTTText:SetText(AL["|cff9d9d9dLootlink Tooltips|r"]); + AtlasLootOptionsFrameLootlinkTT:Disable() + AtlasLootOptionsFrameLootlinkTTText:SetText(AL["|cff9d9d9dLootlink Tooltips|r"]) end if not ItemSync then - AtlasLootOptionsFrameItemSyncTT:Disable(); - AtlasLootOptionsFrameItemSyncTTText:SetText(AL["|cff9d9d9dItemSync Tooltips|r"]); + AtlasLootOptionsFrameItemSyncTT:Disable() + AtlasLootOptionsFrameItemSyncTTText:SetText(AL["|cff9d9d9dItemSync Tooltips|r"]) end if not IsAddOnLoaded("EQCompare") and not IsAddOnLoaded("EquipCompare") then - AtlasLootOptionsFrameEquipCompare:Disable(); - AtlasLootOptionsFrameEquipCompareText:SetText(AL["|cff9d9d9dUse EquipCompare|r"]); + AtlasLootOptionsFrameEquipCompare:Disable() + AtlasLootOptionsFrameEquipCompareText:SetText(AL["|cff9d9d9dUse EquipCompare|r"]) end - AtlasLootOptions_Init(); - UIPanelWindows['AtlasLootOptionsFrame'] = {area = 'center', pushable = 0}; + AtlasLootOptions_Init() + UIPanelWindows['AtlasLootOptionsFrame'] = { area = 'center', pushable = 0 } end --[[ @@ -1093,31 +1104,31 @@ Initiates the options. function AtlasLootOptions_Init() -- clear saved vars for a new version (or a new install!) if AtlasLootCharDB.FirstTime == nil then - AtlasLootOptions_Fresh(); + AtlasLootOptions_Fresh() end -- Initialise all the check boxes on the options frame - -- AtlasLootOptionsFrameSafeLinks:SetChecked(AtlasLootCharDB.SafeLinks); - -- AtlasLootOptionsFrameAllLinks:SetChecked(AtlasLootCharDB.AllLinks); - AtlasLootOptionsFrameDefaultTT:SetChecked(AtlasLootCharDB.DefaultTT); - AtlasLootOptionsFrameLootlinkTT:SetChecked(AtlasLootCharDB.LootlinkTT); - AtlasLootOptionsFrameItemSyncTT:SetChecked(AtlasLootCharDB.ItemSyncTT); - AtlasLootOptionsFrameShowSource:SetChecked(AtlasLootCharDB.ShowSource); - AtlasLootOptionsFrameWishlistGroupedByDungeon:SetChecked(AtlasLootCharDB.WishlistGroupedByDungeon); - AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLootCharDB.EquipCompare); - AtlasLootOptionsFrameOpaque:SetChecked(AtlasLootCharDB.Opaque); - AtlasLootOptionsFrameItemID:SetChecked(AtlasLootCharDB.ItemIDs); - -- AtlasLootOptionsFrameItemSpam:SetChecked(AtlasLootCharDB.ItemSpam); - AtlasLootOptionsFrameHidePanel:SetChecked(AtlasLootCharDB.HidePanel); - AtlasLootOptionsFrameMinimap:SetChecked(AtlasLootCharDB.MinimapButton); - AtlasLootOptionsFrameSliderButtonPos:SetValue(AtlasLootCharDB.MinimapButtonPosition); - AtlasLootOptionsFrameSliderButtonRad:SetValue(AtlasLootCharDB.MinimapButtonRadius); + -- AtlasLootOptionsFrameSafeLinks:SetChecked(AtlasLootCharDB.SafeLinks) + -- AtlasLootOptionsFrameAllLinks:SetChecked(AtlasLootCharDB.AllLinks) + AtlasLootOptionsFrameDefaultTT:SetChecked(AtlasLootCharDB.DefaultTT) + AtlasLootOptionsFrameLootlinkTT:SetChecked(AtlasLootCharDB.LootlinkTT) + AtlasLootOptionsFrameItemSyncTT:SetChecked(AtlasLootCharDB.ItemSyncTT) + AtlasLootOptionsFrameShowSource:SetChecked(AtlasLootCharDB.ShowSource) + AtlasLootOptionsFrameWishlistGroupedByDungeon:SetChecked(AtlasLootCharDB.WishlistGroupedByDungeon) + AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLootCharDB.EquipCompare) + AtlasLootOptionsFrameOpaque:SetChecked(AtlasLootCharDB.Opaque) + AtlasLootOptionsFrameItemID:SetChecked(AtlasLootCharDB.ItemIDs) + -- AtlasLootOptionsFrameItemSpam:SetChecked(AtlasLootCharDB.ItemSpam) + AtlasLootOptionsFrameHidePanel:SetChecked(AtlasLootCharDB.HidePanel) + AtlasLootOptionsFrameMinimap:SetChecked(AtlasLootCharDB.MinimapButton) + AtlasLootOptionsFrameSliderButtonPos:SetValue(AtlasLootCharDB.MinimapButtonPosition) + AtlasLootOptionsFrameSliderButtonRad:SetValue(AtlasLootCharDB.MinimapButtonRadius) AtlasLootMinimapButtonFrame:SetPoint( "TOPLEFT", "Minimap", "TOPLEFT", 54 - (AtlasLootCharDB.MinimapButtonRadius * cos(AtlasLootCharDB.MinimapButtonPosition)), (AtlasLootCharDB.MinimapButtonRadius * sin(AtlasLootCharDB.MinimapButtonPosition)) - 55 - ); + ) end --[[ @@ -1125,26 +1136,26 @@ Atlas_FreshOptions: Sets default options on a fresh start. ]] function AtlasLootOptions_Fresh() - -- AtlasLootCharDB.SafeLinks = false; - -- AtlasLootCharDB.AllLinks = true; - AtlasLootCharDB.DefaultTT = true; - AtlasLootCharDB.LootlinkTT = false; - AtlasLootCharDB.ItemSyncTT = false; - AtlasLootCharDB.ShowSource = true; - AtlasLootCharDB.WishlistGroupedByDungeon = true; - AtlasLootCharDB.EquipCompare = false; - AtlasLootCharDB.Opaque = false; - AtlasLootCharDB.ItemIDs = false; - AtlasLootCharDB.FirstTime = true; - -- AtlasLootCharDB.ItemSpam = true; - AtlasLootCharDB.MinimapButton = true; - AtlasLootCharDB.MinimapButtonPosition = 315; - AtlasLootCharDB.MinimapButtonRadius = 78; - AtlasLootCharDB.HidePanel = false; - AtlasLootCharDB.LastBoss = "DUNGEONSMENU1"; - AtlasLootCharDB.LastBossText = AL["Dungeons & Raids"]; - -- AtlasLootCharDB.AutoQuery = false; - AtlasLootCharDB.PartialMatching = true; + -- AtlasLootCharDB.SafeLinks = false + -- AtlasLootCharDB.AllLinks = true + AtlasLootCharDB.DefaultTT = true + AtlasLootCharDB.LootlinkTT = false + AtlasLootCharDB.ItemSyncTT = false + AtlasLootCharDB.ShowSource = true + AtlasLootCharDB.WishlistGroupedByDungeon = true + AtlasLootCharDB.EquipCompare = false + AtlasLootCharDB.Opaque = false + AtlasLootCharDB.ItemIDs = false + AtlasLootCharDB.FirstTime = true + -- AtlasLootCharDB.ItemSpam = true + AtlasLootCharDB.MinimapButton = true + AtlasLootCharDB.MinimapButtonPosition = 315 + AtlasLootCharDB.MinimapButtonRadius = 78 + AtlasLootCharDB.HidePanel = false + AtlasLootCharDB.LastBoss = "DUNGEONSMENU1" + AtlasLootCharDB.LastBossText = AL["Dungeons & Raids"] + -- AtlasLootCharDB.AutoQuery = false + AtlasLootCharDB.PartialMatching = true end --[[ @@ -1153,12 +1164,12 @@ Performs inital setup of the mod and registers it for further setup when the required resources are in place ]] function AtlasLoot_OnLoad() - this:RegisterEvent("ADDON_LOADED"); + this:RegisterEvent("ADDON_LOADED") -- Enable the use of /al or /atlasloot to open the loot browser - SLASH_ATLASLOOT1 = "/atlasloot"; - SLASH_ATLASLOOT2 = "/al"; + SLASH_ATLASLOOT1 = "/atlasloot" + SLASH_ATLASLOOT2 = "/al" SlashCmdList["ATLASLOOT"] = function(msg) - AtlasLoot_SlashCommand(msg); + AtlasLoot_SlashCommand(msg) end AtlasLootItemsFrame.queue = {} end @@ -1170,13 +1181,13 @@ If someone types /atlasloot, bring up the options box ]] function AtlasLoot_SlashCommand(msg) if msg == AL["reset"] then - AtlasLootOptions_ResetPosition(); + AtlasLootOptions_ResetPosition() elseif msg == AL["default"] then - AtlasLootOptions_DefaultSettings(); + AtlasLootOptions_DefaultSettings() elseif msg == AL["options"] then - AtlasLootOptions_Toggle(); + AtlasLootOptions_Toggle() else - AtlasLootDefaultFrame:Show(); + AtlasLootDefaultFrame:Show() end end @@ -1187,34 +1198,35 @@ and close all Hewdrop menus ]] function AtlasLootDefaultFrame_OnHide() if AtlasFrame then - AtlasLoot_SetupForAtlas(); + AtlasLoot_SetupForAtlas() end - AtlasLoot_Hewdrop:Close(1); - AtlasLoot_HewdropSubMenu:Close(1); + AtlasLoot_Hewdrop:Close(1) + AtlasLoot_HewdropSubMenu:Close(1) if AtlasLootItemsFrame.refresh then AtlasLootCharDB.LastBoss = AtlasLootItemsFrame.refresh[1] AtlasLootCharDB.LastBossText = AtlasLootItemsFrame.refresh[3] end end + --[[ AtlasLoot_SetupForAtlas: This function sets up the Atlas specific XML objects ]] function AtlasLoot_SetupForAtlas() -- Poisition the frame with the AtlasLoot version details in the Atlas frame - AtlasLootInfo:ClearAllPoints(); - AtlasLootInfo:SetParent(AtlasFrame); - AtlasLootInfo:SetPoint("TOPLEFT", "AtlasFrame", "TOPLEFT", 546, -3); + AtlasLootInfo:ClearAllPoints() + AtlasLootInfo:SetParent(AtlasFrame) + AtlasLootInfo:SetPoint("TOPLEFT", "AtlasFrame", "TOPLEFT", 546, -3) AtlasLootInfo:SetFrameLevel(AtlasFrame:GetFrameLevel() + 1) AtlasLootInfo:Show() -- Anchor the bottom panel to the Atlas frame - AtlasLootPanel:ClearAllPoints(); - AtlasLootPanel:SetParent(AtlasFrame); - AtlasLootPanel:SetPoint("TOP", "AtlasFrame", "BOTTOM", 0, 9); + AtlasLootPanel:ClearAllPoints() + AtlasLootPanel:SetParent(AtlasFrame) + AtlasLootPanel:SetPoint("TOP", "AtlasFrame", "BOTTOM", 0, 9) AtlasLootPanel:SetFrameLevel(AtlasFrame:GetFrameLevel() + 1) AtlasLootPanel:Show() - AtlasLoot_AnchorPoint = Anchor_Atlas - AtlasLootItemsFrame:Hide(); + AtlasLoot_AnchorPoint = Anchor_Atlas + AtlasLootItemsFrame:Hide() end --[[ @@ -1224,32 +1236,32 @@ Required as the Atlas function cannot deal with the AtlasLoot button template or ]] function AtlasLoot_AtlasScrollBar_Update() Original_AtlasScrollBar_Update() - local zoneID = ATLAS_DROPDOWNS[AtlasOptions.AtlasType][AtlasOptions.AtlasZone]; + local zoneID = ATLAS_DROPDOWNS[AtlasOptions.AtlasType][AtlasOptions.AtlasZone] -- Make note of how far in the scroll frame we are for line = 1, ATLAS_NUM_LINES do - local lineplusoffset = line + FauxScrollFrame_GetOffset(AtlasScrollBar); - local entry = _G["AtlasEntry" .. line] - local loot = _G["AtlasEntry" .. line .. "_Loot"] - local selected = _G["AtlasEntry" .. line .. "_Selected"] + local lineplusoffset = line + FauxScrollFrame_GetOffset(AtlasScrollBar) + local entry = _G["AtlasEntry"..line] + local loot = _G["AtlasEntry"..line.."_Loot"] + local selected = _G["AtlasEntry"..line.."_Selected"] if loot and lineplusoffset <= ATLAS_CUR_LINES then - _G["AtlasEntry" .. line .. "_Text"]:SetText(ATLAS_SCROLL_LIST[lineplusoffset]); + _G["AtlasEntry"..line.."_Text"]:SetText(ATLAS_SCROLL_LIST[lineplusoffset]) local showIcon = (AtlasLootBossButtons[zoneID] and AtlasLootBossButtons[zoneID][lineplusoffset] and AtlasLootBossButtons[zoneID][lineplusoffset] ~= "") or - (AtlasLootWBBossButtons[zoneID] and AtlasLootWBBossButtons[zoneID][lineplusoffset] and AtlasLootWBBossButtons[zoneID][lineplusoffset] ~= "") or - (AtlasLootBattlegrounds[zoneID] and AtlasLootBattlegrounds[zoneID][lineplusoffset] and AtlasLootBattlegrounds[zoneID][lineplusoffset] ~= "") + (AtlasLootWBBossButtons[zoneID] and AtlasLootWBBossButtons[zoneID][lineplusoffset] and AtlasLootWBBossButtons[zoneID][lineplusoffset] ~= "") or + (AtlasLootBattlegrounds[zoneID] and AtlasLootBattlegrounds[zoneID][lineplusoffset] and AtlasLootBattlegrounds[zoneID][lineplusoffset] ~= "") if AtlasLootItemsFrame.activeBoss == lineplusoffset then - entry:Enable(); - loot:Hide(); - selected:Show(); + entry:Enable() + loot:Hide() + selected:Show() elseif showIcon then - entry:Enable(); - loot:Show(); - selected:Hide(); + entry:Enable() + loot:Show() + selected:Hide() else - entry:Disable(); - loot:Hide(); - selected:Hide(); + entry:Disable() + loot:Hide() + selected:Hide() end - entry.idnum = lineplusoffset; + entry.idnum = lineplusoffset end end end @@ -1273,10 +1285,10 @@ function AtlasLoot_Refresh(keepSelection) Original_Atlas_Refresh() for i = 1, ATLAS_NUM_LINES do - local entry = _G["AtlasEntry" .. i] + local entry = _G["AtlasEntry"..i] if entry and not _G["AtlasEntry"..i.."_Loot"] then -- Add deselected icon - local loot = entry:CreateTexture("$parent_Loot", "OVERLAY"); + local loot = entry:CreateTexture("$parent_Loot", "OVERLAY") loot:SetWidth(16) loot:SetHeight(16) loot:SetPoint("RIGHT", entry, 0, 0) @@ -1302,14 +1314,14 @@ Hooks Atlas_OnShow() to add extra setup routines that AtlasLoot needs for integration purposes. ]] function AtlasLoot_Atlas_OnShow() - AtlasLoot_Refresh(true); + AtlasLoot_Refresh(true) -- We don't want Atlas and the Loot Browser open at the same time, so the Loot Browser is close if AtlasLootDefaultFrame then - AtlasLootDefaultFrame:Hide(); - AtlasLoot_SetupForAtlas(); + AtlasLootDefaultFrame:Hide() + AtlasLoot_SetupForAtlas() end -- Call the Atlas function - Original_Atlas_OnShow(); + Original_Atlas_OnShow() -- If we were looking at a loot table earlier in the session, it is still -- saved on the item frame, so restore it in Atlas if AtlasLootItemsFrame.activeBoss then @@ -1319,9 +1331,9 @@ function AtlasLoot_Atlas_OnShow() end -- Consult the saved variable table to see whether to show the bottom panel if AtlasLootCharDB.HidePanel == true then - AtlasLootPanel:Hide(); + AtlasLootPanel:Hide() else - AtlasLootPanel:Show(); + AtlasLootPanel:Show() end AtlasLoot_AtlasScrollBar_Update() end @@ -1332,9 +1344,9 @@ Simple function to toggle the visibility of the AtlasLoot frame. ]] function AtlasLoot_Toggle() if AtlasLootDefaultFrame:IsVisible() then - HideUIPanel(AtlasLootDefaultFrame); + HideUIPanel(AtlasLootDefaultFrame) else - ShowUIPanel(AtlasLootDefaultFrame); + ShowUIPanel(AtlasLootDefaultFrame) end end @@ -1345,64 +1357,64 @@ Shows a loot page if one is associated with the button ]] function AtlasLootBoss_OnClick() local name = this:GetName() - local zoneID = ATLAS_DROPDOWNS[AtlasOptions.AtlasType][AtlasOptions.AtlasZone]; - local id = this.idnum; + local zoneID = ATLAS_DROPDOWNS[AtlasOptions.AtlasType][AtlasOptions.AtlasZone] + local id = this.idnum -- If the loot table was already shown and boss clicked again, hide the loot table and fix boss list icons if _G[name.."_Selected"]:IsVisible() then - _G[name.."_Selected"]:Hide(); - _G[name.."_Loot"]:Show(); - AtlasLootItemsFrame:Hide(); - AtlasLootItemsFrame.activeBoss = nil; + _G[name.."_Selected"]:Hide() + _G[name.."_Loot"]:Show() + AtlasLootItemsFrame:Hide() + AtlasLootItemsFrame.activeBoss = nil 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] and AtlasLootBossButtons[zoneID][id] and AtlasLootBossButtons[zoneID][id] ~= "" then -- if AtlasLoot_IsLootTableAvailable(AtlasLootBossButtons[zoneID][id]) then - _G[name.."_Selected"]:Show(); - _G[name.."_Loot"]:Hide(); - local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX']*[%) ]*(.*[^%,])[%,]?$"); - AtlasLoot_ShowBossLoot(AtlasLootBossButtons[zoneID][id], boss); - AtlasLootItemsFrame.activeBoss = id; - AtlasLoot_AtlasScrollBar_Update(); - AtlasLootCharDB.LastBoss = AtlasLootBossButtons[zoneID][id] - -- dont show navigation buttons if its not rep or set - local match = string.find(boss, AL["Reputation"]) or string.find(boss, AL["Set"]) - if not match then - AtlasLootItemsFrame_BACK:Hide(); - AtlasLootItemsFrame_NEXT:Hide(); - AtlasLootItemsFrame_PREV:Hide(); - end + _G[name.."_Selected"]:Show() + _G[name.."_Loot"]:Hide() + local _, _, boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX']*[%) ]*(.*[^%,])[%,]?$") + AtlasLoot_ShowBossLoot(AtlasLootBossButtons[zoneID][id], boss) + AtlasLootItemsFrame.activeBoss = id + AtlasLoot_AtlasScrollBar_Update() + AtlasLootCharDB.LastBoss = AtlasLootBossButtons[zoneID][id] + -- dont show navigation buttons if its not rep or set + local match = string.find(boss, AL["Reputation"]) or string.find(boss, AL["Set"]) + if not match then + AtlasLootItemsFrame_BACK:Hide() + AtlasLootItemsFrame_NEXT:Hide() + AtlasLootItemsFrame_PREV:Hide() + end -- end elseif AtlasLootWBBossButtons[zoneID] and AtlasLootWBBossButtons[zoneID][id] and AtlasLootWBBossButtons[zoneID][id] ~= "" then -- if AtlasLoot_IsLootTableAvailable(AtlasLootWBBossButtons[zoneID][id]) then - _G[name.."_Selected"]:Show(); - _G[name.."_Loot"]:Hide(); - local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX]*[%) ]*(.*[^%,])[%,]?$"); - AtlasLoot_ShowBossLoot(AtlasLootWBBossButtons[zoneID][id], boss); - AtlasLootItemsFrame.activeBoss = id; - AtlasLoot_AtlasScrollBar_Update(); - AtlasLootCharDB.LastBoss = AtlasLootWBBossButtons[zoneID][id] - -- dont show navigation buttons - AtlasLootItemsFrame_BACK:Hide(); - AtlasLootItemsFrame_NEXT:Hide(); - AtlasLootItemsFrame_PREV:Hide(); + _G[name.."_Selected"]:Show() + _G[name.."_Loot"]:Hide() + local _, _, boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX]*[%) ]*(.*[^%,])[%,]?$") + AtlasLoot_ShowBossLoot(AtlasLootWBBossButtons[zoneID][id], boss) + AtlasLootItemsFrame.activeBoss = id + AtlasLoot_AtlasScrollBar_Update() + AtlasLootCharDB.LastBoss = AtlasLootWBBossButtons[zoneID][id] + -- dont show navigation buttons + AtlasLootItemsFrame_BACK:Hide() + AtlasLootItemsFrame_NEXT:Hide() + AtlasLootItemsFrame_PREV:Hide() -- end elseif AtlasLootBattlegrounds[zoneID] and AtlasLootBattlegrounds[zoneID][id] and AtlasLootBattlegrounds[zoneID][id] ~= "" then -- if AtlasLoot_IsLootTableAvailable(AtlasLootBattlegrounds[zoneID][id]) then - _G[name.."_Selected"]:Show(); - _G[name.."_Loot"]:Hide(); - local _,_,boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%wX]*[%) ]*(.*[^%,])[%,]?$"); - AtlasLoot_ShowBossLoot(AtlasLootBattlegrounds[zoneID][id], boss); - AtlasLootItemsFrame.activeBoss = id; - AtlasLoot_AtlasScrollBar_Update(); - AtlasLootCharDB.LastBoss = AtlasLootBattlegrounds[zoneID][id] + _G[name.."_Selected"]:Show() + _G[name.."_Loot"]:Hide() + local _, _, boss = string.find(_G[name.."_Text"]:GetText(), "|c%x%x%x%x%x%x%x%x%s*[%wX]*[%) ]*(.*[^%,])[%,]?$") + AtlasLoot_ShowBossLoot(AtlasLootBattlegrounds[zoneID][id], boss) + AtlasLootItemsFrame.activeBoss = id + AtlasLoot_AtlasScrollBar_Update() + AtlasLootCharDB.LastBoss = AtlasLootBattlegrounds[zoneID][id] -- end end end -- This has been invoked from Atlas, so we remove any claim external mods have on the loot table - AtlasLootItemsFrame.externalBoss = nil; + AtlasLootItemsFrame.externalBoss = nil -- Hide the AtlasQuest frame if present so that the AtlasLoot items frame is not stuck under it if AtlasQuestInsideFrame then - AtlasQuestInsideFrame:Hide(); + AtlasQuestInsideFrame:Hide() end end @@ -1411,7 +1423,7 @@ AtlasLoot_ShowMenu: Legacy function used in Cosmos integration to open the loot browser ]] function AtlasLoot_ShowMenu() - AtlasLootDefaultFrame:Show(); + AtlasLootDefaultFrame:Show() end --[[ @@ -1420,12 +1432,12 @@ Toggles SafeLinks. Items uncached will be linked as their names. ]] -- function AtlasLootOptions_SafeLinksToggle() -- if AtlasLootCharDB.SafeLinks then --- AtlasLootCharDB.SafeLinks = false; +-- AtlasLootCharDB.SafeLinks = false -- else --- AtlasLootCharDB.SafeLinks = true; --- AtlasLootCharDB.AllLinks = false; +-- AtlasLootCharDB.SafeLinks = true +-- AtlasLootCharDB.AllLinks = false -- end --- AtlasLootOptions_Init(); +-- AtlasLootOptions_Init() -- end --[[ @@ -1434,12 +1446,12 @@ Toggles AllLinks. All items will be linked. ]] -- function AtlasLootOptions_AllLinksToggle() -- if AtlasLootCharDB.AllLinks then --- AtlasLootCharDB.AllLinks = false; +-- AtlasLootCharDB.AllLinks = false -- else --- AtlasLootCharDB.AllLinks = true; --- AtlasLootCharDB.SafeLinks = false; +-- AtlasLootCharDB.AllLinks = true +-- AtlasLootCharDB.SafeLinks = false -- end --- AtlasLootOptions_Init(); +-- AtlasLootOptions_Init() -- end --[[ @@ -1447,10 +1459,10 @@ AtlasLootOptions_DefaultTTToggle: Toggles DefaultTooltips. Uses default tooltips. ]] function AtlasLootOptions_DefaultTTToggle() - AtlasLootCharDB.DefaultTT = true; - AtlasLootCharDB.LootlinkTT = false; - AtlasLootCharDB.ItemSyncTT = false; - AtlasLootOptions_Init(); + AtlasLootCharDB.DefaultTT = true + AtlasLootCharDB.LootlinkTT = false + AtlasLootCharDB.ItemSyncTT = false + AtlasLootOptions_Init() end --[[ @@ -1458,10 +1470,10 @@ AtlasLootOptions_LootlinkTTToggle: Toggles Lootlink tooltips instead of the default ones. ]] function AtlasLootOptions_LootlinkTTToggle() - AtlasLootCharDB.DefaultTT = false; - AtlasLootCharDB.LootlinkTT = true; - AtlasLootCharDB.ItemSyncTT = false; - AtlasLootOptions_Init(); + AtlasLootCharDB.DefaultTT = false + AtlasLootCharDB.LootlinkTT = true + AtlasLootCharDB.ItemSyncTT = false + AtlasLootOptions_Init() end --[[ @@ -1469,33 +1481,33 @@ AtlasLootOptions_ItemSyncTTToggle: Toggles ItemSync tooltips instead of the default ones. ]] function AtlasLootOptions_ItemSyncTTToggle() - AtlasLootCharDB.DefaultTT = false; - AtlasLootCharDB.LootlinkTT = false; - AtlasLootCharDB.ItemSyncTT = true; - AtlasLootOptions_Init(); + AtlasLootCharDB.DefaultTT = false + AtlasLootCharDB.LootlinkTT = false + AtlasLootCharDB.ItemSyncTT = true + AtlasLootOptions_Init() end function AtlasLootOptions_ShowSourceToggle() if AtlasLootCharDB.ShowSource then - AtlasLootCharDB.ShowSource = false; + AtlasLootCharDB.ShowSource = false else - AtlasLootCharDB.ShowSource = true; + AtlasLootCharDB.ShowSource = true end - AtlasLootOptions_Init(); + AtlasLootOptions_Init() end function AtlasLootOptions_WishlistGroupedByDungeonToggle() if AtlasLootCharDB.WishlistGroupedByDungeon then - AtlasLootCharDB.WishlistGroupedByDungeon = false; + AtlasLootCharDB.WishlistGroupedByDungeon = false else - AtlasLootCharDB.WishlistGroupedByDungeon = true; + AtlasLootCharDB.WishlistGroupedByDungeon = true end - AtlasLootOptions_Init(); - AtlasLoot_WishList = AtlasLoot_CategorizeWishList(AtlasLootCharDB["WishList"]); - local dataID = AtlasLootItemsFrame.refresh[1]; + AtlasLootOptions_Init() + AtlasLoot_WishList = AtlasLoot_CategorizeWishList(AtlasLootCharDB["WishList"]) + local dataID = AtlasLootItemsFrame.refresh[1] if dataID == 'WishList' then - AtlasLoot_ShowWishList(); + AtlasLoot_ShowWishList() end end @@ -1505,27 +1517,27 @@ Toggles EquipCompare. Adds a tooltip with the equipped item (if it's the case) n ]] function AtlasLootOptions_EquipCompareToggle() if AtlasLootCharDB.EquipCompare then - AtlasLootCharDB.EquipCompare = false; + AtlasLootCharDB.EquipCompare = false if IsAddOnLoaded("EquipCompare") then - EquipCompare_UnregisterTooltip(AtlasLootTooltip); - EquipCompare_UnregisterTooltip(AtlasLootTooltip2); + EquipCompare_UnregisterTooltip(AtlasLootTooltip) + EquipCompare_UnregisterTooltip(AtlasLootTooltip2) end if IsAddOnLoaded("EQCompare") then - EQCompare:UnRegisterTooltip(AtlasLootTooltip); - EQCompare:UnRegisterTooltip(AtlasLootTooltip2); + EQCompare:UnRegisterTooltip(AtlasLootTooltip) + EQCompare:UnRegisterTooltip(AtlasLootTooltip2) end else - AtlasLootCharDB.EquipCompare = true; + AtlasLootCharDB.EquipCompare = true if IsAddOnLoaded("EquipCompare") then - EquipCompare_RegisterTooltip(AtlasLootTooltip); - EquipCompare_RegisterTooltip(AtlasLootTooltip2); + EquipCompare_RegisterTooltip(AtlasLootTooltip) + EquipCompare_RegisterTooltip(AtlasLootTooltip2) end if IsAddOnLoaded("EQCompare") then - EQCompare:RegisterTooltip(AtlasLootTooltip); - EQCompare:RegisterTooltip(AtlasLootTooltip2); + EQCompare:RegisterTooltip(AtlasLootTooltip) + EQCompare:RegisterTooltip(AtlasLootTooltip2) end end - AtlasLootOptions_Init(); + AtlasLootOptions_Init() end --[[ @@ -1533,13 +1545,13 @@ AtlasLootOptions_OpaqueToggle: Toggles opacity of the items frame. ]] function AtlasLootOptions_OpaqueToggle() - AtlasLootCharDB.Opaque = AtlasLootOptionsFrameOpaque:GetChecked(); + AtlasLootCharDB.Opaque = AtlasLootOptionsFrameOpaque:GetChecked() if AtlasLootCharDB.Opaque then - AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 1); + AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 1) else - AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 0.65); + AtlasLootItemsFrame_Back:SetTexture(0, 0, 0, 0.65) end - AtlasLootOptions_Init(); + AtlasLootOptions_Init() end --[[ @@ -1548,11 +1560,11 @@ Toggles items ID. ]] function AtlasLootOptions_ItemIDToggle() if AtlasLootCharDB.ItemIDs then - AtlasLootCharDB.ItemIDs = false; + AtlasLootCharDB.ItemIDs = false else - AtlasLootCharDB.ItemIDs = true; + AtlasLootCharDB.ItemIDs = true end - AtlasLootOptions_Init(); + AtlasLootOptions_Init() end --[[ @@ -1561,11 +1573,11 @@ Toggles item query spam. ]] -- function AtlasLootOptions_ItemSpam() -- if AtlasLootCharDB.ItemSpam then --- AtlasLootCharDB.ItemSpam = false; +-- AtlasLootCharDB.ItemSpam = false -- else --- AtlasLootCharDB.ItemSpam = true; +-- AtlasLootCharDB.ItemSpam = true -- end --- AtlasLootOptions_Init(); +-- AtlasLootOptions_Init() -- end --[[ @@ -1575,16 +1587,16 @@ Toggle on/off the options window function AtlasLootOptions_Toggle() if AtlasLootOptionsFrame:IsVisible() then -- Hide the options frame if already shown - AtlasLootOptionsFrame:Hide(); + AtlasLootOptionsFrame:Hide() else - AtlasLootOptionsFrame:Show(); + AtlasLootOptionsFrame:Show() -- Workaround for a weird quirk where tooltip settings so not immediately take effect if AtlasLootCharDB.DefaultTT == true then - AtlasLootOptions_DefaultTTToggle(); + AtlasLootOptions_DefaultTTToggle() elseif AtlasLootCharDB.LootlinkTT == true then - AtlasLootOptions_LootlinkTTToggle(); + AtlasLootOptions_LootlinkTTToggle() elseif AtlasLootCharDB.ItemSyncTT == true then - AtlasLootOptions_ItemSyncTTToggle(); + AtlasLootOptions_ItemSyncTTToggle() end end end @@ -1627,84 +1639,84 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) AtlasLootItemsFrameContainer:Hide() end -- Set up local variables needed for GetItemInfo, etc - local iconFrame, nameFrame, extraFrame, itemButton; - local text, extra; - local wlPage, wlPageMax = 1, 1; - local isItem, isEnchant, isSpell; - local spellName, spellIcon; - local dataSource_backup = dataSource; + local iconFrame, nameFrame, extraFrame, itemButton + local text, extra + local wlPage, wlPageMax = 1, 1 + local isItem, isEnchant, isSpell + local spellName, spellIcon + local dataSource_backup = dataSource if dataSource ~= "dummy" then if dataID == "SearchResult" or dataID == "WishList" then - dataSource = {}; + dataSource = {} -- Match the page number to display - wlPage = tonumber(string.sub(dataSource_backup, string.find(dataSource_backup, "%d"), string.len(dataSource_backup))); + wlPage = tonumber(string.sub(dataSource_backup, string.find(dataSource_backup, "%d"), string.len(dataSource_backup))) -- Aquiring items of the page if dataID == "SearchResult" then - dataSource[dataID], wlPageMax = AtlasLoot:GetSearchResultPage(wlPage); + dataSource[dataID], wlPageMax = AtlasLoot:GetSearchResultPage(wlPage) elseif dataID == "WishList" then - dataSource[dataID], wlPageMax = AtlasLoot_GetWishListPage(wlPage); + dataSource[dataID], wlPageMax = AtlasLoot_GetWishListPage(wlPage) end -- Make page number reasonable if wlPage < 1 then wlPage = 1 end if wlPage > wlPageMax then wlPage = wlPageMax end else - dataSource = AtlasLoot_Data[dataSource_backup]; + dataSource = AtlasLoot_Data[dataSource_backup] end end -- Get AtlasQuest out of the way if AtlasQuestInsideFrame then - AtlasQuestInsideFrame:Hide(); + AtlasQuestInsideFrame:Hide() 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, AtlasLoot_AnchorPoint }; + AtlasLootItemsFrame.refresh = { dataID, dataSource_backup, boss, AtlasLoot_AnchorPoint } -- Escape out of this function if creating a menu, this function only handles loot tables. -- Inserting escapes in this way allows consistant calling of data whether it is a loot table or a menu. if AtlasLoot_MenuList[dataID] then -- Ditch the Quicklook selector - AtlasLoot_QuickLooks:Hide(); - AtlasLootQuickLooksButton:Hide(); + AtlasLoot_QuickLooks:Hide() + AtlasLootQuickLooksButton:Hide() _G[AtlasLoot_MenuList[dataID]]() else -- This is a valid QuickLook, so show the UI objects if dataID ~= "SearchResult" and dataID ~= "WishList" then - AtlasLoot_QuickLooks:Show(); - AtlasLootQuickLooksButton:Show(); + AtlasLoot_QuickLooks:Show() + AtlasLootQuickLooksButton:Show() end -- Iterate through each item object and set its properties for i = 1, 30, 1 do -- Hide the menu objects. These are not required for a loot table - _G["AtlasLootMenuItem_"..i]:Hide(); + _G["AtlasLootMenuItem_"..i]:Hide() -- Check for a valid object (that it exists, and that it has a name) if dataSource[dataID][i] and dataSource[dataID][i][3] ~= "" then -- Use shortcuts for easier reference to parts of the item button - itemButton = _G["AtlasLootItem_"..i]; - iconFrame = _G["AtlasLootItem_"..i.."_Icon"]; - nameFrame = _G["AtlasLootItem_"..i.."_Name"]; - extraFrame = _G["AtlasLootItem_"..i.."_Extra"]; - local quantity = _G["AtlasLootItem_"..i.."_Quantity"] + itemButton = _G["AtlasLootItem_"..i] + iconFrame = _G["AtlasLootItem_"..i.."_Icon"] + nameFrame = _G["AtlasLootItem_"..i.."_Name"] + extraFrame = _G["AtlasLootItem_"..i.."_Extra"] + local quantity = _G["AtlasLootItem_"..i.."_Quantity"] local iconBorder = _G["AtlasLootItem_"..i.."_IconBorder"] iconBorder:SetVertexColor(1, 1, 1) if string.sub(dataSource[dataID][i][1], 1, 1) == "s" then - isItem = false; - isEnchant = false; - isSpell = true; + isItem = false + isEnchant = false + isSpell = true elseif string.sub(dataSource[dataID][i][1], 1, 1) == "e" then - isItem = false; - isEnchant = true; - isSpell = false; + isItem = false + isEnchant = true + isSpell = false else - isItem = true; - isEnchant = false; - isSpell = false; + isItem = true + isEnchant = false + isSpell = false end if isItem then local itemID = tonumber(dataSource[dataID][i][1]) - local itemName, _, itemQuality = GetItemInfo(itemID); + local itemName, _, itemQuality = GetItemInfo(itemID) -- If the client has the name of the item in cache, use that instead. -- This is poor man's localisation, English is replaced be whatever is needed if itemName then - local r, g, b, itemColor = GetItemQualityColor(itemQuality); - text = itemColor..itemName; + local r, g, b, itemColor = GetItemQualityColor(itemQuality) + text = itemColor..itemName iconBorder:SetVertexColor(r, g, b) else if itemID and itemID ~= 0 then @@ -1713,10 +1725,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) AtlasLootItemsFrame.queue[itemID] = true iconBorder:SetVertexColor(1, 0, 0) end - text = AtlasLoot_FixText(dataSource[dataID][i][3]); + text = AtlasLoot_FixText(dataSource[dataID][i][3]) end quantity:SetText("") - itemButton.dressingroomID = dataSource[dataID][i][1]; + itemButton.dressingroomID = dataSource[dataID][i][1] elseif isEnchant then local spellID = tonumber(string.sub(dataSource[dataID][i][1], 2)) local craftItem = tonumber(GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]) @@ -1741,17 +1753,17 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) AtlasLootItemsFrame.refreshTime = refreshTimeout AtlasLootItemsFrame.queue[craftItem] = true end - text = AtlasLoot_FixText(spellName); + text = AtlasLoot_FixText(spellName) end if quality then r, g, b, color = GetItemQualityColor(quality) text = color..(text or "") iconBorder:SetVertexColor(r, g, b) end - itemButton.dressingroomID = craftItem; + itemButton.dressingroomID = craftItem else text = spellName - itemButton.dressingroomID = nil; + itemButton.dressingroomID = nil end quantity:SetText("") elseif isSpell then @@ -1762,7 +1774,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) for j = 1, table.getn(reagents) do local reagent = GetSpellInfoAtlasLootDB["craftspells"][spellID]["reagents"][j] if not GetItemInfo(reagent[1]) then - AtlasLootCacheTooltip:SetHyperlink("item:"..reagent[1]); + AtlasLootCacheTooltip:SetHyperlink("item:"..reagent[1]) end end end @@ -1778,7 +1790,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) if not text then if craftItem ~= 0 then AtlasLootCacheTooltip:SetHyperlink("item:"..craftItem) - text = AtlasLoot_FixText(spellName); + text = AtlasLoot_FixText(spellName) AtlasLootItemsFrame.refreshTime = refreshTimeout AtlasLootItemsFrame.queue[craftItem] = true end @@ -1788,16 +1800,16 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) text = color..(text or "") iconBorder:SetVertexColor(r, g, b) end - itemButton.dressingroomID = craftItem; + itemButton.dressingroomID = craftItem else text = spellName itemButton.dressingroomID = nil end - local qtyMin = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMin"]; - local qtyMax = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMax"]; + local qtyMin = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMin"] + local qtyMax = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMax"] if qtyMin then if qtyMax then - quantity:SetText(qtyMin.. "-"..qtyMax) + quantity:SetText(qtyMin.."-"..qtyMax) else quantity:SetText(qtyMin) end @@ -1806,7 +1818,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) end end -- Insert the item description - extra = AtlasLoot_FixText(dataSource[dataID][i][4]); + extra = AtlasLoot_FixText(dataSource[dataID][i][4]) local iconData = dataSource[dataID][i][2] -- If there is no data on the texture an item should have, show a big red question mark if strsub(iconData, 1, 5) == "CLASS" then @@ -1816,30 +1828,30 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) if not texture and type(iconData) == "string" then texture = "Interface\\Icons\\"..iconData end - iconFrame:SetTexture(texture); + iconFrame:SetTexture(texture) elseif not isItem and spellIcon then if type(iconData) == "number" then local _, _, _, _, _, _, _, _, texture = GetItemInfo(iconData) - iconFrame:SetTexture(texture); + iconFrame:SetTexture(texture) elseif type(iconData) == "string" then - iconFrame:SetTexture("Interface\\Icons\\"..iconData); + iconFrame:SetTexture("Interface\\Icons\\"..iconData) else - iconFrame:SetTexture(spellIcon); + iconFrame:SetTexture(spellIcon) end else - iconFrame:SetTexture("Interface\\Icons\\"..iconData); + iconFrame:SetTexture("Interface\\Icons\\"..iconData) end if iconFrame:GetTexture() == nil then - iconFrame:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark"); + iconFrame:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark") end -- Set the name and description of the item - nameFrame:SetText(text); - extraFrame:SetText(extra); - extraFrame:Show(); + nameFrame:SetText(text) + extraFrame:SetText(extra) + extraFrame:Show() -- Set prices for items, up to 5 different currencies can be used in combination for j = 1, 5 do - _G["AtlasLootItem_"..i.."_PriceText"..j]:Hide(); - _G["AtlasLootItem_"..i.."_PriceIcon"..j]:Hide(); + _G["AtlasLootItem_"..i.."_PriceText"..j]:Hide() + _G["AtlasLootItem_"..i.."_PriceIcon"..j]:Hide() end local index = 1 for j = 6, 14, 2 do @@ -1871,7 +1883,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) end index = index + 1 end - break; + break end end end @@ -1883,7 +1895,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) if dataSource[dataID][i][1] == v[1] then local boss = AtlasLoot_GetWishListSubheadingBoss(wishDataID) if boss then - extraFrame:SetText(extra .. " - "..boss) + extraFrame:SetText(extra.." - "..boss) end end end @@ -1891,9 +1903,9 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) end end -- For convenience, we store information about the objects in the objects so that it can be easily accessed later - itemButton.itemID = dataSource[dataID][i][1]; - itemButton.itemIDName = dataSource[dataID][i][3]; - itemButton.itemIDExtra = dataSource[dataID][i][4]; + itemButton.itemID = dataSource[dataID][i][1] + itemButton.itemIDName = dataSource[dataID][i][3] + itemButton.itemIDExtra = dataSource[dataID][i][4] itemButton.container = dataSource[dataID][i][16] if type(itemButton.container) == "table" then iconBorder:SetVertexColor(1, 0.82, 0) @@ -1903,61 +1915,61 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) end end end - itemButton.droprate = nil; + itemButton.droprate = nil if dataID == "SearchResult" or dataID == "WishList" then - itemButton.sourcePage = dataSource[dataID][i][5]; + itemButton.sourcePage = dataSource[dataID][i][5] else - local droprate = dataSource[dataID][i][5]; + local droprate = dataSource[dataID][i][5] if droprate and string.find(droprate, "%%") then itemButton.droprate = droprate end end - itemButton:Show(); + itemButton:Show() if GetMouseFocus() == itemButton then itemButton:Hide() itemButton:Show() end else - _G["AtlasLootItem_"..i]:Hide(); + _G["AtlasLootItem_"..i]:Hide() end end -- Hide navigation buttons by default, only show what we need - AtlasLootItemsFrame_BACK:Hide(); - AtlasLootItemsFrame_NEXT:Hide(); - AtlasLootItemsFrame_PREV:Hide(); - AtlasLoot_BossName:SetText(boss); + AtlasLootItemsFrame_BACK:Hide() + AtlasLootItemsFrame_NEXT:Hide() + AtlasLootItemsFrame_PREV:Hide() + AtlasLoot_BossName:SetText(boss) -- Consult the button registry to determine what nav buttons are required if dataID == "SearchResult" or dataID == "WishList" then if wlPage < wlPageMax then - AtlasLootItemsFrame_NEXT:Show(); - AtlasLootItemsFrame_NEXT.lootpage = dataID.."Page"..(wlPage + 1); + AtlasLootItemsFrame_NEXT:Show() + AtlasLootItemsFrame_NEXT.lootpage = dataID.."Page"..(wlPage + 1) end if wlPage > 1 then - AtlasLootItemsFrame_PREV:Show(); - AtlasLootItemsFrame_PREV.lootpage = dataID.."Page"..(wlPage - 1); + AtlasLootItemsFrame_PREV:Show() + AtlasLootItemsFrame_PREV.lootpage = dataID.."Page"..(wlPage - 1) end elseif AtlasLoot_ButtonRegistry[dataID] then - local tablebase = AtlasLoot_ButtonRegistry[dataID]; - AtlasLoot_BossName:SetText(tablebase.Title); + local tablebase = AtlasLoot_ButtonRegistry[dataID] + AtlasLoot_BossName:SetText(tablebase.Title) if tablebase.Next_Page then - AtlasLootItemsFrame_NEXT:Show(); - AtlasLootItemsFrame_NEXT.lootpage = tablebase.Next_Page; + AtlasLootItemsFrame_NEXT:Show() + AtlasLootItemsFrame_NEXT.lootpage = tablebase.Next_Page if AtlasLoot_ButtonRegistry[tablebase.Next_Page] then - AtlasLootItemsFrame_NEXT.title = AtlasLoot_ButtonRegistry[tablebase.Next_Page].Title; + AtlasLootItemsFrame_NEXT.title = AtlasLoot_ButtonRegistry[tablebase.Next_Page].Title end end if tablebase.Prev_Page then - AtlasLootItemsFrame_PREV:Show(); - AtlasLootItemsFrame_PREV.lootpage = tablebase.Prev_Page; + AtlasLootItemsFrame_PREV:Show() + AtlasLootItemsFrame_PREV.lootpage = tablebase.Prev_Page if AtlasLoot_ButtonRegistry[tablebase.Prev_Page] then - AtlasLootItemsFrame_PREV.title = AtlasLoot_ButtonRegistry[tablebase.Prev_Page].Title; + AtlasLootItemsFrame_PREV.title = AtlasLoot_ButtonRegistry[tablebase.Prev_Page].Title end end if tablebase.Back_Page then - AtlasLootItemsFrame_BACK:Show(); - AtlasLootItemsFrame_BACK.lootpage = tablebase.Back_Page; + AtlasLootItemsFrame_BACK:Show() + AtlasLootItemsFrame_BACK.lootpage = tablebase.Back_Page if AtlasLoot_ButtonRegistry[tablebase.Back_Page] then - AtlasLootItemsFrame_BACK.title = AtlasLoot_ButtonRegistry[tablebase.Back_Page].Title; + AtlasLootItemsFrame_BACK.title = AtlasLoot_ButtonRegistry[tablebase.Back_Page].Title end if AtlasFrame and AtlasFrame:IsVisible() then local sourceKey @@ -1975,9 +1987,9 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) -- Hide navigation buttons if we click Quicklooks in Atlas for i = 1, 4 do if AtlasLootCharDB["QuickLooks"][i] and dataID == AtlasLootCharDB["QuickLooks"][i][1] then - AtlasLootItemsFrame_BACK:Hide(); - AtlasLootItemsFrame_NEXT:Hide(); - AtlasLootItemsFrame_PREV:Hide(); + AtlasLootItemsFrame_BACK:Hide() + AtlasLootItemsFrame_NEXT:Hide() + AtlasLootItemsFrame_PREV:Hide() end end end @@ -1985,10 +1997,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) end end -- For Alphamap and Atlas integration, show a 'close' button to hide the loot table and restore the map view - AtlasLootItemsFrame_CloseButton:Hide(); + AtlasLootItemsFrame_CloseButton:Hide() if AtlasFrame and AtlasFrame:IsShown() or AlphaMapAlphaMapFrame and AlphaMapAlphaMapFrame:IsShown() then - AtlasLootItemsFrame_CloseButton:Show(); - end + AtlasLootItemsFrame_CloseButton:Show() + end local subMenu = nil local bossName = "" for k in pairs(AtlasLoot_HewdropDown_SubTables) do @@ -2013,10 +2025,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) AtlasLootDefaultFrame_SelectedTable:Hide() end -- Anchor the item frame where it is supposed to be - AtlasLootItemsFrame:SetParent(_G[AtlasLoot_AnchorPoint[2]]); - AtlasLootItemsFrame:ClearAllPoints(); - AtlasLootItemsFrame:SetPoint(AtlasLoot_AnchorPoint[1], AtlasLoot_AnchorPoint[2], AtlasLoot_AnchorPoint[3], AtlasLoot_AnchorPoint[4], AtlasLoot_AnchorPoint[5]); - AtlasLootItemsFrame:Show(); + AtlasLootItemsFrame:SetParent(_G[AtlasLoot_AnchorPoint[2]]) + AtlasLootItemsFrame:ClearAllPoints() + AtlasLootItemsFrame:SetPoint(AtlasLoot_AnchorPoint[1], AtlasLoot_AnchorPoint[2], AtlasLoot_AnchorPoint[3], AtlasLoot_AnchorPoint[4], AtlasLoot_AnchorPoint[5]) + AtlasLootItemsFrame:Show() end --[[ @@ -2034,34 +2046,34 @@ function AtlasLoot_HewdropClick(tablename, text, tabletype) -- If the button clicked was linked to a loot table if tabletype == "Table" then -- Show the loot table - AtlasLoot_ShowBossLoot(tablename, text); + AtlasLoot_ShowBossLoot(tablename, text) -- Save needed info for fuure re-display of the table - AtlasLootCharDB.LastBoss = tablename; - AtlasLootCharDB.LastBossText = text; + AtlasLootCharDB.LastBoss = tablename + AtlasLootCharDB.LastBossText = text -- Purge the text label for the submenu and disable the submenu - AtlasLootDefaultFrame_SubMenu:Disable(); - AtlasLootDefaultFrame_SelectedTable:SetText(""); - AtlasLootDefaultFrame_SelectedTable:Show(); - -- If the button links to a sub menu definition + AtlasLootDefaultFrame_SubMenu:Disable() + AtlasLootDefaultFrame_SelectedTable:SetText("") + AtlasLootDefaultFrame_SelectedTable:Show() + -- If the button links to a sub menu definition else -- Enable the submenu button - AtlasLootDefaultFrame_SubMenu:Enable(); + AtlasLootDefaultFrame_SubMenu:Enable() -- Show the first loot table associated with the submenu - AtlasLoot_ShowBossLoot(AtlasLoot_HewdropDown_SubTables[tablename][1][2], AtlasLoot_HewdropDown_SubTables[tablename][1][1]); + AtlasLoot_ShowBossLoot(AtlasLoot_HewdropDown_SubTables[tablename][1][2], AtlasLoot_HewdropDown_SubTables[tablename][1][1]) -- Save needed info for fuure re-display of the table - AtlasLootCharDB.LastBoss = AtlasLoot_HewdropDown_SubTables[tablename][1][2]; - AtlasLootCharDB.LastBossText = AtlasLoot_HewdropDown_SubTables[tablename][1][1]; + AtlasLootCharDB.LastBoss = AtlasLoot_HewdropDown_SubTables[tablename][1][2] + AtlasLootCharDB.LastBossText = AtlasLoot_HewdropDown_SubTables[tablename][1][1] -- Load the correct submenu and associated with the button - AtlasLoot_HewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu); - AtlasLoot_HewdropSubMenuRegister(AtlasLoot_HewdropDown_SubTables[tablename]); + AtlasLoot_HewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu) + AtlasLoot_HewdropSubMenuRegister(AtlasLoot_HewdropDown_SubTables[tablename]) -- Show a text label of what has been selected - AtlasLootDefaultFrame_SelectedTable:SetText(AtlasLoot_HewdropDown_SubTables[tablename][1][1]); - AtlasLootDefaultFrame_SelectedTable:Show(); + AtlasLootDefaultFrame_SelectedTable:SetText(AtlasLoot_HewdropDown_SubTables[tablename][1][1]) + AtlasLootDefaultFrame_SelectedTable:Show() end -- Show the category that has been selected - AtlasLootDefaultFrame_SelectedCategory:SetText(text); - AtlasLootDefaultFrame_SelectedCategory:Show(); - AtlasLoot_Hewdrop:Close(1); + AtlasLootDefaultFrame_SelectedCategory:SetText(text) + AtlasLootDefaultFrame_SelectedCategory:Show() + AtlasLoot_Hewdrop:Close(1) end --[[ @@ -2074,14 +2086,14 @@ function AtlasLoot_HewdropSubMenuClick(tablename, text) -- Definition of where I want the loot table to be shown AtlasLoot_AnchorPoint = Anchor_Default -- Show the select loot table - AtlasLoot_ShowBossLoot(tablename, text); + AtlasLoot_ShowBossLoot(tablename, text) -- Save needed info for fuure re-display of the table - AtlasLootCharDB.LastBoss = tablename; - AtlasLootCharDB.LastBossText = text; + AtlasLootCharDB.LastBoss = tablename + AtlasLootCharDB.LastBossText = text -- Show the table that has been selected - AtlasLootDefaultFrame_SelectedTable:SetText(text); - AtlasLootDefaultFrame_SelectedTable:Show(); - AtlasLoot_HewdropSubMenu:Close(1); + AtlasLootDefaultFrame_SelectedTable:SetText(text) + AtlasLootDefaultFrame_SelectedTable:Show() + AtlasLoot_HewdropSubMenu:Close(1) end --[[ @@ -2096,7 +2108,7 @@ function AtlasLoot_HewdropSubMenuRegister(loottable) end, 'children', function(level, value) if level == 1 then - for k,v in pairs(loottable) do + for k, v in pairs(loottable) do AtlasLoot_HewdropSubMenu:AddLine( 'text', v[1], 'func', AtlasLoot_HewdropSubMenuClick, @@ -2123,7 +2135,7 @@ function AtlasLoot_HewdropRegister() 'children', function(level, value) if level == 1 then if AtlasLoot_HewdropDown then - for k,v in ipairs(AtlasLoot_HewdropDown) do + for k, v in ipairs(AtlasLoot_HewdropDown) do -- If a link to show a submenu if type(v[1]) == "table" and type(v[1][1]) == "string" then if v[1][3] == "Submenu" then @@ -2140,9 +2152,9 @@ function AtlasLoot_HewdropRegister() ) end else - local lock = 0; + local lock = 0 -- If an entry linked to a subtable - for i,j in pairs(v) do + for i, j in pairs(v) do if lock == 0 then AtlasLoot_Hewdrop:AddLine( 'text', i, @@ -2155,7 +2167,7 @@ function AtlasLoot_HewdropRegister() 'arg1', i, 'notCheckable', true ) - lock = 1; + lock = 1 end end end @@ -2163,23 +2175,23 @@ function AtlasLoot_HewdropRegister() end elseif level == 2 then if value then - for k,v in ipairs(value) do + for k, v in ipairs(value) do if type(v) == "table" then if type(v[1]) == "table" and type(v[1][1]) == "string" then -- If an entry to show a submenu if v[1][3] == "Submenu" then - AtlasLoot_Hewdrop:AddLine( - 'text', v[1][1], - 'textR', 1, - 'textG', 0.82, - 'textB', 0, - 'func', AtlasLoot_HewdropClick, - 'arg1', v[1][2], - 'arg2', v[1][1], - 'arg3', v[1][3], - 'notCheckable', true - ) - -- An entry to show a specific loot page + AtlasLoot_Hewdrop:AddLine( + 'text', v[1][1], + 'textR', 1, + 'textG', 0.82, + 'textB', 0, + 'func', AtlasLoot_HewdropClick, + 'arg1', v[1][2], + 'arg2', v[1][1], + 'arg3', v[1][3], + 'notCheckable', true + ) + -- An entry to show a specific loot page else AtlasLoot_Hewdrop:AddLine( 'text', v[1][1], @@ -2194,9 +2206,9 @@ function AtlasLoot_HewdropRegister() ) end else - local lock = 0; + local lock = 0 -- Entry to link to a sub table - for i,j in pairs(v) do + for i, j in pairs(v) do if lock == 0 then AtlasLoot_Hewdrop:AddLine( 'text', i, @@ -2207,7 +2219,7 @@ function AtlasLoot_HewdropRegister() 'value', j, 'notCheckable', true ) - lock = 1; + lock = 1 end end end @@ -2217,7 +2229,7 @@ function AtlasLoot_HewdropRegister() elseif level == 3 then -- Essentially the same as level == 2 if value then - for k,v in pairs(value) do + for k, v in pairs(value) do if type(v[1]) == "string" then if v[3] == "Submenu" then AtlasLoot_Hewdrop:AddLine( @@ -2264,14 +2276,14 @@ function AtlasLoot_HewdropRegister() end function AtlasLoot_OpenMenu(menuName) - AtlasLoot_QuickLooks:Hide(); - AtlasLootQuickLooksButton:Hide(); + AtlasLoot_QuickLooks:Hide() + AtlasLootQuickLooksButton:Hide() AtlasLootDefaultFrame_SelectedCategory:SetText(menuName) - AtlasLootDefaultFrame_SubMenu:Disable(); - AtlasLootDefaultFrame_SelectedTable:SetText(""); - AtlasLootDefaultFrame_SelectedTable:Show(); - AtlasLootCharDB.LastBoss = this.lootpage; - AtlasLootCharDB.LastBossText = menuName; + AtlasLootDefaultFrame_SubMenu:Disable() + AtlasLootDefaultFrame_SelectedTable:SetText("") + AtlasLootDefaultFrame_SelectedTable:Show() + AtlasLootCharDB.LastBoss = this.lootpage + AtlasLootCharDB.LastBossText = menuName if menuName == AL["Crafting"] then AtlasLoot_ShowItemsFrame("CRAFTINGMENU", "dummy", "dummy") elseif menuName == AL["PvP Rewards"] then @@ -2296,18 +2308,18 @@ Called when the close button on the item frame is clicked ]] function AtlasLootItemsFrame_OnCloseButton() -- Set no loot table as currently selected - AtlasLootItemsFrame.activeBoss = nil; + AtlasLootItemsFrame.activeBoss = nil -- Fix the boss buttons so the correct icons are displayed if AtlasFrame and AtlasFrame:IsVisible() then for i = 1, ATLAS_NUM_LINES do if _G["AtlasEntry"..i.."_Selected"] and _G["AtlasEntry"..i.."_Selected"]:IsShown() then - _G["AtlasEntry"..i.."_Selected"]:Hide(); - _G["AtlasEntry"..i.."_Loot"]:Show(); + _G["AtlasEntry"..i.."_Selected"]:Hide() + _G["AtlasEntry"..i.."_Loot"]:Show() end end end -- Hide the item frame - AtlasLootItemsFrame:Hide(); + AtlasLootItemsFrame:Hide() end --[[ @@ -2321,19 +2333,19 @@ function AtlasLootMenuItem_OnClick() end if this.isheader == nil or this.isheader == false then local pagename = _G[this:GetName().."_Name"]:GetText() - for k,v in ipairs(AtlasLoot_HewdropDown) do + for k, v in ipairs(AtlasLoot_HewdropDown) do if not (type(v[1]) == "table") then for k2, v2 in pairs(v) do for k3, v3 in pairs(v2) do for k4, v4 in pairs(v3) do if not (type(v4[1]) == "table") then if v4[1] == pagename and v4[3] ~= "Table" then - AtlasLoot_HewdropClick(v4[2],v4[1],v4[3]) + AtlasLoot_HewdropClick(v4[2], v4[1], v4[3]) end else - for k5,v5 in pairs(v4) do + for k5, v5 in pairs(v4) do if v5[1] == pagename then - AtlasLoot_HewdropClick(v5[2],v5[1],v5[3]) + AtlasLoot_HewdropClick(v5[2], v5[1], v5[3]) end end end @@ -2343,11 +2355,11 @@ function AtlasLootMenuItem_OnClick() end end CloseDropDownMenus() - AtlasLootCharDB.LastBoss = this.lootpage; - AtlasLootCharDB.LastBossText = pagename; - AtlasLoot_ShowBossLoot(this.lootpage, pagename); - AtlasLootDefaultFrame_SelectedCategory:SetText(pagename); - AtlasLootDefaultFrame_SelectedCategory:Show(); + AtlasLootCharDB.LastBoss = this.lootpage + AtlasLootCharDB.LastBossText = pagename + AtlasLoot_ShowBossLoot(this.lootpage, pagename) + AtlasLootDefaultFrame_SelectedCategory:SetText(pagename) + AtlasLootDefaultFrame_SelectedCategory:Show() end end @@ -2356,26 +2368,26 @@ AtlasLoot_NavButton_OnClick: Called when <-, -> or 'Back' are pressed and calls up the appropriate loot page ]] function AtlasLoot_NavButton_OnClick() - if ( AtlasLootItemsFrame.refresh and AtlasLootItemsFrame.refresh[1] and AtlasLootItemsFrame.refresh[2]) then + if (AtlasLootItemsFrame.refresh and AtlasLootItemsFrame.refresh[1] and AtlasLootItemsFrame.refresh[2]) then if AtlasLootItemsFrame.refresh[1] == "DUNGEONSMENU1" then AtlasLootItemsFrame.refresh[1] = "DUNGEONSMENU2" AtlasLoot_DungeonsMenu2() - AtlasLootDefaultFrame_SubMenu:Disable(); + AtlasLootDefaultFrame_SubMenu:Disable() return elseif AtlasLootItemsFrame.refresh[1] == "DUNGEONSMENU2" then AtlasLootItemsFrame.refresh[1] = "DUNGEONSMENU1" AtlasLoot_DungeonsMenu1() - AtlasLootDefaultFrame_SubMenu:Disable(); + AtlasLootDefaultFrame_SubMenu:Disable() return end if string.sub(this.lootpage, 1, 16) == "SearchResultPage" then - AtlasLoot_ShowItemsFrame("SearchResult", this.lootpage, string.format((AL["Search Result: %s"]), AtlasLootCharDB.LastSearchedText or "")); + AtlasLoot_ShowItemsFrame("SearchResult", this.lootpage, string.format((AL["Search Result: %s"]), AtlasLootCharDB.LastSearchedText or "")) elseif string.sub(this.lootpage, 1, 12) == "WishListPage" then - AtlasLoot_ShowItemsFrame("WishList", this.lootpage, AL["WishList"]); + AtlasLoot_ShowItemsFrame("WishList", this.lootpage, AL["WishList"]) else - AtlasLootCharDB.LastBoss = this.lootpage; - AtlasLootCharDB.LastBossText = this.title; - AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItemsFrame.refresh[2], this.title); + AtlasLootCharDB.LastBoss = this.lootpage + AtlasLootCharDB.LastBossText = this.title + AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItemsFrame.refresh[2], this.title) if AtlasLootDefaultFrame_SelectedTable:GetText() then AtlasLootDefaultFrame_SelectedTable:SetText(AtlasLoot_BossName:GetText()) else @@ -2383,14 +2395,14 @@ function AtlasLoot_NavButton_OnClick() end end elseif AtlasLootItemsFrame.refresh and AtlasLootItemsFrame.refresh[2] then - AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItemsFrame.refresh[2], this.title); + AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItemsFrame.refresh[2], this.title) else -- Fallback for if the requested loot page is a menu and does not have a .refresh instance - AtlasLoot_ShowItemsFrame(this.lootpage, "dummy", this.title); + AtlasLoot_ShowItemsFrame(this.lootpage, "dummy", this.title) end for k in pairs(AtlasLoot_MenuList) do if this.lootpage == k then - AtlasLootDefaultFrame_SubMenu:Disable(); + AtlasLootDefaultFrame_SubMenu:Disable() AtlasLootDefaultFrame_SelectedCategory:SetText(AtlasLootCharDB.LastBossText) AtlasLootDefaultFrame_SelectedTable:SetText("") end @@ -2405,27 +2417,27 @@ dataID: Loot table dataID function AtlasLoot_IsLootTableAvailable(dataID) if not dataID then return false end - local menu_check = false; + local menu_check = false for k in pairs(AtlasLoot_MenuList) do if k == dataID then - menu_check = true; + menu_check = true end end if menu_check then - return true; + return true else if not AtlasLoot_TableNames[dataID] then - DEFAULT_CHAT_FRAME:AddMessage(RED..AL["AtlasLoot Error!"].." "..WHITE..dataID..AL[" not listed in loot table registry, please report this message to the AtlasLoot forums at http://www.atlasloot.net"]); - return false; + DEFAULT_CHAT_FRAME:AddMessage(RED..AL["AtlasLoot Error!"].." "..WHITE..dataID..AL[" not listed in loot table registry, please report this message to the AtlasLoot forums at http://www.atlasloot.net"]) + return false end - local dataSource = AtlasLoot_TableNames[dataID][2]; + local dataSource = AtlasLoot_TableNames[dataID][2] if AtlasLoot_Data[dataSource] then if AtlasLoot_Data[dataSource][dataID] then - return true; + return true end end end @@ -2437,9 +2449,9 @@ button: Identity of the button pressed to trigger the function Shows the GUI for setting Quicklooks ]] function AtlasLoot_ShowQuickLooks(button) - local Hewdrop = AceLibrary("Hewdrop-2.0"); + local Hewdrop = AceLibrary("Hewdrop-2.0") if Hewdrop:IsOpen(button) then - Hewdrop:Close(1); + Hewdrop:Close(1) else local setOptions = function() Hewdrop:AddLine( @@ -2447,48 +2459,48 @@ function AtlasLoot_ShowQuickLooks(button) "tooltipTitle", AL["QuickLook"].." 1", "tooltipText", AL["Assign this loot table\n to QuickLook"].." 1", "func", function() - AtlasLootCharDB["QuickLooks"][1] = {AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]}; - AtlasLoot_RefreshQuickLookButtons(); - Hewdrop:Close(1); + AtlasLootCharDB["QuickLooks"][1] = { AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3] } + AtlasLoot_RefreshQuickLookButtons() + Hewdrop:Close(1) end - ); + ) Hewdrop:AddLine( "text", AL["QuickLook"].." 2", "tooltipTitle", AL["QuickLook"].." 2", "tooltipText", AL["Assign this loot table\n to QuickLook"].." 2", "func", function() - AtlasLootCharDB["QuickLooks"][2] = {AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]}; - AtlasLoot_RefreshQuickLookButtons(); - Hewdrop:Close(1); + AtlasLootCharDB["QuickLooks"][2] = { AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3] } + AtlasLoot_RefreshQuickLookButtons() + Hewdrop:Close(1) end - ); + ) Hewdrop:AddLine( "text", AL["QuickLook"].." 3", "tooltipTitle", AL["QuickLook"].." 3", "tooltipText", AL["Assign this loot table\n to QuickLook"].." 3", "func", function() - AtlasLootCharDB["QuickLooks"][3] = {AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]}; - AtlasLoot_RefreshQuickLookButtons(); - Hewdrop:Close(1); + AtlasLootCharDB["QuickLooks"][3] = { AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3] } + AtlasLoot_RefreshQuickLookButtons() + Hewdrop:Close(1) end - ); + ) Hewdrop:AddLine( "text", AL["QuickLook"].." 4", "tooltipTitle", AL["QuickLook"].." 4", "tooltipText", AL["Assign this loot table\n to QuickLook"].." 4", "func", function() - AtlasLootCharDB["QuickLooks"][4] = {AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]}; - AtlasLoot_RefreshQuickLookButtons(); - Hewdrop:Close(1); + AtlasLootCharDB["QuickLooks"][4] = { AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3] } + AtlasLoot_RefreshQuickLookButtons() + Hewdrop:Close(1) end - ); - end; + ) + end Hewdrop:Open(button, 'point', function(parent) - return "BOTTOMLEFT", "BOTTOMRIGHT"; + return "BOTTOMLEFT", "BOTTOMRIGHT" end, "children", setOptions - ); + ) end end @@ -2499,11 +2511,11 @@ Enables/disables the quicklook buttons depending on what is assigned function AtlasLoot_RefreshQuickLookButtons() for i = 1, 4 do if not AtlasLootCharDB["QuickLooks"][i] or not AtlasLootCharDB["QuickLooks"][i][1] then - _G["AtlasLootPanel_Preset"..i]:Disable(); - _G["AtlasLootDefaultFrame_Preset"..i]:Disable(); + _G["AtlasLootPanel_Preset"..i]:Disable() + _G["AtlasLootDefaultFrame_Preset"..i]:Disable() else - _G["AtlasLootPanel_Preset"..i]:Enable(); - _G["AtlasLootDefaultFrame_Preset"..i]:Enable(); + _G["AtlasLootPanel_Preset"..i]:Enable() + _G["AtlasLootDefaultFrame_Preset"..i]:Enable() end end end @@ -2516,7 +2528,7 @@ function AtlasLoot_ClearQuickLookButton(button) if not button then return end AtlasLootCharDB["QuickLooks"][button] = nil AtlasLoot_RefreshQuickLookButtons() - DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..WHITE..AL["QuickLook"].." "..button.." "..AL["has been reset!"]); + DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..WHITE..AL["QuickLook"].." "..button.." "..AL["has been reset!"]) end --[[ @@ -2528,28 +2540,28 @@ This is the intended API for external mods to use for displaying loot pages. This function figures out where the loot table is stored, then sends the relevant info to AtlasLoot_ShowItemsFrame ]] function AtlasLoot_ShowBossLoot(dataID, boss) - -- local tableavailable = AtlasLoot_IsLootTableAvailable(dataID); + -- local tableavailable = AtlasLoot_IsLootTableAvailable(dataID) -- if tableavailable then - AtlasLootItemsFrame:Hide(); - -- If the loot table is already being displayed, it is hidden and the current table selection cancelled - if dataID == AtlasLootItemsFrame.externalBoss and AtlasLootItemsFrame:GetParent() ~= AtlasFrame and AtlasLootItemsFrame:GetParent() ~= AtlasLootDefaultFrame then - AtlasLootItemsFrame.externalBoss = nil; - else - -- Use the original WoW instance data by default - local dataSource = AtlasLoot_TableNames[dataID][2]; - -- Set selected table and call AtlasLoot_ShowItemsFrame - AtlasLootItemsFrame.externalBoss = dataID; - AtlasLoot_ShowItemsFrame(dataID, dataSource, boss); - end + AtlasLootItemsFrame:Hide() + -- If the loot table is already being displayed, it is hidden and the current table selection cancelled + if dataID == AtlasLootItemsFrame.externalBoss and AtlasLootItemsFrame:GetParent() ~= AtlasFrame and AtlasLootItemsFrame:GetParent() ~= AtlasLootDefaultFrame then + AtlasLootItemsFrame.externalBoss = nil + else + -- Use the original WoW instance data by default + local dataSource = AtlasLoot_TableNames[dataID][2] + -- Set selected table and call AtlasLoot_ShowItemsFrame + AtlasLootItemsFrame.externalBoss = dataID + AtlasLoot_ShowItemsFrame(dataID, dataSource, boss) + end -- end end function AtlasLootOptions_SetupSlider(text, mymin, mymax, step) - _G[this:GetName().."Text"]:SetText(text.." ("..this:GetValue()..")"); - this:SetMinMaxValues(mymin, mymax); - _G[this:GetName().."Low"]:SetText(mymin); - _G[this:GetName().."High"]:SetText(mymax); - this:SetValueStep(step); + _G[this:GetName().."Text"]:SetText(text.." ("..this:GetValue()..")") + this:SetMinMaxValues(mymin, mymax) + _G[this:GetName().."Low"]:SetText(mymin) + _G[this:GetName().."High"]:SetText(mymax) + this:SetValueStep(step) end --[[ @@ -2558,7 +2570,7 @@ Function to show/hide AtlasLoot when click on minimap button. ]] function AtlasLootMinimapButton_OnClick(arg1) if arg1 == "LeftButton" then - AtlasLoot_Toggle(); + AtlasLoot_Toggle() end end @@ -2568,9 +2580,9 @@ Show/hide minimap button. ]] function AtlasLootMinimapButton_Init() if AtlasLootCharDB.MinimapButton == true then - AtlasLootMinimapButtonFrame:Show(); + AtlasLootMinimapButtonFrame:Show() else - AtlasLootMinimapButtonFrame:Hide(); + AtlasLootMinimapButtonFrame:Hide() end end @@ -2579,11 +2591,11 @@ AtlasLootMinimapButton_OnEnter: Show tooltip when mouse is over minimap button. ]] function AtlasLootMinimapButton_OnEnter() - GameTooltip:SetOwner(this, "ANCHOR_LEFT"); - GameTooltip:SetText(AL["AtlasLoot Enhanced"]); - GameTooltipTextLeft1:SetTextColor(1, 1, 1); - GameTooltip:AddLine(AL["Left-click to open AtlasLoot.\nMiddle-click for AtlasLoot options.\nRight-click and drag to move this button."]); - GameTooltip:Show(); + GameTooltip:SetOwner(this, "ANCHOR_LEFT") + GameTooltip:SetText(AL["AtlasLoot Enhanced"]) + GameTooltipTextLeft1:SetTextColor(1, 1, 1) + GameTooltip:AddLine(AL["Left-click to open AtlasLoot.\nMiddle-click for AtlasLoot options.\nRight-click and drag to move this button."]) + GameTooltip:Show() end --[[ @@ -2597,52 +2609,52 @@ function AtlasLootMinimapButton_UpdatePosition() "TOPLEFT", 54 - (AtlasLootCharDB.MinimapButtonRadius * cos(AtlasLootCharDB.MinimapButtonPosition)), (AtlasLootCharDB.MinimapButtonRadius * sin(AtlasLootCharDB.MinimapButtonPosition)) - 55 - ); + ) AtlasLootOptions_Init() end local function around(num, idp) - local mult = 10 ^ (idp or 0); - return math.floor(num * mult + 0.5) / mult; + local mult = 10 ^ (idp or 0) + return math.floor(num * mult + 0.5) / mult end function AtlasLootOptions_UpdateSlider(text) - _G[this:GetName().."Text"]:SetText(text.." ("..around(this:GetValue(),2)..")"); + _G[this:GetName().."Text"]:SetText(text.." ("..around(this:GetValue(), 2)..")") end function AtlasLootOptions_ResetPosition() - AtlasLootCharDB.MinimapButtonPosition = 315; - AtlasLootCharDB.MinimapButtonRadius = 78; - AtlasLootMinimapButton_UpdatePosition(); - DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..RED..AL["Minimap button has been reset!"]); + AtlasLootCharDB.MinimapButtonPosition = 315 + AtlasLootCharDB.MinimapButtonRadius = 78 + AtlasLootMinimapButton_UpdatePosition() + DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..RED..AL["Minimap button has been reset!"]) end function AtlasLootOptions_DefaultSettings() - -- AtlasLootCharDB.SafeLinks = false; - -- AtlasLootCharDB.AllLinks = true; - AtlasLootCharDB.DefaultTT = true; - AtlasLootCharDB.LootlinkTT = false; - AtlasLootCharDB.ItemSyncTT = false; - AtlasLootCharDB.ShowSource = true; - AtlasLootCharDB.EquipCompare = false; - AtlasLootCharDB.Opaque = false; - AtlasLootCharDB.ItemIDs = false; - -- AtlasLootCharDB.ItemSpam = true; - AtlasLootCharDB.MinimapButton = true; - AtlasLootCharDB.HidePanel = false; - -- AtlasLootCharDB.AutoQuery = false; - AtlasLootCharDB.PartialMatching = true; - AtlasLootCharDB.LastBoss = "DUNGEONSMENU1"; - AtlasLootCharDB.LastBossText = AL["Dungeons & Raids"]; - AtlasLootDefaultFrame:ClearAllPoints(); - AtlasLootDefaultFrame:SetPoint("TOP", "UIParent", "TOP", 0, -30); - AtlasLootOptionsFrame:ClearAllPoints(); - AtlasLootOptionsFrame:SetPoint("CENTER", "UIParent", "CENTER", 0, 100); - AtlasLootCharDB["QuickLooks"] = {}; - AtlasLootCharDB["WishList"] = {}; - AtlasLoot_RefreshQuickLookButtons(); - AtlasLootOptions_Init(); - DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..RED..AL["Default settings applied!"]); + -- AtlasLootCharDB.SafeLinks = false + -- AtlasLootCharDB.AllLinks = true + AtlasLootCharDB.DefaultTT = true + AtlasLootCharDB.LootlinkTT = false + AtlasLootCharDB.ItemSyncTT = false + AtlasLootCharDB.ShowSource = true + AtlasLootCharDB.EquipCompare = false + AtlasLootCharDB.Opaque = false + AtlasLootCharDB.ItemIDs = false + -- AtlasLootCharDB.ItemSpam = true + AtlasLootCharDB.MinimapButton = true + AtlasLootCharDB.HidePanel = false + -- AtlasLootCharDB.AutoQuery = false + AtlasLootCharDB.PartialMatching = true + AtlasLootCharDB.LastBoss = "DUNGEONSMENU1" + AtlasLootCharDB.LastBossText = AL["Dungeons & Raids"] + AtlasLootDefaultFrame:ClearAllPoints() + AtlasLootDefaultFrame:SetPoint("TOP", "UIParent", "TOP", 0, -30) + AtlasLootOptionsFrame:ClearAllPoints() + AtlasLootOptionsFrame:SetPoint("CENTER", "UIParent", "CENTER", 0, 100) + AtlasLootCharDB["QuickLooks"] = {} + AtlasLootCharDB["WishList"] = {} + AtlasLoot_RefreshQuickLookButtons() + AtlasLootOptions_Init() + DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..RED..AL["Default settings applied!"]) end --[[ @@ -2650,11 +2662,11 @@ 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 - AtlasLootMinimapButton_SetPosition(math.deg(math.atan2(ypos,xpos))); + 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 --[[ @@ -2663,10 +2675,10 @@ Function to save the position of the minimap button. ]] function AtlasLootMinimapButton_SetPosition(v) if v < 0 then - v = v + 360; + v = v + 360 end - AtlasLootCharDB.MinimapButtonPosition = v; - AtlasLootMinimapButton_UpdatePosition(); + AtlasLootCharDB.MinimapButtonPosition = v + AtlasLootMinimapButton_UpdatePosition() end -------------------------------------------------------------------------------- @@ -2676,101 +2688,101 @@ end local stringArgs = {} local messageShown = false function AtlasLootItem_OnEnter() - local isItem, isEnchant, isSpell; + local isItem, isEnchant, isSpell local buttonID = this:GetID() - AtlasLootTooltip:ClearLines(); + AtlasLootTooltip:ClearLines() for i = 1, 30, 1 do if _G["AtlasLootTooltipTextRight"..i] then - _G["AtlasLootTooltipTextRight"..i]:SetText(""); + _G["AtlasLootTooltipTextRight"..i]:SetText("") end end - if not ( this.itemID and this.itemID ~= 0 ) then + if not (this.itemID and this.itemID ~= 0) then return end if string.sub(this.itemID, 1, 1) == "s" then - isItem = false; - isEnchant = false; - isSpell = true; + isItem = false + isEnchant = false + isSpell = true elseif string.sub(this.itemID, 1, 1) == "e" then - isItem = false; - isEnchant = true; - isSpell = false; + isItem = false + isEnchant = true + isSpell = false else - isItem = true; - isEnchant = false; - isSpell = false; + isItem = true + isEnchant = false + isSpell = false end if isItem then local name, link, quality = GetItemInfo(this.itemID) local _, _, _, color = GetItemQualityColor(quality or 1) - -- local color = strsub(_G["AtlasLootItem_"..buttonID.."_Name"]:GetText(), 3, 10); - -- local name = strsub(_G["AtlasLootItem_"..buttonID.."_Name"]:GetText(), 11); + -- local color = strsub(_G["AtlasLootItem_"..buttonID.."_Name"]:GetText(), 3, 10) + -- local name = strsub(_G["AtlasLootItem_"..buttonID.."_Name"]:GetText(), 11) -- Lootlink tooltips if AtlasLootCharDB.LootlinkTT then -- If we have seen the item, use the game tooltip to minimise same name item problems if name then - AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24); - AtlasLootTooltip:SetHyperlink("item:"..this.itemID..":0:0:0"); + AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24) + AtlasLootTooltip:SetHyperlink("item:"..this.itemID..":0:0:0") if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID); + AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID) end if this.droprate then - AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0); + AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0) end - AtlasLootTooltip:Show(); + AtlasLootTooltip:Show() if LootLink_AddItem then - LootLink_AddItem(name, this.itemID..":0:0:0", color); + LootLink_AddItem(name, this.itemID..":0:0:0", color) end else - AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24); + AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24) if LootLink_Database and LootLink_Database[this.itemID] then - LootLink_SetTooltip(AtlasLootTooltip, LootLink_Database[this.itemID][1], 1); + LootLink_SetTooltip(AtlasLootTooltip, LootLink_Database[this.itemID][1], 1) else - LootLink_SetTooltip(AtlasLootTooltip, name, 1); + LootLink_SetTooltip(AtlasLootTooltip, name, 1) end if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID); + AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID) end if this.droprate then - AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0, 1); + AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0, 1) end - AtlasLootTooltip:Show(); + AtlasLootTooltip:Show() end - -- Item Sync tooltips + -- Item Sync tooltips elseif AtlasLootCharDB.ItemSyncTT then - ItemSync:ButtonEnter(); + ItemSync:ButtonEnter() if AtlasLootCharDB.ItemIDs then - GameTooltip:AddLine(AL["ItemID:"].." "..this.itemID); + GameTooltip:AddLine(AL["ItemID:"].." "..this.itemID) end if this.droprate then - GameTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0); + GameTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0) end - GameTooltip:Show(); - -- Default game tooltips + GameTooltip:Show() + -- Default game tooltips else - AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24); + AtlasLootTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24) if GetItemInfo(this.itemID) then - AtlasLootTooltip:SetHyperlink("item:"..this.itemID..":0:0:0"); + AtlasLootTooltip:SetHyperlink("item:"..this.itemID..":0:0:0") else AtlasLootTooltip:SetText(AL["Retrieving item information"], RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) end if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID); + AtlasLootTooltip:AddLine(AL["ItemID:"].." "..this.itemID) end if this.droprate then - AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0); + AtlasLootTooltip:AddLine(AL["Drop Rate: "]..this.droprate, 1, 1, 0) end - AtlasLootTooltip:Show(); + AtlasLootTooltip:Show() end elseif isEnchant then - local spellID = tonumber(string.sub(this.itemID, 2)); - AtlasLootTooltip:SetOwner(this, "ANCHOR_NONE"); + local spellID = tonumber(string.sub(this.itemID, 2)) + AtlasLootTooltip:SetOwner(this, "ANCHOR_NONE") AtlasLootTooltip:SetPoint("BOTTOMLEFT", this, "TOPRIGHT", -(this:GetWidth() / 2), 24) - AtlasLootTooltip:ClearLines(); + AtlasLootTooltip:ClearLines() if SetAutoloot == nil or (SUPERWOW_VERSION and (tonumber(SUPERWOW_VERSION)) >= 1.2) then AtlasLootTooltip:SetHyperlink("enchant:"..spellID) else - AtlasLootTooltip:SetHyperlink("spell:"..spellID); + AtlasLootTooltip:SetHyperlink("spell:"..spellID) if not messageShown then DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..WHITE.."Old version of SuperWoW detected, please download the latest version from https://github.com/balakethelock/SuperWoW/releases/tag/Release") messageShown = true @@ -2787,29 +2799,29 @@ function AtlasLootItem_OnEnter() AtlasLootTooltipTextRight2:SetText(longCooldown) end if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip:AddLine(AL["SpellID:"].." "..spellID); + AtlasLootTooltip:AddLine(AL["SpellID:"].." "..spellID) end - AtlasLootTooltip:Show(); + AtlasLootTooltip:Show() local item = tonumber(GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]) local extra = GetSpellInfoAtlasLootDB["enchants"][spellID]["extra"] - if not ( item and item ~= 0 ) then + if not (item and item ~= 0) then return end - AtlasLootTooltip2:SetOwner(this, "ANCHOR_NONE"); + AtlasLootTooltip2:SetOwner(this, "ANCHOR_NONE") AtlasLootTooltip2:SetPoint("TOPLEFT", AtlasLootTooltip, "BOTTOMLEFT", 0, 0) - AtlasLootTooltip2:ClearLines(); + AtlasLootTooltip2:ClearLines() if not GetItemInfo(item) then AtlasLootTooltip2:SetText(AL["Retrieving item information"], RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) else - AtlasLootTooltip2:SetHyperlink("item:"..item); + AtlasLootTooltip2:SetHyperlink("item:"..item) if extra then - AtlasLootTooltip2:AddLine(extra, 1, 1, 1, 1); + AtlasLootTooltip2:AddLine(extra, 1, 1, 1, 1) end end if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip2:AddLine(AL["ItemID:"].." "..item); + AtlasLootTooltip2:AddLine(AL["ItemID:"].." "..item) end - AtlasLootTooltip2:Show(); + AtlasLootTooltip2:Show() -- Reposition if tooltips overlap local bottom = AtlasLootTooltip:GetBottom() local top = AtlasLootTooltip2:GetTop() @@ -2820,10 +2832,10 @@ function AtlasLootItem_OnEnter() AtlasLootTooltip:SetPoint("BOTTOMLEFT", AtlasLootTooltip2, "TOPLEFT", 0, 0) end elseif isSpell then - local spellID = tonumber(string.sub(this.itemID, 2)); - AtlasLootTooltip:SetOwner(this, "ANCHOR_NONE"); + local spellID = tonumber(string.sub(this.itemID, 2)) + AtlasLootTooltip:SetOwner(this, "ANCHOR_NONE") AtlasLootTooltip:SetPoint("BOTTOMLEFT", this, "TOPRIGHT", -(this:GetWidth() / 2), 24) - AtlasLootTooltip:ClearLines(); + AtlasLootTooltip:ClearLines() if SpellInfo then AtlasLootTooltip:SetHyperlink("enchant:"..spellID) local _, _, longCooldown = strfind(AtlasLootTooltipTextRight2:GetText() or "", gsub(SPELL_RECAST_TIME_MIN, "%%%.3g", "(.+)")) @@ -2902,29 +2914,29 @@ function AtlasLootItem_OnEnter() end end if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip:AddLine(AL["SpellID:"].." "..spellID); + AtlasLootTooltip:AddLine(AL["SpellID:"].." "..spellID) end - AtlasLootTooltip:Show(); + AtlasLootTooltip:Show() local craftItem = tonumber(GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]) local extra = GetSpellInfoAtlasLootDB["craftspells"][spellID]["extra"] - if not ( craftItem and craftItem ~= 0 ) then + if not (craftItem and craftItem ~= 0) then return end - AtlasLootTooltip2:SetOwner(this, "ANCHOR_NONE"); + AtlasLootTooltip2:SetOwner(this, "ANCHOR_NONE") AtlasLootTooltip2:SetPoint("TOPLEFT", AtlasLootTooltip, "BOTTOMLEFT", 0, 0) - AtlasLootTooltip2:ClearLines(); + AtlasLootTooltip2:ClearLines() if not GetItemInfo(craftItem) then AtlasLootTooltip2:SetText(AL["Retrieving item information"], RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) else - AtlasLootTooltip2:SetHyperlink("item:"..craftItem); + AtlasLootTooltip2:SetHyperlink("item:"..craftItem) if extra then - AtlasLootTooltip2:AddLine(extra, 1, 1, 1, 1); + AtlasLootTooltip2:AddLine(extra, 1, 1, 1, 1) end end if AtlasLootCharDB.ItemIDs then - AtlasLootTooltip2:AddLine(AL["ItemID:"].." "..craftItem); + AtlasLootTooltip2:AddLine(AL["ItemID:"].." "..craftItem) end - AtlasLootTooltip2:Show(); + AtlasLootTooltip2:Show() -- Reposition if tooltips overlap local bottom = AtlasLootTooltip:GetBottom() local top = AtlasLootTooltip2:GetTop() @@ -2942,11 +2954,11 @@ end -- Called when the mouse cursor leaves a loot item -------------------------------------------------------------------------------- function AtlasLootItem_OnLeave() - AtlasLootTooltip:Hide(); - AtlasLootTooltip2:Hide(); - GameTooltip:Hide(); - ShoppingTooltip1:Hide(); - ShoppingTooltip2:Hide(); + AtlasLootTooltip:Hide() + AtlasLootTooltip2:Hide() + GameTooltip:Hide() + ShoppingTooltip1:Hide() + ShoppingTooltip2:Hide() end -------------------------------------------------------------------------------- @@ -2954,57 +2966,57 @@ end -- Called when a loot item is clicked on -------------------------------------------------------------------------------- function AtlasLootItem_OnClick() - local isItem, isEnchant, isSpell; - local name = _G["AtlasLootItem_"..this:GetID().."_Name"]:GetText(); - local _, _, color = strfind(name, "(|cff%x%x%x%x%x%x)"); + local isItem, isEnchant, isSpell + local name = _G["AtlasLootItem_"..this:GetID().."_Name"]:GetText() + local _, _, color = strfind(name, "(|cff%x%x%x%x%x%x)") color = color or NORMAL_FONT_COLOR_CODE name = gsub(name, "|cff%x%x%x%x%x%x", "") name = gsub(name, "|r", "") - local id = this:GetID(); + local id = this:GetID() local _, _, texture = strfind(_G["AtlasLootItem_"..this:GetID().."_Icon"]:GetTexture() or "", ".+\\(.+)$") - texture = texture or "INV_Misc_QuestionMark" + texture = texture or "INV_Misc_QuestionMark" local dataID = AtlasLootItemsFrame.refresh[1] local dataSource = AtlasLootItemsFrame.refresh[2] local bossName = AtlasLootItemsFrame.refresh[3] if string.sub(this.itemID, 1, 1) == "s" then - isItem = false; - isEnchant = false; - isSpell = true; + isItem = false + isEnchant = false + isSpell = true elseif string.sub(this.itemID, 1, 1) == "e" then - isItem = false; - isEnchant = true; - isSpell = false; + isItem = false + isEnchant = true + isSpell = false else - isItem = true; - isEnchant = false; - isSpell = false; + isItem = true + isEnchant = false + isSpell = false end if isItem then - local itemName, itemLink = GetItemInfo(this.itemID); + local itemName, itemLink = GetItemInfo(this.itemID) -- If shift-clicked, link in the chat window if itemName and IsShiftKeyDown() and this.itemID ~= 0 then if WIM_EditBoxInFocus then - WIM_EditBoxInFocus:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..itemName.."]|h|r"); + WIM_EditBoxInFocus:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..itemName.."]|h|r") elseif ChatFrameEditBox:IsVisible() then - ChatFrameEditBox:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..itemName.."]|h|r"); + ChatFrameEditBox:Insert(color.."|Hitem:"..this.itemID..":0:0:0|h["..itemName.."]|h|r") else - AtlasLoot_SayItemReagents(this.itemID, color, itemName); + AtlasLoot_SayItemReagents(this.itemID, color, itemName) end - -- If control-clicked, use the dressing room + -- If control-clicked, use the dressing room elseif IsControlKeyDown() and itemLink then - DressUpItemLink(itemLink); + DressUpItemLink(itemLink) elseif IsAltKeyDown() and this.itemID ~= 0 then if dataID == "WishList" then - AtlasLoot_DeleteFromWishList(this.itemID); + AtlasLoot_DeleteFromWishList(this.itemID) elseif dataID == "SearchResult" then - AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(this.itemID)); + AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(this.itemID)) else - AtlasLoot_AddToWishlist(this.itemID, texture, this.itemIDName, this.itemIDExtra, dataID.."|"..dataSource); + AtlasLoot_AddToWishlist(this.itemID, texture, this.itemIDName, this.itemIDExtra, dataID.."|"..dataSource) end elseif (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage then - local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)"); + local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)") if dataID and dataSource --[[and AtlasLoot_IsLootTableAvailable(dataID)]] then - AtlasLoot_ShowItemsFrame(dataID, dataSource, AtlasLoot_TableNames[dataID][1]); + AtlasLoot_ShowItemsFrame(dataID, dataSource, AtlasLoot_TableNames[dataID][1]) end elseif this.container then AtlasLoot_ShowContainerFrame() @@ -3014,18 +3026,18 @@ function AtlasLootItem_OnClick() AtlasLoot_SayItemReagents(this.itemID, color, name) elseif IsAltKeyDown() and this.itemID ~= 0 then if dataID == "WishList" then - AtlasLoot_DeleteFromWishList(this.itemID); + AtlasLoot_DeleteFromWishList(this.itemID) elseif dataID == "SearchResult" then - AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(this.itemID)); + AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(this.itemID)) else - AtlasLoot_AddToWishlist(this.itemID, texture, this.itemIDName, this.itemIDExtra, dataID.."|"..dataSource); + AtlasLoot_AddToWishlist(this.itemID, texture, this.itemIDName, this.itemIDExtra, dataID.."|"..dataSource) end elseif IsControlKeyDown() and this.dressingroomID then - DressUpItemLink("item:"..this.dressingroomID..":0:0:0"); + DressUpItemLink("item:"..this.dressingroomID..":0:0:0") elseif (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage then - local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)"); + local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)") if dataID and dataSource --[[and AtlasLoot_IsLootTableAvailable(dataID)]] then - AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName); + AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName) end end elseif isSpell then @@ -3035,33 +3047,33 @@ function AtlasLootItem_OnClick() local craftname = GetItemInfo(craftitem or 0) if WIM_EditBoxInFocus then if craftitem and craftitem ~= 0 and craftname then - WIM_EditBoxInFocus:Insert(color.."|Hitem:"..craftitem..":0:0:0|h["..craftname.."]|h|r"); + WIM_EditBoxInFocus:Insert(color.."|Hitem:"..craftitem..":0:0:0|h["..craftname.."]|h|r") else - WIM_EditBoxInFocus:Insert(color.."|Henchant:"..spellID.."|h["..name.."]|h|r"); + WIM_EditBoxInFocus:Insert(color.."|Henchant:"..spellID.."|h["..name.."]|h|r") end elseif ChatFrameEditBox:IsVisible() then if craftitem and craftitem ~= 0 and craftname then - ChatFrameEditBox:Insert(color.."|Hitem:"..craftitem..":0:0:0|h["..craftname.."]|h|r"); + ChatFrameEditBox:Insert(color.."|Hitem:"..craftitem..":0:0:0|h["..craftname.."]|h|r") else - ChatFrameEditBox:Insert(color.."|Henchant:"..spellID.."|h["..name.."]|h|r"); + ChatFrameEditBox:Insert(color.."|Henchant:"..spellID.."|h["..name.."]|h|r") end else AtlasLoot_SayItemReagents(this.itemID, color, name) end elseif IsAltKeyDown() and this.itemID ~= 0 then if dataID == "WishList" then - AtlasLoot_DeleteFromWishList(this.itemID); + AtlasLoot_DeleteFromWishList(this.itemID) elseif dataID == "SearchResult" then - AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(this.itemID)); + AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(this.itemID)) else - AtlasLoot_AddToWishlist(this.itemID, texture, this.itemIDName, this.itemIDExtra, dataID.."|"..dataSource); + AtlasLoot_AddToWishlist(this.itemID, texture, this.itemIDName, this.itemIDExtra, dataID.."|"..dataSource) end elseif IsControlKeyDown() and this.dressingroomID then - DressUpItemLink("item:"..this.dressingroomID..":0:0:0"); + DressUpItemLink("item:"..this.dressingroomID..":0:0:0") elseif (dataID == "SearchResult" or dataID == "WishList") and this.sourcePage then - local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)"); + local _, _, dataID, dataSource = strfind(this.sourcePage, "(.+)|(.+)") if dataID and dataSource --[[and AtlasLoot_IsLootTableAvailable(dataID)]] then - AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName); + AtlasLoot_ShowItemsFrame(dataID, dataSource, bossName) end end end @@ -3072,7 +3084,7 @@ function AtlasLoot_CacheItem(linkOrID) if not linkOrID or linkOrID == 0 then return nil end - if ( tonumber(linkOrID )) then + if (tonumber(linkOrID)) then if GetItemInfo(linkOrID) then return true else @@ -3136,7 +3148,7 @@ function AtlasLoot_ShowContainerFrame() local icon = _G["AtlasLootContainerItem"..buttonIndex.."Icon"] local r, g, b = 1, 1, 1 if quality then - r, g, b = GetItemQualityColor(quality) + r, g, b = GetItemQualityColor(quality) end if not tex then tex = "Interface\\Icons\\INV_Misc_QuestionMark" @@ -3154,7 +3166,7 @@ function AtlasLoot_ShowContainerFrame() end row = row + 1 end - AtlasLootItemsFrameContainer:SetPoint("TOPLEFT", this , "BOTTOMLEFT", -2, 2) + AtlasLootItemsFrameContainer:SetPoint("TOPLEFT", this, "BOTTOMLEFT", -2, 2) AtlasLootItemsFrameContainer:SetWidth(16 + (maxCols * 35)) AtlasLootItemsFrameContainer:SetHeight(16 + (row * 35)) end @@ -3181,7 +3193,7 @@ function AtlasLoot_ContainerItem_OnEnter() if icon:GetTexture() == "Interface\\Icons\\INV_Misc_QuestionMark" then local _, _, quality, _, _, _, _, _, tex = GetItemInfo(itemID) if tex and quality then - local r, g, b = GetItemQualityColor(quality) + local r, g, b = GetItemQualityColor(quality) icon:SetTexture(tex) this:SetBackdropBorderColor(r, g, b) end @@ -3209,12 +3221,12 @@ function AtlasLoot_ContainerItem_OnClick(arg1) end if IsShiftKeyDown() and arg1 == "LeftButton" then if WIM_EditBoxInFocus then - WIM_EditBoxInFocus:Insert(color.."|Hitem:"..itemID..":0:0:0|h["..name.."]|h|r"); + WIM_EditBoxInFocus:Insert(color.."|Hitem:"..itemID..":0:0:0|h["..name.."]|h|r") elseif ChatFrameEditBox:IsVisible() then - ChatFrameEditBox:Insert(color.."|Hitem:"..itemID..":0:0:0|h["..name.."]|h|r"); + ChatFrameEditBox:Insert(color.."|Hitem:"..itemID..":0:0:0|h["..name.."]|h|r") end elseif IsControlKeyDown() and link then - DressUpItemLink(link); + DressUpItemLink(link) elseif IsAltKeyDown() and itemID ~= 0 then if lootpage and dataSource then AtlasLoot_AddToWishlist(itemID, tex, name, extra, lootpage.."|"..dataSource) @@ -3222,11 +3234,11 @@ function AtlasLoot_ContainerItem_OnClick(arg1) local dataID = AtlasLootItemsFrame.refresh[1] local dataSource = AtlasLootItemsFrame.refresh[2] if dataID == "WishList" then - AtlasLoot_DeleteFromWishList(this.itemID); + AtlasLoot_DeleteFromWishList(this.itemID) elseif dataID == "SearchResult" then - AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(itemID)); + AtlasLoot_AddToWishlist(AtlasLoot:GetOriginalDataFromSearchResult(itemID)) else - AtlasLoot_AddToWishlist(itemID, tex, name, extra, dataID.."|"..dataSource); + AtlasLoot_AddToWishlist(itemID, tex, name, extra, dataID.."|"..dataSource) end end end @@ -3234,17 +3246,20 @@ end local function idFromLink(itemlink) if itemlink then - local _,_,id = string.find(itemlink, "|Hitem:([^:]+)%:") + local _, _, id = string.find(itemlink, "|Hitem:([^:]+)%:") return tonumber(id) end return nil end function AtlasLoot_CheckBagsForItems(id, qty) - if not id then DEFAULT_CHAT_FRAME:AddMessage("AtlasLoot_CheckBagsForItems: no ID specified!") return end + if not id then + DEFAULT_CHAT_FRAME:AddMessage("AtlasLoot_CheckBagsForItems: no ID specified!") + return + end if not qty then qty = 1 end - local itemsfound = 0; - local itemName = GetItemInfo(id); + local itemsfound = 0 + local itemName = GetItemInfo(id) if not itemName then return nil end for i = 0, NUM_BAG_FRAMES do for j = 1, GetContainerNumSlots(i) do @@ -3264,8 +3279,8 @@ end function AtlasLoot_SayItemReagents(id, color, name, safe) if not id then return end - local chatline = ""; - local itemCount = 0; + local chatline = "" + local itemCount = 0 name = gsub(name, "|cff%x%x%x%x%x%x", "") name = gsub(name, "|r", "") color = color or NORMAL_FONT_COLOR_CODE @@ -3282,10 +3297,10 @@ function AtlasLoot_SayItemReagents(id, color, name, safe) end local channel, chatnumber if tListActivity[1] and WIM_Windows and WIM_Windows[tListActivity[1]].is_visible then - channel = "WHISPER"; - chatnumber = tListActivity[1]; + channel = "WHISPER" + chatnumber = tListActivity[1] else - channel = ChatFrameEditBox.chatType; + channel = ChatFrameEditBox.chatType if channel == "WHISPER" then chatnumber = ChatFrameEditBox.tellTarget elseif channel == "CHANNEL" then @@ -3296,56 +3311,56 @@ function AtlasLoot_SayItemReagents(id, color, name, safe) local spellID = tonumber(string.sub(id, 2)) local craftItem = tonumber(GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftItem"]) if craftItem and craftItem ~= 0 then - local craftnumber = ""; - local qtyMin = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMin"]; - local qtyMax = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMax"]; + local craftnumber = "" + local qtyMin = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMin"] + local qtyMax = GetSpellInfoAtlasLootDB["craftspells"][spellID]["craftQuantityMax"] if qtyMin then if qtyMax then - craftnumber = craftnumber..qtyMin.. "-"..qtyMax.."x" + craftnumber = craftnumber..qtyMin.."-"..qtyMax.."x" else craftnumber = craftnumber..qtyMin.."x" end end - SendChatMessage(AL["To craft "]..craftnumber..AtlasLoot_GetChatLink(craftItem)..AL[" the following reagents are needed:"], channel, nil, chatnumber); + SendChatMessage(AL["To craft "]..craftnumber..AtlasLoot_GetChatLink(craftItem)..AL[" the following reagents are needed:"], channel, nil, chatnumber) local reagents = GetSpellInfoAtlasLootDB["craftspells"][spellID]["reagents"] if type(reagents) == "table" then for j = 1, table.getn(reagents) do local tempnumber = reagents[j][2] if not tempnumber or tempnumber == nil or tempnumber == "" then - tempnumber = 1; + tempnumber = 1 end - chatline = chatline..tempnumber.."x"..AtlasLoot_GetChatLink(reagents[j][1]).." "; - itemCount = itemCount + 1; + chatline = chatline..tempnumber.."x"..AtlasLoot_GetChatLink(reagents[j][1]).." " + itemCount = itemCount + 1 if itemCount == 4 then - SendChatMessage(chatline, channel, nil, chatnumber); - chatline = ""; - itemCount = 0; + SendChatMessage(chatline, channel, nil, chatnumber) + chatline = "" + itemCount = 0 end end end if itemCount > 0 then - SendChatMessage(chatline, channel, nil, chatnumber); + SendChatMessage(chatline, channel, nil, chatnumber) end else local reagents = GetSpellInfoAtlasLootDB["craftspells"][spellID]["reagents"] - SendChatMessage(AL["To cast "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r"..AL[" the following items are needed:"], channel, nil, chatnumber); + SendChatMessage(AL["To cast "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r"..AL[" the following items are needed:"], channel, nil, chatnumber) if type(reagents) == "table" then for j = 1, table.getn(reagents) do local tempnumber = reagents[j][2] if not tempnumber or tempnumber == nil or tempnumber == "" then - tempnumber = 1; + tempnumber = 1 end - chatline = chatline..tempnumber.."x"..AtlasLoot_GetChatLink(reagents[j][1]).." "; - itemCount = itemCount + 1; + chatline = chatline..tempnumber.."x"..AtlasLoot_GetChatLink(reagents[j][1]).." " + itemCount = itemCount + 1 if itemCount == 4 then - SendChatMessage(chatline, channel, nil, chatnumber); - chatline = ""; - itemCount = 0; + SendChatMessage(chatline, channel, nil, chatnumber) + chatline = "" + itemCount = 0 end end end if itemCount > 0 then - SendChatMessage(chatline, channel, nil, chatnumber); + SendChatMessage(chatline, channel, nil, chatnumber) end end elseif string.sub(id, 1, 1) == "e" then @@ -3353,28 +3368,28 @@ function AtlasLoot_SayItemReagents(id, color, name, safe) local item = tonumber(GetSpellInfoAtlasLootDB["enchants"][spellID]["item"]) if tListActivity[1] and WIM_Windows[tListActivity[1]].is_visible then if not item then - SendChatMessage(NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber); + SendChatMessage(NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber) else - SendChatMessage(AL["To craft "]..AtlasLoot_GetChatLink(item)..AL[" you need this: "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber); + SendChatMessage(AL["To craft "]..AtlasLoot_GetChatLink(item)..AL[" you need this: "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber) end elseif ChatFrameEditBox:IsVisible() then if not item then - ChatFrameEditBox:Insert(NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber); + ChatFrameEditBox:Insert(NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber) else - ChatFrameEditBox:Insert(AL["To craft "]..AtlasLoot_GetChatLink(item)..AL[" you need this: "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber); + ChatFrameEditBox:Insert(AL["To craft "]..AtlasLoot_GetChatLink(item)..AL[" you need this: "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber) end else if not item then - SendChatMessage(color.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber); + SendChatMessage(color.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber) else - SendChatMessage(AL["To craft "]..AtlasLoot_GetChatLink(item)..AL[" you need this: "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber); + SendChatMessage(AL["To craft "]..AtlasLoot_GetChatLink(item)..AL[" you need this: "]..NORMAL_FONT_COLOR_CODE.."|Henchant:"..spellID.."|h["..name.."]|h|r", channel, nil, chatnumber) end end else if safe then - SendChatMessage("["..name.."]", channel, nil, chatnumber); + SendChatMessage("["..name.."]", channel, nil, chatnumber) else - SendChatMessage(color.."|Hitem:"..id..":0:0:0|h["..name.."]|h|r", channel, nil, chatnumber); + SendChatMessage(color.."|Hitem:"..id..":0:0:0|h["..name.."]|h|r", channel, nil, chatnumber) end end end @@ -3386,36 +3401,36 @@ function AtlasLoot_GetChatLink(id) end function AtlasLoot_QuickLook_OnClick(id) - if IsAltKeyDown() then - AtlasLoot_ClearQuickLookButton(id) - return - end - if this:GetParent() == AtlasLootPanel then - if AtlasLootPanel:GetParent() == AtlasFrame then - AtlasLoot_AnchorPoint = Anchor_Atlas - elseif AtlasLootPanel:GetParent() == AlphaMapAlphaMapFrame then - AtlasLoot_AnchorPoint = Anchor_AlphaMap - end - else - AtlasLoot_AnchorPoint = Anchor_Default - end - AtlasLoot_ShowItemsFrame(AtlasLootCharDB["QuickLooks"][id][1], AtlasLootCharDB["QuickLooks"][id][2], AtlasLootCharDB["QuickLooks"][id][3]); + if IsAltKeyDown() then + AtlasLoot_ClearQuickLookButton(id) + return + end + if this:GetParent() == AtlasLootPanel then + if AtlasLootPanel:GetParent() == AtlasFrame then + AtlasLoot_AnchorPoint = Anchor_Atlas + elseif AtlasLootPanel:GetParent() == AlphaMapAlphaMapFrame then + AtlasLoot_AnchorPoint = Anchor_AlphaMap + end + else + AtlasLoot_AnchorPoint = Anchor_Default + end + AtlasLoot_ShowItemsFrame(AtlasLootCharDB["QuickLooks"][id][1], AtlasLootCharDB["QuickLooks"][id][2], AtlasLootCharDB["QuickLooks"][id][3]) end function AtlasLoot_QuickLook_OnShow(id) - this:SetText(AL["QuickLook"].." "..id) - this:SetFrameLevel(this:GetParent():GetFrameLevel() + 1) - if not AtlasLootCharDB["QuickLooks"][id] or not AtlasLootCharDB["QuickLooks"][id][1] then - this:Disable() - end + this:SetText(AL["QuickLook"].." "..id) + this:SetFrameLevel(this:GetParent():GetFrameLevel() + 1) + if not AtlasLootCharDB["QuickLooks"][id] or not AtlasLootCharDB["QuickLooks"][id][1] then + this:Disable() + end end function AtlasLoot_QuickLook_OnEnter(id) - if this:IsEnabled() then - GameTooltip:ClearLines() - GameTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 5) - GameTooltip:AddLine(WHITE..AtlasLootCharDB["QuickLooks"][id][3].."|r") - GameTooltip:AddLine(AL["ALT+Click to clear"]) - GameTooltip:Show() - end + if this:IsEnabled() then + GameTooltip:ClearLines() + GameTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 5) + GameTooltip:AddLine(WHITE..AtlasLootCharDB["QuickLooks"][id][3].."|r") + GameTooltip:AddLine(AL["ALT+Click to clear"]) + GameTooltip:Show() + end end diff --git a/Core/AtlasLoot.xml b/Core/AtlasLoot.xml index e8f927a..5c63f7d 100644 --- a/Core/AtlasLoot.xml +++ b/Core/AtlasLoot.xml @@ -1,4 +1,5 @@ - + @@ -115,15 +116,15 @@ if AtlasLoot_Hewdrop:IsOpen() then - AtlasLoot_Hewdrop:Close(); + AtlasLoot_Hewdrop:Close() else - AtlasLoot_Hewdrop:Open(this); + AtlasLoot_Hewdrop:Open(this) end - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - this:SetText(AL["Select Loot Table"]); - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + this:SetText(AL["Select Loot Table"]) + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) @@ -137,15 +138,15 @@ if AtlasLoot_HewdropSubMenu:IsOpen() then - AtlasLoot_HewdropSubMenu:Close(); + AtlasLoot_HewdropSubMenu:Close() else - AtlasLoot_HewdropSubMenu:Open(this); + AtlasLoot_HewdropSubMenu:Open(this) end - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - this:SetText(AL["Select Sub-Table"]); - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + this:SetText(AL["Select Sub-Table"]) + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) @@ -157,16 +158,16 @@ - AtlasLoot_QuickLook_OnEnter(1) + AtlasLoot_QuickLook_OnEnter(1) GameTooltip:Hide() - AtlasLoot_QuickLook_OnClick(1) + AtlasLoot_QuickLook_OnClick(1) - AtlasLoot_QuickLook_OnShow(1) + AtlasLoot_QuickLook_OnShow(1) @@ -178,16 +179,16 @@ - AtlasLoot_QuickLook_OnEnter(2) + AtlasLoot_QuickLook_OnEnter(2) GameTooltip:Hide() - AtlasLoot_QuickLook_OnClick(2) + AtlasLoot_QuickLook_OnClick(2)a - AtlasLoot_QuickLook_OnShow(2) + AtlasLoot_QuickLook_OnShow(2) @@ -199,16 +200,16 @@ - AtlasLoot_QuickLook_OnEnter(3) + AtlasLoot_QuickLook_OnEnter(3) GameTooltip:Hide() - AtlasLoot_QuickLook_OnClick(3) + AtlasLoot_QuickLook_OnClick(3) - AtlasLoot_QuickLook_OnShow(3) + AtlasLoot_QuickLook_OnShow(3) @@ -220,16 +221,16 @@ - AtlasLoot_QuickLook_OnEnter(4) + AtlasLoot_QuickLook_OnEnter(4) GameTooltip:Hide() - AtlasLoot_QuickLook_OnClick(4) + AtlasLoot_QuickLook_OnClick(4) - AtlasLoot_QuickLook_OnShow(4) + AtlasLoot_QuickLook_OnShow(4) @@ -242,12 +243,12 @@ - this:SetAutoFocus(false); - this:SetTextInsets(0, 8, 0, 0); + this:SetAutoFocus(false) + this:SetTextInsets(0, 8, 0, 0) - AtlasLoot:Search(this:GetText()); - this:ClearFocus(); + AtlasLoot:Search(this:GetText()) + this:ClearFocus() @@ -259,14 +260,14 @@ - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - this:SetText(AL["Search"]); - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + this:SetText(AL["Search"]) + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) - AtlasLoot:Search(AtlasLootDefaultFrameSearchBox:GetText()); - AtlasLootDefaultFrameSearchBox:ClearFocus(); - CloseDropDownMenus(); + AtlasLoot:Search(AtlasLootDefaultFrameSearchBox:GetText()) + AtlasLootDefaultFrameSearchBox:ClearFocus() + CloseDropDownMenus() @@ -283,10 +284,10 @@ - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) - AtlasLoot:ShowSearchOptions(this); + AtlasLoot:ShowSearchOptions(this) @@ -299,14 +300,14 @@ - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - this:SetText(AL["Clear"]); - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + this:SetText(AL["Clear"]) + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) - AtlasLootDefaultFrameSearchBox:SetText(""); - AtlasLootDefaultFrameSearchBox:ClearFocus(); - CloseDropDownMenus(); + AtlasLootDefaultFrameSearchBox:SetText("") + AtlasLootDefaultFrameSearchBox:ClearFocus() + CloseDropDownMenus() @@ -317,13 +318,13 @@ - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - this:SetText(AL["Last Result"]); - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + this:SetText(AL["Last Result"]) + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) - AtlasLoot:ShowSearchResult(); - CloseDropDownMenus(); + AtlasLoot:ShowSearchResult() + CloseDropDownMenus() @@ -336,25 +337,25 @@ - AtlasLoot_ShowWishList(); + AtlasLoot_ShowWishList() - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - this:SetText(AL["WishList"]); - this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + this:SetText(AL["WishList"]) + this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1) - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") if this:IsEnabled() then - GameTooltip:ClearLines(); - GameTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 5); - GameTooltip:AddLine("|cffFFFFFF"..AL["WishList"].."|r"); - GameTooltip:AddLine(AL["ALT+Click on item to add or remove it from WishList"]); - GameTooltip:Show(); + GameTooltip:ClearLines() + GameTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 5) + GameTooltip:AddLine("|cffFFFFFF"..AL["WishList"].."|r") + GameTooltip:AddLine(AL["ALT+Click on item to add or remove it from WishList"]) + GameTooltip:Show() end - GameTooltip:Hide(); + GameTooltip:Hide() @@ -403,31 +404,31 @@ - this:RegisterForDrag("LeftButton"); - this:SetBackdropColor(0.75, 0, 0.75); - local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); - AtlasLootDefaultFrame_Notice:SetText(AL["NoticeFrame"]); + this:RegisterForDrag("LeftButton") + this:SetBackdropColor(0.75, 0, 0.75) + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot") + AtlasLootDefaultFrame_Notice:SetText(AL["NoticeFrame"]) - CloseDropDownMenus(); + CloseDropDownMenus() - AtlasLootDefaultFrame_OnShow(); + AtlasLootDefaultFrame_OnShow() - AtlasLootDefaultFrame_OnHide(); + AtlasLootDefaultFrame_OnHide() - this:StartMoving(); + this:StartMoving() - this:StopMovingOrSizing(); + this:StopMovingOrSizing()