diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index 04e485b..6399d93 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -50,9 +50,46 @@ local MOD = {}; LOCAL VARS ########################################################## ]]-- -local invertMap1 = {DOWN_RIGHT = "TOPLEFT", DOWN_LEFT = "TOPRIGHT", UP_RIGHT = "BOTTOMLEFT", UP_LEFT = "BOTTOMRIGHT", RIGHT_DOWN = "TOPLEFT", RIGHT_UP = "BOTTOMLEFT", LEFT_DOWN = "TOPRIGHT", LEFT_UP = "BOTTOMRIGHT"}; -local showMap1 = {DOWN_RIGHT = 1, DOWN_LEFT = -1, UP_RIGHT = 1, UP_LEFT = -1, RIGHT_DOWN = 1, RIGHT_UP = 1, LEFT_DOWN = -1, LEFT_UP = -1}; -local showMap2 = {DOWN_RIGHT = -1, DOWN_LEFT = -1, UP_RIGHT = 1, UP_LEFT = 1, RIGHT_DOWN = -1, RIGHT_UP = 1, LEFT_DOWN = -1, LEFT_UP = 1}; +local DIRECTION_TO_POINT = { + DOWN_RIGHT = "TOPLEFT", + DOWN_LEFT = "TOPRIGHT", + UP_RIGHT = "BOTTOMLEFT", + UP_LEFT = "BOTTOMRIGHT", + RIGHT_DOWN = "TOPLEFT", + RIGHT_UP = "BOTTOMLEFT", + LEFT_DOWN = "TOPRIGHT", + LEFT_UP = "BOTTOMRIGHT", +} + +local DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER = { + DOWN_RIGHT = 1, + DOWN_LEFT = -1, + UP_RIGHT = 1, + UP_LEFT = -1, + RIGHT_DOWN = 1, + RIGHT_UP = 1, + LEFT_DOWN = -1, + LEFT_UP = -1, +} + +local DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER = { + DOWN_RIGHT = -1, + DOWN_LEFT = -1, + UP_RIGHT = 1, + UP_LEFT = 1, + RIGHT_DOWN = -1, + RIGHT_UP = 1, + LEFT_DOWN = -1, + LEFT_UP = 1, +} + +local IS_HORIZONTAL_GROWTH = { + RIGHT_DOWN = true, + RIGHT_UP = true, + LEFT_DOWN = true, + LEFT_UP = true, +} + local AURA_FADE_TIME = 5; local AURA_ICONS = { [[Interface\Addons\SVUI\assets\artwork\Icons\AURA-STATS]], @@ -443,49 +480,54 @@ end function MOD:UpdateAuraHeader(auraHeader, auraType) if(InCombatLockdown() or not auraHeader) then return end - local db = MOD.db[auraType] + + local db = self.db[auraType] local showBy = db.showBy - local font = SV.Shared:Fetch("font", MOD.db.font) - if auraHeader:GetAttribute("filter") == "HELPFUL" then - db = MOD.db.buffs; - auraHeader:SetAttribute("consolidateTo", MOD.db.hyperBuffs.enable == true and 1 or 0) + local font = SV.Shared:Fetch("font", self.db.font) + + if auraType == "buffs" then + auraHeader:SetAttribute("consolidateTo", self.db.hyperBuffs.enable == true and 1 or 0) auraHeader:SetAttribute("weaponTemplate", ("SVUI_AuraTemplate%d"):format(db.size)) - end + end + auraHeader:SetAttribute("separateOwn", db.isolate) auraHeader:SetAttribute("sortMethod", db.sortMethod) auraHeader:SetAttribute("sortDir", db.sortDir) auraHeader:SetAttribute("maxWraps", db.maxWraps) auraHeader:SetAttribute("wrapAfter", db.wrapAfter) - auraHeader:SetAttribute("point", invertMap1[showBy]) - if(showBy == "RIGHT_DOWN" or showBy == "RIGHT_UP" or showBy == "LEFT_DOWN" or showBy == "LEFT_UP") then + auraHeader:SetAttribute("point", DIRECTION_TO_POINT[showBy]) + + if(IS_HORIZONTAL_GROWTH[showBy]) then auraHeader:SetAttribute("minWidth", ((db.wrapAfter == 1 and 0 or db.wrapXOffset) + db.size) * db.wrapAfter) auraHeader:SetAttribute("minHeight", (db.wrapYOffset + db.size) * db.maxWraps) - auraHeader:SetAttribute("xOffset", showMap1[showBy] * (db.wrapXOffset + db.size)) + auraHeader:SetAttribute("xOffset", DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[showBy] * (db.wrapXOffset + db.size)) auraHeader:SetAttribute("yOffset", 0) - auraHeader:SetAttribute("wrapOffsetH", 0) - auraHeader:SetAttribute("wrapOffsetV", showMap2[showBy] * (db.wrapYOffset + db.size)) + auraHeader:SetAttribute("wrapXOffset", 0) + auraHeader:SetAttribute("wrapYOffset", DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[showBy] * (db.wrapYOffset + db.size)) else auraHeader:SetAttribute("minWidth", (db.wrapXOffset + db.size) * db.maxWraps) auraHeader:SetAttribute("minHeight", ((db.wrapAfter == 1 and 0 or db.wrapYOffset) + db.size) * db.wrapAfter) auraHeader:SetAttribute("xOffset", 0) - auraHeader:SetAttribute("yOffset", showMap2[showBy] * (db.wrapYOffset + db.size)) - auraHeader:SetAttribute("wrapOffsetH", showMap1[showBy] * (db.wrapXOffset + db.size)) - auraHeader:SetAttribute("wrapOffsetV", 0) + auraHeader:SetAttribute("yOffset", DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[showBy] * (db.wrapYOffset + db.size)) + auraHeader:SetAttribute("wrapXOffset", DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[showBy] * (db.wrapXOffset + db.size)) + auraHeader:SetAttribute("wrapYOffset", 0) end auraHeader:SetAttribute("template", ("SVUI_AuraTemplate%d"):format(db.size)) + local i = 1; local auraChild = select(i, auraHeader:GetChildren()) + while(auraChild) do if ((floor(auraChild:GetWidth() * 100 + 0.5) / 100) ~= db.size) then auraChild:SetSize(db.size, db.size) end if(auraChild.time) then auraChild.time:ClearAllPoints() - auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + MOD.db.timeOffsetH, MOD.db.timeOffsetV) + auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + self.db.timeOffsetH, self.db.timeOffsetV) auraChild.count:ClearAllPoints() - auraChild.count:SetPoint("BOTTOMRIGHT", -1 + MOD.db.countOffsetH, MOD.db.countOffsetV) + auraChild.count:SetPoint("BOTTOMRIGHT", -1 + self.db.countOffsetH, self.db.countOffsetV) end if (i > (db.maxWraps * db.wrapAfter) and auraChild:IsShown()) then auraChild:Hide() diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index a4217d3..21b1c2f 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -573,12 +573,12 @@ end do local function Bags_OnEnter() if MOD.db.bagBar.mouseover ~= true then return end - UIFrameFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) + SV:SecureFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) end local function Bags_OnLeave() if MOD.db.bagBar.mouseover ~= true then return end - UIFrameFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) + SV:SecureFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) end local function AlterBagBar(bar) @@ -593,93 +593,112 @@ do end local function LoadBagBar() - if MOD.BagBarLoaded then return end + if MOD.BagBarLoaded then return end + local bar = NewFrame("Frame", "SVUI_BagBar", SV.UIParent) bar:SetPoint("TOPRIGHT", RightSuperDock, "TOPLEFT", -4, 0) bar.buttons = {} - bar:SetPanelTemplate() bar:EnableMouse(true) bar:SetScript("OnEnter", Bags_OnEnter) bar:SetScript("OnLeave", Bags_OnLeave) + MainMenuBarBackpackButton:SetParent(bar) - MainMenuBarBackpackButton.SetParent = SV.dummy; + MainMenuBarBackpackButton.SetParent = SV.Cloaked; MainMenuBarBackpackButton:ClearAllPoints() MainMenuBarBackpackButtonCount:SetFontTemplate(nil, 10) MainMenuBarBackpackButtonCount:ClearAllPoints() MainMenuBarBackpackButtonCount:Point("BOTTOMRIGHT", MainMenuBarBackpackButton, "BOTTOMRIGHT", -1, 4) MainMenuBarBackpackButton:HookScript("OnEnter", Bags_OnEnter) MainMenuBarBackpackButton:HookScript("OnLeave", Bags_OnLeave) + tinsert(bar.buttons, MainMenuBarBackpackButton) AlterBagBar(MainMenuBarBackpackButton) + local count = #bar.buttons local frameCount = NUM_BAG_FRAMES - 1; + for i = 0, frameCount do local bagSlot = _G["CharacterBag"..i.."Slot"] bagSlot:SetParent(bar) - bagSlot.SetParent = SV.dummy; + bagSlot.SetParent = SV.Cloaked; bagSlot:HookScript("OnEnter", Bags_OnEnter) bagSlot:HookScript("OnLeave", Bags_OnLeave) AlterBagBar(bagSlot) count = count + 1 bar.buttons[count] = bagSlot - end - SV:SetSVMovable(bar, L["Bags"]) + end + MOD.BagBarLoaded = true end function MOD:ModifyBagBar() - if not SV.db.SVBag.bagBar.enable then return end - if not MOD.BagBarLoaded then + if not SV.db.SVBag.bagBar.enable then return end + + if not self.BagBarLoaded then LoadBagBar() end - if MOD.db.bagBar.mouseover then + if self.db.bagBar.mouseover then SVUI_BagBar:SetAlpha(0) else SVUI_BagBar:SetAlpha(1) end - if MOD.db.bagBar.showBackdrop then - SVUI_BagBar.Panel:Show() - else - SVUI_BagBar.Panel:Hide() - end + + local showBy = self.db.bagBar.showBy + local sortDir = self.db.bagBar.sortDirection + local bagSize = self.db.bagBar.size + local bagSpacing = self.db.bagBar.spacing + for i = 1, #SVUI_BagBar.buttons do local button = SVUI_BagBar.buttons[i] local lastButton = SVUI_BagBar.buttons[i - 1] - button:Size(MOD.db.bagBar.size) + + button:Size(bagSize) button:ClearAllPoints() - if MOD.db.bagBar.showBy == "HORIZONTAL" and MOD.db.bagBar.sortDirection == "ASCENDING" then + + if(showBy == "HORIZONTAL" and sortDir == "ASCENDING") then if i == 1 then - button:SetPoint("LEFT", SVUI_BagBar, "LEFT", MOD.db.bagBar.spacing, 0) + button:SetPoint("LEFT", SVUI_BagBar, "LEFT", bagSpacing, 0) elseif lastButton then - button:SetPoint("LEFT", lastButton, "RIGHT", MOD.db.bagBar.spacing, 0) + button:SetPoint("LEFT", lastButton, "RIGHT", bagSpacing, 0) end - elseif MOD.db.bagBar.showBy == "VERTICAL" and MOD.db.bagBar.sortDirection == "ASCENDING" then + elseif(showBy == "VERTICAL" and sortDir == "ASCENDING") then if i == 1 then - button:SetPoint("TOP", SVUI_BagBar, "TOP", 0, -MOD.db.bagBar.spacing) + button:SetPoint("TOP", SVUI_BagBar, "TOP", 0, -bagSpacing) elseif lastButton then - button:SetPoint("TOP", lastButton, "BOTTOM", 0, -MOD.db.bagBar.spacing) + button:SetPoint("TOP", lastButton, "BOTTOM", 0, -bagSpacing) end - elseif MOD.db.bagBar.showBy == "HORIZONTAL" and MOD.db.bagBar.sortDirection == "DESCENDING" then + elseif(showBy == "HORIZONTAL" and sortDir == "DESCENDING") then if i == 1 then - button:SetPoint("RIGHT", SVUI_BagBar, "RIGHT", -MOD.db.bagBar.spacing, 0) + button:SetPoint("RIGHT", SVUI_BagBar, "RIGHT", -bagSpacing, 0) elseif lastButton then - button:SetPoint("RIGHT", lastButton, "LEFT", -MOD.db.bagBar.spacing, 0) + button:SetPoint("RIGHT", lastButton, "LEFT", -bagSpacing, 0) end else if i == 1 then - button:SetPoint("BOTTOM", SVUI_BagBar, "BOTTOM", 0, MOD.db.bagBar.spacing) + button:SetPoint("BOTTOM", SVUI_BagBar, "BOTTOM", 0, bagSpacing) elseif lastButton then - button:SetPoint("BOTTOM", lastButton, "TOP", 0, MOD.db.bagBar.spacing) + button:SetPoint("BOTTOM", lastButton, "TOP", 0, bagSpacing) end end end - if MOD.db.bagBar.showBy == "HORIZONTAL" then - SVUI_BagBar:Width(MOD.db.bagBar.size * numBagFrame + MOD.db.bagBar.spacing * numBagFrame + MOD.db.bagBar.spacing) - SVUI_BagBar:Height(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) + if showBy == "HORIZONTAL" then + SVUI_BagBar:Width((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) + SVUI_BagBar:Height(bagSize + (bagSpacing * 2)) else - SVUI_BagBar:Height(MOD.db.bagBar.size * numBagFrame + MOD.db.bagBar.spacing * numBagFrame + MOD.db.bagBar.spacing) - SVUI_BagBar:Width(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) - end + SVUI_BagBar:Height((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) + SVUI_BagBar:Width(bagSize + (bagSpacing * 2)) + end + + if not SVUI_BagBar_MOVE then + SVUI_BagBar:SetPanelTemplate("Default") + SV:SetSVMovable(SVUI_BagBar, L["Bags Bar"]) + end + + if self.db.bagBar.showBackdrop then + SVUI_BagBar.Panel:Show() + else + SVUI_BagBar.Panel:Hide() + end end end --[[ diff --git a/Interface/AddOns/SVUI/system/global.lua b/Interface/AddOns/SVUI/system/global.lua index ca4d379..ce33783 100644 --- a/Interface/AddOns/SVUI/system/global.lua +++ b/Interface/AddOns/SVUI/system/global.lua @@ -346,8 +346,8 @@ end local Core_TaintHandler = function(self, taint, sourceName, sourceFunc) if GetCVarBool('scriptErrors') ~= 1 then return end local errorString = ("Error Captured: %s->%s->{%s}"):format(taint, sourceName or "Unknown", sourceFunc or "Unknown") - SV:AddonMessage(errorString) - SV:StaticPopup_Show("TAINT_RL") + self:AddonMessage(errorString) + self:StaticPopup_Show("TAINT_RL") end local function _sendmessage(msg, prefix) diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua index a40f619..a87eb28 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua @@ -146,7 +146,7 @@ SV.Options.args.SVBag = { type = "input", width = "full", multiline = true, - set = function(a,b)SV.db.SVBag[a[#a]] = b end + set = function(a,b) SV.db.SVBag[a[#a]] = b end } } }, @@ -237,21 +237,21 @@ SV.Options.args.SVBag = { } }, - bagBar={ - order=4, - type="group", - name=L["Bag-Bar"], + bagBar = { + order = 4, + type = "group", + name = L["Bag-Bar"], guiInline = true, - get=function(a)return SV.db.SVBag.bagBar[a[#a]]end, - set=function(a,b)SV.db.SVBag.bagBar[a[#a]]=b;MOD:ModifyBagBar()end, + get = function(key) return SV.db.SVBag.bagBar[key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bagBar"); MOD:ModifyBagBar() end, args={ enable = { order = 1, type = "toggle", name = L["Enable"], desc = L["Enable/Disable the Bag-Bar."], - get = function(a)return SV.db.SVBag.bagBar end, - set = function(a,b)SV.db.SVBag.bagBar = b;SV:StaticPopup_Show("RL_CLIENT")end + get = function() return SV.db.SVBag.bagBar.enable end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bagBar"); SV:StaticPopup_Show("RL_CLIENT")end }, mouseover = { order = 2, @@ -259,8 +259,14 @@ SV.Options.args.SVBag = { desc = L["Hidden unless you mouse over the frame."], type = "toggle" }, - size = { + showBackdrop = { order = 3, + name = L["Backdrop"], + desc = L["Show/Hide bag bar backdrop"], + type = "toggle" + }, + size = { + order = 4, type = "range", name = L["Button Size"], desc = L["Set the size of your bag buttons."], @@ -269,7 +275,7 @@ SV.Options.args.SVBag = { step = 1 }, spacing = { - order = 4, + order = 5, type = "range", name = L["Button Spacing"], desc = L["The spacing between buttons."], @@ -278,7 +284,7 @@ SV.Options.args.SVBag = { step = 1 }, sortDirection = { - order = 5, + order = 6, type = "select", name = L["Sort Direction"], desc = L["The direction that the bag frames will grow from the anchor."], @@ -288,7 +294,7 @@ SV.Options.args.SVBag = { } }, showBy = { - order = 6, + order = 7, type = "select", name = L["Bar Direction"], desc = L["The direction that the bag frames be (Horizontal or Vertical)."], diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index 981718a..eac7d11 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -64,7 +64,7 @@ PLUGIN.OptionsCache = { type = "group", name = "Addon Styling", get = function(a)return SV.db[SCHEMA].addons[a[#a]] end, - set = function(a,b)SV.db[SCHEMA].addons[a[#a]] = b;SV:StaticPopup_Show("RL_CLIENT")end, + set = function(a,b) SV.db[SCHEMA].addons[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT")end, disabled = function()return not SV.db[SCHEMA].addons.enable end, guiInline = true, args = { @@ -221,7 +221,7 @@ function PLUGIN:AppendAddonOption(addon) name = addon, desc = L["Addon Styling"], get = function(key) return self:IsAddonReady(key[#key]) end, - set = function(key,value) self:ChangeDBVar(value, key[#key]); SV:StaticPopup_Show("RL_CLIENT") end, + set = function(key,value) self:ChangeDBVar(value, key[#key], "addons"); SV:StaticPopup_Show("RL_CLIENT") end, disabled = function() if addon then return not IsAddOnLoaded(addon) @@ -419,25 +419,27 @@ function PLUGIN:Load() order = 2, type = "toggle", name = "Standard UI Styling", - get = function(a)return SV.db[SCHEMA].blizzard.enable end, - set = function(a,b)SV.db[SCHEMA].blizzard.enable = b;SV:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SV.db.SVStyle.blizzard.enable end, + set = function(a,b) SV.db.SVStyle.blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("blizzardEnable", option) + option = { order = 3, type = "toggle", name = "Addon Styling", - get = function(a)return SV.db[SCHEMA].addons.enable end, - set = function(a,b)SV.db[SCHEMA].addons.enable = b;SV:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SV.db.SVStyle.addons.enable end, + set = function(a,b) SV.db.SVStyle.addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("addonEnable", option) + option = { order = 300, type = "group", name = "Individual Mods", - get = function(a)return SV.db[SCHEMA].blizzard[a[#a]]end, - set = function(a,b)SV.db[SCHEMA].blizzard[a[#a]] = b;SV:StaticPopup_Show("RL_CLIENT")end, - disabled = function()return not SV.db[SCHEMA].blizzard.enable end, + get = function(a)return SV.db.SVStyle.blizzard[a[#a]]end, + set = function(a,b) SV.db.SVStyle.blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, + disabled = function() return not SV.db.SVStyle.blizzard.enable end, guiInline = true, args = { bmah = {