added options to hide the hotkey and macrotext
This commit is contained in:
@@ -19,6 +19,8 @@ do
|
||||
buttons = "Buttons",
|
||||
enabled = "Enabled",
|
||||
grid = "Grid",
|
||||
macrotext = "HideMacroText",
|
||||
hotkey = "HideHotkey",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the modules actionbars table
|
||||
@@ -92,6 +94,27 @@ function module:GetOptionsObject()
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hidedesc = {
|
||||
order = 80,
|
||||
name = "Button Look",
|
||||
type = "header",
|
||||
},
|
||||
macrotext = {
|
||||
order = 81,
|
||||
type = "toggle",
|
||||
name = "Hide Macro Text",
|
||||
desc = "Hide the Macro Text on the buttons of this bar.",
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hotkey = {
|
||||
order = 82,
|
||||
type = "toggle",
|
||||
name = "Hide Hotkey",
|
||||
desc = "Hide the Hotkey on the buttons of this bar.",
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
}
|
||||
obj:AddElementGroup("general", cat_general)
|
||||
|
||||
@@ -218,6 +241,28 @@ function ActionBar:SetGrid(state)
|
||||
end
|
||||
end
|
||||
|
||||
function ActionBar:SetHideMacroText(state)
|
||||
if state ~= nil then
|
||||
self.config.hidemacrotext = state
|
||||
end
|
||||
self:ForAll("Update")
|
||||
end
|
||||
|
||||
function ActionBar:GetHideMacroText()
|
||||
return self.config.hidemacrotext
|
||||
end
|
||||
|
||||
function ActionBar:SetHideHotkey(state)
|
||||
if state ~= nil then
|
||||
self.config.hidehotkey = state
|
||||
end
|
||||
self:ForAll("Update")
|
||||
end
|
||||
|
||||
function ActionBar:GetHideHotkey()
|
||||
return self.config.hidehotkey
|
||||
end
|
||||
|
||||
function ActionBar:UpdateSelfCast(nostates)
|
||||
self:ForAll("SetAttribute", "checkselfcast", Bartender4.db.profile.selfcastmodifier and true or nil)
|
||||
if not nostates then
|
||||
|
||||
@@ -9,6 +9,7 @@ local abdefaults = {
|
||||
enabled = true,
|
||||
buttons = 12,
|
||||
hidemacrotext = false,
|
||||
hidehotkey = false,
|
||||
showgrid = false,
|
||||
states = {
|
||||
enabled = false,
|
||||
|
||||
+1
-2
@@ -27,7 +27,6 @@ function Bartender4.Button:Create(id, parent)
|
||||
button.rid = id
|
||||
button.id = absid
|
||||
button.parent = parent
|
||||
button.settings = parent.module.db
|
||||
|
||||
button:SetFrameStrata("MEDIUM")
|
||||
button:SetWidth(36)
|
||||
@@ -282,7 +281,7 @@ function Button:UpdateHotkeys()
|
||||
local key = self:GetHotkey() or ""
|
||||
local hotkey = self.hotkey
|
||||
|
||||
if key == "" or self.settings.profile.HideHotkey or not HasAction(self.action) then
|
||||
if key == "" or self.parent.config.hidehotkey or not HasAction(self.action) then
|
||||
hotkey:SetText(RANGE_INDICATOR)
|
||||
hotkey:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -2)
|
||||
hotkey:Hide()
|
||||
|
||||
Reference in New Issue
Block a user