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
+53 -46
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 = {
@@ -397,16 +396,10 @@ function AtlasLoot_OnLoad()
AtlasLoot_Expac = xpaclist[GetAccountExpansionLevel()+1];
end
getExpac();
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
@@ -493,19 +493,27 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame, tablenum)
--Ditch the Quicklook selector
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
--[[
@@ -984,20 +983,28 @@ function AtlasLoot_RefreshQuickLookButtons()
end
end
--[[
--[[
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();