Fix all and any white-space errors
This commit is contained in:
+9
-9
@@ -18,9 +18,9 @@ end
|
|||||||
-- Apply the specified config to the bar and refresh all settings
|
-- Apply the specified config to the bar and refresh all settings
|
||||||
function ActionBar:ApplyConfig(config)
|
function ActionBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then initialPosition(self) end
|
if not self.config.position then initialPosition(self) end
|
||||||
|
|
||||||
self:UpdateButtons()
|
self:UpdateButtons()
|
||||||
self:UpdateSelfCast(true)
|
self:UpdateSelfCast(true)
|
||||||
self:UpdateStates()
|
self:UpdateStates()
|
||||||
@@ -33,15 +33,15 @@ function ActionBar:UpdateButtons(numbuttons)
|
|||||||
else
|
else
|
||||||
numbuttons = min(self.config.buttons, 12)
|
numbuttons = min(self.config.buttons, 12)
|
||||||
end
|
end
|
||||||
|
|
||||||
local buttons = self.buttons or {}
|
local buttons = self.buttons or {}
|
||||||
|
|
||||||
local updateBindings = (numbuttons > #buttons)
|
local updateBindings = (numbuttons > #buttons)
|
||||||
-- create more buttons if needed
|
-- create more buttons if needed
|
||||||
for i = (#buttons+1), numbuttons do
|
for i = (#buttons+1), numbuttons do
|
||||||
buttons[i] = Bartender4.Button:Create(i, self)
|
buttons[i] = Bartender4.Button:Create(i, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- show active buttons
|
-- show active buttons
|
||||||
for i = 1, numbuttons do
|
for i = 1, numbuttons do
|
||||||
buttons[i]:SetParent(self)
|
buttons[i]:SetParent(self)
|
||||||
@@ -49,23 +49,23 @@ function ActionBar:UpdateButtons(numbuttons)
|
|||||||
buttons[i]:SetAttribute("statehidden", nil)
|
buttons[i]:SetAttribute("statehidden", nil)
|
||||||
buttons[i]:UpdateAction(true)
|
buttons[i]:UpdateAction(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- hide inactive buttons
|
-- hide inactive buttons
|
||||||
for i = (numbuttons + 1), #buttons do
|
for i = (numbuttons + 1), #buttons do
|
||||||
buttons[i]:Hide()
|
buttons[i]:Hide()
|
||||||
buttons[i]:SetParent(UIParent)
|
buttons[i]:SetParent(UIParent)
|
||||||
buttons[i]:SetAttribute("statehidden", true)
|
buttons[i]:SetAttribute("statehidden", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.numbuttons = numbuttons
|
self.numbuttons = numbuttons
|
||||||
self.buttons = buttons
|
self.buttons = buttons
|
||||||
|
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
self:SetGrid()
|
self:SetGrid()
|
||||||
if updateBindings and self.id == "1" then
|
if updateBindings and self.id == "1" then
|
||||||
self.module:ReassignBindings()
|
self.module:ReassignBindings()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- need to re-set clickthrough after creating new buttons
|
-- need to re-set clickthrough after creating new buttons
|
||||||
self:SetClickThrough()
|
self:SetClickThrough()
|
||||||
end
|
end
|
||||||
|
|||||||
+17
-17
@@ -47,7 +47,7 @@ local DefaultStanceMap = setmetatable({}, { __index = function(t,k)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
rawset(t, k, newT)
|
rawset(t, k, newT)
|
||||||
|
|
||||||
return newT
|
return newT
|
||||||
end})
|
end})
|
||||||
Bartender4.StanceMap = DefaultStanceMap
|
Bartender4.StanceMap = DefaultStanceMap
|
||||||
@@ -61,24 +61,24 @@ function ActionBar:UpdateStates(returnOnly)
|
|||||||
if not stancemap and DefaultStanceMap[playerclass] then
|
if not stancemap and DefaultStanceMap[playerclass] then
|
||||||
stancemap = DefaultStanceMap[playerclass]
|
stancemap = DefaultStanceMap[playerclass]
|
||||||
end
|
end
|
||||||
|
|
||||||
self:ForAll("ClearStateAction")
|
self:ForAll("ClearStateAction")
|
||||||
for i=0,11 do
|
for i=0,11 do
|
||||||
self:AddButtonStates(i)
|
self:AddButtonStates(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
local statedriver
|
local statedriver
|
||||||
|
|
||||||
if returnOnly or not self:GetStateOption("customEnabled") then
|
if returnOnly or not self:GetStateOption("customEnabled") then
|
||||||
statedriver = {}
|
statedriver = {}
|
||||||
local stateconfig = self.config.states
|
local stateconfig = self.config.states
|
||||||
if self:GetStateOption("enabled") then
|
if self:GetStateOption("enabled") then
|
||||||
-- arguments will be parsed from left to right, so we have a priority here
|
-- arguments will be parsed from left to right, so we have a priority here
|
||||||
|
|
||||||
if self:GetStateOption("possess") then
|
if self:GetStateOption("possess") then
|
||||||
table_insert(statedriver, "[bonusbar:5]11")
|
table_insert(statedriver, "[bonusbar:5]11")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- highest priority have our temporary quick-swap keys
|
-- highest priority have our temporary quick-swap keys
|
||||||
for _,v in pairs(modifiers) do
|
for _,v in pairs(modifiers) do
|
||||||
local page = self:GetStateOption(v)
|
local page = self:GetStateOption(v)
|
||||||
@@ -86,14 +86,14 @@ function ActionBar:UpdateStates(returnOnly)
|
|||||||
table_insert(statedriver, fmt("[mod:%s]%s", v, page))
|
table_insert(statedriver, fmt("[mod:%s]%s", v, page))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- second priority the manual changes using the actionbar options
|
-- second priority the manual changes using the actionbar options
|
||||||
if self:GetStateOption("actionbar") then
|
if self:GetStateOption("actionbar") then
|
||||||
for i=2,6 do
|
for i=2,6 do
|
||||||
table_insert(statedriver, fmt("[bar:%s]%s", i, i))
|
table_insert(statedriver, fmt("[bar:%s]%s", i, i))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- third priority the stances
|
-- third priority the stances
|
||||||
if stancemap then
|
if stancemap then
|
||||||
if not stateconfig.stance[playerclass] then stateconfig.stance[playerclass] = {} end
|
if not stateconfig.stance[playerclass] then stateconfig.stance[playerclass] = {} end
|
||||||
@@ -111,7 +111,7 @@ function ActionBar:UpdateStates(returnOnly)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
table_insert(statedriver, tostring(self:GetDefaultState() or 0))
|
table_insert(statedriver, tostring(self:GetDefaultState() or 0))
|
||||||
statedriver = table_concat(statedriver, ";")
|
statedriver = table_concat(statedriver, ";")
|
||||||
if returnOnly then
|
if returnOnly then
|
||||||
@@ -120,38 +120,38 @@ function ActionBar:UpdateStates(returnOnly)
|
|||||||
else
|
else
|
||||||
statedriver = self:GetStateOption("custom")
|
statedriver = self:GetStateOption("custom")
|
||||||
end
|
end
|
||||||
|
|
||||||
self:SetAttribute("_onstate-page", [[
|
self:SetAttribute("_onstate-page", [[
|
||||||
self:SetAttribute("state", newstate)
|
self:SetAttribute("state", newstate)
|
||||||
control:ChildUpdate("state", newstate)
|
control:ChildUpdate("state", newstate)
|
||||||
]])
|
]])
|
||||||
|
|
||||||
UnregisterStateDriver(self, "page")
|
UnregisterStateDriver(self, "page")
|
||||||
RegisterStateDriver(self, "page", statedriver or "")
|
RegisterStateDriver(self, "page", statedriver or "")
|
||||||
|
|
||||||
self:SetAttribute("_onstate-assist-help", [[
|
self:SetAttribute("_onstate-assist-help", [[
|
||||||
local state = (newstate ~= "nil") and newstate or nil
|
local state = (newstate ~= "nil") and newstate or nil
|
||||||
control:ChildUpdate("assist-help", state)
|
control:ChildUpdate("assist-help", state)
|
||||||
]])
|
]])
|
||||||
|
|
||||||
self:SetAttribute("_onstate-assist-harm", [[
|
self:SetAttribute("_onstate-assist-harm", [[
|
||||||
local state = (newstate ~= "nil") and newstate or nil
|
local state = (newstate ~= "nil") and newstate or nil
|
||||||
control:ChildUpdate("assist-harm", state)
|
control:ChildUpdate("assist-harm", state)
|
||||||
]])
|
]])
|
||||||
|
|
||||||
local preSelf = ""
|
local preSelf = ""
|
||||||
if Bartender4.db.profile.selfcastmodifier then
|
if Bartender4.db.profile.selfcastmodifier then
|
||||||
preSelf = "[mod:SELFCAST]player;"
|
preSelf = "[mod:SELFCAST]player;"
|
||||||
end
|
end
|
||||||
|
|
||||||
local preFocus = ""
|
local preFocus = ""
|
||||||
if Bartender4.db.profile.focuscastmodifier then
|
if Bartender4.db.profile.focuscastmodifier then
|
||||||
preFocus = "[mod:FOCUSCAST,target=focus,exists,nodead]focus;"
|
preFocus = "[mod:FOCUSCAST,target=focus,exists,nodead]focus;"
|
||||||
end
|
end
|
||||||
|
|
||||||
UnregisterStateDriver(self, "assist-help")
|
UnregisterStateDriver(self, "assist-help")
|
||||||
UnregisterStateDriver(self, "assist-harm")
|
UnregisterStateDriver(self, "assist-harm")
|
||||||
|
|
||||||
if self.config.autoassist then
|
if self.config.autoassist then
|
||||||
RegisterStateDriver(self, "assist-help", ("%s%s[help]nil; [target=targettarget, help]targettarget; nil"):format(preSelf, preFocus))
|
RegisterStateDriver(self, "assist-help", ("%s%s[help]nil; [target=targettarget, help]targettarget; nil"):format(preSelf, preFocus))
|
||||||
RegisterStateDriver(self, "assist-harm", ("%s[harm]nil; [target=targettarget, harm]targettarget; nil"):format(preFocus))
|
RegisterStateDriver(self, "assist-harm", ("%s[harm]nil; [target=targettarget, harm]targettarget; nil"):format(preFocus))
|
||||||
|
|||||||
+11
-11
@@ -61,7 +61,7 @@ local defaults = {
|
|||||||
|
|
||||||
function BT4ActionBars:OnInitialize()
|
function BT4ActionBars:OnInitialize()
|
||||||
self.db = Bartender4.db:RegisterNamespace("ActionBars", defaults)
|
self.db = Bartender4.db:RegisterNamespace("ActionBars", defaults)
|
||||||
|
|
||||||
-- fetch the prototype information
|
-- fetch the prototype information
|
||||||
ActionBar = Bartender4.ActionBar
|
ActionBar = Bartender4.ActionBar
|
||||||
ActionBar_MT = {__index = ActionBar}
|
ActionBar_MT = {__index = ActionBar}
|
||||||
@@ -76,7 +76,7 @@ function BT4ActionBars:OnEnable()
|
|||||||
if first then
|
if first then
|
||||||
self.playerclass = select(2, UnitClass("player"))
|
self.playerclass = select(2, UnitClass("player"))
|
||||||
self.actionbars = {}
|
self.actionbars = {}
|
||||||
|
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
local config = self.db.profile.actionbars[i]
|
local config = self.db.profile.actionbars[i]
|
||||||
if config.enabled then
|
if config.enabled then
|
||||||
@@ -85,10 +85,10 @@ function BT4ActionBars:OnEnable()
|
|||||||
self:CreateBarOption(i, self.disabledoptions)
|
self:CreateBarOption(i, self.disabledoptions)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
first = nil
|
first = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
self:RegisterEvent("UPDATE_BINDINGS", "ReassignBindings")
|
self:RegisterEvent("UPDATE_BINDINGS", "ReassignBindings")
|
||||||
self:ReassignBindings()
|
self:ReassignBindings()
|
||||||
end
|
end
|
||||||
@@ -97,7 +97,7 @@ function BT4ActionBars:SetupOptions()
|
|||||||
if not self.options then
|
if not self.options then
|
||||||
-- empty table to hold the bar options
|
-- empty table to hold the bar options
|
||||||
self.options = {}
|
self.options = {}
|
||||||
|
|
||||||
-- template for disabled bars
|
-- template for disabled bars
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
@@ -116,7 +116,7 @@ function BT4ActionBars:SetupOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- iterate over bars and create their option tables
|
-- iterate over bars and create their option tables
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
local config = self.db.profile.actionbars[i]
|
local config = self.db.profile.actionbars[i]
|
||||||
@@ -170,7 +170,7 @@ function BT4ActionBars:ReassignBindings()
|
|||||||
SetOverrideBindingClick(frame, false, key, real_button)
|
SetOverrideBindingClick(frame, false, key, real_button)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1, 120 do
|
for i = 1, 120 do
|
||||||
-- rename old bindings from <buttonname>Secure to only <buttonname>
|
-- rename old bindings from <buttonname>Secure to only <buttonname>
|
||||||
local button, real_button = ("CLICK BT4Button%dSecure:LeftButton"):format(i), ("BT4Button%d"):format(i)
|
local button, real_button = ("CLICK BT4Button%dSecure:LeftButton"):format(i), ("BT4Button%d"):format(i)
|
||||||
@@ -190,11 +190,11 @@ function BT4ActionBars:Create(id, config)
|
|||||||
local id = tostring(id)
|
local id = tostring(id)
|
||||||
local bar = setmetatable(Bartender4.ButtonBar:Create(id, config, (L["Bar %s"]):format(id)), ActionBar_MT)
|
local bar = setmetatable(Bartender4.ButtonBar:Create(id, config, (L["Bar %s"]):format(id)), ActionBar_MT)
|
||||||
bar.module = self
|
bar.module = self
|
||||||
|
|
||||||
self:CreateBarOption(id)
|
self:CreateBarOption(id)
|
||||||
|
|
||||||
bar:ApplyConfig()
|
bar:ApplyConfig()
|
||||||
|
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ function BT4ActionBars:DisableBar(id)
|
|||||||
id = tonumber(id)
|
id = tonumber(id)
|
||||||
local bar = self.actionbars[id]
|
local bar = self.actionbars[id]
|
||||||
if not bar then return end
|
if not bar then return end
|
||||||
|
|
||||||
bar.config.enabled = false
|
bar.config.enabled = false
|
||||||
bar:Disable()
|
bar:Disable()
|
||||||
self:CreateBarOption(id, self.disabledoptions)
|
self:CreateBarOption(id, self.disabledoptions)
|
||||||
|
|||||||
+28
-28
@@ -1,6 +1,6 @@
|
|||||||
--[[
|
--[[
|
||||||
Action Button Template
|
Action Button Template
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
Some IDs produce a special behaviour!
|
Some IDs produce a special behaviour!
|
||||||
- Button ID 132 (Last Button in Possess Bar) Creates a Leave Vehicle Button
|
- Button ID 132 (Last Button in Possess Bar) Creates a Leave Vehicle Button
|
||||||
@@ -34,20 +34,20 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
local button = setmetatable(CreateFrame("CheckButton", name, parent, "ActionBarButtonTemplate"), Button_MT)
|
local button = setmetatable(CreateFrame("CheckButton", name, parent, "ActionBarButtonTemplate"), Button_MT)
|
||||||
-- work around for "blocked" message when using /click macros
|
-- work around for "blocked" message when using /click macros
|
||||||
GetClickFrame(name)
|
GetClickFrame(name)
|
||||||
|
|
||||||
-- Backwards Compat to pre-4.2.0 button names/layout
|
-- Backwards Compat to pre-4.2.0 button names/layout
|
||||||
_G[name .. "Secure"] = button
|
_G[name .. "Secure"] = button
|
||||||
button.Secure = button
|
button.Secure = button
|
||||||
|
|
||||||
button.rid = id
|
button.rid = id
|
||||||
button.id = absid
|
button.id = absid
|
||||||
button.parent = parent
|
button.parent = parent
|
||||||
button.stateactions = {}
|
button.stateactions = {}
|
||||||
|
|
||||||
button:SetRealNormalTexture("")
|
button:SetRealNormalTexture("")
|
||||||
local oldNT = _G[("%sNormalTexture"):format(name)]
|
local oldNT = _G[("%sNormalTexture"):format(name)]
|
||||||
oldNT:Hide()
|
oldNT:Hide()
|
||||||
|
|
||||||
button.normalTexture = button:CreateTexture(("%sBTNT"):format(name))
|
button.normalTexture = button:CreateTexture(("%sBTNT"):format(name))
|
||||||
button.normalTexture:SetWidth(66)
|
button.normalTexture:SetWidth(66)
|
||||||
button.normalTexture:SetHeight(66)
|
button.normalTexture:SetHeight(66)
|
||||||
@@ -55,15 +55,15 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
button.normalTexture:SetPoint("CENTER", 0, -1)
|
button.normalTexture:SetPoint("CENTER", 0, -1)
|
||||||
button.normalTexture:Show()
|
button.normalTexture:Show()
|
||||||
|
|
||||||
|
|
||||||
--button:SetFrameStrata("MEDIUM")
|
--button:SetFrameStrata("MEDIUM")
|
||||||
|
|
||||||
-- overwrite some scripts with out customized versions
|
-- overwrite some scripts with out customized versions
|
||||||
button:SetScript("OnEnter", onEnter)
|
button:SetScript("OnEnter", onEnter)
|
||||||
button:SetScript("OnUpdate", onUpdate)
|
button:SetScript("OnUpdate", onUpdate)
|
||||||
button:SetScript("OnDragStart", onDragStart)
|
button:SetScript("OnDragStart", onDragStart)
|
||||||
button:SetScript("OnReceiveDrag", onReceiveDrag)
|
button:SetScript("OnReceiveDrag", onReceiveDrag)
|
||||||
|
|
||||||
button.icon = _G[("%sIcon"):format(name)]
|
button.icon = _G[("%sIcon"):format(name)]
|
||||||
button.border = _G[("%sBorder"):format(name)]
|
button.border = _G[("%sBorder"):format(name)]
|
||||||
button.cooldown = _G[("%sCooldown"):format(name)]
|
button.cooldown = _G[("%sCooldown"):format(name)]
|
||||||
@@ -72,14 +72,14 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
button.count = _G[("%sCount"):format(name)]
|
button.count = _G[("%sCount"):format(name)]
|
||||||
button.flash = _G[("%sFlash"):format(name)]
|
button.flash = _G[("%sFlash"):format(name)]
|
||||||
button.flash:Hide()
|
button.flash:Hide()
|
||||||
|
|
||||||
button:SetAttribute("type", "action")
|
button:SetAttribute("type", "action")
|
||||||
button:SetAttribute("action", absid)
|
button:SetAttribute("action", absid)
|
||||||
button:SetAttribute("useparent-unit", nil);
|
button:SetAttribute("useparent-unit", nil);
|
||||||
button:SetAttribute("useparent-actionpage", nil);
|
button:SetAttribute("useparent-actionpage", nil);
|
||||||
|
|
||||||
button:UpdateSelfCast()
|
button:UpdateSelfCast()
|
||||||
|
|
||||||
button:SetAttribute('_childupdate-state', [[
|
button:SetAttribute('_childupdate-state', [[
|
||||||
self:SetAttribute("state", message)
|
self:SetAttribute("state", message)
|
||||||
local action = self:GetAttribute("action-" .. message)
|
local action = self:GetAttribute("action-" .. message)
|
||||||
@@ -101,7 +101,7 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:SetAttribute("action", action)
|
self:SetAttribute("action", action)
|
||||||
|
|
||||||
local unit = nil
|
local unit = nil
|
||||||
-- fix unit on state change
|
-- fix unit on state change
|
||||||
if action <= 120 then
|
if action <= 120 then
|
||||||
@@ -115,36 +115,36 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
G_state = message
|
G_state = message
|
||||||
G_action = action
|
G_action = action
|
||||||
]])
|
]])
|
||||||
|
|
||||||
button:SetAttribute('_childupdate-assist-help', [[
|
button:SetAttribute('_childupdate-assist-help', [[
|
||||||
if self:GetAttribute("assisttype-"..G_state) == 1 and G_action <= 120 then
|
if self:GetAttribute("assisttype-"..G_state) == 1 and G_action <= 120 then
|
||||||
self:SetAttribute("unit", message)
|
self:SetAttribute("unit", message)
|
||||||
end
|
end
|
||||||
G_assist_help = message
|
G_assist_help = message
|
||||||
]])
|
]])
|
||||||
|
|
||||||
button:SetAttribute('_childupdate-assist-harm', [[
|
button:SetAttribute('_childupdate-assist-harm', [[
|
||||||
if self:GetAttribute("assisttype-"..G_state) == 2 and G_action <= 120 then
|
if self:GetAttribute("assisttype-"..G_state) == 2 and G_action <= 120 then
|
||||||
self:SetAttribute("unit", message)
|
self:SetAttribute("unit", message)
|
||||||
end
|
end
|
||||||
G_assist_harm = message
|
G_assist_harm = message
|
||||||
]])
|
]])
|
||||||
|
|
||||||
if LBF and parent.LBFGroup then
|
if LBF and parent.LBFGroup then
|
||||||
local group = parent.LBFGroup
|
local group = parent.LBFGroup
|
||||||
group:AddButton(button)
|
group:AddButton(button)
|
||||||
end
|
end
|
||||||
|
|
||||||
if button.parent.config.showgrid then
|
if button.parent.config.showgrid then
|
||||||
button:ShowGrid()
|
button:ShowGrid()
|
||||||
end
|
end
|
||||||
|
|
||||||
--self:UpdateAction(true)
|
--self:UpdateAction(true)
|
||||||
button:UpdateHotkeys()
|
button:UpdateHotkeys()
|
||||||
button:UpdateUsable()
|
button:UpdateUsable()
|
||||||
button:UpdateGrid()
|
button:UpdateGrid()
|
||||||
button:ToggleButtonElements()
|
button:ToggleButtonElements()
|
||||||
|
|
||||||
return button
|
return button
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ function onUpdate(self, elapsed)
|
|||||||
overtime = 0
|
overtime = 0
|
||||||
end
|
end
|
||||||
self.flashtime = ATTACK_BUTTON_FLASH_TIME - overtime
|
self.flashtime = ATTACK_BUTTON_FLASH_TIME - overtime
|
||||||
|
|
||||||
local flashTexture = self.flash
|
local flashTexture = self.flash
|
||||||
if flashTexture:IsShown() then
|
if flashTexture:IsShown() then
|
||||||
flashTexture:Hide()
|
flashTexture:Hide()
|
||||||
@@ -191,7 +191,7 @@ function onUpdate(self, elapsed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.rangeTimer then
|
if self.rangeTimer then
|
||||||
self.rangeTimer = self.rangeTimer - elapsed
|
self.rangeTimer = self.rangeTimer - elapsed
|
||||||
if self.rangeTimer <= 0 then
|
if self.rangeTimer <= 0 then
|
||||||
@@ -265,13 +265,13 @@ function Button:RefreshStateAction(state)
|
|||||||
local state = tonumber(state or self:GetAttribute("state")) or 0
|
local state = tonumber(state or self:GetAttribute("state")) or 0
|
||||||
local action = self.stateactions[state]
|
local action = self.stateactions[state]
|
||||||
self:SetAttribute("action-"..state, action)
|
self:SetAttribute("action-"..state, action)
|
||||||
|
|
||||||
if action > 120 and action <= 126 then
|
if action > 120 and action <= 126 then
|
||||||
self:SetAttribute("clickbutton", _G["VehicleMenuBarActionButton"..tostring(action-120)])
|
self:SetAttribute("clickbutton", _G["VehicleMenuBarActionButton"..tostring(action-120)])
|
||||||
elseif action == 132 then
|
elseif action == 132 then
|
||||||
self:SetAttribute("clickbutton", PossessButton2)
|
self:SetAttribute("clickbutton", PossessButton2)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:SetAttribute("assisttype-"..state, nil)
|
self:SetAttribute("assisttype-"..state, nil)
|
||||||
self:SetAttribute("unit", nil)
|
self:SetAttribute("unit", nil)
|
||||||
if self.parent.config.autoassist then
|
if self.parent.config.autoassist then
|
||||||
@@ -333,7 +333,7 @@ end
|
|||||||
function Button:UpdateHotkeys()
|
function Button:UpdateHotkeys()
|
||||||
local key = self:GetHotkey() or ""
|
local key = self:GetHotkey() or ""
|
||||||
local hotkey = self.hotkey
|
local hotkey = self.hotkey
|
||||||
|
|
||||||
if key == "" or self.parent.config.hidehotkey then
|
if key == "" or self.parent.config.hidehotkey then
|
||||||
hotkey:SetText(RANGE_INDICATOR)
|
hotkey:SetText(RANGE_INDICATOR)
|
||||||
hotkey:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -2)
|
hotkey:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -2)
|
||||||
@@ -352,7 +352,7 @@ end
|
|||||||
|
|
||||||
function Button:GetBindings()
|
function Button:GetBindings()
|
||||||
local keys, binding = ""
|
local keys, binding = ""
|
||||||
|
|
||||||
if self.id <= 12 then
|
if self.id <= 12 then
|
||||||
binding = format("ACTIONBUTTON%d", self.id)
|
binding = format("ACTIONBUTTON%d", self.id)
|
||||||
for i = 1, select('#', GetBindingKey(binding)) do
|
for i = 1, select('#', GetBindingKey(binding)) do
|
||||||
@@ -363,7 +363,7 @@ function Button:GetBindings()
|
|||||||
keys = keys .. GetBindingText(hotKey,'KEY_')
|
keys = keys .. GetBindingText(hotKey,'KEY_')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
binding = "CLICK "..self:GetName()..":LeftButton"
|
binding = "CLICK "..self:GetName()..":LeftButton"
|
||||||
for i = 1, select('#', GetBindingKey(binding)) do
|
for i = 1, select('#', GetBindingKey(binding)) do
|
||||||
local hotKey = select(i, GetBindingKey(binding))
|
local hotKey = select(i, GetBindingKey(binding))
|
||||||
@@ -413,7 +413,7 @@ function Button:UpdateUsable()
|
|||||||
local icon, hotkey = self.icon, self.hotkey
|
local icon, hotkey = self.icon, self.hotkey
|
||||||
local oor = Bartender4.db.profile.outofrange
|
local oor = Bartender4.db.profile.outofrange
|
||||||
local oorcolor, oomcolor = Bartender4.db.profile.colors.range, Bartender4.db.profile.colors.mana
|
local oorcolor, oomcolor = Bartender4.db.profile.colors.range, Bartender4.db.profile.colors.mana
|
||||||
|
|
||||||
if oor == "button" and self.outOfRange then
|
if oor == "button" and self.outOfRange then
|
||||||
icon:SetVertexColor(oorcolor.r, oorcolor.g, oorcolor.b)
|
icon:SetVertexColor(oorcolor.r, oorcolor.g, oorcolor.b)
|
||||||
hotkey:SetVertexColor(1.0, 1.0, 1.0)
|
hotkey:SetVertexColor(1.0, 1.0, 1.0)
|
||||||
@@ -423,7 +423,7 @@ function Button:UpdateUsable()
|
|||||||
else
|
else
|
||||||
hotkey:SetVertexColor(1.0, 1.0, 1.0)
|
hotkey:SetVertexColor(1.0, 1.0, 1.0)
|
||||||
end
|
end
|
||||||
|
|
||||||
if isUsable or specialButtons[self.action] then
|
if isUsable or specialButtons[self.action] then
|
||||||
icon:SetVertexColor(1.0, 1.0, 1.0)
|
icon:SetVertexColor(1.0, 1.0, 1.0)
|
||||||
elseif notEnoughMana then
|
elseif notEnoughMana then
|
||||||
@@ -440,7 +440,7 @@ function Button:SetTooltip()
|
|||||||
else
|
else
|
||||||
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
|
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
|
||||||
end
|
end
|
||||||
|
|
||||||
if specialButtons[self.action] then
|
if specialButtons[self.action] then
|
||||||
GameTooltip:SetText(specialButtons[self.action].tooltip)
|
GameTooltip:SetText(specialButtons[self.action].tooltip)
|
||||||
self.UpdateTooltip = self.SetTooltip
|
self.UpdateTooltip = self.SetTooltip
|
||||||
|
|||||||
+9
-9
@@ -42,12 +42,12 @@ end
|
|||||||
|
|
||||||
function BagBar:ApplyConfig(config)
|
function BagBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then
|
if not self.config.position then
|
||||||
self:ClearSetPoint("CENTER", 142, -18)
|
self:ClearSetPoint("CENTER", 142, -18)
|
||||||
self:SavePosition()
|
self:SavePosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:FeedButtons()
|
self:FeedButtons()
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
end
|
end
|
||||||
@@ -76,12 +76,12 @@ function BagBar:FeedButtons()
|
|||||||
else
|
else
|
||||||
self.buttons = {}
|
self.buttons = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.config.keyring then
|
if self.config.keyring then
|
||||||
table_insert(self.buttons, KeyRingButton)
|
table_insert(self.buttons, KeyRingButton)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.config.onebag then
|
if not self.config.onebag then
|
||||||
table_insert(self.buttons, CharacterBag3Slot)
|
table_insert(self.buttons, CharacterBag3Slot)
|
||||||
table_insert(self.buttons, CharacterBag2Slot)
|
table_insert(self.buttons, CharacterBag2Slot)
|
||||||
@@ -89,15 +89,15 @@ function BagBar:FeedButtons()
|
|||||||
table_insert(self.buttons, CharacterBag0Slot)
|
table_insert(self.buttons, CharacterBag0Slot)
|
||||||
count = count + 4
|
count = count + 4
|
||||||
end
|
end
|
||||||
|
|
||||||
table_insert(self.buttons, MainMenuBarBackpackButton)
|
table_insert(self.buttons, MainMenuBarBackpackButton)
|
||||||
|
|
||||||
for i,v in pairs(self.buttons) do
|
for i,v in pairs(self.buttons) do
|
||||||
v:SetParent(self)
|
v:SetParent(self)
|
||||||
v:Show()
|
v:Show()
|
||||||
if v ~= KeyRingButton then
|
if v ~= KeyRingButton then
|
||||||
v:SetNormalTexture("")
|
v:SetNormalTexture("")
|
||||||
|
|
||||||
if LBF then
|
if LBF then
|
||||||
local group = self.LBFGroup
|
local group = self.LBFGroup
|
||||||
if not v.LBFButtonData then
|
if not v.LBFButtonData then
|
||||||
@@ -109,10 +109,10 @@ function BagBar:FeedButtons()
|
|||||||
group:AddButton(v, v.LBFButtonData)
|
group:AddButton(v, v.LBFButtonData)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
v.ClearSetPoint = clearSetPoint
|
v.ClearSetPoint = clearSetPoint
|
||||||
end
|
end
|
||||||
|
|
||||||
BagBarMod.button_count = count
|
BagBarMod.button_count = count
|
||||||
if BagBarMod.optionobject then
|
if BagBarMod.optionobject then
|
||||||
BagBarMod.optionobject.table.general.args.rows.max = count
|
BagBarMod.optionobject.table.general.args.rows.max = count
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ do
|
|||||||
parent.isMoving = nil
|
parent.isMoving = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function barOnClick(self)
|
function barOnClick(self)
|
||||||
-- TODO: Hide/Show bar on Click
|
-- TODO: Hide/Show bar on Click
|
||||||
-- TODO: Once dropdown config is stable, show dropdown on rightclick
|
-- TODO: Once dropdown config is stable, show dropdown on rightclick
|
||||||
end
|
end
|
||||||
|
|
||||||
function barOnUpdateFunc(self, elapsed)
|
function barOnUpdateFunc(self, elapsed)
|
||||||
self.elapsed = self.elapsed + elapsed
|
self.elapsed = self.elapsed + elapsed
|
||||||
if self.elapsed > self.config.fadeoutdelay then
|
if self.elapsed > self.config.fadeoutdelay then
|
||||||
@@ -76,7 +76,7 @@ do
|
|||||||
self.elapsed = 0
|
self.elapsed = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function barOnAttributeChanged(self, attribute, value)
|
function barOnAttributeChanged(self, attribute, value)
|
||||||
if attribute == "fade" then
|
if attribute == "fade" then
|
||||||
if value then
|
if value then
|
||||||
@@ -99,16 +99,16 @@ Bartender4.Bar.barregistry = barregistry
|
|||||||
function Bartender4.Bar:Create(id, config, name)
|
function Bartender4.Bar:Create(id, config, name)
|
||||||
id = tostring(id)
|
id = tostring(id)
|
||||||
assert(not barregistry[id], "duplicated entry in barregistry.")
|
assert(not barregistry[id], "duplicated entry in barregistry.")
|
||||||
|
|
||||||
local bar = setmetatable(CreateFrame("Frame", ("BT4Bar%s"):format(id), UIParent, "SecureHandlerStateTemplate"), Bar_MT)
|
local bar = setmetatable(CreateFrame("Frame", ("BT4Bar%s"):format(id), UIParent, "SecureHandlerStateTemplate"), Bar_MT)
|
||||||
barregistry[id] = bar
|
barregistry[id] = bar
|
||||||
table_insert(snapBars, bar)
|
table_insert(snapBars, bar)
|
||||||
|
|
||||||
bar.id = id
|
bar.id = id
|
||||||
bar.name = name or id
|
bar.name = name or id
|
||||||
bar:SetMovable(true)
|
bar:SetMovable(true)
|
||||||
bar:HookScript("OnAttributeChanged", barOnAttributeChanged)
|
bar:HookScript("OnAttributeChanged", barOnAttributeChanged)
|
||||||
|
|
||||||
local overlay = CreateFrame("Button", bar:GetName() .. "Overlay", bar)
|
local overlay = CreateFrame("Button", bar:GetName() .. "Overlay", bar)
|
||||||
bar.overlay = overlay
|
bar.overlay = overlay
|
||||||
overlay:EnableMouse(true)
|
overlay:EnableMouse(true)
|
||||||
@@ -130,22 +130,22 @@ function Bartender4.Bar:Create(id, config, name)
|
|||||||
overlay.Text:Show()
|
overlay.Text:Show()
|
||||||
overlay.Text:ClearAllPoints()
|
overlay.Text:ClearAllPoints()
|
||||||
overlay.Text:SetPoint("CENTER", overlay, "CENTER")
|
overlay.Text:SetPoint("CENTER", overlay, "CENTER")
|
||||||
|
|
||||||
overlay:SetScript("OnEnter", barOnEnter)
|
overlay:SetScript("OnEnter", barOnEnter)
|
||||||
overlay:SetScript("OnLeave", barOnLeave)
|
overlay:SetScript("OnLeave", barOnLeave)
|
||||||
overlay:SetScript("OnDragStart", barOnDragStart)
|
overlay:SetScript("OnDragStart", barOnDragStart)
|
||||||
overlay:SetScript("OnDragStop", barOnDragStop)
|
overlay:SetScript("OnDragStop", barOnDragStop)
|
||||||
overlay:SetScript("OnClick", barOnClick)
|
overlay:SetScript("OnClick", barOnClick)
|
||||||
|
|
||||||
overlay:SetFrameLevel(bar:GetFrameLevel() + 10)
|
overlay:SetFrameLevel(bar:GetFrameLevel() + 10)
|
||||||
overlay:ClearAllPoints()
|
overlay:ClearAllPoints()
|
||||||
overlay:SetAllPoints(bar)
|
overlay:SetAllPoints(bar)
|
||||||
overlay:Hide()
|
overlay:Hide()
|
||||||
|
|
||||||
bar.config = config
|
bar.config = config
|
||||||
bar.elapsed = 0
|
bar.elapsed = 0
|
||||||
bar.hidedriver = {}
|
bar.hidedriver = {}
|
||||||
|
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -195,9 +195,9 @@ function Bar:Lock()
|
|||||||
if self.disabled or not self.unlocked then return end
|
if self.disabled or not self.unlocked then return end
|
||||||
self.unlocked = nil
|
self.unlocked = nil
|
||||||
self:StopDragging()
|
self:StopDragging()
|
||||||
|
|
||||||
self:ApplyVisibilityDriver()
|
self:ApplyVisibilityDriver()
|
||||||
|
|
||||||
self.overlay:Hide()
|
self.overlay:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ function Bar:InitVisibilityDriver(returnOnly)
|
|||||||
UnregisterStateDriver(self, 'vis')
|
UnregisterStateDriver(self, 'vis')
|
||||||
end
|
end
|
||||||
self.hidedriver = {}
|
self.hidedriver = {}
|
||||||
|
|
||||||
self:SetAttribute("_onstate-vis", [[
|
self:SetAttribute("_onstate-vis", [[
|
||||||
if not newstate then return end
|
if not newstate then return end
|
||||||
if newstate == "show" then
|
if newstate == "show" then
|
||||||
@@ -345,7 +345,7 @@ function Bar:InitVisibilityDriver(returnOnly)
|
|||||||
self:Hide()
|
self:Hide()
|
||||||
end
|
end
|
||||||
]])
|
]])
|
||||||
|
|
||||||
if self.config.visibility.custom and not returnOnly then
|
if self.config.visibility.custom and not returnOnly then
|
||||||
table_insert(self.hidedriver, self.config.visibility.customdata or "")
|
table_insert(self.hidedriver, self.config.visibility.customdata or "")
|
||||||
else
|
else
|
||||||
@@ -374,7 +374,7 @@ function Bar:InitVisibilityDriver(returnOnly)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
table_insert(self.hidedriver, self.config.fadeout and "fade" or "show")
|
table_insert(self.hidedriver, self.config.fadeout and "fade" or "show")
|
||||||
|
|
||||||
if not returnOnly then
|
if not returnOnly then
|
||||||
self:ApplyVisibilityDriver()
|
self:ApplyVisibilityDriver()
|
||||||
else
|
else
|
||||||
|
|||||||
+20
-20
@@ -25,18 +25,18 @@ function Bartender4:OnInitialize()
|
|||||||
self.db.RegisterCallback(self, "OnProfileChanged", "UpdateModuleConfigs")
|
self.db.RegisterCallback(self, "OnProfileChanged", "UpdateModuleConfigs")
|
||||||
self.db.RegisterCallback(self, "OnProfileCopied", "UpdateModuleConfigs")
|
self.db.RegisterCallback(self, "OnProfileCopied", "UpdateModuleConfigs")
|
||||||
self.db.RegisterCallback(self, "OnProfileReset", "UpdateModuleConfigs")
|
self.db.RegisterCallback(self, "OnProfileReset", "UpdateModuleConfigs")
|
||||||
|
|
||||||
self:SetupOptions()
|
self:SetupOptions()
|
||||||
|
|
||||||
self.Locked = true
|
self.Locked = true
|
||||||
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CombatLockdown")
|
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CombatLockdown")
|
||||||
|
|
||||||
self:HideBlizzard()
|
self:HideBlizzard()
|
||||||
|
|
||||||
if LDB then
|
if LDB then
|
||||||
createLDBLauncher()
|
createLDBLauncher()
|
||||||
end
|
end
|
||||||
|
|
||||||
BINDING_HEADER_Bartender4 = "Bartender4"
|
BINDING_HEADER_Bartender4 = "Bartender4"
|
||||||
BINDING_CATEGORY_Bartender4 = "Action Bars"
|
BINDING_CATEGORY_Bartender4 = "Action Bars"
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
@@ -61,21 +61,21 @@ end
|
|||||||
function Bartender4:HideBlizzard()
|
function Bartender4:HideBlizzard()
|
||||||
--MultiActionBar_Update = function() end
|
--MultiActionBar_Update = function() end
|
||||||
MultiActionBar_UpdateGrid = function() end
|
MultiActionBar_UpdateGrid = function() end
|
||||||
|
|
||||||
-- Hide MultiBar Buttons, but keep the bars alive
|
-- Hide MultiBar Buttons, but keep the bars alive
|
||||||
for i=1,12 do
|
for i=1,12 do
|
||||||
_G["ActionButton" .. i]:Hide()
|
_G["ActionButton" .. i]:Hide()
|
||||||
_G["ActionButton" .. i]:UnregisterAllEvents()
|
_G["ActionButton" .. i]:UnregisterAllEvents()
|
||||||
|
|
||||||
_G["MultiBarBottomLeftButton" .. i]:Hide()
|
_G["MultiBarBottomLeftButton" .. i]:Hide()
|
||||||
_G["MultiBarBottomLeftButton" .. i]:UnregisterAllEvents()
|
_G["MultiBarBottomLeftButton" .. i]:UnregisterAllEvents()
|
||||||
|
|
||||||
_G["MultiBarBottomRightButton" .. i]:Hide()
|
_G["MultiBarBottomRightButton" .. i]:Hide()
|
||||||
_G["MultiBarBottomRightButton" .. i]:UnregisterAllEvents()
|
_G["MultiBarBottomRightButton" .. i]:UnregisterAllEvents()
|
||||||
|
|
||||||
_G["MultiBarRightButton" .. i]:Hide()
|
_G["MultiBarRightButton" .. i]:Hide()
|
||||||
_G["MultiBarRightButton" .. i]:UnregisterAllEvents()
|
_G["MultiBarRightButton" .. i]:UnregisterAllEvents()
|
||||||
|
|
||||||
_G["MultiBarLeftButton" .. i]:Hide()
|
_G["MultiBarLeftButton" .. i]:Hide()
|
||||||
_G["MultiBarLeftButton" .. i]:UnregisterAllEvents()
|
_G["MultiBarLeftButton" .. i]:UnregisterAllEvents()
|
||||||
end
|
end
|
||||||
@@ -90,7 +90,7 @@ function Bartender4:HideBlizzard()
|
|||||||
|
|
||||||
MainMenuBar:UnregisterAllEvents()
|
MainMenuBar:UnregisterAllEvents()
|
||||||
MainMenuBar:Hide()
|
MainMenuBar:Hide()
|
||||||
|
|
||||||
MainMenuBarArtFrame:UnregisterEvent("PLAYER_ENTERING_WORLD")
|
MainMenuBarArtFrame:UnregisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
--MainMenuBarArtFrame:UnregisterEvent("BAG_UPDATE")
|
--MainMenuBarArtFrame:UnregisterEvent("BAG_UPDATE")
|
||||||
MainMenuBarArtFrame:UnregisterEvent("ACTIONBAR_PAGE_CHANGED")
|
MainMenuBarArtFrame:UnregisterEvent("ACTIONBAR_PAGE_CHANGED")
|
||||||
@@ -102,7 +102,7 @@ function Bartender4:HideBlizzard()
|
|||||||
MainMenuBarArtFrame:UnregisterEvent("UNIT_EXITING_VEHICLE")
|
MainMenuBarArtFrame:UnregisterEvent("UNIT_EXITING_VEHICLE")
|
||||||
MainMenuBarArtFrame:UnregisterEvent("UNIT_EXITED_VEHICLE")
|
MainMenuBarArtFrame:UnregisterEvent("UNIT_EXITED_VEHICLE")
|
||||||
MainMenuBarArtFrame:Hide()
|
MainMenuBarArtFrame:Hide()
|
||||||
|
|
||||||
--MainMenuExpBar:UnregisterAllEvents()
|
--MainMenuExpBar:UnregisterAllEvents()
|
||||||
--MainMenuExpBar:Hide()
|
--MainMenuExpBar:Hide()
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ end
|
|||||||
|
|
||||||
function Bartender4:RegisterDefaultsKey(key, subdefaults)
|
function Bartender4:RegisterDefaultsKey(key, subdefaults)
|
||||||
defaults.profile[key] = subdefaults
|
defaults.profile[key] = subdefaults
|
||||||
|
|
||||||
self.db:RegisterDefaults(defaults)
|
self.db:RegisterDefaults(defaults)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ function Bartender4:UpdateModuleConfigs()
|
|||||||
self:Lock()
|
self:Lock()
|
||||||
unlock = true
|
unlock = true
|
||||||
end
|
end
|
||||||
|
|
||||||
for k,v in AceAddon:IterateModulesOfAddon(self) do
|
for k,v in AceAddon:IterateModulesOfAddon(self) do
|
||||||
v:ToggleModule()
|
v:ToggleModule()
|
||||||
if v:IsEnabled() and type(v.ApplyConfig) == "function" then
|
if v:IsEnabled() and type(v.ApplyConfig) == "function" then
|
||||||
@@ -143,7 +143,7 @@ function Bartender4:UpdateModuleConfigs()
|
|||||||
if LDB and LDBIcon then
|
if LDB and LDBIcon then
|
||||||
LDBIcon:Refresh("Bartender4", Bartender4.db.profile.minimapIcon)
|
LDBIcon:Refresh("Bartender4", Bartender4.db.profile.minimapIcon)
|
||||||
end
|
end
|
||||||
|
|
||||||
if unlock then
|
if unlock then
|
||||||
self:Unlock()
|
self:Unlock()
|
||||||
end
|
end
|
||||||
@@ -167,7 +167,7 @@ do
|
|||||||
function getSnap()
|
function getSnap()
|
||||||
return Bartender4.db.profile.snapping
|
return Bartender4.db.profile.snapping
|
||||||
end
|
end
|
||||||
|
|
||||||
function setSnap(value)
|
function setSnap(value)
|
||||||
Bartender4.Bar:ForAll("StopDragging")
|
Bartender4.Bar:ForAll("StopDragging")
|
||||||
Bartender4.db.profile.snapping = value
|
Bartender4.db.profile.snapping = value
|
||||||
@@ -179,7 +179,7 @@ function Bartender4:ShowUnlockDialog()
|
|||||||
if not self.unlock_dialog then
|
if not self.unlock_dialog then
|
||||||
local f = CreateFrame('Frame', 'Bartender4Dialog', UIParent)
|
local f = CreateFrame('Frame', 'Bartender4Dialog', UIParent)
|
||||||
f:SetFrameStrata('DIALOG')
|
f:SetFrameStrata('DIALOG')
|
||||||
f:SetToplevel(true)
|
f:SetToplevel(true)
|
||||||
f:EnableMouse(true)
|
f:EnableMouse(true)
|
||||||
f:SetClampedToScreen(true)
|
f:SetClampedToScreen(true)
|
||||||
f:SetWidth(360)
|
f:SetWidth(360)
|
||||||
@@ -199,12 +199,12 @@ function Bartender4:ShowUnlockDialog()
|
|||||||
|
|
||||||
local tr = f:CreateTitleRegion()
|
local tr = f:CreateTitleRegion()
|
||||||
tr:SetAllPoints(f)
|
tr:SetAllPoints(f)
|
||||||
|
|
||||||
local header = f:CreateTexture(nil, 'ARTWORK')
|
local header = f:CreateTexture(nil, 'ARTWORK')
|
||||||
header:SetTexture('Interface\\DialogFrame\\UI-DialogBox-Header')
|
header:SetTexture('Interface\\DialogFrame\\UI-DialogBox-Header')
|
||||||
header:SetWidth(256); header:SetHeight(64)
|
header:SetWidth(256); header:SetHeight(64)
|
||||||
header:SetPoint('TOP', 0, 12)
|
header:SetPoint('TOP', 0, 12)
|
||||||
|
|
||||||
local title = f:CreateFontString('ARTWORK')
|
local title = f:CreateFontString('ARTWORK')
|
||||||
title:SetFontObject('GameFontNormal')
|
title:SetFontObject('GameFontNormal')
|
||||||
title:SetPoint('TOP', header, 'TOP', 0, -14)
|
title:SetPoint('TOP', header, 'TOP', 0, -14)
|
||||||
@@ -340,7 +340,7 @@ function createLDBLauncher()
|
|||||||
tooltip:AddLine(L_BT_RIGHT)
|
tooltip:AddLine(L_BT_RIGHT)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
if LDBIcon then
|
if LDBIcon then
|
||||||
LDBIcon:Register("Bartender4", LDBObj, Bartender4.db.profile.minimapIcon)
|
LDBIcon:Register("Bartender4", LDBObj, Bartender4.db.profile.minimapIcon)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -139,5 +139,4 @@
|
|||||||
<Binding name="CLICK BT4StanceButton8:LeftButton" />
|
<Binding name="CLICK BT4StanceButton8:LeftButton" />
|
||||||
<Binding name="CLICK BT4StanceButton9:LeftButton" />
|
<Binding name="CLICK BT4StanceButton9:LeftButton" />
|
||||||
<Binding name="CLICK BT4StanceButton10:LeftButton" />
|
<Binding name="CLICK BT4StanceButton10:LeftButton" />
|
||||||
|
|
||||||
</Bindings>
|
</Bindings>
|
||||||
+11
-11
@@ -26,17 +26,17 @@ local LBF = LibStub("LibButtonFacade", true)
|
|||||||
|
|
||||||
function Bartender4.ButtonBar:Create(id, config, name)
|
function Bartender4.ButtonBar:Create(id, config, name)
|
||||||
local bar = setmetatable(Bartender4.Bar:Create(id, config, name), ButtonBar_MT)
|
local bar = setmetatable(Bartender4.Bar:Create(id, config, name), ButtonBar_MT)
|
||||||
|
|
||||||
if LBF then
|
if LBF then
|
||||||
bar.LBFGroup = LBF:Group("Bartender4", tostring(id))
|
bar.LBFGroup = LBF:Group("Bartender4", tostring(id))
|
||||||
bar.LBFGroup.SkinID = config.skin.ID or "Blizzard"
|
bar.LBFGroup.SkinID = config.skin.ID or "Blizzard"
|
||||||
bar.LBFGroup.Backdrop = config.skin.Backdrop
|
bar.LBFGroup.Backdrop = config.skin.Backdrop
|
||||||
bar.LBFGroup.Gloss = config.skin.Gloss
|
bar.LBFGroup.Gloss = config.skin.Gloss
|
||||||
bar.LBFGroup.Colors = config.skin.Colors
|
bar.LBFGroup.Colors = config.skin.Colors
|
||||||
|
|
||||||
LBF:RegisterSkinCallback("Bartender4", self.SkinChanged, self)
|
LBF:RegisterSkinCallback("Bartender4", self.SkinChanged, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ local barregistry = Bartender4.Bar.barregistry
|
|||||||
function Bartender4.ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Group, Button, Colors)
|
function Bartender4.ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Group, Button, Colors)
|
||||||
local bar = barregistry[tostring(Group)]
|
local bar = barregistry[tostring(Group)]
|
||||||
if not bar then return end
|
if not bar then return end
|
||||||
|
|
||||||
bar:SkinChanged(SkinID, Gloss, Backdrop, Colors, Button)
|
bar:SkinChanged(SkinID, Gloss, Backdrop, Colors, Button)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -135,13 +135,13 @@ ButtonBar.button_height = 36
|
|||||||
function ButtonBar:UpdateButtonLayout()
|
function ButtonBar:UpdateButtonLayout()
|
||||||
local buttons = self.buttons
|
local buttons = self.buttons
|
||||||
local pad = self:GetPadding()
|
local pad = self:GetPadding()
|
||||||
|
|
||||||
local numbuttons = self.numbuttons or #buttons
|
local numbuttons = self.numbuttons or #buttons
|
||||||
|
|
||||||
-- bail out if the bar has no buttons, for whatever reason
|
-- bail out if the bar has no buttons, for whatever reason
|
||||||
-- (eg. stanceless class, or no stances learned yet, etc.)
|
-- (eg. stanceless class, or no stances learned yet, etc.)
|
||||||
if numbuttons == 0 then return end
|
if numbuttons == 0 then return end
|
||||||
|
|
||||||
local Rows = self:GetRows()
|
local Rows = self:GetRows()
|
||||||
local ButtonPerRow = math_ceil(numbuttons / Rows) -- just a precaution
|
local ButtonPerRow = math_ceil(numbuttons / Rows) -- just a precaution
|
||||||
Rows = math_ceil(numbuttons / ButtonPerRow)
|
Rows = math_ceil(numbuttons / ButtonPerRow)
|
||||||
@@ -149,12 +149,12 @@ function ButtonBar:UpdateButtonLayout()
|
|||||||
Rows = numbuttons
|
Rows = numbuttons
|
||||||
ButtonPerRow = 1
|
ButtonPerRow = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local hpad = pad + (self.hpad_offset or 0)
|
local hpad = pad + (self.hpad_offset or 0)
|
||||||
local vpad = pad + (self.vpad_offset or 0)
|
local vpad = pad + (self.vpad_offset or 0)
|
||||||
|
|
||||||
self:SetSize((self.button_width + hpad) * ButtonPerRow - pad + 8, (self.button_height + vpad) * Rows - pad + 8)
|
self:SetSize((self.button_width + hpad) * ButtonPerRow - pad + 8, (self.button_height + vpad) * Rows - pad + 8)
|
||||||
|
|
||||||
-- anchor button 1 to the topleft corner of the bar
|
-- anchor button 1 to the topleft corner of the bar
|
||||||
buttons[1]:ClearSetPoint("TOPLEFT", self, "TOPLEFT", 5 - (self.hpad_offset or 0), -3 - (self.vpad_offset or 0))
|
buttons[1]:ClearSetPoint("TOPLEFT", self, "TOPLEFT", 5 - (self.hpad_offset or 0), -3 - (self.vpad_offset or 0))
|
||||||
-- and anchor all other buttons relative to our button 1
|
-- and anchor all other buttons relative to our button 1
|
||||||
@@ -167,7 +167,7 @@ function ButtonBar:UpdateButtonLayout()
|
|||||||
buttons[i]:ClearSetPoint("TOPLEFT", buttons[i-1], "TOPRIGHT", hpad, 0)
|
buttons[i]:ClearSetPoint("TOPLEFT", buttons[i-1], "TOPRIGHT", hpad, 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not LBF then
|
if not LBF then
|
||||||
for i = 1, #buttons do
|
for i = 1, #buttons do
|
||||||
local button = buttons[i]
|
local button = buttons[i]
|
||||||
|
|||||||
+5
-5
@@ -42,12 +42,12 @@ function MicroMenuMod:OnEnable()
|
|||||||
table_insert(buttons, MainMenuMicroButton)
|
table_insert(buttons, MainMenuMicroButton)
|
||||||
table_insert(buttons, HelpMicroButton)
|
table_insert(buttons, HelpMicroButton)
|
||||||
self.bar.buttons = buttons
|
self.bar.buttons = buttons
|
||||||
|
|
||||||
MicroMenuMod.button_count = #buttons
|
MicroMenuMod.button_count = #buttons
|
||||||
|
|
||||||
self:RawHook("UpdateTalentButton", noopFunc, true)
|
self:RawHook("UpdateTalentButton", noopFunc, true)
|
||||||
self:RawHook("AchievementMicroButton_Update", noopFunc, true)
|
self:RawHook("AchievementMicroButton_Update", noopFunc, true)
|
||||||
|
|
||||||
for i,v in pairs(buttons) do
|
for i,v in pairs(buttons) do
|
||||||
v:SetParent(self.bar)
|
v:SetParent(self.bar)
|
||||||
v:Show()
|
v:Show()
|
||||||
@@ -69,11 +69,11 @@ MicroMenuBar.button_height = 58
|
|||||||
MicroMenuBar.vpad_offset = -21
|
MicroMenuBar.vpad_offset = -21
|
||||||
function MicroMenuBar:ApplyConfig(config)
|
function MicroMenuBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then
|
if not self.config.position then
|
||||||
self:ClearSetPoint("CENTER", -105, 27)
|
self:ClearSetPoint("CENTER", -105, 27)
|
||||||
self:SavePosition()
|
self:SavePosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
end
|
end
|
||||||
|
|||||||
+13
-13
@@ -18,28 +18,28 @@ do
|
|||||||
enabled = "Enabled",
|
enabled = "Enabled",
|
||||||
grid = "Grid",
|
grid = "Grid",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- retrieves a valid bar object from the modules actionbars table
|
-- retrieves a valid bar object from the modules actionbars table
|
||||||
function getBar(id)
|
function getBar(id)
|
||||||
local bar = module.actionbars[tonumber(id)]
|
local bar = module.actionbars[tonumber(id)]
|
||||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
-- calls a function on the bar
|
-- calls a function on the bar
|
||||||
function callFunc(bar, type, option, ...)
|
function callFunc(bar, type, option, ...)
|
||||||
local func = type .. (optionMap[option] or option)
|
local func = type .. (optionMap[option] or option)
|
||||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||||
return bar[func](bar, ...)
|
return bar[func](bar, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to get a option
|
-- universal function to get a option
|
||||||
function optGetter(info)
|
function optGetter(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info[#info]
|
local option = info[#info]
|
||||||
return callFunc(bar, "Get", option)
|
return callFunc(bar, "Get", option)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to set a option
|
-- universal function to set a option
|
||||||
function optSetter(info, ...)
|
function optSetter(info, ...)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
@@ -58,7 +58,7 @@ end
|
|||||||
function module:GetOptionsObject()
|
function module:GetOptionsObject()
|
||||||
if not self.baroptions then
|
if not self.baroptions then
|
||||||
local obj = ButtonBar.GetOptionObject(self)
|
local obj = ButtonBar.GetOptionObject(self)
|
||||||
|
|
||||||
local cat_general = {
|
local cat_general = {
|
||||||
enabled ={
|
enabled ={
|
||||||
order = 4,
|
order = 4,
|
||||||
@@ -87,7 +87,7 @@ function module:GetOptionsObject()
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
obj:AddElementGroup("general", cat_general)
|
obj:AddElementGroup("general", cat_general)
|
||||||
|
|
||||||
local states = {
|
local states = {
|
||||||
type = "group",
|
type = "group",
|
||||||
name = L["State Configuration"],
|
name = L["State Configuration"],
|
||||||
@@ -95,20 +95,20 @@ function module:GetOptionsObject()
|
|||||||
args = self:GetStateOptionsTable(),
|
args = self:GetStateOptionsTable(),
|
||||||
}
|
}
|
||||||
obj:NewCategory("state", states)
|
obj:NewCategory("state", states)
|
||||||
|
|
||||||
self.baroptions = obj
|
self.baroptions = obj
|
||||||
end
|
end
|
||||||
|
|
||||||
return self.baroptions
|
return self.baroptions
|
||||||
end
|
end
|
||||||
|
|
||||||
function module:CreateBarOption(id, options)
|
function module:CreateBarOption(id, options)
|
||||||
if not self.options then return end
|
if not self.options then return end
|
||||||
|
|
||||||
if not options then
|
if not options then
|
||||||
options = self:GetOptionsTable()
|
options = self:GetOptionsTable()
|
||||||
end
|
end
|
||||||
|
|
||||||
id = tostring(id)
|
id = tostring(id)
|
||||||
if not self.options[id] then
|
if not self.options[id] then
|
||||||
self.options[id] = {
|
self.options[id] = {
|
||||||
@@ -120,7 +120,7 @@ function module:CreateBarOption(id, options)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
self.options[id].args = options
|
self.options[id].args = options
|
||||||
|
|
||||||
-- register options in the BT GUI
|
-- register options in the BT GUI
|
||||||
Bartender4:RegisterBarOptions(id, self.options[id])
|
Bartender4:RegisterBarOptions(id, self.options[id])
|
||||||
end
|
end
|
||||||
|
|||||||
+16
-16
@@ -6,7 +6,7 @@ local module = Bartender4:GetModule("ActionBars")
|
|||||||
local optGetter, optSetter
|
local optGetter, optSetter
|
||||||
do
|
do
|
||||||
local getBar, optionMap, callFunc
|
local getBar, optionMap, callFunc
|
||||||
|
|
||||||
optionMap = {
|
optionMap = {
|
||||||
stance = "StanceStateOption",
|
stance = "StanceStateOption",
|
||||||
enabled = "StateOption",
|
enabled = "StateOption",
|
||||||
@@ -25,21 +25,21 @@ do
|
|||||||
assert(bar, "Invalid bar id in options table.")
|
assert(bar, "Invalid bar id in options table.")
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
-- calls a function on the bar
|
-- calls a function on the bar
|
||||||
function callFunc(bar, type, option, ...)
|
function callFunc(bar, type, option, ...)
|
||||||
local func = type .. (optionMap[option] or option)
|
local func = type .. (optionMap[option] or option)
|
||||||
assert(bar[func], "Invalid get/set function."..func)
|
assert(bar[func], "Invalid get/set function."..func)
|
||||||
return bar[func](bar, ...)
|
return bar[func](bar, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to get a option
|
-- universal function to get a option
|
||||||
function optGetter(info)
|
function optGetter(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info.arg or info[#info]
|
local option = info.arg or info[#info]
|
||||||
return callFunc(bar, "Get", option, info[#info])
|
return callFunc(bar, "Get", option, info[#info])
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to set a option
|
-- universal function to set a option
|
||||||
function optSetter(info, ...)
|
function optSetter(info, ...)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
@@ -51,18 +51,18 @@ end
|
|||||||
|
|
||||||
local hasStances
|
local hasStances
|
||||||
|
|
||||||
local validStanceTable = {
|
local validStanceTable = {
|
||||||
[0] = L["Don't Page"],
|
[0] = L["Don't Page"],
|
||||||
(L["Page %2d"]):format(1),
|
(L["Page %2d"]):format(1),
|
||||||
(L["Page %2d"]):format(2),
|
(L["Page %2d"]):format(2),
|
||||||
(L["Page %2d"]):format(3),
|
(L["Page %2d"]):format(3),
|
||||||
(L["Page %2d"]):format(4),
|
(L["Page %2d"]):format(4),
|
||||||
(L["Page %2d"]):format(5),
|
(L["Page %2d"]):format(5),
|
||||||
(L["Page %2d"]):format(6),
|
(L["Page %2d"]):format(6),
|
||||||
(L["Page %2d"]):format(7),
|
(L["Page %2d"]):format(7),
|
||||||
(L["Page %2d"]):format(8),
|
(L["Page %2d"]):format(8),
|
||||||
(L["Page %2d"]):format(9),
|
(L["Page %2d"]):format(9),
|
||||||
(L["Page %2d"]):format(10)
|
(L["Page %2d"]):format(10)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ function module:GetStateOptionsTable()
|
|||||||
multiline = true,
|
multiline = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
local defstancemap = Bartender4.StanceMap[playerclass]
|
local defstancemap = Bartender4.StanceMap[playerclass]
|
||||||
if defstancemap then
|
if defstancemap then
|
||||||
@@ -266,6 +266,6 @@ function module:GetStateOptionsTable()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return options
|
return options
|
||||||
end
|
end
|
||||||
|
|||||||
+3
-3
@@ -19,7 +19,7 @@ function BagBarMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
local onebag = {
|
local onebag = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
order = 80,
|
order = 80,
|
||||||
@@ -29,7 +29,7 @@ function BagBarMod:SetupOptions()
|
|||||||
set = function(info, state) self.db.profile.onebag = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
set = function(info, state) self.db.profile.onebag = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "onebag", onebag)
|
self.optionobject:AddElement("general", "onebag", onebag)
|
||||||
|
|
||||||
local keyring = {
|
local keyring = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
order = 80,
|
order = 80,
|
||||||
@@ -39,7 +39,7 @@ function BagBarMod:SetupOptions()
|
|||||||
set = function(info, state) self.db.profile.keyring = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
set = function(info, state) self.db.profile.keyring = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "keyring", keyring)
|
self.optionobject:AddElement("general", "keyring", keyring)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
|
|||||||
+11
-11
@@ -20,62 +20,62 @@ do
|
|||||||
fadeoutdelay = "FadeOutDelay",
|
fadeoutdelay = "FadeOutDelay",
|
||||||
clickthrough = "ClickThrough",
|
clickthrough = "ClickThrough",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- retrieves a valid bar object from the barregistry table
|
-- retrieves a valid bar object from the barregistry table
|
||||||
function getBar(id)
|
function getBar(id)
|
||||||
local bar = barregistry[tostring(id)]
|
local bar = barregistry[tostring(id)]
|
||||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
-- calls a function on the bar
|
-- calls a function on the bar
|
||||||
function callFunc(bar, type, option, ...)
|
function callFunc(bar, type, option, ...)
|
||||||
local func = type .. (optionMap[option] or option)
|
local func = type .. (optionMap[option] or option)
|
||||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||||
return bar[func](bar, ...)
|
return bar[func](bar, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to get a option
|
-- universal function to get a option
|
||||||
function optGetter(info)
|
function optGetter(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info[#info]
|
local option = info[#info]
|
||||||
return callFunc(bar, "Get", option)
|
return callFunc(bar, "Get", option)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to set a option
|
-- universal function to set a option
|
||||||
function optSetter(info, ...)
|
function optSetter(info, ...)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info[#info]
|
local option = info[#info]
|
||||||
return callFunc(bar, "Set", option, ...)
|
return callFunc(bar, "Set", option, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function visibilityGetter(info, ...)
|
function visibilityGetter(info, ...)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info[#info]
|
local option = info[#info]
|
||||||
return bar:GetVisibilityOption(option, ...)
|
return bar:GetVisibilityOption(option, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function visibilitySetter(info, ...)
|
function visibilitySetter(info, ...)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info[#info]
|
local option = info[#info]
|
||||||
bar:SetVisibilityOption(option, ...)
|
bar:SetVisibilityOption(option, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function customEnabled(info)
|
function customEnabled(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
return bar:GetVisibilityOption("custom")
|
return bar:GetVisibilityOption("custom")
|
||||||
end
|
end
|
||||||
|
|
||||||
function customDisabled(info)
|
function customDisabled(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
return not bar:GetVisibilityOption("custom")
|
return not bar:GetVisibilityOption("custom")
|
||||||
end
|
end
|
||||||
|
|
||||||
function customCopy(info)
|
function customCopy(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
bar:CopyCustomConditionals()
|
bar:CopyCustomConditionals()
|
||||||
end
|
end
|
||||||
|
|
||||||
function clickThroughVis(info)
|
function clickThroughVis(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
return (not bar.ClickThroughSupport)
|
return (not bar.ClickThroughSupport)
|
||||||
@@ -86,7 +86,7 @@ local _, class = UnitClass("player")
|
|||||||
|
|
||||||
local function getStanceTable()
|
local function getStanceTable()
|
||||||
local num = GetNumShapeshiftForms()
|
local num = GetNumShapeshiftForms()
|
||||||
|
|
||||||
local tbl = {}
|
local tbl = {}
|
||||||
for i = 1, num do
|
for i = 1, num do
|
||||||
tbl[i] = select(2, GetShapeshiftFormInfo(i))
|
tbl[i] = select(2, GetShapeshiftFormInfo(i))
|
||||||
|
|||||||
@@ -20,28 +20,28 @@ do
|
|||||||
macrotext = "HideMacroText",
|
macrotext = "HideMacroText",
|
||||||
hotkey = "HideHotkey",
|
hotkey = "HideHotkey",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- retrieves a valid bar object from the barregistry table
|
-- retrieves a valid bar object from the barregistry table
|
||||||
function getBar(id)
|
function getBar(id)
|
||||||
local bar = barregistry[tostring(id)]
|
local bar = barregistry[tostring(id)]
|
||||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
-- calls a function on the bar
|
-- calls a function on the bar
|
||||||
function callFunc(bar, type, option, ...)
|
function callFunc(bar, type, option, ...)
|
||||||
local func = type .. (optionMap[option] or option)
|
local func = type .. (optionMap[option] or option)
|
||||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||||
return bar[func](bar, ...)
|
return bar[func](bar, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to get a option
|
-- universal function to get a option
|
||||||
function optGetter(info)
|
function optGetter(info)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
local option = info[#info]
|
local option = info[#info]
|
||||||
return callFunc(bar, "Get", option)
|
return callFunc(bar, "Get", option)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- universal function to set a option
|
-- universal function to set a option
|
||||||
function optSetter(info, ...)
|
function optSetter(info, ...)
|
||||||
local bar = getBar(info[2])
|
local bar = getBar(info[2])
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function MicroMenuMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
|
|||||||
+12
-12
@@ -7,7 +7,7 @@ do
|
|||||||
function getFunc(info)
|
function getFunc(info)
|
||||||
return (info.arg and Bartender4.db.profile[info.arg] or Bartender4.db.profile[info[#info]])
|
return (info.arg and Bartender4.db.profile[info.arg] or Bartender4.db.profile[info[#info]])
|
||||||
end
|
end
|
||||||
|
|
||||||
function setFunc(info, value)
|
function setFunc(info, value)
|
||||||
local key = info.arg or info[#info]
|
local key = info.arg or info[#info]
|
||||||
Bartender4.db.profile[key] = value
|
Bartender4.db.profile[key] = value
|
||||||
@@ -147,7 +147,7 @@ local function getOptions()
|
|||||||
get = function()
|
get = function()
|
||||||
return Bartender4.db.profile.outofrange
|
return Bartender4.db.profile.outofrange
|
||||||
end,
|
end,
|
||||||
set = function(info, value)
|
set = function(info, value)
|
||||||
Bartender4.db.profile.outofrange = value
|
Bartender4.db.profile.outofrange = value
|
||||||
Bartender4.Bar:ForAll("ApplyConfig")
|
Bartender4.Bar:ForAll("ApplyConfig")
|
||||||
end,
|
end,
|
||||||
@@ -220,12 +220,12 @@ local function getOptions()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Bartender4:ChatCommand(input)
|
function Bartender4:ChatCommand(input)
|
||||||
if InCombatLockdown() then
|
if InCombatLockdown() then
|
||||||
self:Print(L["Cannot access options during combat."])
|
self:Print(L["Cannot access options during combat."])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not input or input:trim() == "" then
|
if not input or input:trim() == "" then
|
||||||
LibStub("AceConfigDialog-3.0"):Open("Bartender4")
|
LibStub("AceConfigDialog-3.0"):Open("Bartender4")
|
||||||
else
|
else
|
||||||
LibStub("AceConfigCmd-3.0").HandleCommand(Bartender4, "bt", "Bartender4", input)
|
LibStub("AceConfigCmd-3.0").HandleCommand(Bartender4, "bt", "Bartender4", input)
|
||||||
end
|
end
|
||||||
@@ -234,14 +234,14 @@ end
|
|||||||
function Bartender4:SetupOptions()
|
function Bartender4:SetupOptions()
|
||||||
LibStub("AceConfig-3.0"):RegisterOptionsTable("Bartender4", getOptions)
|
LibStub("AceConfig-3.0"):RegisterOptionsTable("Bartender4", getOptions)
|
||||||
AceConfigDialog:SetDefaultSize("Bartender4", 680,525)
|
AceConfigDialog:SetDefaultSize("Bartender4", 680,525)
|
||||||
local optFunc = function()
|
local optFunc = function()
|
||||||
if InCombatLockdown() then return end
|
if InCombatLockdown() then return end
|
||||||
AceConfigDialog:Open("Bartender4")
|
AceConfigDialog:Open("Bartender4")
|
||||||
--[[
|
--[[
|
||||||
local status = AceConfigDialog:GetStatusTable("Bartender4")
|
local status = AceConfigDialog:GetStatusTable("Bartender4")
|
||||||
if not status.groups then status.groups = {} end
|
if not status.groups then status.groups = {} end
|
||||||
if not status.groups.groups then status.groups.groups = {} end
|
if not status.groups.groups then status.groups.groups = {} end
|
||||||
status.groups.groups["actionbars"] = true
|
status.groups.groups["actionbars"] = true
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
self:RegisterChatCommand( "bar", "ChatCommand")
|
self:RegisterChatCommand( "bar", "ChatCommand")
|
||||||
@@ -280,7 +280,7 @@ function optionParent:AddElement(category, element, data, ...)
|
|||||||
end
|
end
|
||||||
lvl = lvl.args[key]
|
lvl = lvl.args[key]
|
||||||
end
|
end
|
||||||
|
|
||||||
lvl.args[element] = data
|
lvl.args[element] = data
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -298,6 +298,6 @@ function Bartender4:NewOptionObject(otbl)
|
|||||||
for k, v in pairs(optionParent) do
|
for k, v in pairs(optionParent) do
|
||||||
tbl[k] = v
|
tbl[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
return tbl
|
return tbl
|
||||||
end
|
end
|
||||||
|
|||||||
+4
-4
@@ -8,9 +8,9 @@ local ButtonBar = Bartender4.ButtonBar.prototype
|
|||||||
function PetBarMod:SetupOptions()
|
function PetBarMod:SetupOptions()
|
||||||
if not self.options then
|
if not self.options then
|
||||||
self.optionobject = ButtonBar:GetOptionObject()
|
self.optionobject = ButtonBar:GetOptionObject()
|
||||||
|
|
||||||
self.optionobject.table.general.args.rows.max = 10
|
self.optionobject.table.general.args.rows.max = 10
|
||||||
|
|
||||||
local enabled = {
|
local enabled = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
order = 1,
|
order = 1,
|
||||||
@@ -21,7 +21,7 @@ function PetBarMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
@@ -33,7 +33,7 @@ function PetBarMod:SetupOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.options = {
|
self.options = {
|
||||||
order = 30,
|
order = 30,
|
||||||
type = "group",
|
type = "group",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function RepBarMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
@@ -56,7 +56,7 @@ function XPBarMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ function StanceBarMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
@@ -32,7 +32,7 @@ function StanceBarMod:SetupOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.options = {
|
self.options = {
|
||||||
order = 30,
|
order = 30,
|
||||||
type = "group",
|
type = "group",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function VehicleBarMod:SetupOptions()
|
|||||||
handler = self,
|
handler = self,
|
||||||
}
|
}
|
||||||
self.optionobject:AddElement("general", "enabled", enabled)
|
self.optionobject:AddElement("general", "enabled", enabled)
|
||||||
|
|
||||||
self.disabledoptions = {
|
self.disabledoptions = {
|
||||||
general = {
|
general = {
|
||||||
type = "group",
|
type = "group",
|
||||||
|
|||||||
+7
-7
@@ -27,17 +27,17 @@ end
|
|||||||
function PetBarMod:OnEnable()
|
function PetBarMod:OnEnable()
|
||||||
if not self.bar then
|
if not self.bar then
|
||||||
self.bar = setmetatable(Bartender4.ButtonBar:Create("PetBar", self.db.profile, L["Pet Bar"]), {__index = PetBar})
|
self.bar = setmetatable(Bartender4.ButtonBar:Create("PetBar", self.db.profile, L["Pet Bar"]), {__index = PetBar})
|
||||||
|
|
||||||
local buttons = {}
|
local buttons = {}
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
buttons[i] = Bartender4.PetButton:Create(i, self.bar)
|
buttons[i] = Bartender4.PetButton:Create(i, self.bar)
|
||||||
end
|
end
|
||||||
self.bar.buttons = buttons
|
self.bar.buttons = buttons
|
||||||
|
|
||||||
self.bar:SetScript("OnEvent", PetBar.OnEvent)
|
self.bar:SetScript("OnEvent", PetBar.OnEvent)
|
||||||
end
|
end
|
||||||
self.bar:Enable()
|
self.bar:Enable()
|
||||||
|
|
||||||
self.bar:RegisterEvent("PLAYER_CONTROL_LOST")
|
self.bar:RegisterEvent("PLAYER_CONTROL_LOST")
|
||||||
self.bar:RegisterEvent("PLAYER_CONTROL_GAINED")
|
self.bar:RegisterEvent("PLAYER_CONTROL_GAINED")
|
||||||
self.bar:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED")
|
self.bar:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED")
|
||||||
@@ -48,10 +48,10 @@ function PetBarMod:OnEnable()
|
|||||||
self.bar:RegisterEvent("PET_BAR_UPDATE_COOLDOWN")
|
self.bar:RegisterEvent("PET_BAR_UPDATE_COOLDOWN")
|
||||||
self.bar:RegisterEvent("PET_BAR_SHOWGRID")
|
self.bar:RegisterEvent("PET_BAR_SHOWGRID")
|
||||||
self.bar:RegisterEvent("PET_BAR_HIDEGRID")
|
self.bar:RegisterEvent("PET_BAR_HIDEGRID")
|
||||||
|
|
||||||
self:ApplyConfig()
|
self:ApplyConfig()
|
||||||
self:ToggleOptions()
|
self:ToggleOptions()
|
||||||
|
|
||||||
self:RegisterEvent("UPDATE_BINDINGS", "ReassignBindings")
|
self:RegisterEvent("UPDATE_BINDINGS", "ReassignBindings")
|
||||||
self:ReassignBindings()
|
self:ReassignBindings()
|
||||||
end
|
end
|
||||||
@@ -95,12 +95,12 @@ end
|
|||||||
|
|
||||||
function PetBar:ApplyConfig(config)
|
function PetBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then
|
if not self.config.position then
|
||||||
self:ClearSetPoint("CENTER", 0, 70)
|
self:ClearSetPoint("CENTER", 0, 70)
|
||||||
self:SavePosition()
|
self:SavePosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
self:ForAll("Update")
|
self:ForAll("Update")
|
||||||
self:ForAll("ApplyStyle", self.config.style)
|
self:ForAll("ApplyStyle", self.config.style)
|
||||||
|
|||||||
+18
-18
@@ -43,40 +43,40 @@ function Bartender4.PetButton:Create(id, parent)
|
|||||||
button.showgrid = 0
|
button.showgrid = 0
|
||||||
button.id = id
|
button.id = id
|
||||||
button.parent = parent
|
button.parent = parent
|
||||||
|
|
||||||
button:SetFrameStrata("MEDIUM")
|
button:SetFrameStrata("MEDIUM")
|
||||||
button:SetID(id)
|
button:SetID(id)
|
||||||
|
|
||||||
button:UnregisterAllEvents()
|
button:UnregisterAllEvents()
|
||||||
button:SetScript("OnEvent", nil)
|
button:SetScript("OnEvent", nil)
|
||||||
|
|
||||||
button.OnEnter = button:GetScript("OnEnter")
|
button.OnEnter = button:GetScript("OnEnter")
|
||||||
button:SetScript("OnEnter", onEnter)
|
button:SetScript("OnEnter", onEnter)
|
||||||
|
|
||||||
button:SetScript("OnDragStart", onDragStart)
|
button:SetScript("OnDragStart", onDragStart)
|
||||||
button:SetScript("OnReceiveDrag", onReceiveDrag)
|
button:SetScript("OnReceiveDrag", onReceiveDrag)
|
||||||
|
|
||||||
button.flash = _G[name .. "Flash"]
|
button.flash = _G[name .. "Flash"]
|
||||||
button.cooldown = _G[name .. "Cooldown"]
|
button.cooldown = _G[name .. "Cooldown"]
|
||||||
button.icon = _G[name .. "Icon"]
|
button.icon = _G[name .. "Icon"]
|
||||||
button.autocastable = _G[name .. "AutoCastable"]
|
button.autocastable = _G[name .. "AutoCastable"]
|
||||||
button.autocast = _G[name .. "Shine"]
|
button.autocast = _G[name .. "Shine"]
|
||||||
button.hotkey = _G[name .. "HotKey"]
|
button.hotkey = _G[name .. "HotKey"]
|
||||||
|
|
||||||
button:SetNormalTexture("")
|
button:SetNormalTexture("")
|
||||||
local oldNT = button:GetNormalTexture()
|
local oldNT = button:GetNormalTexture()
|
||||||
oldNT:Hide()
|
oldNT:Hide()
|
||||||
|
|
||||||
button.normalTexture = button:CreateTexture(("%sBTNT"):format(name))
|
button.normalTexture = button:CreateTexture(("%sBTNT"):format(name))
|
||||||
button.normalTexture:SetAllPoints(oldNT)
|
button.normalTexture:SetAllPoints(oldNT)
|
||||||
|
|
||||||
button.pushedTexture = button:GetPushedTexture()
|
button.pushedTexture = button:GetPushedTexture()
|
||||||
button.highlightTexture = button:GetHighlightTexture()
|
button.highlightTexture = button:GetHighlightTexture()
|
||||||
|
|
||||||
button.textureCache = {}
|
button.textureCache = {}
|
||||||
button.textureCache.pushed = button.pushedTexture:GetTexture()
|
button.textureCache.pushed = button.pushedTexture:GetTexture()
|
||||||
button.textureCache.highlight = button.highlightTexture:GetTexture()
|
button.textureCache.highlight = button.highlightTexture:GetTexture()
|
||||||
|
|
||||||
if LBF then
|
if LBF then
|
||||||
local group = parent.LBFGroup
|
local group = parent.LBFGroup
|
||||||
button.LBFButtonData = {
|
button.LBFButtonData = {
|
||||||
@@ -90,7 +90,7 @@ end
|
|||||||
|
|
||||||
function PetButtonPrototype:Update()
|
function PetButtonPrototype:Update()
|
||||||
local name, subtext, texture, isToken, isActive, autoCastAllowed, autoCastEnabled = GetPetActionInfo(self.id)
|
local name, subtext, texture, isToken, isActive, autoCastAllowed, autoCastEnabled = GetPetActionInfo(self.id)
|
||||||
|
|
||||||
if not isToken then
|
if not isToken then
|
||||||
self.icon:SetTexture(texture)
|
self.icon:SetTexture(texture)
|
||||||
self.tooltipName = name;
|
self.tooltipName = name;
|
||||||
@@ -98,7 +98,7 @@ function PetButtonPrototype:Update()
|
|||||||
self.icon:SetTexture(_G[texture])
|
self.icon:SetTexture(_G[texture])
|
||||||
self.tooltipName = _G[name]
|
self.tooltipName = _G[name]
|
||||||
end
|
end
|
||||||
|
|
||||||
self.isToken = isToken
|
self.isToken = isToken
|
||||||
self.tooltipSubtext = subtext
|
self.tooltipSubtext = subtext
|
||||||
self:SetChecked(isActive and 1 or 0)
|
self:SetChecked(isActive and 1 or 0)
|
||||||
@@ -112,7 +112,7 @@ function PetButtonPrototype:Update()
|
|||||||
self.autocastable:Hide()
|
self.autocastable:Hide()
|
||||||
AutoCastShine_AutoCastStop(self.autocast)
|
AutoCastShine_AutoCastStop(self.autocast)
|
||||||
end
|
end
|
||||||
|
|
||||||
if texture then
|
if texture then
|
||||||
if GetPetActionsUsable() then
|
if GetPetActionsUsable() then
|
||||||
SetDesaturation(self.icon, nil)
|
SetDesaturation(self.icon, nil)
|
||||||
@@ -146,7 +146,7 @@ end
|
|||||||
function PetButtonPrototype:UpdateHotkeys()
|
function PetButtonPrototype:UpdateHotkeys()
|
||||||
local key = self:GetHotkey() or ""
|
local key = self:GetHotkey() or ""
|
||||||
local hotkey = self.hotkey
|
local hotkey = self.hotkey
|
||||||
|
|
||||||
if key == "" or self.parent.config.hidehotkey then
|
if key == "" or self.parent.config.hidehotkey then
|
||||||
hotkey:Hide()
|
hotkey:Hide()
|
||||||
else
|
else
|
||||||
@@ -172,7 +172,7 @@ end
|
|||||||
function PetButtonPrototype:HideButton()
|
function PetButtonPrototype:HideButton()
|
||||||
self.textureCache.pushed = self.pushedTexture:GetTexture()
|
self.textureCache.pushed = self.pushedTexture:GetTexture()
|
||||||
self.textureCache.highlight = self.highlightTexture:GetTexture()
|
self.textureCache.highlight = self.highlightTexture:GetTexture()
|
||||||
|
|
||||||
self.pushedTexture:SetTexture("")
|
self.pushedTexture:SetTexture("")
|
||||||
self.highlightTexture:SetTexture("")
|
self.highlightTexture:SetTexture("")
|
||||||
if LBF then
|
if LBF then
|
||||||
@@ -210,7 +210,7 @@ end
|
|||||||
|
|
||||||
function PetButtonPrototype:GetBindings()
|
function PetButtonPrototype:GetBindings()
|
||||||
local keys, binding = ""
|
local keys, binding = ""
|
||||||
|
|
||||||
binding = format("BONUSACTIONBUTTON%d", self.id)
|
binding = format("BONUSACTIONBUTTON%d", self.id)
|
||||||
for i = 1, select('#', GetBindingKey(binding)) do
|
for i = 1, select('#', GetBindingKey(binding)) do
|
||||||
local hotKey = select(i, GetBindingKey(binding))
|
local hotKey = select(i, GetBindingKey(binding))
|
||||||
@@ -219,7 +219,7 @@ function PetButtonPrototype:GetBindings()
|
|||||||
end
|
end
|
||||||
keys = keys .. GetBindingText(hotKey,'KEY_')
|
keys = keys .. GetBindingText(hotKey,'KEY_')
|
||||||
end
|
end
|
||||||
|
|
||||||
binding = "CLICK "..self:GetName()..":LeftButton"
|
binding = "CLICK "..self:GetName()..":LeftButton"
|
||||||
for i = 1, select('#', GetBindingKey(binding)) do
|
for i = 1, select('#', GetBindingKey(binding)) do
|
||||||
local hotKey = select(i, GetBindingKey(binding))
|
local hotKey = select(i, GetBindingKey(binding))
|
||||||
@@ -241,7 +241,7 @@ function PetButtonPrototype:ClearBindings()
|
|||||||
while GetBindingKey(binding) do
|
while GetBindingKey(binding) do
|
||||||
SetBinding(GetBindingKey(binding), nil)
|
SetBinding(GetBindingKey(binding), nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
binding = "CLICK "..self:GetName()..":LeftButton"
|
binding = "CLICK "..self:GetName()..":LeftButton"
|
||||||
while GetBindingKey(binding) do
|
while GetBindingKey(binding) do
|
||||||
SetBinding(GetBindingKey(binding), nil)
|
SetBinding(GetBindingKey(binding), nil)
|
||||||
|
|||||||
+5
-5
@@ -24,9 +24,9 @@ function RepBarMod:OnEnable()
|
|||||||
if not self.bar then
|
if not self.bar then
|
||||||
self.bar = setmetatable(Bartender4.Bar:Create("Rep", self.db.profile, L["Reputation Bar"]), {__index = RepBar})
|
self.bar = setmetatable(Bartender4.Bar:Create("Rep", self.db.profile, L["Reputation Bar"]), {__index = RepBar})
|
||||||
self.bar.content = ReputationWatchBar
|
self.bar.content = ReputationWatchBar
|
||||||
|
|
||||||
hooksecurefunc("ReputationWatchBar_Update", function() self.bar:PerformLayout() end)
|
hooksecurefunc("ReputationWatchBar_Update", function() self.bar:PerformLayout() end)
|
||||||
|
|
||||||
self.bar.content:SetParent(self.bar)
|
self.bar.content:SetParent(self.bar)
|
||||||
self.bar.content:Show()
|
self.bar.content:Show()
|
||||||
self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1)
|
self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1)
|
||||||
@@ -42,12 +42,12 @@ end
|
|||||||
|
|
||||||
function RepBar:ApplyConfig(config)
|
function RepBar:ApplyConfig(config)
|
||||||
Bar.ApplyConfig(self, config)
|
Bar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then
|
if not self.config.position then
|
||||||
self:ClearSetPoint("CENTER")
|
self:ClearSetPoint("CENTER")
|
||||||
self:SavePosition()
|
self:SavePosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:PerformLayout()
|
self:PerformLayout()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ function XPBarMod:OnEnable()
|
|||||||
if not self.bar then
|
if not self.bar then
|
||||||
self.bar = setmetatable(Bartender4.Bar:Create("XP", self.db.profile, L["XP Bar"]), {__index = XPBar})
|
self.bar = setmetatable(Bartender4.Bar:Create("XP", self.db.profile, L["XP Bar"]), {__index = XPBar})
|
||||||
self.bar.content = MainMenuExpBar
|
self.bar.content = MainMenuExpBar
|
||||||
|
|
||||||
self.bar.content:SetParent(self.bar)
|
self.bar.content:SetParent(self.bar)
|
||||||
self.bar.content:Show()
|
self.bar.content:Show()
|
||||||
self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1)
|
self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1)
|
||||||
|
|||||||
+25
-25
@@ -32,7 +32,7 @@ function StanceBarMod:OnEnable()
|
|||||||
self.bar:SetScript("OnEvent", StanceBar.OnEvent)
|
self.bar:SetScript("OnEvent", StanceBar.OnEvent)
|
||||||
end
|
end
|
||||||
self.bar:Enable()
|
self.bar:Enable()
|
||||||
|
|
||||||
self:ToggleOptions()
|
self:ToggleOptions()
|
||||||
self.bar:RegisterEvent("PLAYER_ENTERING_WORLD")
|
self.bar:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
self.bar:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")
|
self.bar:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")
|
||||||
@@ -51,7 +51,7 @@ StanceBarMod.button_count = 10
|
|||||||
function StanceBarMod:ApplyConfig()
|
function StanceBarMod:ApplyConfig()
|
||||||
if not self:IsEnabled() then return end
|
if not self:IsEnabled() then return end
|
||||||
self.bar:ApplyConfig(self.db.profile)
|
self.bar:ApplyConfig(self.db.profile)
|
||||||
|
|
||||||
if GetNumShapeshiftForms() == 0 then
|
if GetNumShapeshiftForms() == 0 then
|
||||||
self:Disable()
|
self:Disable()
|
||||||
end
|
end
|
||||||
@@ -74,9 +74,9 @@ function StanceButtonPrototype:Update()
|
|||||||
if not self:IsShown() then return end
|
if not self:IsShown() then return end
|
||||||
local id = self:GetID()
|
local id = self:GetID()
|
||||||
local texture, name, isActive, isCastable = GetShapeshiftFormInfo(id)
|
local texture, name, isActive, isCastable = GetShapeshiftFormInfo(id)
|
||||||
|
|
||||||
self.icon:SetTexture(texture)
|
self.icon:SetTexture(texture)
|
||||||
|
|
||||||
-- manage cooldowns
|
-- manage cooldowns
|
||||||
if texture then
|
if texture then
|
||||||
self.cooldown:Show()
|
self.cooldown:Show()
|
||||||
@@ -85,26 +85,26 @@ function StanceButtonPrototype:Update()
|
|||||||
end
|
end
|
||||||
local start, duration, enable = GetShapeshiftFormCooldown(id)
|
local start, duration, enable = GetShapeshiftFormCooldown(id)
|
||||||
CooldownFrame_SetTimer(self.cooldown, start, duration, enable)
|
CooldownFrame_SetTimer(self.cooldown, start, duration, enable)
|
||||||
|
|
||||||
if isActive then
|
if isActive then
|
||||||
self:SetChecked(1)
|
self:SetChecked(1)
|
||||||
else
|
else
|
||||||
self:SetChecked(0)
|
self:SetChecked(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
if isCastable then
|
if isCastable then
|
||||||
self.icon:SetVertexColor(1.0, 1.0, 1.0)
|
self.icon:SetVertexColor(1.0, 1.0, 1.0)
|
||||||
else
|
else
|
||||||
self.icon:SetVertexColor(0.4, 0.4, 0.4)
|
self.icon:SetVertexColor(0.4, 0.4, 0.4)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:UpdateHotkeys()
|
self:UpdateHotkeys()
|
||||||
end
|
end
|
||||||
|
|
||||||
function StanceButtonPrototype:UpdateHotkeys()
|
function StanceButtonPrototype:UpdateHotkeys()
|
||||||
local key = self:GetHotkey() or ""
|
local key = self:GetHotkey() or ""
|
||||||
local hotkey = self.hotkey
|
local hotkey = self.hotkey
|
||||||
|
|
||||||
if key == "" or self.parent.config.hidehotkey then
|
if key == "" or self.parent.config.hidehotkey then
|
||||||
hotkey:Hide()
|
hotkey:Hide()
|
||||||
else
|
else
|
||||||
@@ -120,7 +120,7 @@ end
|
|||||||
|
|
||||||
function StanceButtonPrototype:GetBindings()
|
function StanceButtonPrototype:GetBindings()
|
||||||
local keys, binding = ""
|
local keys, binding = ""
|
||||||
|
|
||||||
binding = format("SHAPESHIFTBUTTON%d", self:GetID())
|
binding = format("SHAPESHIFTBUTTON%d", self:GetID())
|
||||||
for i = 1, select('#', GetBindingKey(binding)) do
|
for i = 1, select('#', GetBindingKey(binding)) do
|
||||||
local hotKey = select(i, GetBindingKey(binding))
|
local hotKey = select(i, GetBindingKey(binding))
|
||||||
@@ -129,7 +129,7 @@ function StanceButtonPrototype:GetBindings()
|
|||||||
end
|
end
|
||||||
keys = keys .. GetBindingText(hotKey,'KEY_')
|
keys = keys .. GetBindingText(hotKey,'KEY_')
|
||||||
end
|
end
|
||||||
|
|
||||||
binding = "CLICK "..self:GetName()..":LeftButton"
|
binding = "CLICK "..self:GetName()..":LeftButton"
|
||||||
for i = 1, select('#', GetBindingKey(binding)) do
|
for i = 1, select('#', GetBindingKey(binding)) do
|
||||||
local hotKey = select(i, GetBindingKey(binding))
|
local hotKey = select(i, GetBindingKey(binding))
|
||||||
@@ -151,7 +151,7 @@ function StanceButtonPrototype:ClearBindings()
|
|||||||
while GetBindingKey(binding) do
|
while GetBindingKey(binding) do
|
||||||
SetBinding(GetBindingKey(binding), nil)
|
SetBinding(GetBindingKey(binding), nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
binding = "CLICK "..self:GetName()..":LeftButton"
|
binding = "CLICK "..self:GetName()..":LeftButton"
|
||||||
while GetBindingKey(binding) do
|
while GetBindingKey(binding) do
|
||||||
SetBinding(GetBindingKey(binding), nil)
|
SetBinding(GetBindingKey(binding), nil)
|
||||||
@@ -188,10 +188,10 @@ function StanceBarMod:CreateStanceButton(id)
|
|||||||
button.normalTexture:SetTexture("")
|
button.normalTexture:SetTexture("")
|
||||||
-- button.checkedTexture = button:GetCheckedTexture()
|
-- button.checkedTexture = button:GetCheckedTexture()
|
||||||
-- button.checkedTexture:SetTexture("")
|
-- button.checkedTexture:SetTexture("")
|
||||||
|
|
||||||
button.OnEnter = button:GetScript("OnEnter")
|
button.OnEnter = button:GetScript("OnEnter")
|
||||||
button:SetScript("OnEnter", onEnter)
|
button:SetScript("OnEnter", onEnter)
|
||||||
|
|
||||||
if LBF then
|
if LBF then
|
||||||
local group = self.bar.LBFGroup
|
local group = self.bar.LBFGroup
|
||||||
button.LBFButtonData = {
|
button.LBFButtonData = {
|
||||||
@@ -199,18 +199,18 @@ function StanceBarMod:CreateStanceButton(id)
|
|||||||
}
|
}
|
||||||
group:AddButton(button, button.LBFButtonData)
|
group:AddButton(button, button.LBFButtonData)
|
||||||
end
|
end
|
||||||
|
|
||||||
return button
|
return button
|
||||||
end
|
end
|
||||||
|
|
||||||
function StanceBar:ApplyConfig(config)
|
function StanceBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then
|
if not self.config.position then
|
||||||
self:ClearSetPoint("CENTER", -55, -10)
|
self:ClearSetPoint("CENTER", -55, -10)
|
||||||
self:SavePosition()
|
self:SavePosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:UpdateStanceButtons()
|
self:UpdateStanceButtons()
|
||||||
self:ForAll("ApplyStyle", self.config.style)
|
self:ForAll("ApplyStyle", self.config.style)
|
||||||
end
|
end
|
||||||
@@ -219,37 +219,37 @@ StanceBar.button_width = 30
|
|||||||
StanceBar.button_height = 30
|
StanceBar.button_height = 30
|
||||||
function StanceBar:UpdateStanceButtons()
|
function StanceBar:UpdateStanceButtons()
|
||||||
local buttons = self.buttons or {}
|
local buttons = self.buttons or {}
|
||||||
|
|
||||||
local num_stances = GetNumShapeshiftForms()
|
local num_stances = GetNumShapeshiftForms()
|
||||||
|
|
||||||
local updateBindings = (num_stances > #buttons)
|
local updateBindings = (num_stances > #buttons)
|
||||||
|
|
||||||
for i = (#buttons+1), num_stances do
|
for i = (#buttons+1), num_stances do
|
||||||
buttons[i] = StanceBarMod:CreateStanceButton(i)
|
buttons[i] = StanceBarMod:CreateStanceButton(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1, num_stances do
|
for i = 1, num_stances do
|
||||||
buttons[i]:Show()
|
buttons[i]:Show()
|
||||||
buttons[i]:Update()
|
buttons[i]:Update()
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = num_stances+1, #buttons do
|
for i = num_stances+1, #buttons do
|
||||||
buttons[i]:Hide()
|
buttons[i]:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
StanceBarMod.button_count = num_stances
|
StanceBarMod.button_count = num_stances
|
||||||
if StanceBarMod.optionobject then
|
if StanceBarMod.optionobject then
|
||||||
StanceBarMod.optionobject.table.general.args.rows.max = num_stances
|
StanceBarMod.optionobject.table.general.args.rows.max = num_stances
|
||||||
end
|
end
|
||||||
|
|
||||||
self.buttons = buttons
|
self.buttons = buttons
|
||||||
|
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
if updateBindings then
|
if updateBindings then
|
||||||
StanceBarMod:ReassignBindings()
|
StanceBarMod:ReassignBindings()
|
||||||
end
|
end
|
||||||
self.disabled = (GetNumShapeshiftForms() == 0) and true or nil
|
self.disabled = (GetNumShapeshiftForms() == 0) and true or nil
|
||||||
|
|
||||||
-- need to re-set clickthrough after creating new buttons
|
-- need to re-set clickthrough after creating new buttons
|
||||||
self:SetClickThrough()
|
self:SetClickThrough()
|
||||||
end
|
end
|
||||||
|
|||||||
+8
-8
@@ -28,7 +28,7 @@ function VehicleBarMod:OnEnable()
|
|||||||
self.bar = setmetatable(Bartender4.ButtonBar:Create("Vehicle", self.db.profile, L["Vehicle Bar"], true), {__index = VehicleBar})
|
self.bar = setmetatable(Bartender4.ButtonBar:Create("Vehicle", self.db.profile, L["Vehicle Bar"], true), {__index = VehicleBar})
|
||||||
local buttons = {VehicleMenuBarLeaveButton, VehicleMenuBarPitchUpButton, VehicleMenuBarPitchDownButton}
|
local buttons = {VehicleMenuBarLeaveButton, VehicleMenuBarPitchUpButton, VehicleMenuBarPitchDownButton}
|
||||||
self.bar.buttons = buttons
|
self.bar.buttons = buttons
|
||||||
|
|
||||||
VehicleBarMod.button_count = 3
|
VehicleBarMod.button_count = 3
|
||||||
|
|
||||||
for i,v in pairs(buttons) do
|
for i,v in pairs(buttons) do
|
||||||
@@ -36,21 +36,21 @@ function VehicleBarMod:OnEnable()
|
|||||||
v:Show()
|
v:Show()
|
||||||
v.ClearSetPoint = self.bar.ClearSetPoint
|
v.ClearSetPoint = self.bar.ClearSetPoint
|
||||||
end
|
end
|
||||||
|
|
||||||
self.bar:SetScript("OnEvent", self.bar.OnEvent)
|
self.bar:SetScript("OnEvent", self.bar.OnEvent)
|
||||||
self.bar:RegisterEvent("UNIT_ENTERED_VEHICLE")
|
self.bar:RegisterEvent("UNIT_ENTERED_VEHICLE")
|
||||||
|
|
||||||
-- setup button skins
|
-- setup button skins
|
||||||
VehicleMenuBarPitchUpButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Pitch-Up]])
|
VehicleMenuBarPitchUpButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Pitch-Up]])
|
||||||
VehicleMenuBarPitchUpButton:GetNormalTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
VehicleMenuBarPitchUpButton:GetNormalTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
||||||
VehicleMenuBarPitchUpButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Pitch-Down]])
|
VehicleMenuBarPitchUpButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Pitch-Down]])
|
||||||
VehicleMenuBarPitchUpButton:GetPushedTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
VehicleMenuBarPitchUpButton:GetPushedTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
||||||
|
|
||||||
VehicleMenuBarPitchDownButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-PitchDown-Up]])
|
VehicleMenuBarPitchDownButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-PitchDown-Up]])
|
||||||
VehicleMenuBarPitchDownButton:GetNormalTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
VehicleMenuBarPitchDownButton:GetNormalTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
||||||
VehicleMenuBarPitchDownButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-PitchDown-Down]])
|
VehicleMenuBarPitchDownButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-PitchDown-Down]])
|
||||||
VehicleMenuBarPitchDownButton:GetPushedTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
VehicleMenuBarPitchDownButton:GetPushedTexture():SetTexCoord(0.21875, 0.765625, 0.234375, 0.78125)
|
||||||
|
|
||||||
VehicleMenuBarLeaveButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Exit-Up]])
|
VehicleMenuBarLeaveButton:GetNormalTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Exit-Up]])
|
||||||
VehicleMenuBarLeaveButton:GetNormalTexture():SetTexCoord(0.140625, 0.859375, 0.140625, 0.859375)
|
VehicleMenuBarLeaveButton:GetNormalTexture():SetTexCoord(0.140625, 0.859375, 0.140625, 0.859375)
|
||||||
VehicleMenuBarLeaveButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Exit-Down]])
|
VehicleMenuBarLeaveButton:GetPushedTexture():SetTexture([[Interface\Vehicles\UI-Vehicles-Button-Exit-Down]])
|
||||||
@@ -70,12 +70,12 @@ VehicleBar.button_height = 30
|
|||||||
VehicleBar.LBFOverride = true
|
VehicleBar.LBFOverride = true
|
||||||
function VehicleBar:ApplyConfig(config)
|
function VehicleBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
|
|
||||||
if not self.config.position then
|
if not self.config.position then
|
||||||
self:ClearSetPoint("CENTER", -105, 27)
|
self:ClearSetPoint("CENTER", -105, 27)
|
||||||
self:SavePosition()
|
self:SavePosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ function VehicleBar:UpdateButtonVisibility()
|
|||||||
_G["VehicleMenuBarPitchUpButton"]:Hide()
|
_G["VehicleMenuBarPitchUpButton"]:Hide()
|
||||||
_G["VehicleMenuBarPitchDownButton"]:Hide()
|
_G["VehicleMenuBarPitchDownButton"]:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
if CanExitVehicle() then
|
if CanExitVehicle() then
|
||||||
_G["VehicleMenuBarLeaveButton"]:Show()
|
_G["VehicleMenuBarLeaveButton"]:Show()
|
||||||
else
|
else
|
||||||
|
|||||||
+39
-39
@@ -1,19 +1,19 @@
|
|||||||
--[[---------------------------------------------------------------------------------
|
--[[---------------------------------------------------------------------------------
|
||||||
General Library providing an alternate StartMoving() that allows you to
|
General Library providing an alternate StartMoving() that allows you to
|
||||||
specify a number of frames to snap-to when moving the frame around
|
specify a number of frames to snap-to when moving the frame around
|
||||||
|
|
||||||
Example Usage:
|
Example Usage:
|
||||||
|
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
this:RegisterForDrag("LeftButton")
|
this:RegisterForDrag("LeftButton")
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnDragStart>
|
<OnDragStart>
|
||||||
StickyFrames:StartMoving(this, {WatchDogFrame_player, WatchDogFrame_target, WatchDogFrame_party1, WatchDogFrame_party2, WatchDogFrame_party3, WatchDogFrame_party4},3,3,3,3)
|
StickyFrames:StartMoving(this, {WatchDogFrame_player, WatchDogFrame_target, WatchDogFrame_party1, WatchDogFrame_party2, WatchDogFrame_party3, WatchDogFrame_party4},3,3,3,3)
|
||||||
</OnDragStart>
|
</OnDragStart>
|
||||||
<OnDragStop>
|
<OnDragStop>
|
||||||
StickyFrames:StopMoving(this)
|
StickyFrames:StopMoving(this)
|
||||||
StickyFrames:AnchorFrame(this)
|
StickyFrames:AnchorFrame(this)
|
||||||
</OnDragStop>
|
</OnDragStop>
|
||||||
|
|
||||||
------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------
|
||||||
This is a modified version by Nevcairiel for Bartender4
|
This is a modified version by Nevcairiel for Bartender4
|
||||||
@@ -25,7 +25,7 @@ local StickyFrames, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
|||||||
if not StickyFrames then return end
|
if not StickyFrames then return end
|
||||||
|
|
||||||
--[[---------------------------------------------------------------------------------
|
--[[---------------------------------------------------------------------------------
|
||||||
Class declaration, along with a temporary table to hold any existing OnUpdate
|
Class declaration, along with a temporary table to hold any existing OnUpdate
|
||||||
scripts.
|
scripts.
|
||||||
------------------------------------------------------------------------------------]]
|
------------------------------------------------------------------------------------]]
|
||||||
|
|
||||||
@@ -37,22 +37,22 @@ StickyFrames.sticky = StickyFrames.sticky or {}
|
|||||||
--[[---------------------------------------------------------------------------------
|
--[[---------------------------------------------------------------------------------
|
||||||
StickyFrames:StartMoving() - Sets a custom OnUpdate for the frame so it follows
|
StickyFrames:StartMoving() - Sets a custom OnUpdate for the frame so it follows
|
||||||
the mouse and snaps to the frames you specify
|
the mouse and snaps to the frames you specify
|
||||||
|
|
||||||
frame: The frame we want to move. Is typically "this"
|
frame: The frame we want to move. Is typically "this"
|
||||||
|
|
||||||
frameList: A integer indexed list of frames that the given frame should try to
|
frameList: A integer indexed list of frames that the given frame should try to
|
||||||
stick to. These don't have to have anything special done to them,
|
stick to. These don't have to have anything special done to them,
|
||||||
and they don't really even need to exist. You can inclue the
|
and they don't really even need to exist. You can inclue the
|
||||||
moving frame in this list, it will be ignored. This helps you
|
moving frame in this list, it will be ignored. This helps you
|
||||||
if you have a number of frames, just make ONE list to pass.
|
if you have a number of frames, just make ONE list to pass.
|
||||||
|
|
||||||
{WatchDogFrame_player, WatchDogFrame_party1, .. WatchDogFrame_party4}
|
{WatchDogFrame_player, WatchDogFrame_party1, .. WatchDogFrame_party4}
|
||||||
|
|
||||||
left: If your frame has a tranparent border around the entire frame
|
left: If your frame has a tranparent border around the entire frame
|
||||||
(think backdrops with borders). This can be used to fine tune the
|
(think backdrops with borders). This can be used to fine tune the
|
||||||
edges when you're stickying groups. Refers to any offset on the
|
edges when you're stickying groups. Refers to any offset on the
|
||||||
LEFT edge of the frame being moved.
|
LEFT edge of the frame being moved.
|
||||||
|
|
||||||
top: same
|
top: same
|
||||||
right: same
|
right: same
|
||||||
bottom: same
|
bottom: same
|
||||||
@@ -62,7 +62,7 @@ function StickyFrames:StartMoving(frame, frameList, left, top, right, bottom)
|
|||||||
local x,y = GetCursorPosition()
|
local x,y = GetCursorPosition()
|
||||||
local aX,aY = frame:GetCenter()
|
local aX,aY = frame:GetCenter()
|
||||||
local aS = frame:GetEffectiveScale()
|
local aS = frame:GetEffectiveScale()
|
||||||
|
|
||||||
aX,aY = aX*aS,aY*aS
|
aX,aY = aX*aS,aY*aS
|
||||||
local xoffset,yoffset = (aX - x),(aY - y)
|
local xoffset,yoffset = (aX - x),(aY - y)
|
||||||
self.scripts[frame] = frame:GetScript("OnUpdate")
|
self.scripts[frame] = frame:GetScript("OnUpdate")
|
||||||
@@ -71,25 +71,25 @@ end
|
|||||||
|
|
||||||
--[[---------------------------------------------------------------------------------
|
--[[---------------------------------------------------------------------------------
|
||||||
This stops the OnUpdate, leaving the frame at its last position. This will
|
This stops the OnUpdate, leaving the frame at its last position. This will
|
||||||
leave it anchored to UIParent. You can call StickyFrames:AnchorFrame() to
|
leave it anchored to UIParent. You can call StickyFrames:AnchorFrame() to
|
||||||
anchor it back "TOPLEFT" , "TOPLEFT" to the parent.
|
anchor it back "TOPLEFT" , "TOPLEFT" to the parent.
|
||||||
------------------------------------------------------------------------------------]]
|
------------------------------------------------------------------------------------]]
|
||||||
|
|
||||||
function StickyFrames:StopMoving(frame)
|
function StickyFrames:StopMoving(frame)
|
||||||
frame:SetScript("OnUpdate", self.scripts[frame])
|
frame:SetScript("OnUpdate", self.scripts[frame])
|
||||||
self.scripts[frame] = nil
|
self.scripts[frame] = nil
|
||||||
|
|
||||||
if StickyFrames.sticky[frame] then
|
if StickyFrames.sticky[frame] then
|
||||||
local sticky = StickyFrames.sticky[frame]
|
local sticky = StickyFrames.sticky[frame]
|
||||||
StickyFrames.sticky[frame] = nil
|
StickyFrames.sticky[frame] = nil
|
||||||
return true, sticky
|
return true, sticky
|
||||||
else
|
else
|
||||||
return false, nil
|
return false, nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[---------------------------------------------------------------------------------
|
--[[---------------------------------------------------------------------------------
|
||||||
This can be called in conjunction with StickyFrames:StopMoving() to anchor the
|
This can be called in conjunction with StickyFrames:StopMoving() to anchor the
|
||||||
frame right back to the parent, so you can manipulate its children as a group
|
frame right back to the parent, so you can manipulate its children as a group
|
||||||
(This is useful in WatchDog)
|
(This is useful in WatchDog)
|
||||||
------------------------------------------------------------------------------------]]
|
------------------------------------------------------------------------------------]]
|
||||||
@@ -99,14 +99,14 @@ function StickyFrames:AnchorFrame(frame)
|
|||||||
local parent = frame:GetParent() or UIParent
|
local parent = frame:GetParent() or UIParent
|
||||||
local xP,yP = parent:GetCenter()
|
local xP,yP = parent:GetCenter()
|
||||||
local sA,sP = frame:GetEffectiveScale(), parent:GetEffectiveScale()
|
local sA,sP = frame:GetEffectiveScale(), parent:GetEffectiveScale()
|
||||||
|
|
||||||
xP,yP = (xP*sP) / sA, (yP*sP) / sA
|
xP,yP = (xP*sP) / sA, (yP*sP) / sA
|
||||||
|
|
||||||
local xo,yo = (xP - xA)*-1, (yP - yA)*-1
|
local xo,yo = (xP - xA)*-1, (yP - yA)*-1
|
||||||
|
|
||||||
frame:ClearAllPoints()
|
frame:ClearAllPoints()
|
||||||
frame:SetPoint("CENTER", parent, "CENTER", xo, yo)
|
frame:SetPoint("CENTER", parent, "CENTER", xo, yo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[---------------------------------------------------------------------------------
|
--[[---------------------------------------------------------------------------------
|
||||||
@@ -127,12 +127,12 @@ function StickyFrames:GetUpdateFunc(frame, frameList, xoffset, yoffset, left, to
|
|||||||
local x,y = GetCursorPosition()
|
local x,y = GetCursorPosition()
|
||||||
local s = frame:GetEffectiveScale()
|
local s = frame:GetEffectiveScale()
|
||||||
local sticky = nil
|
local sticky = nil
|
||||||
|
|
||||||
x,y = x/s,y/s
|
x,y = x/s,y/s
|
||||||
|
|
||||||
frame:ClearAllPoints()
|
frame:ClearAllPoints()
|
||||||
frame:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x+xoffset, y+yoffset)
|
frame:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x+xoffset, y+yoffset)
|
||||||
|
|
||||||
StickyFrames.sticky[frame] = nil
|
StickyFrames.sticky[frame] = nil
|
||||||
for i = 1, #frameList do
|
for i = 1, #frameList do
|
||||||
local v = frameList[i]
|
local v = frameList[i]
|
||||||
@@ -167,7 +167,7 @@ function StickyFrames:SnapFrame(frameA, frameB, left, top, right, bottom)
|
|||||||
local xB, yB = frameB:GetCenter()
|
local xB, yB = frameB:GetCenter()
|
||||||
local hA, hB = frameA:GetHeight() / 2, ((frameB:GetHeight() * sB) / sA) / 2
|
local hA, hB = frameA:GetHeight() / 2, ((frameB:GetHeight() * sB) / sA) / 2
|
||||||
local wA, wB = frameA:GetWidth() / 2, ((frameB:GetWidth() * sB) / sA) / 2
|
local wA, wB = frameA:GetWidth() / 2, ((frameB:GetWidth() * sB) / sA) / 2
|
||||||
|
|
||||||
local newX, newY = xA, yA
|
local newX, newY = xA, yA
|
||||||
|
|
||||||
if not left then left = 0 end
|
if not left then left = 0 end
|
||||||
@@ -182,81 +182,81 @@ function StickyFrames:SnapFrame(frameA, frameB, left, top, right, bottom)
|
|||||||
local stickyBx, stickyBy = wB * 0.75, hB * 0.75
|
local stickyBx, stickyBy = wB * 0.75, hB * 0.75
|
||||||
|
|
||||||
-- Grab the edges of each frame, for easier comparison
|
-- Grab the edges of each frame, for easier comparison
|
||||||
|
|
||||||
local lA, tA, rA, bA = frameA:GetLeft(), frameA:GetTop(), frameA:GetRight(), frameA:GetBottom()
|
local lA, tA, rA, bA = frameA:GetLeft(), frameA:GetTop(), frameA:GetRight(), frameA:GetBottom()
|
||||||
local lB, tB, rB, bB = frameB:GetLeft(), frameB:GetTop(), frameB:GetRight(), frameB:GetBottom()
|
local lB, tB, rB, bB = frameB:GetLeft(), frameB:GetTop(), frameB:GetRight(), frameB:GetBottom()
|
||||||
local snap = nil
|
local snap = nil
|
||||||
|
|
||||||
-- Translate into A's scale
|
-- Translate into A's scale
|
||||||
lB, tB, rB, bB = (lB * sB) / sA, (tB * sB) / sA, (rB * sB) / sA, (bB * sB) / sA
|
lB, tB, rB, bB = (lB * sB) / sA, (tB * sB) / sA, (rB * sB) / sA, (bB * sB) / sA
|
||||||
|
|
||||||
if (bA <= tB and bB <= tA) then
|
if (bA <= tB and bB <= tA) then
|
||||||
|
|
||||||
-- Horizontal Centers
|
-- Horizontal Centers
|
||||||
if xA <= (xB + StickyFrames.rangeX) and xA >= (xB - StickyFrames.rangeX) then
|
if xA <= (xB + StickyFrames.rangeX) and xA >= (xB - StickyFrames.rangeX) then
|
||||||
newX = xB
|
newX = xB
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Interior Left
|
-- Interior Left
|
||||||
if lA <= (lB + StickyFrames.rangeX) and lA >= (lB - StickyFrames.rangeX) then
|
if lA <= (lB + StickyFrames.rangeX) and lA >= (lB - StickyFrames.rangeX) then
|
||||||
newX = lB + wA
|
newX = lB + wA
|
||||||
if frameB == UIParent or frameB == WorldFrame then newX = newX - left/2 end
|
if frameB == UIParent or frameB == WorldFrame then newX = newX - left/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Interior Right
|
-- Interior Right
|
||||||
if rA <= (rB + StickyFrames.rangeX) and rA >= (rB - StickyFrames.rangeX) then
|
if rA <= (rB + StickyFrames.rangeX) and rA >= (rB - StickyFrames.rangeX) then
|
||||||
newX = rB - wA
|
newX = rB - wA
|
||||||
if frameB == UIParent or frameB == WorldFrame then newX = newX + right/2 end
|
if frameB == UIParent or frameB == WorldFrame then newX = newX + right/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Exterior Left to Right
|
-- Exterior Left to Right
|
||||||
if lA <= (rB + StickyFrames.rangeX) and lA >= (rB - StickyFrames.rangeX) then
|
if lA <= (rB + StickyFrames.rangeX) and lA >= (rB - StickyFrames.rangeX) then
|
||||||
newX = rB + (wA - left)
|
newX = rB + (wA - left)
|
||||||
if frameB == UIParent or frameB == WorldFrame then newX = newX + left/2 end
|
if frameB == UIParent or frameB == WorldFrame then newX = newX + left/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Exterior Right to Left
|
-- Exterior Right to Left
|
||||||
if rA <= (lB + StickyFrames.rangeX) and rA >= (lB - StickyFrames.rangeX) then
|
if rA <= (lB + StickyFrames.rangeX) and rA >= (lB - StickyFrames.rangeX) then
|
||||||
newX = lB - (wA - right)
|
newX = lB - (wA - right)
|
||||||
if frameB == UIParent or frameB == WorldFrame then newX = newX - right/2 end
|
if frameB == UIParent or frameB == WorldFrame then newX = newX - right/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if (lA <= rB and lB <= rA) then
|
if (lA <= rB and lB <= rA) then
|
||||||
|
|
||||||
-- Vertical Centers
|
-- Vertical Centers
|
||||||
if yA <= (yB + StickyFrames.rangeY) and yA >= (yB - StickyFrames.rangeY) then
|
if yA <= (yB + StickyFrames.rangeY) and yA >= (yB - StickyFrames.rangeY) then
|
||||||
newY = yB
|
newY = yB
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Interior Top
|
-- Interior Top
|
||||||
if tA <= (tB + StickyFrames.rangeY) and tA >= (tB - StickyFrames.rangeY) then
|
if tA <= (tB + StickyFrames.rangeY) and tA >= (tB - StickyFrames.rangeY) then
|
||||||
newY = tB - hA
|
newY = tB - hA
|
||||||
if frameB == UIParent or frameB == WorldFrame then newY = newY + top/2 end
|
if frameB == UIParent or frameB == WorldFrame then newY = newY + top/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Interior Bottom
|
-- Interior Bottom
|
||||||
if bA <= (bB + StickyFrames.rangeY) and bA >= (bB - StickyFrames.rangeY) then
|
if bA <= (bB + StickyFrames.rangeY) and bA >= (bB - StickyFrames.rangeY) then
|
||||||
newY = bB + hA
|
newY = bB + hA
|
||||||
if frameB == UIParent or frameB == WorldFrame then newY = newY - bottom/2 end
|
if frameB == UIParent or frameB == WorldFrame then newY = newY - bottom/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Exterior Top to Bottom
|
-- Exterior Top to Bottom
|
||||||
if tA <= (bB + StickyFrames.rangeY + bottom) and tA >= (bB - StickyFrames.rangeY + bottom) then
|
if tA <= (bB + StickyFrames.rangeY + bottom) and tA >= (bB - StickyFrames.rangeY + bottom) then
|
||||||
newY = bB - (hA - top)
|
newY = bB - (hA - top)
|
||||||
if frameB == UIParent or frameB == WorldFrame then newY = newY - top/2 end
|
if frameB == UIParent or frameB == WorldFrame then newY = newY - top/2 end
|
||||||
snap = true
|
snap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Exterior Bottom to Top
|
-- Exterior Bottom to Top
|
||||||
if bA <= (tB + StickyFrames.rangeY - top) and bA >= (tB - StickyFrames.rangeY - top) then
|
if bA <= (tB + StickyFrames.rangeY - top) and bA >= (tB - StickyFrames.rangeY - top) then
|
||||||
newY = tB + (hA - bottom)
|
newY = tB + (hA - bottom)
|
||||||
@@ -265,7 +265,7 @@ function StickyFrames:SnapFrame(frameA, frameB, left, top, right, bottom)
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if snap then
|
if snap then
|
||||||
frameA:ClearAllPoints()
|
frameA:ClearAllPoints()
|
||||||
frameA:SetPoint("CENTER", UIParent, "BOTTOMLEFT", newX, newY)
|
frameA:SetPoint("CENTER", UIParent, "BOTTOMLEFT", newX, newY)
|
||||||
|
|||||||
Reference in New Issue
Block a user