From ab31f49b35748d77158bf091784e4b6bfc2c6a56 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 26 Oct 2012 15:01:22 +0400 Subject: [PATCH] some stuff to make uibuttons.lua smaller --- ElvUI_SLE/modules/uibuttons/uibuttons.lua | 33 +++++++++++++---------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/ElvUI_SLE/modules/uibuttons/uibuttons.lua b/ElvUI_SLE/modules/uibuttons/uibuttons.lua index 17fb87f..2c48046 100644 --- a/ElvUI_SLE/modules/uibuttons/uibuttons.lua +++ b/ElvUI_SLE/modules/uibuttons/uibuttons.lua @@ -14,6 +14,14 @@ if IsAddOnLoaded("iFilger_ConfigUI") then NumBut = 6 end +local ButtonTable = { +Cbutton, +Rbutton, +Mbutton, +Bbutton, +Abutton, +} + function UB:CreateFrame() UIBFrame:SetFrameLevel(5); UIBFrame:SetFrameStrata('BACKGROUND'); @@ -76,19 +84,11 @@ end function UB:FrameSize() local db = E.db.sle.uibuttons - if db.position == "uib_vert" then - UIBFrame:SetWidth(db.size + 8) - UIBFrame:SetHeight((db.size + 5) * NumBut + 3) - else - UIBFrame:SetWidth((db.size + 5) * NumBut + 3) - UIBFrame:SetHeight(db.size + 8) - end + UB:MoverSize() - Cbutton:Size(db.size) - Rbutton:Size(db.size) - Mbutton:Size(db.size) - Bbutton:Size(db.size) - Abutton:Size(db.size) + for i = 1, 5 do + ButtonTable[i]:Size(db.size) + end if Fbutton then Fbutton:Size(db.size) end @@ -98,11 +98,9 @@ end function UB:Positioning() local db = E.db.sle.uibuttons - Cbutton:ClearAllPoints() - Rbutton:ClearAllPoints() - Mbutton:ClearAllPoints() - Bbutton:ClearAllPoints() - Abutton:ClearAllPoints() + for i = 1, 5 do + ButtonTable[i]:ClearAllPoints() + end if Fbutton then Fbutton:ClearAllPoints() end @@ -161,7 +159,6 @@ end function UB:UpdateAll() UB:FrameSize() - UB:MoverSize() UB:Start() end -- 1.7.9.5