Bartender4:
- options to configure self-casting - implement right-click self-cast
This commit is contained in:
@@ -131,6 +131,7 @@ function ActionBar:ApplyConfig(config)
|
||||
if not config.position then initialPosition(self) end
|
||||
|
||||
self:UpdateButtons()
|
||||
self:UpdateSelfCast(true)
|
||||
self:UpdateStates()
|
||||
end
|
||||
|
||||
@@ -214,3 +215,10 @@ function ActionBar:SetGrid(state)
|
||||
self:ForAll("HideGrid", true)
|
||||
end
|
||||
end
|
||||
|
||||
function ActionBar:UpdateSelfCast(nostates)
|
||||
self:ForAll("SetAttribute", "checkselfcast", Bartender4.db.profile.selfcastmodifier and true or nil)
|
||||
if not nostates then
|
||||
self:UpdateStates()
|
||||
end
|
||||
end
|
||||
|
||||
+4
-3
@@ -258,6 +258,7 @@ function module:CreateStanceMap()
|
||||
end
|
||||
|
||||
function ActionBar:UpdateStates()
|
||||
self.statebutton = {}
|
||||
if not module.stancemap and module.DefaultStanceMap[playerclass] then
|
||||
module.stancemap = module.DefaultStanceMap[playerclass]
|
||||
end
|
||||
@@ -361,14 +362,14 @@ function ActionBar:AddRightClickState(state)
|
||||
local scrc = Bartender4.db.profile.selfcastrightclick
|
||||
local target = scrc and "player" or nil
|
||||
|
||||
self:SetAttribute("unit-S" .. state .. "2", target)
|
||||
self:SetAttribute("unit-S" .. state .. "Right", target)
|
||||
end
|
||||
|
||||
function ActionBar:ApplyStateButton()
|
||||
local states1, states2 = {}, {}
|
||||
for _,v in pairs(self.statebutton) do
|
||||
table_insert(states1, fmt("%s:S%s1;", v, v))
|
||||
table_insert(states2, fmt("%s:S%s2;", v, v))
|
||||
table_insert(states1, fmt("%s:S%s;", v, v))
|
||||
table_insert(states2, fmt("%s:S%sRight;", v, v))
|
||||
end
|
||||
self:SetAttribute("statebutton", table_concat(states1, ""))
|
||||
self:SetAttribute("statebutton2", table_concat(states2, ""))
|
||||
|
||||
@@ -8,6 +8,8 @@ local defaults = {
|
||||
buttonlock = false,
|
||||
outofrange = "button",
|
||||
colors = { range = { r = 0.8, g = 0.1, b = 0.1 }, mana = { r = 0.5, g = 0.5, b = 1.0 } },
|
||||
selfcastmodifier = true,
|
||||
selfcastrightclick = false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -89,7 +89,7 @@ function Bartender4.Button:Create(id, parent)
|
||||
button:SetAttribute("useparent-unit", true)
|
||||
button:SetAttribute("useparent-statebutton", true)
|
||||
button:SetAttribute("hidestates", "-1")
|
||||
button:SetAttribute("checkselfcast", true)
|
||||
--button:SetAttribute("checkselfcast", true)
|
||||
|
||||
button:RegisterForDrag("LeftButton", "RightButton")
|
||||
button:RegisterForClicks("AnyUp")
|
||||
@@ -182,9 +182,8 @@ function onUpdate(self, elapsed)
|
||||
end
|
||||
|
||||
function Button:SetStateAction(state, action)
|
||||
for i=1,2 do
|
||||
self:SetAttribute(("*action-S%d%d"):format(state, i), action)
|
||||
end
|
||||
self:SetAttribute(("*action-S%d"):format(state), action)
|
||||
self:SetAttribute(("*action-S%dRight"):format(state), action)
|
||||
end
|
||||
|
||||
function Button:CalculateAction()
|
||||
|
||||
+25
-3
@@ -44,8 +44,30 @@ local function getOptions()
|
||||
type = "group",
|
||||
name = "Bars",
|
||||
args = {
|
||||
range = {
|
||||
selfcastmodifier = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = "Self-Cast by modifier",
|
||||
desc = "Toggle the use of the modifier-based self-cast functionality.",
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.selfcastmodifier = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast", true)
|
||||
end,
|
||||
},
|
||||
selfcastrightclick = {
|
||||
order = 2,
|
||||
type = "toggle",
|
||||
name = "Right-click Self-Cast",
|
||||
desc = "Toggle the use of the right-click self-cast functionality.",
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.selfcastrightclick = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
range = {
|
||||
order = 10,
|
||||
name = "Out of Range Indicator",
|
||||
desc = "Configure how the Out of Range Indicator should display on the buttons.",
|
||||
type = "select",
|
||||
@@ -60,7 +82,7 @@ local function getOptions()
|
||||
values = { none = "No Display", button = "Full Button Mode", hotkey = "Hotkey Mode" },
|
||||
},
|
||||
colors = {
|
||||
order = 3,
|
||||
order = 13,
|
||||
type = "group",
|
||||
guiInline = true,
|
||||
name = "Colors",
|
||||
@@ -89,7 +111,7 @@ local function getOptions()
|
||||
},
|
||||
},
|
||||
tooltip = {
|
||||
order = 2,
|
||||
order = 20,
|
||||
name = "Button Tooltip",
|
||||
type = "select",
|
||||
desc = "Configure the Button Tooltip.",
|
||||
|
||||
Reference in New Issue
Block a user