From dda757c661e1623ec9ad5098529f27750d098cbe Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Fri, 8 Jun 2018 16:58:03 +0300 Subject: [PATCH] update AceGUI-3.0-SharedMediaWidgets --- .../AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/FontWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/prototypes.lua | 10 ++++------ 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua index 6c3a678..95284d1 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua @@ -171,7 +171,7 @@ do end f.obj = self f.dropdown = self.dropdown - self.dropdown:AddFrame(f) + self.dropdown:AddFrame(f, i) end wipe(sortedlist) end diff --git a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua index b2cd579..37e2307 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua @@ -166,7 +166,7 @@ do end f.obj = self f.dropdown = self.dropdown - self.dropdown:AddFrame(f) + self.dropdown:AddFrame(f, i) end wipe(sortedlist) end diff --git a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua index 6ba564b..4d2ca99 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua @@ -153,7 +153,7 @@ do f.check:Show() end f.obj = self - self.dropdown:AddFrame(f) + self.dropdown:AddFrame(f, i) end wipe(sortedlist) end diff --git a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua index 3d5ee3f..8d659d0 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua @@ -175,7 +175,7 @@ do f.check:Show() end f.obj = self - self.dropdown:AddFrame(f) + self.dropdown:AddFrame(f, i) end wipe(sortedlist) end diff --git a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua index b7e10cf..363d351 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua @@ -163,7 +163,7 @@ do f.bar:SetTexture(statusbar) f.obj = self f.dropdown = self.dropdown - self.dropdown:AddFrame(f) + self.dropdown:AddFrame(f, i) end wipe(sortedlist) end diff --git a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/prototypes.lua b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/prototypes.lua index 16a9665..06a5509 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/prototypes.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0-SharedMediaWidgets/prototypes.lua @@ -17,7 +17,7 @@ local Media = LibStub("LibSharedMedia-3.0") AGSMW = AGSMW or {} local next, ipairs = next, ipairs -local getn, setn, tinsert, tremove = table.getn, table.setn, table.insert, table.remove +local tinsert, tremove = table.insert, table.remove AceGUIWidgetLSMlists = { ['font'] = Media:HashTable("font"), @@ -163,20 +163,19 @@ do self.slider:SetValue(self.slider:GetValue()+(15*dir*-1)) end - local function AddFrame(self, frame) + local function AddFrame(self, frame, i) frame:SetParent(self.contentframe) frame:SetFrameStrata(self:GetFrameStrata()) frame:SetFrameLevel(self:GetFrameLevel() + 100) if next(self.contentRepo) then - frame:SetPoint("TOPLEFT", self.contentRepo[getn(self.contentRepo)], "BOTTOMLEFT", 0, 0) + frame:SetPoint("TOPLEFT", self.contentRepo[i-1], "BOTTOMLEFT", 0, 0) self.contentframe:SetHeight(self.contentframe:GetHeight() + frame:GetHeight()) - tinsert(self.contentRepo, frame) else self.contentframe:SetHeight(frame:GetHeight()) frame:SetPoint("TOPLEFT", self.contentframe, 0, 0) - tinsert(self.contentRepo, frame) end + self.contentRepo[i] = frame if self.contentframe:GetHeight() > GetScreenHeight()*2/5 - 20 then self.scrollframe:SetWidth(128) @@ -202,7 +201,6 @@ do frame:ReturnSelf() self.contentRepo[i] = nil end - setn(self.contentRepo, 0) end local function slider_OnValueChanged()