diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index 3e27b4b..6206583 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -141,6 +141,7 @@ function AtlasLoot:OnEnable() end if IsAddOnLoaded("Atlas") then + AtlasLoot:LoadMapData(); ATLASLOOT_ATLASLOADED = true; AtlasLootDefaultFrame_MapButton:Show(); AtlasLootDefaultFrame_MapSelectButton:Show(); @@ -389,7 +390,7 @@ dataSource - Table in the database where the loot table is stored tablenum - Number of the table with the loot in it It is the workhorse of the mod and allows the loot tables to be displayed any way anywhere in any mod. ]] -function AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum) +function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) --Set up local variables needed for GetItemInfo, etc local itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture, itemColor; local iconFrame, nameFrame, extraFrame, itemButton; @@ -397,7 +398,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum) local isValid, isItem, toShow, IDfound; local spellName, spellIcon; - SearchPrevData = {dataID, dataSource, tablenum}; + SearchPrevData = {dataID, dataSource_backup, tablenum}; --If the loot table name has not been passed, throw up a debugging statement @@ -423,8 +424,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum) -- Hide the map header lable Atlasloot_HeaderLabel:Hide(); - local dataSource_backup = dataSource; - dataSource = _G[dataSource] or AtlasLoot_Data; + local dataSource = _G[dataSource_backup] or AtlasLoot_Data; -- Check to see if Atlas is loaded and the table has a map if dataSource_backup ~= "AtlasLoot_TokenData" and dataSource[dataID].Map and ATLASLOOT_ATLASLOADED then @@ -750,7 +750,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum) tablenum = AtlasLootItemsFrame.refreshOri[3]; end - if tablenum ~= #_G[AtlasLootItemsFrame.refreshOri[2]][AtlasLootItemsFrame.refreshOri[1]] and dataSource_backup ~= "AtlasLoot_TokenData" then + if AtlasLootItemsFrame.refreshOri and tablenum ~= #_G[AtlasLootItemsFrame.refreshOri[2]][AtlasLootItemsFrame.refreshOri[1]] and dataSource_backup ~= "AtlasLoot_TokenData" then _G["AtlasLootItemsFrame_NEXT"]:Show(); _G["AtlasLootItemsFrame_NEXT"].tablenum = tablenum + 1; _G["AtlasLootItemsFrame_NEXT"].tablebase = tablebase; diff --git a/AtlasLoot/Core/Atlasloot_Maps.lua b/AtlasLoot/Core/Atlasloot_Maps.lua index 6c054ce..9e59845 100644 --- a/AtlasLoot/Core/Atlasloot_Maps.lua +++ b/AtlasLoot/Core/Atlasloot_Maps.lua @@ -110,6 +110,7 @@ function AtlasLoot:MapMenuRegister(mapID) ) end +function AtlasLoot:LoadMapData() AtlasLoot_MultiMapData = { ["AuchManaTombs"] = {"AuchindounEnt","AuchManaTombs","AuchAuchenaiCrypts","AuchSethekkHalls","AuchShadowLabyrinth"}; ["AuchAuchenaiCrypts"] = {"AuchindounEnt","AuchManaTombs","AuchAuchenaiCrypts","AuchSethekkHalls","AuchShadowLabyrinth"}; @@ -2461,4 +2462,5 @@ AtlasLoot_MapData = { { WHITE.."5) "..AtlasLocale["Lavanthor"].." ("..AtlasLocale["Random"]..")", NPC, 29312 }; { WHITE.."6) "..AtlasLocale["Cyanigosa"].." ("..AtlasLocale["Wave 18"]..")", NPC, 31134 }; }; -}; \ No newline at end of file +}; +end \ No newline at end of file