added subtablescrollframeupdate to showitemsframe and removed it from everywere else

This commit is contained in:
Anch
2022-08-04 20:22:14 +12:00
parent af6dc788a7
commit b9fdf6e890
11 changed files with 2236 additions and 86 deletions
-1
View File
@@ -36,7 +36,6 @@ embeds.xml
Locales\Locales.xml
TableRegister\TableRegister.xml
AtlasLayout\AtlasLayout.xml
Add_Ons\Addons.xml
Core\AtlasLoot.xml
+51 -44
View File
@@ -32,7 +32,6 @@ AtlasLoot = LibStub("AceAddon-3.0"):NewAddon("AtlasLoot", "AceTimer-3.0");
local BabbleBoss = AtlasLoot_GetLocaleLibBabble("LibBabble-Boss-3.0")
local AL = LibStub("AceLocale-3.0"):GetLocale("AtlasLoot");
--Establish version number and compatible version of Atlas
local VERSION_MAJOR = "5";
local VERSION_MINOR = "11";
@@ -44,7 +43,6 @@ ATLASLOOT_PREVIEW_ATLAS = {"1.17.3", "1.17.2"};
ATLASLOOT_POSITION = AL["Position:"];
ATLASLOOT_DEBUGMESSAGES = false;
ATLASLOOT_LOOP = false;
--Standard indent to line text up with Atlas text
ATLASLOOT_INDENT = " ";
@@ -70,7 +68,8 @@ local ORANGE = "|cffFF8400";
--dataID, dataSource, boss, pFrame, tablenumber
SearchPrevData = {"", "", "", "", ""};
AtlasLootCharDB={};
AtlasLootCharDB = {};
AtlasLoot_TokenData = {};
local AtlasLootDBDefaults = {
profile = {
@@ -400,13 +399,7 @@ function AtlasLoot_OnLoad()
end
--Used to refresh the page after its loaded all the items
function AtlasLoot:callShowloot()
ATLASLOOT_LOOP = true;
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4], AtlasLootItemsFrame.refresh[5])
end
function AtlasLoot_CleandataID(newID, listnum)
function AtlasLoot:CleandataID(newID, listnum)
local cleanlist = { [1] = {"CLASSIC", "TBC", "WRATH"} };
for i = 1, #cleanlist[listnum] do
newID = gsub(newID, cleanlist[listnum][i], "");
@@ -415,7 +408,7 @@ function AtlasLoot_CleandataID(newID, listnum)
end
--Creates tables for raid tokens from the collections tables
function Atlasloot_CreateToken(dataID)
function AtlasLoot:CreateToken(dataID)
local itemType, slotType, itemName, itemType2
--orginal dataID
local orgID = dataID;
@@ -432,27 +425,31 @@ function Atlasloot_CreateToken(dataID)
end
end
--Creates data set of the item type
AtlasLoot_Data[orgID] = {};
local newData = AtlasLoot_Data[orgID];
AtlasLoot_TokenData[orgID] = {};
local newData = AtlasLoot_TokenData[orgID];
newData.Name = itemName;
newData.Type = AtlasLoot_Data[dataID].Type;
newData.Back = true;
newData.NoSubt = true;
newData[1] = {};
newData[1].Name = itemName;
--Adds all the items to the new data set
--Uses a timer so that AtlasLoot:callShowloot() only fires once after all then items have been loaded
local keyNumber = AtlasLoot_GetNumOfRows(AtlasLoot_Data[dataID]);
local tableNumber;
for i, v in ipairs(AtlasLoot_Data[dataID]) do
tableNumber = AtlasLoot_GetNumOfRows(v);
for t, id in ipairs(v) do
local itemID = AL_FindId(id[2], ItemindexID);
local item = Item:CreateFromID(itemID);
item:ContinueOnLoad(function(itemID)
AtlasLoot:CancelTimer(AtlasLoot.refreshTimer);
if itemType == select(9,GetItemInfo(itemID)) or itemType2 == select(9,GetItemInfo(itemID)) then
local newTable = rawset(id, 1, i);
newTable = rawset(id, 5, v.Name);
table.insert(newData[1],newTable);
end
AtlasLoot.refreshTimer = AtlasLoot:ScheduleTimer("callShowloot", .5);
if i == keyNumber and tableNumber == t then
AtlasLoot_ShowItemsFrame(orgID, AtlasLoot_TokenData, AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4], 1)
end
end)
end
end
@@ -482,9 +479,12 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
DEFAULT_CHAT_FRAME:AddMessage("No dataID!");
return;
end
--Get AtlasQuest out of the way
if (AtlasQuestInsideFrame) then
HideUIPanel(AtlasQuestInsideFrame);
--Check to see if Atlas is loaded and the table has a map
if dataSource[dataID].Map and IsAddOnLoaded("Atlas") then
AtlasLootDefaultFrame_MapButton:Show();
else
AtlasLootDefaultFrame_MapButton:Hide();
end
--Hide Advanced search if it is up and reshow Querybutton
@@ -494,18 +494,26 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
AtlasLoot_QuickLooks:Hide();
AtlasLootQuickLooksButton:Hide();
--Hide Map and reshow lootbackground
AtlasLootDefaultFrame_Map:Hide();
AtlasLootDefaultFrame_LootBackground:Show();
-- Hide the Filter Check-Box
AtlasLootFilterCheck:Hide();
if dataID ~= "SearchResult" and dataID ~= "WishList" then
dataSource = AtlasLoot_Data;
end
if dataID == "SearchResult" then
dataSource = AtlasLootCharDB;
end
AtlasLoot_CurrentType = dataSource[dataID].Type or "";
AtlasLootDefaultFrame_ScrollFrameUpdate();
AtlasLoot:ScrollFrameUpdate();
AtlasLoot_BossName:SetText(dataSource[dataID][tablenum].Name);
--For stopping the subtable from changing if its a token table
if dataSource[dataID].NoSubt == nil then
AtlasLootDefaultFrame_SubMenu:SetText(dataSource[dataID].Name);
AtlasLoot:SubTableScrollFrameUpdate(dataID, dataSource, pFrame, tablenum);
end
--Hide UI objects so that only needed ones are shown
for i = 1, 30, 1 do
@@ -520,12 +528,13 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
--Iterate through each item object and set its properties
for i = 1, 30, 1 do
local toShow = true;
if(dataSource[dataID][tablenum][i][AtlasLoot_Difficulty.MIN_DIF]) then
local itemDif = ItemindexID;
--[[ if(dataSource[dataID][tablenum][i][AtlasLoot_Difficulty.MIN_DIF]) then
if tonumber(dataSource[dataID][tablenum][i][AtlasLoot_Difficulty.MIN_DIF]) < itemDif then toShow = false; end
end
end ]]
--Check for a valid object (that it exists, and that it has a name
if(dataSource[dataID][tablenum][i] ~= nil and dataSource[dataID][tablenum][i][4] ~= "") and toShow then
local itemDif = ItemindexID;
if type(ItemindexID) == "string" then
IDfound = dataSource[dataID][tablenum][i][2];
else
@@ -582,7 +591,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
--Store data about the state of the items frame to allow minor tweaks or a recall of the current loot page
AtlasLootItemsFrame.refresh = {dataID, dataSource_backup, boss, pFrame, tablenum};
--and dataSource[dataID].Back ~= true
if dataID ~= "FilterList" then
if dataID ~= "WishList" and dataID ~= "FilterList" and dataSource[dataID].Back ~= true then
AtlasLootItemsFrame.refreshOri = {dataID, dataSource_backup, boss, pFrame, tablenum};
end
@@ -693,7 +702,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
end
AtlasLootItemsFrame.refresh = {dataID, dataSource, boss, pFrame, tablenum};
--and dataID ~= "SearchResult"
if dataID ~= "WishList" and dataID ~= "FilterList" and dataSource[dataID].Back ~= true then
AtlasLootItemsFrame.refreshOri = {dataID, dataSource, boss, pFrame, tablenum};
AtlasLoot.db.profile.LastBoss = {dataID, dataSource, boss, pFrame, tablenum, ATLASLOOT_LASTMODULE, ATLASLOOT_CURRENTTABLE};
@@ -725,9 +734,6 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
getglobal("AtlasLootItemsFrame_NEXT"):Hide();
getglobal("AtlasLootItemsFrame_PREV"):Hide();
AtlasLoot_BossName:SetText(dataSource[dataID][tablenum].Name);
AtlasLootDefaultFrame_SubMenu:SetText(dataSource[dataID].Name);
if tablenum + 1 ~= AtlasLoot_GetNumOfRows(dataSource[dataID]) then
getglobal("AtlasLootItemsFrame_NEXT"):Show();
if dataID ~= "FilterList" then
@@ -752,12 +758,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
AtlasLoot_HideNoUsableItems();
end
if ATLASLOOT_LOOP then
ATLASLOOT_LOOP = false;
else
AtlasLoot_QueryLootPage();
end
AtlasLoot_QueryLootPage();
end
--[[
@@ -788,8 +789,7 @@ Called when <-, -> are pressed and calls up the appropriate loot page
]]
function AtlasLoot_NavButton_OnClick(self)
local tablenum = self.tablenum;
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refreshOri[1], AtlasLootItemsFrame.refreshOri[2], AtlasLootItemsFrame.refreshOri[3], AtlasLootItemsFrame.refreshOri[4], tablenum);
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(AtlasLootItemsFrame.refreshOri[1], AtlasLootItemsFrame.refreshOri[2], AtlasLootItemsFrame.refreshOri[4], tablenum);
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4], tablenum);
end
--[[
@@ -798,7 +798,6 @@ Called when 'Back'Button is pressed and calls up the appropriate loot page
]]
function AtlasLoot_BackButton_OnClick()
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refreshOri[1], AtlasLootItemsFrame.refreshOri[2], AtlasLootItemsFrame.refreshOri[3], AtlasLootItemsFrame.refreshOri[4], AtlasLootItemsFrame.refreshOri[5]);
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(AtlasLootItemsFrame.refreshOri[1], AtlasLootItemsFrame.refreshOri[2], AtlasLootItemsFrame.refreshOri[3], AtlasLootItemsFrame.refreshOri[5]);
end
--[[
@@ -989,15 +988,23 @@ AtlasLoot_QueryLootPage()
Querys all valid items on the current loot page.
]]
function AtlasLoot_QueryLootPage()
for i = 1, 30, 1 do
button = getglobal("AtlasLootItem_"..i);
local lastitem
for t = 1, 30, 1 do
local xbutton = getglobal("AtlasLootItem_"..t);
local xqueryitem = xbutton.itemID;
if (xqueryitem) and (xqueryitem ~= nil) and (xqueryitem ~= "") and (xqueryitem ~= 0) and (string.sub(xqueryitem, 1, 1) ~= "s") then
lastitem = t;
end
end
for i = 1, 30, 1 do
local button = getglobal("AtlasLootItem_"..i);
local queryitem = button.itemID;
if (queryitem) and (queryitem ~= nil) and (queryitem ~= "") and (queryitem ~= 0) and (string.sub(queryitem, 1, 1) ~= "s") then
local item = Item:CreateFromID(queryitem);
if not (item:GetInfo()) then
item:ContinueOnLoad(function(itemId)
if i == 30 then
AtlasLoot:callShowloot();
if i == lastitem then
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4], AtlasLootItemsFrame.refresh[5]);
end
end)
end
+1 -1
View File
@@ -8,6 +8,7 @@
<Script file="ItemIDsDatabaseFixes.lua"/>
<!--Default Files-->
<Script file="AtlasLoot.lua"/>
<Script file="Filter.lua"/>
<Script file="ExtraText.lua"/>
<Script file="TextParsing.lua"/>
@@ -15,7 +16,6 @@
<Script file="LootButtons.lua"/>
<Script file="Atlasloot_Maps.lua"/>
<Script file="Launchers.lua"/>
<Script file="AtlasLoot.lua"/>
<Script file="WishList.lua"/>
<Script file="SearchAdvanced.lua"/>
<Script file="Search.lua"/>
File diff suppressed because it is too large Load Diff
+6 -5
View File
@@ -251,11 +251,12 @@ function AtlasLootItem_OnClick(arg1)
AtlasLoot_ShowItemsFrame(dataID, dataSource, dataSource[dataID].Name, AtlasLootItemsFrame.refresh[4], 1);
end
elseif (arg1=="LeftButton") and this.sourcePage ~= nil then
--Holds AtlasLoot_Lastboss so back button works
if AtlasLoot_Data[this.sourcePage] == nil then
Atlasloot_CreateToken(this.sourcePage)
end
AtlasLoot_ShowItemsFrame(this.sourcePage, "",this.sourcePage, pFrame,1);
--Create token table if there isnt one
if AtlasLoot_TokenData[this.sourcePage] == nil then
AtlasLoot:CreateToken(this.sourcePage)
end
--Show token table
AtlasLoot_ShowItemsFrame(this.sourcePage, AtlasLoot_TokenData,this.sourcePage, pFrame,1);
end
else
if IsShiftKeyDown() then
-2
View File
@@ -694,7 +694,6 @@ end
function AtlasLoot:ShowSearchResult()
AtlasLoot_ShowItemsFrame("SearchResult", AtlasLootCharDB, (AL["Search Result: %s"]):format(AtlasLootCharDB.LastSearchedText or ""), pFrame, 1);
AtlasLootDefaultFrame_SubTableScrollFrameUpdate("SearchResult", AtlasLootCharDB, pFrame, 1);
end
function AtlasLoot:Search(Text)
@@ -747,7 +746,6 @@ function AtlasLoot:Search(Text)
else
--SearchResult = AtlasLoot_CategorizeWishList(AtlasLootCharDB["SearchResult"]);
AtlasLoot_ShowItemsFrame("SearchResult", AtlasLootCharDB, (AL["Search Result: %s"]):format(AtlasLootCharDB.LastSearchedText or ""), pFrame, 1);
AtlasLootDefaultFrame_SubTableScrollFrameUpdate("SearchResult", AtlasLootCharDB, pFrame, 1);
end
end
+2 -3
View File
@@ -235,15 +235,14 @@ function AtlasLoot_AdvancedSearchShow()
AtlasLootDefaultFrame_AdvancedSearchPanel:Show();
AtlasLoot_CurrentType = "Search";
AtlasLootDefaultFrame_ScrollFrameUpdate();
AtlasLootDefaultFrame_SubTableScrollFrameUpdate("", "", "", "");
AtlasLoot:ScrollFrameUpdate();
AtlasLoot:SubTableScrollFrameUpdate("", "", "", "");
end
function AtlasLoot_AdvancedSearchClose()
AtlasLootDefaultFrame_AdvancedSearchPanel:Hide();
if (SearchPrevData[1] ~= "") then
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(SearchPrevData[1], SearchPrevData[2], SearchPrevData[4], SearchPrevData[5]);
AtlasLoot_ShowItemsFrame(SearchPrevData[1], SearchPrevData[2], SearchPrevData[3], SearchPrevData[4], SearchPrevData[5]);
end
end
-3
View File
@@ -68,7 +68,6 @@ function AtlasLoot_ShowWishList()
AtlasLootWishList["WishList"].Name = "Wish List";
AtlasLootWishList["WishList"].Back = true;
AtlasLootWishList["WishList"][1].Name = AtlasLootWishList["Own"][playerName][lastWishListarg2]["info"][1];
AtlasLootDefaultFrame_SubTableScrollFrameUpdate("WishList", AtlasLootWishList, pFrame, 1);
AtlasLoot_ShowItemsFrame("WishList", AtlasLootWishList, AtlasLootWishList["Own"][playerName][lastWishListarg2]["info"][1], pFrame, 1);
elseif lastWishListtyp == "addOther" then
AtlasLootWishList["WishList"] = AtlasLootWishList["Own"][lastWishListarg2];
@@ -76,7 +75,6 @@ function AtlasLoot_ShowWishList()
AtlasLootWishList["WishList"].Name = "Wish List";
AtlasLootWishList["WishList"].Back = true;
AtlasLootWishList["WishList"][1].Name = AtlasLootWishList["Own"][lastWishListarg2][lastWishListarg3]["info"][1];
AtlasLootDefaultFrame_SubTableScrollFrameUpdate("WishList", AtlasLootWishList, pFrame, 1);
AtlasLoot_ShowItemsFrame("WishList", AtlasLootWishList, AtlasLootWishList["Own"][lastWishListarg2][lastWishListarg3]["info"][1], pFrame, 1);
elseif lastWishListtyp == "addShared" then
AtlasLootWishList["WishList"] = AtlasLootWishList["Shared"][lastWishListarg2];
@@ -84,7 +82,6 @@ function AtlasLoot_ShowWishList()
AtlasLootWishList["WishList"].Name = "Wish List";
AtlasLootWishList["WishList"].Back = true;
AtlasLootWishList["WishList"][1].Name = AtlasLootWishList["Shared"][lastWishListarg2][lastWishListarg3]["info"][1];
AtlasLootDefaultFrame_SubTableScrollFrameUpdate("WishList", AtlasLootWishList, pFrame, 1);
AtlasLoot_ShowItemsFrame("WishList", AtlasLootWishList, AtlasLootWishList["Shared"][lastWishListarg2][lastWishListarg3]["info"][1], pFrame, 1);
end
end
@@ -5,10 +5,6 @@ AtlasLoot_DewDropSubMenuClick(tablename, text)
AtlasLoot_DewdropExpansionMenuClick(tablename, text)
AtlasLoot_DefaultFrame_OnShow()
AtlasLootDefaultFrame_OnHide()
AtlasLoot_DewdropExpansionMenuClick(raidtablename, itemID, itemColour)
AtlasLoot_DifficultyDisable()
AtlasLoot_DifficultyEnable(dataID, dataSource)
AtlasLootDefaultFrame_GetRaidDifficulty(raidtablename, itemID, itemColour)
AtlasLoot_DewdropExpansionMenuRegister(loottable)
AtlasLoot_DewdropSubMenuRegister(loottable)
AtlasLoot_DewdropRegister()
@@ -56,7 +52,6 @@ function AtlasLootDefaultFrame_OnShow()
ATLASLOOT_LASTMODULE = lastboss[6];
AtlasLoot_IsLootTableAvailable(lastboss[6]);
AtlasLoot_ShowItemsFrame(lastboss[1], AtlasLoot_Data, AtlasLoot_Data[lastboss[1]][lastboss[5]].Name, pFrame, lastboss[5]);
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(lastboss[1], AtlasLoot_Data, pFrame, lastboss[5]);
AtlasLoot_DewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu);
AtlasLoot_DewdropSubMenuRegister(AtlasLoot_SubMenus[lastboss[7]]);
else
@@ -107,13 +102,17 @@ function AtlasLoot_DewDropSubMenuClick(tablename)
pFrame = { "TOPLEFT", "AtlasLootDefaultFrame_LootBackground", "TOPLEFT", "2", "-2" };
--Show the select loot table
local tablenum = AtlasLoot_Data[tablename].Loadfirst or 1;
ItemindexID = ItemindexID or 2;
if AtlasLoot_Data[tablename].Type == "Crafting" then
ItemindexID = "Pattern";
elseif ItemindexID == "Pattern" and AtlasLoot_Data[tablename].Type ~= "Crafting" then
ItemindexID = 2;
else
ItemindexID = ItemindexID or 2;
end
--Show the table that has been selected
AtlasLoot_ShowItemsFrame(tablename, AtlasLoot_Data, AtlasLoot_Data[tablename][tablenum].Name, pFrame, tablenum);
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(tablename, AtlasLoot_Data, pFrame, tablenum);
AtlasLoot_DewdropSubMenu:Close(1);
end
@@ -128,7 +127,7 @@ function AtlasLoot_DewdropExpansionMenuClick(expansion, name)
AtlasLoot_DewdropExpansionMenu:Close(1);
AtlasLoot_Expac = expansion;
if ATLASLOOT_CURRENTTABLE then
local tablename = AtlasLoot_CleandataID(ATLASLOOT_CURRENTTABLE, 1) .. AtlasLoot_Expac;
local tablename = AtlasLoot:CleandataID(ATLASLOOT_CURRENTTABLE, 1) .. AtlasLoot_Expac;
AtlasLoot_IsLootTableAvailable(AtlasLoot_SubMenus[tablename].Module);
AtlasLoot_DewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu);
AtlasLoot_DewdropSubMenuRegister(AtlasLoot_SubMenus[tablename]);
@@ -137,6 +137,12 @@ local lootbground = CreateFrame("Frame", "AtlasLootDefaultFrame_LootBackground",
lootbground.Back:SetAllPoints();
lootbground.Back:SetPoint("TOPLEFT","AtlasLootDefaultFrame_LootBackground","TOPLEFT");
lootbground.Back:SetPoint("BOTTOMRIGHT","AtlasLootDefaultFrame_LootBackground","BOTTOMRIGHT");
lootbground:EnableMouse();
lootbground:SetScript("OnMouseDown",function(self, button)
if AtlasLootItemsFrame.refresh[2][AtlasLootItemsFrame.refresh[1]].Back and button == "RightButton" then
AtlasLoot_BackButton_OnClick()
end
end);
--Atlas Map
local map = CreateFrame("Frame", "AtlasLootDefaultFrame_Map", AtlasLootDefaultFrame);
@@ -144,6 +150,12 @@ local map = CreateFrame("Frame", "AtlasLootDefaultFrame_Map", AtlasLootDefaultFr
map:SetPoint("BOTTOMLEFT", AtlasLootDefaultFrame, "BOTTOMLEFT",40,90);
map:SetFrameStrata("HIGH");
map:Hide();
map:EnableMouse();
map:SetScript("OnMouseDown", function(self, button)
if button == "RightButton" then
AtlasLoot:MapOnShow();
end
end);
--Wish List Button
local wishbtn = CreateFrame("Button", "AtlasLootDefaultFrameWishListButton", AtlasLootDefaultFrame, "OptionsButtonTemplate");
@@ -176,7 +188,6 @@ local function presetcreate(preset,num)
pFrame = { "TOPLEFT", "AtlasLootDefaultFrame_LootBackground", "TOPLEFT", "2", "-2" };
ATLASLOOT_LASTMODULE = AtlasLootCharDB["QuickLooks"][num][6];
ATLASLOOT_CURRENTTABLE = AtlasLootCharDB["QuickLooks"][num][7];
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(AtlasLootCharDB["QuickLooks"][num][1], AtlasLootCharDB["QuickLooks"][num][2], pFrame, AtlasLootCharDB["QuickLooks"][num][5])
AtlasLoot_ShowItemsFrame(AtlasLootCharDB["QuickLooks"][num][1], AtlasLootCharDB["QuickLooks"][num][2], AtlasLootCharDB["QuickLooks"][num][3], pFrame, AtlasLootCharDB["QuickLooks"][num][5]);
end
end);
@@ -306,7 +317,7 @@ function AtlasLoot_GetNumOfRows(tablename)
return num
end
function AtlasLootDefaultFrame_ScrollFrameUpdate()
function AtlasLoot:ScrollFrameUpdate()
local maxValue = AtlasLoot_GetNumOfRows(AtlasLoot_Difficulty[AtlasLoot_CurrentType])
FauxScrollFrame_Update(scrollFrame.scrollBar, maxValue, MAX_ROWS, ROW_HEIGHT);
local offset = FauxScrollFrame_GetOffset(scrollFrame.scrollBar);
@@ -333,11 +344,11 @@ local scrollSlider = CreateFrame("ScrollFrame","AtlasLootDefaultFrameScroll", At
scrollSlider:SetPoint("BOTTOMRIGHT", -30, 8)
scrollSlider:SetScript("OnVerticalScroll", function(self, offset)
self.offset = math.floor(offset / ROW_HEIGHT + 0.5)
AtlasLootDefaultFrame_ScrollFrameUpdate()
AtlasLoot:ScrollFrameUpdate()
end)
scrollSlider:SetScript("OnShow", function()
AtlasLootDefaultFrame_ScrollFrameUpdate()
AtlasLoot:ScrollFrameUpdate()
end)
scrollFrame.scrollBar = scrollSlider
@@ -352,7 +363,7 @@ local rows = setmetatable({}, { __index = function(t, i)
if not AtlasLootDefaultFrame_AdvancedSearchPanel:IsVisible() then
AtlasLoot_ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3], AtlasLootItemsFrame.refresh[4], AtlasLootItemsFrame.refresh[5]);
end
AtlasLootDefaultFrame_ScrollFrameUpdate();
AtlasLoot:ScrollFrameUpdate();
end)
if i == 1 then
row:SetPoint("TOPLEFT", scrollFrame, 8, -8)
@@ -378,7 +389,7 @@ local subtableFrame = CreateFrame("Frame", "Atlasloot_SubTableFrame", AtlasLootD
insets = { left = 4, right = 4, top = 4, bottom = 4 },
});
function AtlasLootDefaultFrame_SubTableScrollFrameUpdate(tablename, dataSource, pFrame, currenttablenum)
function AtlasLoot:SubTableScrollFrameUpdate(tablename, dataSource, pFrame, currenttablenum)
if dataSource ~= nil then
if(string.find(tablename, "SearchResult")) then tablename = "SearchResult"; end
local maxValue = AtlasLoot_GetNumOfRows(dataSource[tablename]);
@@ -412,11 +423,11 @@ local scrollSlider2 = CreateFrame("ScrollFrame","AtlasLootDefaultFrameSubTableSc
scrollSlider2:SetPoint("BOTTOMRIGHT", -30, 8)
scrollSlider2:SetScript("OnVerticalScroll", function(self, offset)
self.offset = math.floor(offset / ROW_HEIGHT + 0.5)
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(subtableFrame.tablename);
AtlasLoot:SubTableScrollFrameUpdate(subtableFrame.tablename);
end)
scrollSlider2:SetScript("OnShow", function()
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(subtableFrame.tablename);
AtlasLoot:SubTableScrollFrameUpdate(subtableFrame.tablename);
end)
subtableFrame.scrollBar = scrollSlider2
@@ -428,7 +439,7 @@ local rows2 = setmetatable({}, { __index = function(t, i)
row:SetCheckedTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight", "ADD");
row:SetScript("OnClick", function()
pFrame = { "TOPLEFT", "AtlasLootDefaultFrame_LootBackground", "TOPLEFT", "2", "-2" };
AtlasLootDefaultFrame_SubTableScrollFrameUpdate(row.tablename, row.dataSource, pFrame, row.tablenum);
AtlasLoot:SubTableScrollFrameUpdate(row.tablename, row.dataSource, pFrame, row.tablenum);
AtlasLoot_ShowItemsFrame(row.tablename, row.dataSource, row.dataSource[row.tablename][row.tablenum].Name, pFrame, row.tablenum);
end)
if i == 1 then
@@ -451,4 +462,5 @@ local mapbtn = CreateFrame("Button","AtlasLootDefaultFrame_MapButton", AtlasLoot
self:SetText("Map");
self:SetFrameLevel( (self:GetParent()):GetFrameLevel() + 1 );
end)
mapbtn:SetScript("OnClick", function() AtlasLoot_MapOnShow(); end)
mapbtn:SetScript("OnClick", function() AtlasLoot:MapOnShow(); end)
mapbtn:Hide();
+24 -4
View File
@@ -112,6 +112,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["AuchCrypts"] = {
Name = BabbleZone["Auchenai Crypts"];
Type = "BCDungeon";
Map = "AuchAuchenaiCrypts";
{
Name = BabbleBoss["Shirrak the Dead Watcher"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -175,6 +176,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["AuchManaTombs"] = {
Name = BabbleZone["Mana-Tombs"];
Type = "BCDungeon";
Map = "AuchManaTombs";
{
Name = BabbleBoss["Pandemonius"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -280,6 +282,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["AuchSethekk"] = {
Name = BabbleZone["Sethekk Halls"];
Type = "BCDungeon";
Map = "AuchSethekkHalls";
{
Name = BabbleBoss["Darkweaver Syth"];
{ 1, 27919, "", "=q3=Light-Woven Slippers", "=ds=#s12#, #a1#", "", "13.90%"};
@@ -345,6 +348,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["AuchShadowLab"] = {
Name = BabbleZone["Shadow Labyrinth"];
Type = "BCDungeon";
Map = "AuchShadowLabyrinth";
{
Name = BabbleBoss["Ambassador Hellmaw"];
{ 1, 27889, "", "=q3=Jaedenfire Gloves of Annihilation", "=ds=#s9#, #a1#", "", "13.58%"};
@@ -448,6 +452,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["BlackTemple"] = {
Name = BabbleZone["Black Temple"];
Type = "BCRaid";
Map = "BlackTempleStart";
{
Name = BabbleBoss["High Warlord Naj'entus"];
{ 1, 32239, "", "=q4=Slippers of the Seacaller", "=ds=#s12#, #a1#", "", "15%"};
@@ -653,6 +658,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CoTOldHillsbrad"] = {
Name = BabbleZone["Old Hillsbrad Foothills"];
Type = "BCDungeon";
Map = "CoTOldHillsbrad";
{
Name = BabbleBoss["Lieutenant Drake"];
{ 1, 27423, "", "=q3=Cloak of Impulsiveness", "=ds=#s4#", "", "19.68%"};
@@ -738,7 +744,6 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
{ 17, 25725, "", "=q1=Pattern: Riding Crop", "=ds=#p7# (350)"};
{ 19, 0, "INV_Box_01", "=q6="..AL["Aged Dalaran Wizard"], "=q5="..BabbleZone["Old Hillsbrad Foothills"]};
{ 20, 22539, "", "=q1=Formula: Enchant Shield - Intellect", "=ds=#p4# (325)"};
Type = "BCDungeon";
};
};
@@ -753,6 +758,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CoTBlackMorass"] = {
Name = BabbleZone["The Black Morass"];
Type = "BCDungeon";
Map = "CoTBlackMorass";
{
Name = BabbleBoss["Chrono Lord Deja"];
{ 1, 27988, "", "=q3=Burnoose of Shifting Ages", "=ds=#s4#", "", "13.87%"};
@@ -819,6 +825,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CoTHyjal"] = {
Name = BabbleZone["Hyjal Summit"];
Type = "BCRaid";
Map = "CoTHyjal";
{
Name = BabbleBoss["Rage Winterchill"];
{ 1, 30871, "", "=q4=Bracers of Martyrdom", "=ds=#s8#, #a1#", "", "17%"};
@@ -931,6 +938,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CFRSlavePens"] = {
Name = BabbleZone["The Slave Pens"];
Type = "BCDungeon";
Map = "CFRTheSlavePens";
{
Name = BabbleBoss["Mennu the Betrayer"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -1013,6 +1021,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CFRSteamvault"] = {
Name = BabbleZone["The Steamvault"];
Type = "BCDungeon";
Map = "CFRTheSteamvault";
{
Name = BabbleBoss["Hydromancer Thespia"];
{ 1, 27508, "", "=q3=Incanter's Gloves", "=ds=#s9#, #a1# (D3)", "", "17.09%"};
@@ -1087,6 +1096,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CFRUnderbog"] = {
Name = BabbleZone["The Underbog"];
Type = "BCDungeon";
Map = "CFRTheUnderbog";
{
Name = BabbleBoss["Hungarfen"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -1126,9 +1136,6 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
{ 25, 27758, "", "=q3=Hydra-fang Necklace", "=ds=#s2#", "", "12.00%"};
{ 26, 27761, "", "=q3=Ring of the Shadow Deeps", "=ds=#s13#", "", "18.67%"};
{ 27, 27757, "", "=q3=Greatstaff of the Leviathan", "=ds=#h2#, #w9#", "", "16.00%"};
Prev = "CFRUnderHungarfen";
Next = "CFRUnderSwamplord";
Type = "BCDungeon";
};
{
Name = BabbleBoss["Swamplord Musel'ek"];
@@ -1192,6 +1199,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["CFRSerpentshrine"] = {
Name = BabbleZone["Serpentshrine Cavern"];
Type = "BCRaid";
Map = "CFRSerpentshrineCavern";
{
Name = BabbleBoss["Hydross the Unstable"];
{ 1, 30056, "", "=q4=Robe of Hateful Echoes", "=ds=#s5#, #a1#", "", "18%"};
@@ -1323,6 +1331,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["GruulsLair"] = {
Name = BabbleZone["Gruul's Lair"];
Type = "BCRaid";
Map = "GruulsLair";
{
Name = BabbleBoss["High King Maulgar"];
{ 1, 28797, "", "=q4=Brute Cloak of the Ogre-Magi", "#s4#", "", "8.39%"};
@@ -1365,6 +1374,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["HCRamparts"] = {
Name = BabbleZone["Hellfire Ramparts"];
Type = "BCDungeon";
Map = "HCHellfireRamparts";
{
Name = BabbleBoss["Watchkeeper Gargolmar"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -1469,6 +1479,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["HCFurnace"] = {
Name = BabbleZone["The Blood Furnace"];
Type = "BCDungeon";
Map = "HCBloodFurnace";
{
Name = BabbleBoss["The Maker"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -1546,6 +1557,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["HCShatteredHalls"] = {
Name = BabbleZone["The Shattered Halls"];
Type = "BCDungeon";
Map = "HCTheShatteredHalls";
{
Name = BabbleBoss["Grand Warlock Nethekurse"];
{ 1, 24312, "", "=q4=Pattern: Spellstrike Hood", "=ds=#p8# (375)", "", "0.47%"};
@@ -1629,6 +1641,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["HCMagtheridon"] = {
Name = "Magtheridon";
Type = "BCRaid";
Map = "HCMagtheridonsLair";
{
Name = "Magtheridon";
{ 1, 28777, "", "=q4=Cloak of the Pit Stalker", "=ds=#s4#"};
@@ -1912,6 +1925,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["MagistersTerrace"] = {
Name = BabbleZone["Magisters' Terrace"];
Type = "BCDungeon";
Map = "MagistersTerrace";
{
Name = BabbleBoss["Selin Fireheart"];
{ 1, 0, "INV_Box_01", "=q6=#j1#", ""};
@@ -2008,6 +2022,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["SunwellPlateau"] = {
Name = BabbleZone["Sunwell Plateau"];
Type = "BCRaid";
Map = "SunwellPlateau";
{
Name = BabbleBoss["Kalecgos"];
{ 1, 34170, "", "=q4=Pantaloons of Calming Strife", "=ds=#s11#, #a1#"};
@@ -2214,6 +2229,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["TKArc"] = {
Name = BabbleZone["The Arcatraz"];
Type = "BCDungeon";
Map = "TempestKeepArcatraz";
{
Name = BabbleBoss["Zereketh the Unbound"];
{ 1, 28373, "", "=q3=Cloak of Scintillating Auras", "=ds=#s4#", "", "17.13%"};
@@ -2305,6 +2321,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["TKBot"] = {
Name = BabbleZone["The Botanica"];
Type = "BCDungeon";
Map = "TempestKeepBotanica";
{
Name = BabbleBoss["Commander Sarannis"];
{ 1, 28301, "", "=q3=Syrannis' Mystic Sheen", "=ds=#s4#", "", "28.54%"};
@@ -2417,6 +2434,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["TKMech"] = {
Name = BabbleZone["The Mechanar"];
Type = "BCDungeon";
Map = "TempestKeepMechanar";
{
Name = AL["Cache of the Legion"];
{ 1, 0, "INV_Box_01", "=q6="..AL["Cache of the Legion"], ""};
@@ -2494,6 +2512,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["TKEye"] = {
Name = BabbleZone["The Eye"];
Type = "BCRaid";
Map = "TempestKeepTheEye";
{
Name = BabbleBoss["Al'ar"];
{ 1, 29925, "", "=q4=Phoenix-Wing Cloak", "=ds=#s4#", "", "23%"};
@@ -2615,6 +2634,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
AtlasLoot_Data["ZulAman"] = {
Name = BabbleZone["Zul'Aman"];
Type = "BCRaid";
Map = "ZulAman";
{
Name = BabbleBoss["Nalorakk"];
{ 1, 29434, "", "=q4=Badge of Justice", "=ds=#e15#", "", "100%"};