From 0d7c70b35a421de45336fd08823795cebba0af8a Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sun, 9 Oct 2016 12:06:37 +0300 Subject: [PATCH] init --- .../actionbars/ClickThroughActionBars.lua | 108 ++++++ .../Categories/actionbars/PushedColor.lua | 61 +++ .../Categories/actionbars/load_tweaks.xml | 4 + .../Categories/bags/BagButtons.lua | 357 ++++++++++++++++++ .../Categories/bags/load_tweaks.xml | 3 + .../Categories/chat/MaxLines.lua | 46 +++ .../Categories/chat/load_tweaks.xml | 3 + .../Categories/datatexts/BagsTextFormat.lua | 90 +++++ .../Categories/datatexts/load_tweaks.xml | 3 + .../Categories/load_categories.xml | 9 + .../Categories/minimap/MinimapSizeLimits.lua | 9 + .../Categories/minimap/load_tweaks.xml | 3 + .../Categories/misc/NoBorders.lua | 81 ++++ .../Categories/misc/RaidControl.lua | 61 +++ .../Categories/misc/load_tweaks.xml | 4 + .../Categories/unitframes/AuraIconSpacing.lua | 178 +++++++++ .../Categories/unitframes/AuraIconText.lua | 301 +++++++++++++++ .../unitframes/CastbarCustomBackdrop.lua | 126 +++++++ .../Categories/unitframes/CastbarText.lua | 322 ++++++++++++++++ .../Categories/unitframes/PowerBarTexture.lua | 79 ++++ .../unitframes/UnitframeSpacingLimits.lua | 14 + .../Categories/unitframes/load_tweaks.xml | 8 + ElvUI_CustomTweaks/ElvUI_CustomTweaks.toc | 12 + ElvUI_CustomTweaks/LICENSE.txt | 19 + ElvUI_CustomTweaks/core.lua | 251 ++++++++++++ ElvUI_CustomTweaks/locales.lua | 167 ++++++++ 26 files changed, 2319 insertions(+) create mode 100644 ElvUI_CustomTweaks/Categories/actionbars/ClickThroughActionBars.lua create mode 100644 ElvUI_CustomTweaks/Categories/actionbars/PushedColor.lua create mode 100644 ElvUI_CustomTweaks/Categories/actionbars/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/Categories/bags/BagButtons.lua create mode 100644 ElvUI_CustomTweaks/Categories/bags/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/Categories/chat/MaxLines.lua create mode 100644 ElvUI_CustomTweaks/Categories/chat/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/Categories/datatexts/BagsTextFormat.lua create mode 100644 ElvUI_CustomTweaks/Categories/datatexts/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/Categories/load_categories.xml create mode 100644 ElvUI_CustomTweaks/Categories/minimap/MinimapSizeLimits.lua create mode 100644 ElvUI_CustomTweaks/Categories/minimap/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/Categories/misc/NoBorders.lua create mode 100644 ElvUI_CustomTweaks/Categories/misc/RaidControl.lua create mode 100644 ElvUI_CustomTweaks/Categories/misc/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/AuraIconSpacing.lua create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/AuraIconText.lua create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/CastbarCustomBackdrop.lua create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/CastbarText.lua create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/PowerBarTexture.lua create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/UnitframeSpacingLimits.lua create mode 100644 ElvUI_CustomTweaks/Categories/unitframes/load_tweaks.xml create mode 100644 ElvUI_CustomTweaks/ElvUI_CustomTweaks.toc create mode 100644 ElvUI_CustomTweaks/LICENSE.txt create mode 100644 ElvUI_CustomTweaks/core.lua create mode 100644 ElvUI_CustomTweaks/locales.lua diff --git a/ElvUI_CustomTweaks/Categories/actionbars/ClickThroughActionBars.lua b/ElvUI_CustomTweaks/Categories/actionbars/ClickThroughActionBars.lua new file mode 100644 index 0000000..071ff27 --- /dev/null +++ b/ElvUI_CustomTweaks/Categories/actionbars/ClickThroughActionBars.lua @@ -0,0 +1,108 @@ +local E, L, V, P, G = unpack(ElvUI) +local AB = E:GetModule("ActionBars") +local CT = E:GetModule("CustomTweaks") +local isEnabled = E.private["actionbar"].enable and E.private["CustomTweaks"] and E.private["CustomTweaks"]["ClickThroughActionBars"] and true or false + +--Cache global variables +local _G = _G +local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS +local NUM_PET_ACTION_SLOTS = NUM_PET_ACTION_SLOTS +local NUM_SHAPESHIFT_SLOTS = NUM_SHAPESHIFT_SLOTS + +--- +-- GLOBALS: IsAddOnLoaded, ElvUI_StanceBar, ElvUI_BarPet +--- + +P["CustomTweaks"]["ClickThroughActionBars"] = { + ["bar1"] = false, + ["bar2"] = false, + ["bar3"] = false, + ["bar4"] = false, + ["bar5"] = false, + ["bar6"] = false, + ["bar7"] = false, + ["bar8"] = false, + ["bar9"] = false, + ["bar10"] = false, + ["barPet"] = false, + ["stanceBar"] = false, +} + +local function ConfigTable() + E.Options.args.CustomTweaks.args.Actionbar.args.options.args.ClickThroughActionBars = { + type = "group", + name = "ClickThroughActionBars", + args = { + barPet = { + order = 11, + type = "toggle", + name = L["Pet Bar"], + disabled = function() return not isEnabled end, + get = function(info) return E.db.CustomTweaks["ClickThroughActionBars"]["barPet"] end, + set = function(info, value) E.db.CustomTweaks["ClickThroughActionBars"]["barPet"] = value; AB:PositionAndSizeBarPet() end, + }, + stanceBar = { + order = 12, + type = "toggle", + name = L["Stance Bar"], + disabled = function() return not isEnabled end, + get = function(info) return E.db.CustomTweaks["ClickThroughActionBars"]["stanceBar"] end, + set = function(info, value) E.db.CustomTweaks["ClickThroughActionBars"]["stanceBar"] = value; AB:PositionAndSizeBarShapeShift() end, + }, + }, + } + + local numBars = 6 + if IsAddOnLoaded("ElvUI_ExtraActionBars") then + numBars = 10 + end + + for i = 1, numBars do + E.Options.args.CustomTweaks.args.Actionbar.args.options.args.ClickThroughActionBars.args["bar"..i] = { + order = i, + type = "toggle", + name = L["Bar "]..i, + disabled = function() return not isEnabled end, + get = function(info) return E.db.CustomTweaks["ClickThroughActionBars"]["bar"..i] end, + set = function(info, value) E.db.CustomTweaks["ClickThroughActionBars"]["bar"..i] = value; AB:PositionAndSizeBar("bar"..i) end, + } + end +end +CT.Configs["ClickThroughActionBars"] = ConfigTable +if not isEnabled then return; end + +local function PositionAndSizeBar(self, barName) + local clickThrough = E.db.CustomTweaks.ClickThroughActionBars[barName] + local bar = AB["handledBars"][barName] + local button + + bar:EnableMouse(not clickThrough) + for i=1, NUM_ACTIONBAR_BUTTONS do + button = bar.buttons[i]; + button:EnableMouse(not clickThrough) + end +end + +local function PositionAndSizeBarShapeShift(self) + ElvUI_StanceBar:EnableMouse(not E.db.CustomTweaks.ClickThroughActionBars.stanceBar) + + local button + for i=1, NUM_SHAPESHIFT_SLOTS do + button = _G["ElvUI_StanceBarButton"..i]; + button:EnableMouse(not E.db.CustomTweaks.ClickThroughActionBars.stanceBar) + end +end + +local function PositionAndSizeBarPet(self) + ElvUI_BarPet:EnableMouse(not E.db.CustomTweaks.ClickThroughActionBars.barPet) + + local button + for i=1, NUM_PET_ACTION_SLOTS do + button = _G["PetActionButton"..i]; + button:EnableMouse(not E.db.CustomTweaks.ClickThroughActionBars.barPet) + end +end + +hooksecurefunc(AB, "PositionAndSizeBar", PositionAndSizeBar) +hooksecurefunc(AB, "PositionAndSizeBarShapeShift", PositionAndSizeBarShapeShift) +hooksecurefunc(AB, "PositionAndSizeBarPet", PositionAndSizeBarPet) \ No newline at end of file diff --git a/ElvUI_CustomTweaks/Categories/actionbars/PushedColor.lua b/ElvUI_CustomTweaks/Categories/actionbars/PushedColor.lua new file mode 100644 index 0000000..781cafe --- /dev/null +++ b/ElvUI_CustomTweaks/Categories/actionbars/PushedColor.lua @@ -0,0 +1,61 @@ +local E, L, V, P, G = unpack(ElvUI) +local AB = E:GetModule("ActionBars") +local CT = E:GetModule("CustomTweaks") +local isEnabled = E.private["actionbar"].enable and E.private["CustomTweaks"] and E.private["CustomTweaks"]["PushedColor"] and true or false + +--Cache global variables +local pairs = pairs + +P["CustomTweaks"]["PushedColor"] = { + ["Color"] = {r = 1, g = 0, b = 0, a = 0.3}, +} + +local function UpdateBars() + for barName in pairs(AB["handledBars"]) do + AB:PositionAndSizeBar(barName) + end + AB:PositionAndSizeBarPet() + AB:PositionAndSizeBarShapeShift() +end + +local function ConfigTable() + E.Options.args.CustomTweaks.args.Actionbar.args.options.args.PushedColor = { + type = "group", + name = "PushedColor", + args = { + color = { + order = 1, + type = "color", + name = L["Color"], + disabled = function() return not isEnabled end, + hasAlpha = true, + get = function(info) + local t = E.db.CustomTweaks.PushedColor.Color + local d = P.CustomTweaks.PushedColor.Color + return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a + end, + set = function(info, r, g, b, a) + E.db.CustomTweaks.PushedColor.Color = {} + local t = E.db.CustomTweaks.PushedColor.Color + t.r, t.g, t.b, t.a = r, g, b, a + UpdateBars() + end, + }, + }, + } +end +CT.Configs["PushedColor"] = ConfigTable +if not isEnabled then return; end + +local function StyleButton(self, button, noBackdrop, adjustChecked) + if button.SetPushedTexture then + local c = E.db.CustomTweaks.PushedColor.Color + local r, g, b, a = c.r, c.g, c.b, c.a + local pushedmod = button:CreateTexture("frame", nil, self) + pushedmod:SetTexture(r, g, b, a) + pushedmod:SetInside() + button.pushedmod = pushedmod + button:SetPushedTexture(pushedmod) + end +end +hooksecurefunc(AB, "StyleButton", StyleButton) \ No newline at end of file diff --git a/ElvUI_CustomTweaks/Categories/actionbars/load_tweaks.xml b/ElvUI_CustomTweaks/Categories/actionbars/load_tweaks.xml new file mode 100644 index 0000000..25f50a3 --- /dev/null +++ b/ElvUI_CustomTweaks/Categories/actionbars/load_tweaks.xml @@ -0,0 +1,4 @@ + +