diff --git a/Config/_Gui.lua b/Config/_Gui.lua index 473c71c..431054e 100755 --- a/Config/_Gui.lua +++ b/Config/_Gui.lua @@ -736,7 +736,7 @@ function Gui:OnEnable() size = { key = 'buttons.size', type = 'slider', - label = 'Size', + label = 'Button Size', max = 50, column = 4, order = 1 @@ -744,13 +744,41 @@ function Gui:OnEnable() padding = { key = 'buttons.padding', type = 'slider', - label = 'Padding', + label = 'Button Padding', min = 1, max = 5, column = 4, order = 2 } }, + { + micromenu = { + key = 'micromenu', + type = 'dropdown', + label = 'MicroMenu', + options = { + { value = 'always', text = 'Show always' }, + { value = 'mouseover', text = 'Show on Mouseover' }, + { value = 'hidden', text = 'Hide always' } + }, + initialValue = 1, + column = 5, + order = 1 + }, + bagbuttons = { + key = 'bagbuttons', + type = 'dropdown', + label = 'Bag Buttons', + options = { + { value = 'always', text = 'Show always' }, + { value = 'mouseover', text = 'Show on Mouseover' }, + { value = 'hidden', text = 'Hide always' } + }, + initialValue = 1, + column = 5, + order = 2 + } + }, { header = { type = 'header', @@ -758,39 +786,21 @@ function Gui:OnEnable() }, }, { - mouseoverMicro = { - key = 'menu.mouseovermicro', - type = 'checkbox', - label = 'MicroMenu', - tooltip = 'Show MicroMenu on mouseover', - column = 4, - order = 1 - }, - mouseoverBagButtons = { - key = 'menu.mouseoverbags', - type = 'checkbox', - label = 'BagButtons', - tooltip = 'Show Bag Buttons on mouseover', - column = 4, - order = 2 - }, actionBar3 = { key = 'mouseover.bar3', type = 'checkbox', label = 'ActionBar 3', tooltip = 'Show ActionBar 3 on mouseover', column = 4, - order = 3 - } - }, - { + order = 1 + }, actionBar4 = { key = 'mouseover.bar4', type = 'checkbox', label = 'ActionBar 4', tooltip = 'Show ActionBar 4 on mouseover', column = 4, - order = 1 + order = 2 }, actionBar5 = { key = 'mouseover.bar5', @@ -798,15 +808,17 @@ function Gui:OnEnable() label = 'ActionBar 5', tooltip = 'Show ActionBar 5 on mouseover', column = 4, - order = 2 - }, + order = 3 + } + }, + { stanceBar = { key = 'mouseover.stancebar', type = 'checkbox', label = 'Stance Bar', tooltip = 'Show Stance Bar on mouseover', column = 4, - order = 3 + order = 1 } } }, diff --git a/Core/Init.lua b/Core/Init.lua index 909584f..c4852b0 100755 --- a/Core/Init.lua +++ b/Core/Init.lua @@ -82,11 +82,8 @@ local defaults = { size = 38, padding = 5 }, - menu = { - style = 'Default', - mouseovermicro = false, - mouseoverbags = false, - }, + micromenu = 'mouseover', + bagbuttons = 'mouseover', mouseover = { bar3 = false, bar4 = false, diff --git a/Modules/ActionBars/_Menu.lua b/Modules/ActionBars/_Menu.lua index a328c01..7dbd2ba 100644 --- a/Modules/ActionBars/_Menu.lua +++ b/Modules/ActionBars/_Menu.lua @@ -3,12 +3,12 @@ local Module = SUI:NewModule("ActionBars.Menu"); function Module:OnEnable() local db = { style = SUI.db.profile.actionbar.style, - mouseovermicro = SUI.db.profile.actionbar.menu.mouseovermicro, - mouseoverbags = SUI.db.profile.actionbar.menu.mouseoverbags, + micromenu = SUI.db.profile.actionbar.micromenu, + bagbuttons = SUI.db.profile.actionbar.bagbuttons, module = SUI.db.profile.modules.actionbar } - if ((db.style == 'Small' or db.style == 'BFA' or db.style == 'BFATransparent') and (db.module)) then + if ((db.style == 'Small' or db.style == 'BFA' or db.style == 'BFATransparent') and db.module) then -- Bag Buttons Table local BagButtons = { MainMenuBarBackpackButton, @@ -68,30 +68,32 @@ function Module:OnEnable() end -- MicroMenu Position - MoveMicroButtons("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -275, 0) + if (db.micromenu ~= 'hidden') then + MoveMicroButtons("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -275, 0) - local vehicle = CreateFrame("Frame") - vehicle:RegisterEvent("UNIT_ENTERED_VEHICLE") - vehicle:RegisterEvent("UNIT_EXITED_VEHICLE") - vehicle:HookScript("OnEvent", function(self, event, unit) - if unit == "player" then - if event == "UNIT_EXITED_VEHICLE" then - MoveMicroButtons("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -275, 0) - if (GetNumShapeshiftForms() > 0) then - SUIStanceBar:Show() + local vehicle = CreateFrame("Frame") + vehicle:RegisterEvent("UNIT_ENTERED_VEHICLE") + vehicle:RegisterEvent("UNIT_EXITED_VEHICLE") + vehicle:HookScript("OnEvent", function(self, event, unit) + if unit == "player" then + if event == "UNIT_EXITED_VEHICLE" then + MoveMicroButtons("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -275, 0) + if (GetNumShapeshiftForms() > 0) then + SUIStanceBar:Show() + end + else + SUIStanceBar:Hide() end - else - SUIStanceBar:Hide() end - end - end) + end) + end -- Bag Buttons Position MainMenuBarBackpackButton:ClearAllPoints() MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -2.5, 40) -- MicroMenu Mouseover - if (db.mouseovermicro) then + if (db.micromenu == 'mouseover') then for _, frame in ipairs(MICRO_BUTTONS) do frame = _G[frame] hooksecurefunc(frame, "SetAlpha", setFrameAlpha) @@ -103,10 +105,14 @@ function Module:OnEnable() end) frame:SetAlpha(0) end + elseif (db.micromenu == 'hidden') then + for _, frame in ipairs(MICRO_BUTTONS) do + _G[frame]:Hide() + end end -- Bag Buttons Mouseover - if (db.mouseoverbags) then + if (db.bagbuttons == 'mouseover') then -- Bags bar for frame, _ in pairs(BagButtons) do frame = BagButtons[frame] @@ -120,6 +126,11 @@ function Module:OnEnable() end) frame:SetAlpha(0) end + elseif (db.bagbuttons == 'hidden') then + for frame, _ in pairs(BagButtons) do + frame = BagButtons[frame] + frame:Hide() + end end end end \ No newline at end of file