This commit is contained in:
Bunny67
2018-06-07 22:28:02 +03:00
parent 06fa470c01
commit 8cdf05e91f
@@ -17,7 +17,7 @@ local Media = LibStub("LibSharedMedia-3.0")
AGSMW = AGSMW or {} AGSMW = AGSMW or {}
local next, ipairs = next, ipairs local next, ipairs = next, ipairs
local tinsert, tremove = table.insert, table.remove local getn, setn, tinsert, tremove = table.getn, table.setn, table.insert, table.remove
AceGUIWidgetLSMlists = { AceGUIWidgetLSMlists = {
['font'] = Media:HashTable("font"), ['font'] = Media:HashTable("font"),
@@ -163,22 +163,19 @@ do
self.slider:SetValue(self.slider:GetValue()+(15*dir*-1)) self.slider:SetValue(self.slider:GetValue()+(15*dir*-1))
end end
local numContentRepo = 0
local function AddFrame(self, frame) local function AddFrame(self, frame)
frame:SetParent(self.contentframe) frame:SetParent(self.contentframe)
frame:SetFrameStrata(self:GetFrameStrata()) frame:SetFrameStrata(self:GetFrameStrata())
frame:SetFrameLevel(self:GetFrameLevel() + 100) frame:SetFrameLevel(self:GetFrameLevel() + 100)
if next(self.contentRepo) then if next(self.contentRepo) then
frame:SetPoint("TOPLEFT", self.contentRepo[numContentRepo], "BOTTOMLEFT", 0, 0) frame:SetPoint("TOPLEFT", self.contentRepo[getn(self.contentRepo)], "BOTTOMLEFT", 0, 0)
self.contentframe:SetHeight(self.contentframe:GetHeight() + frame:GetHeight()) self.contentframe:SetHeight(self.contentframe:GetHeight() + frame:GetHeight())
numContentRepo = numContentRepo + 1 tinsert(self.contentRepo, frame)
self.contentRepo[numContentRepo] = frame
else else
self.contentframe:SetHeight(frame:GetHeight()) self.contentframe:SetHeight(frame:GetHeight())
frame:SetPoint("TOPLEFT", self.contentframe, 0, 0) frame:SetPoint("TOPLEFT", self.contentframe, 0, 0)
numContentRepo = 1 tinsert(self.contentRepo, frame)
self.contentRepo[1] = frame
end end
if self.contentframe:GetHeight() > GetScreenHeight()*2/5 - 20 then if self.contentframe:GetHeight() > GetScreenHeight()*2/5 - 20 then
@@ -205,7 +202,7 @@ do
frame:ReturnSelf() frame:ReturnSelf()
self.contentRepo[i] = nil self.contentRepo[i] = nil
end end
numContentRepo = 0 setn(self.contentRepo, 0)
end end
local function slider_OnValueChanged() local function slider_OnValueChanged()