made subtable scroll with next/prev buttons if theres more then 1 page
This commit is contained in:
@@ -779,19 +779,8 @@ Called when <-, -> are pressed and calls up the appropriate loot page
|
||||
function AtlasLoot:NavButton_OnClick(self)
|
||||
local tablenum, dataID, dataSource = self.tablenum, self.tablebase[1], self.tablebase[2];
|
||||
if #dataSource[dataID] > 26 then
|
||||
local offset = math.floor(AtlasLootDefaultFrameSubTableScrollScrollBar:GetValue());
|
||||
local min, max = AtlasLootDefaultFrameSubTableScrollScrollBar:GetMinMaxValues();
|
||||
|
||||
|
||||
if self == AtlasLootItemsFrame_NEXT then
|
||||
AtlasLootDefaultFrameSubTableScrollScrollBar:SetValue(offset * math.floor((max / #dataSource[dataID])));
|
||||
--AtlasLootDefaultFrameSubTableScrollScrollBarScrollDownButton:Click()
|
||||
elseif self == AtlasLootItemsFrame_PREV then
|
||||
AtlasLootDefaultFrameSubTableScrollScrollBar:SetValue(offset * math.floor((max / #dataSource[dataID])));
|
||||
--AtlasLootDefaultFrameSubTableScrollScrollBarScrollUpButton:Click()
|
||||
end
|
||||
AtlasLootDefaultFrameSubTableScroll.offset = math.floor(offset / 16.5)
|
||||
--AtlasLoot:SubTableScrollFrameUpdate(dataID, dataSource, tablenum);
|
||||
AtlasLootDefaultFrameSubTableScrollScrollBar:SetValue(tablenum * (max / #dataSource[dataID]));
|
||||
end
|
||||
AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum);
|
||||
end
|
||||
|
||||
@@ -535,7 +535,7 @@ 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)
|
||||
AtlasLoot:SubTableScrollFrameUpdate(subtableFrame.tablename, subtableFrame.dataSource, subtableFrame.pFrame, subtableFrame.tablenum);
|
||||
AtlasLoot:SubTableScrollFrameUpdate(subtableFrame.tablename, subtableFrame.dataSource, subtableFrame.tablenum);
|
||||
end)
|
||||
|
||||
subtableFrame.scrollBar = scrollSlider2
|
||||
|
||||
Reference in New Issue
Block a user