ascension: 4.4.2 → vendored 4.4.2-2-g3b02ee4 (in-game AddOns dir)
Imported from /srv/add01/wow-ascension/Interface/AddOns/Bartender4 — the build Ascension's WotLK 3.3.5 client ships. Single vendored drop: Ascension's build process bundles their custom patches with the standard CurseForge packager output (embedded libs), and the individual patches aren't published separately. Net delta vs Nevcairiel 4.4.2, excluding bundled libs and CRLF normalization: 21 files, 2213+/52- — the Ascension-specific adaptations for WotLK 3.3.5 hero classes / custom action systems. License: All rights reserved (per .toc).
This commit is contained in:
@@ -1,216 +1,216 @@
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
|
||||
--------------------------
|
||||
-- Edit box --
|
||||
--------------------------
|
||||
--[[
|
||||
Events :
|
||||
OnTextChanged
|
||||
OnEnterPressed
|
||||
|
||||
]]
|
||||
do
|
||||
local Type = "NumberEditBox"
|
||||
local Version = 1
|
||||
|
||||
local function OnAcquire(self)
|
||||
self:SetDisabled(false)
|
||||
self.showbutton = true
|
||||
end
|
||||
|
||||
local function OnRelease(self)
|
||||
self.frame:ClearAllPoints()
|
||||
self.frame:Hide()
|
||||
self:SetDisabled(false)
|
||||
end
|
||||
|
||||
local function Control_OnEnter(this)
|
||||
this.obj:Fire("OnEnter")
|
||||
end
|
||||
|
||||
local function Control_OnLeave(this)
|
||||
this.obj:Fire("OnLeave")
|
||||
end
|
||||
|
||||
local function EditBox_OnEscapePressed(this)
|
||||
this:ClearFocus()
|
||||
end
|
||||
|
||||
local function ShowButton(self)
|
||||
if self.showbutton then
|
||||
self.button:Show()
|
||||
self.editbox:SetTextInsets(0,20,3,3)
|
||||
end
|
||||
end
|
||||
|
||||
local function HideButton(self)
|
||||
self.button:Hide()
|
||||
self.editbox:SetTextInsets(0,0,3,3)
|
||||
end
|
||||
|
||||
local function EditBox_OnEnterPressed(this)
|
||||
local self = this.obj
|
||||
local value = tonumber(this:GetText()) or 0
|
||||
local cancel = self:Fire("OnEnterPressed",value)
|
||||
if not cancel then
|
||||
HideButton(self)
|
||||
end
|
||||
end
|
||||
|
||||
local function Button_OnClick(this)
|
||||
local editbox = this.obj.editbox
|
||||
editbox:ClearFocus()
|
||||
EditBox_OnEnterPressed(editbox)
|
||||
end
|
||||
|
||||
local function EditBox_OnTextChanged(this)
|
||||
local self = this.obj
|
||||
local value = tonumber(this:GetText()) or 0
|
||||
if value ~= self.lastvalue then
|
||||
self:Fire("OnTextChanged",value)
|
||||
self.lastvalue = value
|
||||
ShowButton(self)
|
||||
end
|
||||
end
|
||||
|
||||
local function SetDisabled(self, disabled)
|
||||
self.disabled = disabled
|
||||
if disabled then
|
||||
self.editbox:EnableMouse(false)
|
||||
self.editbox:ClearFocus()
|
||||
self.editbox:SetTextColor(0.5,0.5,0.5)
|
||||
self.label:SetTextColor(0.5,0.5,0.5)
|
||||
else
|
||||
self.editbox:EnableMouse(true)
|
||||
self.editbox:SetTextColor(1,1,1)
|
||||
self.label:SetTextColor(1,.82,0)
|
||||
end
|
||||
end
|
||||
|
||||
local function SetText(self, text)
|
||||
self.lastvalue = tonumber(text) or 0
|
||||
self.editbox:SetText(tostring(self.lastvalue))
|
||||
self.editbox:SetCursorPosition(0)
|
||||
HideButton(self)
|
||||
end
|
||||
|
||||
local function SetWidth(self, width)
|
||||
self.frame:SetWidth(width)
|
||||
end
|
||||
|
||||
local function SetLabel(self, text)
|
||||
if text and text ~= "" then
|
||||
self.label:SetText(text)
|
||||
self.label:Show()
|
||||
self.editbox:SetPoint("TOPLEFT",self.frame,"TOPLEFT",7,-18)
|
||||
self.frame:SetHeight(60)
|
||||
self.alignoffset = 30
|
||||
else
|
||||
self.label:SetText("")
|
||||
self.label:Hide()
|
||||
self.editbox:SetPoint("TOPLEFT",self.frame,"TOPLEFT",7,0)
|
||||
self.frame:SetHeight(42)
|
||||
self.alignoffset = 12
|
||||
end
|
||||
end
|
||||
|
||||
local function ModButton_OnClick(self)
|
||||
local value = self.obj.lastvalue
|
||||
value = math.floor(value + 0.5) + self.adjust
|
||||
self.obj.editbox:SetText(tostring(value))
|
||||
EditBox_OnEnterPressed(self.obj.editbox)
|
||||
end
|
||||
|
||||
local function Constructor()
|
||||
local num = AceGUI:GetNextWidgetNum(Type)
|
||||
local frame = CreateFrame("Frame",nil,UIParent)
|
||||
local editbox = CreateFrame("EditBox","AceGUI-3.0NumberEditBox"..num,frame,"InputBoxTemplate")
|
||||
|
||||
local self = {}
|
||||
self.type = Type
|
||||
self.num = num
|
||||
|
||||
self.OnRelease = OnRelease
|
||||
self.OnAcquire = OnAcquire
|
||||
|
||||
self.SetDisabled = SetDisabled
|
||||
self.SetText = SetText
|
||||
self.SetWidth = SetWidth
|
||||
self.SetLabel = SetLabel
|
||||
|
||||
self.frame = frame
|
||||
frame.obj = self
|
||||
self.editbox = editbox
|
||||
editbox.obj = self
|
||||
|
||||
self.alignoffset = 30
|
||||
|
||||
frame:SetHeight(60)
|
||||
frame:SetWidth(200)
|
||||
|
||||
editbox:SetScript("OnEnter",Control_OnEnter)
|
||||
editbox:SetScript("OnLeave",Control_OnLeave)
|
||||
|
||||
editbox:SetAutoFocus(false)
|
||||
editbox:SetFontObject(ChatFontNormal)
|
||||
editbox:SetScript("OnEscapePressed",EditBox_OnEscapePressed)
|
||||
editbox:SetScript("OnEnterPressed",EditBox_OnEnterPressed)
|
||||
editbox:SetScript("OnTextChanged",EditBox_OnTextChanged)
|
||||
|
||||
editbox:SetTextInsets(0,0,3,3)
|
||||
editbox:SetMaxLetters(256)
|
||||
|
||||
editbox:SetPoint("BOTTOMLEFT",frame,"BOTTOMLEFT",6,15)
|
||||
editbox:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",0,15)
|
||||
editbox:SetHeight(19)
|
||||
|
||||
local label = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
|
||||
label:SetPoint("TOPLEFT",frame,"TOPLEFT",0,-2)
|
||||
label:SetPoint("TOPRIGHT",frame,"TOPRIGHT",0,-2)
|
||||
label:SetJustifyH("LEFT")
|
||||
label:SetHeight(18)
|
||||
self.label = label
|
||||
|
||||
local button = CreateFrame("Button",nil,editbox,"UIPanelButtonTemplate")
|
||||
button:SetWidth(40)
|
||||
button:SetHeight(20)
|
||||
button:SetPoint("RIGHT",editbox,"RIGHT",-2,0)
|
||||
button:SetText(OKAY)
|
||||
button:SetScript("OnClick", Button_OnClick)
|
||||
button:Hide()
|
||||
|
||||
self.button = button
|
||||
button.obj = self
|
||||
|
||||
local minus = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
|
||||
minus:SetWidth(20)
|
||||
minus:SetHeight(15)
|
||||
minus:SetPoint("TOPLEFT", editbox, "BOTTOMLEFT", -4, 0)
|
||||
minus:SetText("-")
|
||||
minus:Show()
|
||||
minus.adjust = -1
|
||||
minus:SetScript("OnClick", ModButton_OnClick)
|
||||
minus:SetFrameLevel(editbox:GetFrameLevel() + 2)
|
||||
|
||||
self.minus = minus
|
||||
minus.obj = self
|
||||
|
||||
local plus = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
|
||||
plus:SetWidth(20)
|
||||
plus:SetHeight(15)
|
||||
plus:SetPoint("TOPRIGHT", editbox, "BOTTOMRIGHT", -2, 0)
|
||||
plus:SetText("+")
|
||||
plus:Show()
|
||||
plus.adjust = 1
|
||||
plus:SetScript("OnClick", ModButton_OnClick)
|
||||
plus:SetFrameLevel(editbox:GetFrameLevel() + 2)
|
||||
|
||||
self.plus = plus
|
||||
plus.obj = self
|
||||
|
||||
AceGUI:RegisterAsWidget(self)
|
||||
return self
|
||||
end
|
||||
|
||||
AceGUI:RegisterWidgetType(Type,Constructor,Version)
|
||||
end
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
|
||||
--------------------------
|
||||
-- Edit box --
|
||||
--------------------------
|
||||
--[[
|
||||
Events :
|
||||
OnTextChanged
|
||||
OnEnterPressed
|
||||
|
||||
]]
|
||||
do
|
||||
local Type = "NumberEditBox"
|
||||
local Version = 1
|
||||
|
||||
local function OnAcquire(self)
|
||||
self:SetDisabled(false)
|
||||
self.showbutton = true
|
||||
end
|
||||
|
||||
local function OnRelease(self)
|
||||
self.frame:ClearAllPoints()
|
||||
self.frame:Hide()
|
||||
self:SetDisabled(false)
|
||||
end
|
||||
|
||||
local function Control_OnEnter(this)
|
||||
this.obj:Fire("OnEnter")
|
||||
end
|
||||
|
||||
local function Control_OnLeave(this)
|
||||
this.obj:Fire("OnLeave")
|
||||
end
|
||||
|
||||
local function EditBox_OnEscapePressed(this)
|
||||
this:ClearFocus()
|
||||
end
|
||||
|
||||
local function ShowButton(self)
|
||||
if self.showbutton then
|
||||
self.button:Show()
|
||||
self.editbox:SetTextInsets(0,20,3,3)
|
||||
end
|
||||
end
|
||||
|
||||
local function HideButton(self)
|
||||
self.button:Hide()
|
||||
self.editbox:SetTextInsets(0,0,3,3)
|
||||
end
|
||||
|
||||
local function EditBox_OnEnterPressed(this)
|
||||
local self = this.obj
|
||||
local value = tonumber(this:GetText()) or 0
|
||||
local cancel = self:Fire("OnEnterPressed",value)
|
||||
if not cancel then
|
||||
HideButton(self)
|
||||
end
|
||||
end
|
||||
|
||||
local function Button_OnClick(this)
|
||||
local editbox = this.obj.editbox
|
||||
editbox:ClearFocus()
|
||||
EditBox_OnEnterPressed(editbox)
|
||||
end
|
||||
|
||||
local function EditBox_OnTextChanged(this)
|
||||
local self = this.obj
|
||||
local value = tonumber(this:GetText()) or 0
|
||||
if value ~= self.lastvalue then
|
||||
self:Fire("OnTextChanged",value)
|
||||
self.lastvalue = value
|
||||
ShowButton(self)
|
||||
end
|
||||
end
|
||||
|
||||
local function SetDisabled(self, disabled)
|
||||
self.disabled = disabled
|
||||
if disabled then
|
||||
self.editbox:EnableMouse(false)
|
||||
self.editbox:ClearFocus()
|
||||
self.editbox:SetTextColor(0.5,0.5,0.5)
|
||||
self.label:SetTextColor(0.5,0.5,0.5)
|
||||
else
|
||||
self.editbox:EnableMouse(true)
|
||||
self.editbox:SetTextColor(1,1,1)
|
||||
self.label:SetTextColor(1,.82,0)
|
||||
end
|
||||
end
|
||||
|
||||
local function SetText(self, text)
|
||||
self.lastvalue = tonumber(text) or 0
|
||||
self.editbox:SetText(tostring(self.lastvalue))
|
||||
self.editbox:SetCursorPosition(0)
|
||||
HideButton(self)
|
||||
end
|
||||
|
||||
local function SetWidth(self, width)
|
||||
self.frame:SetWidth(width)
|
||||
end
|
||||
|
||||
local function SetLabel(self, text)
|
||||
if text and text ~= "" then
|
||||
self.label:SetText(text)
|
||||
self.label:Show()
|
||||
self.editbox:SetPoint("TOPLEFT",self.frame,"TOPLEFT",7,-18)
|
||||
self.frame:SetHeight(60)
|
||||
self.alignoffset = 30
|
||||
else
|
||||
self.label:SetText("")
|
||||
self.label:Hide()
|
||||
self.editbox:SetPoint("TOPLEFT",self.frame,"TOPLEFT",7,0)
|
||||
self.frame:SetHeight(42)
|
||||
self.alignoffset = 12
|
||||
end
|
||||
end
|
||||
|
||||
local function ModButton_OnClick(self)
|
||||
local value = self.obj.lastvalue
|
||||
value = math.floor(value + 0.5) + self.adjust
|
||||
self.obj.editbox:SetText(tostring(value))
|
||||
EditBox_OnEnterPressed(self.obj.editbox)
|
||||
end
|
||||
|
||||
local function Constructor()
|
||||
local num = AceGUI:GetNextWidgetNum(Type)
|
||||
local frame = CreateFrame("Frame",nil,UIParent)
|
||||
local editbox = CreateFrame("EditBox","AceGUI-3.0NumberEditBox"..num,frame,"InputBoxTemplate")
|
||||
|
||||
local self = {}
|
||||
self.type = Type
|
||||
self.num = num
|
||||
|
||||
self.OnRelease = OnRelease
|
||||
self.OnAcquire = OnAcquire
|
||||
|
||||
self.SetDisabled = SetDisabled
|
||||
self.SetText = SetText
|
||||
self.SetWidth = SetWidth
|
||||
self.SetLabel = SetLabel
|
||||
|
||||
self.frame = frame
|
||||
frame.obj = self
|
||||
self.editbox = editbox
|
||||
editbox.obj = self
|
||||
|
||||
self.alignoffset = 30
|
||||
|
||||
frame:SetHeight(60)
|
||||
frame:SetWidth(200)
|
||||
|
||||
editbox:SetScript("OnEnter",Control_OnEnter)
|
||||
editbox:SetScript("OnLeave",Control_OnLeave)
|
||||
|
||||
editbox:SetAutoFocus(false)
|
||||
editbox:SetFontObject(ChatFontNormal)
|
||||
editbox:SetScript("OnEscapePressed",EditBox_OnEscapePressed)
|
||||
editbox:SetScript("OnEnterPressed",EditBox_OnEnterPressed)
|
||||
editbox:SetScript("OnTextChanged",EditBox_OnTextChanged)
|
||||
|
||||
editbox:SetTextInsets(0,0,3,3)
|
||||
editbox:SetMaxLetters(256)
|
||||
|
||||
editbox:SetPoint("BOTTOMLEFT",frame,"BOTTOMLEFT",6,15)
|
||||
editbox:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",0,15)
|
||||
editbox:SetHeight(19)
|
||||
|
||||
local label = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
|
||||
label:SetPoint("TOPLEFT",frame,"TOPLEFT",0,-2)
|
||||
label:SetPoint("TOPRIGHT",frame,"TOPRIGHT",0,-2)
|
||||
label:SetJustifyH("LEFT")
|
||||
label:SetHeight(18)
|
||||
self.label = label
|
||||
|
||||
local button = CreateFrame("Button",nil,editbox,"UIPanelButtonTemplate")
|
||||
button:SetWidth(40)
|
||||
button:SetHeight(20)
|
||||
button:SetPoint("RIGHT",editbox,"RIGHT",-2,0)
|
||||
button:SetText(OKAY)
|
||||
button:SetScript("OnClick", Button_OnClick)
|
||||
button:Hide()
|
||||
|
||||
self.button = button
|
||||
button.obj = self
|
||||
|
||||
local minus = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
|
||||
minus:SetWidth(20)
|
||||
minus:SetHeight(15)
|
||||
minus:SetPoint("TOPLEFT", editbox, "BOTTOMLEFT", -4, 0)
|
||||
minus:SetText("-")
|
||||
minus:Show()
|
||||
minus.adjust = -1
|
||||
minus:SetScript("OnClick", ModButton_OnClick)
|
||||
minus:SetFrameLevel(editbox:GetFrameLevel() + 2)
|
||||
|
||||
self.minus = minus
|
||||
minus.obj = self
|
||||
|
||||
local plus = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
|
||||
plus:SetWidth(20)
|
||||
plus:SetHeight(15)
|
||||
plus:SetPoint("TOPRIGHT", editbox, "BOTTOMRIGHT", -2, 0)
|
||||
plus:SetText("+")
|
||||
plus:Show()
|
||||
plus.adjust = 1
|
||||
plus:SetScript("OnClick", ModButton_OnClick)
|
||||
plus:SetFrameLevel(editbox:GetFrameLevel() + 2)
|
||||
|
||||
self.plus = plus
|
||||
plus.obj = self
|
||||
|
||||
AceGUI:RegisterAsWidget(self)
|
||||
return self
|
||||
end
|
||||
|
||||
AceGUI:RegisterWidgetType(Type,Constructor,Version)
|
||||
end
|
||||
|
||||
+121
-121
@@ -1,121 +1,121 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local StateBar = Bartender4.StateBar.prototype
|
||||
local ActionBar = Bartender4.ActionBar
|
||||
|
||||
--[[===================================================================================
|
||||
ActionBar Options
|
||||
===================================================================================]]--
|
||||
|
||||
local module = Bartender4:GetModule("ActionBars")
|
||||
|
||||
-- option utilty functions
|
||||
local optGetter, optSetter
|
||||
do
|
||||
local optionMap, getBar, callFunc
|
||||
-- maps option keys to function names
|
||||
optionMap = {
|
||||
buttons = "Buttons",
|
||||
enabled = "Enabled",
|
||||
grid = "Grid",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the modules actionbars table
|
||||
function getBar(id)
|
||||
local bar = module.actionbars[tonumber(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Get", option)
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Set", option, ...)
|
||||
end
|
||||
end
|
||||
|
||||
-- returns the option table used for all action bars
|
||||
-- creates it, if the first time called
|
||||
-- the Universal Bar option table is merged into this, alot of stuff gets inherited.
|
||||
function module:GetOptionsTable()
|
||||
return self:GetOptionsObject().table
|
||||
end
|
||||
|
||||
function module:GetOptionsObject()
|
||||
if not self.baroptions then
|
||||
local obj = StateBar.GetOptionObject(self)
|
||||
|
||||
local cat_general = {
|
||||
enabled ={
|
||||
order = 4,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable/Disable the bar."],
|
||||
type = "toggle",
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
grid = {
|
||||
order = 60,
|
||||
type = "toggle",
|
||||
name = L["Button Grid"],
|
||||
desc = L["Toggle the button grid."],
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
buttons = {
|
||||
order = 50,
|
||||
name = L["Buttons"],
|
||||
desc = L["Number of buttons."],
|
||||
type = "range",
|
||||
min = 1, max = 12, step = 1,
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
}
|
||||
obj:AddElementGroup("general", cat_general)
|
||||
self.baroptions = obj
|
||||
end
|
||||
|
||||
return self.baroptions
|
||||
end
|
||||
|
||||
function module:CreateBarOption(id, options)
|
||||
if not self.options then return end
|
||||
|
||||
if not options then
|
||||
options = self:GetOptionsTable()
|
||||
end
|
||||
|
||||
id = tostring(id)
|
||||
if not self.options[id] then
|
||||
self.options[id] = {
|
||||
order = 10 + tonumber(id),
|
||||
type = "group",
|
||||
name = (L["Bar %s"]):format(id),
|
||||
desc = (L["Configure Bar %s"]):format(id),
|
||||
childGroups = "tab",
|
||||
}
|
||||
end
|
||||
self.options[id].args = options
|
||||
|
||||
-- register options in the BT GUI
|
||||
Bartender4:RegisterBarOptions(id, self.options[id])
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local StateBar = Bartender4.StateBar.prototype
|
||||
local ActionBar = Bartender4.ActionBar
|
||||
|
||||
--[[===================================================================================
|
||||
ActionBar Options
|
||||
===================================================================================]]--
|
||||
|
||||
local module = Bartender4:GetModule("ActionBars")
|
||||
|
||||
-- option utilty functions
|
||||
local optGetter, optSetter
|
||||
do
|
||||
local optionMap, getBar, callFunc
|
||||
-- maps option keys to function names
|
||||
optionMap = {
|
||||
buttons = "Buttons",
|
||||
enabled = "Enabled",
|
||||
grid = "Grid",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the modules actionbars table
|
||||
function getBar(id)
|
||||
local bar = module.actionbars[tonumber(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Get", option)
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Set", option, ...)
|
||||
end
|
||||
end
|
||||
|
||||
-- returns the option table used for all action bars
|
||||
-- creates it, if the first time called
|
||||
-- the Universal Bar option table is merged into this, alot of stuff gets inherited.
|
||||
function module:GetOptionsTable()
|
||||
return self:GetOptionsObject().table
|
||||
end
|
||||
|
||||
function module:GetOptionsObject()
|
||||
if not self.baroptions then
|
||||
local obj = StateBar.GetOptionObject(self)
|
||||
|
||||
local cat_general = {
|
||||
enabled ={
|
||||
order = 4,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable/Disable the bar."],
|
||||
type = "toggle",
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
grid = {
|
||||
order = 60,
|
||||
type = "toggle",
|
||||
name = L["Button Grid"],
|
||||
desc = L["Toggle the button grid."],
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
buttons = {
|
||||
order = 50,
|
||||
name = L["Buttons"],
|
||||
desc = L["Number of buttons."],
|
||||
type = "range",
|
||||
min = 1, max = 12, step = 1,
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
}
|
||||
obj:AddElementGroup("general", cat_general)
|
||||
self.baroptions = obj
|
||||
end
|
||||
|
||||
return self.baroptions
|
||||
end
|
||||
|
||||
function module:CreateBarOption(id, options)
|
||||
if not self.options then return end
|
||||
|
||||
if not options then
|
||||
options = self:GetOptionsTable()
|
||||
end
|
||||
|
||||
id = tostring(id)
|
||||
if not self.options[id] then
|
||||
self.options[id] = {
|
||||
order = 10 + tonumber(id),
|
||||
type = "group",
|
||||
name = (L["Bar %s"]):format(id),
|
||||
desc = (L["Configure Bar %s"]):format(id),
|
||||
childGroups = "tab",
|
||||
}
|
||||
end
|
||||
self.options[id].args = options
|
||||
|
||||
-- register options in the BT GUI
|
||||
Bartender4:RegisterBarOptions(id, self.options[id])
|
||||
end
|
||||
|
||||
+68
-68
@@ -1,68 +1,68 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local BagBarMod = Bartender4:GetModule("BagBar")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function BagBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Bag Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
local onebag = {
|
||||
type = "toggle",
|
||||
order = 80,
|
||||
name = L["One Bag"],
|
||||
desc = L["Only show one Bag Button in the BagBar."],
|
||||
get = function() return self.db.profile.onebag end,
|
||||
set = function(info, state) self.db.profile.onebag = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
||||
}
|
||||
self.optionobject:AddElement("general", "onebag", onebag)
|
||||
|
||||
local keyring = {
|
||||
type = "toggle",
|
||||
order = 80,
|
||||
name = L["Keyring"],
|
||||
desc = L["Show the keyring button."],
|
||||
get = function() return self.db.profile.keyring end,
|
||||
set = function(info, state) self.db.profile.keyring = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
||||
}
|
||||
self.optionobject:AddElement("general", "keyring", keyring)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Bag Bar"],
|
||||
desc = L["Configure the Bag Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("BagBar", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local BagBarMod = Bartender4:GetModule("BagBar")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function BagBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Bag Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
local onebag = {
|
||||
type = "toggle",
|
||||
order = 80,
|
||||
name = L["One Bag"],
|
||||
desc = L["Only show one Bag Button in the BagBar."],
|
||||
get = function() return self.db.profile.onebag end,
|
||||
set = function(info, state) self.db.profile.onebag = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
||||
}
|
||||
self.optionobject:AddElement("general", "onebag", onebag)
|
||||
|
||||
local keyring = {
|
||||
type = "toggle",
|
||||
order = 80,
|
||||
name = L["Keyring"],
|
||||
desc = L["Show the keyring button."],
|
||||
get = function() return self.db.profile.keyring end,
|
||||
set = function(info, state) self.db.profile.keyring = state; self.bar:FeedButtons(); self.bar:UpdateButtonLayout() end,
|
||||
}
|
||||
self.optionobject:AddElement("general", "keyring", keyring)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Bag Bar"],
|
||||
desc = L["Configure the Bag Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("BagBar", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
+475
-474
@@ -1,474 +1,475 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
|
||||
--[[===================================================================================
|
||||
Bar Options
|
||||
===================================================================================]]--
|
||||
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
|
||||
local function round(num, idp)
|
||||
local mult = 10^(idp or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
-- option utilty functions
|
||||
local optGetter, optSetter, visibilityGetter, visibilitySetter, customEnabled, customDisabled, customCopy, clickThroughVis, posGet, posSet, centerHorz, centerVert, resetPos
|
||||
do
|
||||
local getBar, optionMap, callFunc
|
||||
-- maps option keys to function names
|
||||
optionMap = {
|
||||
alpha = "ConfigAlpha",
|
||||
scale = "ConfigScale",
|
||||
fadeout = "FadeOut",
|
||||
fadeoutalpha = "FadeOutAlpha",
|
||||
fadeoutdelay = "FadeOutDelay",
|
||||
clickthrough = "ClickThrough",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the barregistry table
|
||||
function getBar(id)
|
||||
local bar = barregistry[tostring(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Get", option)
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Set", option, ...)
|
||||
end
|
||||
|
||||
function visibilityGetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return bar:GetVisibilityOption(option, ...)
|
||||
end
|
||||
|
||||
function visibilitySetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
bar:SetVisibilityOption(option, ...)
|
||||
end
|
||||
|
||||
function customEnabled(info)
|
||||
local bar = getBar(info[2])
|
||||
return bar:GetVisibilityOption("custom")
|
||||
end
|
||||
|
||||
function customDisabled(info)
|
||||
local bar = getBar(info[2])
|
||||
return not bar:GetVisibilityOption("custom")
|
||||
end
|
||||
|
||||
function customCopy(info)
|
||||
local bar = getBar(info[2])
|
||||
bar:CopyCustomConditionals()
|
||||
end
|
||||
|
||||
function clickThroughVis(info)
|
||||
local bar = getBar(info[2])
|
||||
return (not bar.ClickThroughSupport)
|
||||
end
|
||||
|
||||
function posGet(info)
|
||||
local bar = getBar(info[2])
|
||||
local opt = info.arg or info[#info]
|
||||
if opt == "x" or opt == "y" then
|
||||
local v = bar.config.position[opt]
|
||||
return tostring(round(v, 5))
|
||||
end
|
||||
return bar.config.position[opt]
|
||||
end
|
||||
|
||||
function posSet(info, value)
|
||||
local bar = getBar(info[2])
|
||||
local opt = info.arg or info[#info]
|
||||
if opt == "x" or opt == "y" then
|
||||
value = tonumber(value)
|
||||
end
|
||||
bar.config.position[opt] = value
|
||||
bar:LoadPosition()
|
||||
end
|
||||
|
||||
function centerHorz(info)
|
||||
local bar = getBar(info[2])
|
||||
local pos = bar.config.position
|
||||
local x_mod = (pos.growHorizontal == "RIGHT") and -1 or 1
|
||||
pos.x = (bar.overlay:GetWidth() / 2) * pos.scale * x_mod
|
||||
if pos.point == "CENTER" or pos.point == "LEFT" or pos.point == "RIGHT" then -- no special handling
|
||||
pos.point = "CENTER"
|
||||
else
|
||||
pos.point = pos.point:gsub("LEFT", ""):gsub("RIGHT", "")
|
||||
end
|
||||
bar:LoadPosition()
|
||||
end
|
||||
|
||||
function centerVert(info)
|
||||
local bar = getBar(info[2])
|
||||
local pos = bar.config.position
|
||||
local y_mod = (pos.growVertical == "DOWN") and 1 or -1
|
||||
pos.y = (bar.overlay:GetHeight() / 2) * pos.scale * y_mod
|
||||
if pos.point == "CENTER" or pos.point == "TOP" or pos.point == "BOTTOM" then -- no special handling
|
||||
pos.point = "CENTER"
|
||||
else
|
||||
pos.point = pos.point:gsub("TOP", ""):gsub("BOTTOM", "")
|
||||
end
|
||||
bar:LoadPosition()
|
||||
end
|
||||
|
||||
function resetPos(info)
|
||||
local bar = getBar(info[2])
|
||||
local pos = bar.config.position
|
||||
local x_mod = (pos.growHorizontal == "RIGHT") and -1 or 1
|
||||
local y_mod = (pos.growVertical == "DOWN") and 1 or -1
|
||||
pos.x = (bar.overlay:GetWidth() / 2) * pos.scale * x_mod
|
||||
pos.y = (bar.overlay:GetHeight() / 2) * pos.scale * y_mod
|
||||
pos.point = "CENTER"
|
||||
bar:LoadPosition()
|
||||
end
|
||||
end
|
||||
|
||||
local _, class = UnitClass("player")
|
||||
local stanceClasses = {
|
||||
DRUID = true,
|
||||
WARRIOR = true,
|
||||
WARLOCK = true,
|
||||
PRIEST = true,
|
||||
ROGUE = true,
|
||||
}
|
||||
|
||||
local function getStanceTable()
|
||||
local tbl = {}
|
||||
|
||||
if class ~= "WARRIOR" then
|
||||
tbl[0] = L["No Stance/Form"]
|
||||
end
|
||||
|
||||
local num = GetNumShapeshiftForms()
|
||||
for i = 1, num do
|
||||
tbl[i] = select(2, GetShapeshiftFormInfo(i))
|
||||
end
|
||||
-- HACK: Metamorphosis work around, it is on slot 1 in GetShapeshiftFormInfo() but stance:2 is active..
|
||||
if class == "WARLOCK" and tbl[1] == GetSpellInfo(59672) then
|
||||
tbl[2], tbl[1] = tbl[1], nil
|
||||
end
|
||||
|
||||
if class == "ROGUE" and tbl[1] == GetSpellInfo(51713) then -- shadow dance hack
|
||||
tbl[3], tbl[1] = tbl[1], nil
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
local validAnchors = {
|
||||
CENTER = "CENTER",
|
||||
LEFT = "LEFT",
|
||||
RIGHT = "RIGHT",
|
||||
TOP = "TOP",
|
||||
TOPLEFT = "TOPLEFT",
|
||||
TOPRIGHT = "TOPRIGHT",
|
||||
BOTTOM = "BOTTOM",
|
||||
BOTTOMLEFT = "BOTTOMLEFT",
|
||||
BOTTOMRIGHT = "BOTTOMRIGHT",
|
||||
}
|
||||
|
||||
local options
|
||||
function Bar:GetOptionObject()
|
||||
local otbl = {
|
||||
general = {
|
||||
type = "group",
|
||||
cmdInline = true,
|
||||
name = L["General Settings"],
|
||||
order = 1,
|
||||
args = {
|
||||
styleheader = {
|
||||
order = 10,
|
||||
type = "header",
|
||||
name = L["Bar Style & Layout"],
|
||||
},
|
||||
alpha = {
|
||||
order = 20,
|
||||
name = L["Alpha"],
|
||||
desc = L["Configure the alpha of the bar."],
|
||||
type = "range",
|
||||
min = .1, max = 1, step = 0.05,
|
||||
isPercent = true,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
scale = {
|
||||
order = 30,
|
||||
name = L["Scale"],
|
||||
desc = L["Configure the scale of the bar."],
|
||||
type = "range",
|
||||
min = .1, max = 2, step = 0.05,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
clickthrough = {
|
||||
order = 200,
|
||||
name = L["Click-Through"],
|
||||
desc = L["Disable any reaction to mouse events on this bar, making the bar click-through."],
|
||||
type = "toggle",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
hidden = clickThroughVis,
|
||||
width = "full",
|
||||
},
|
||||
},
|
||||
},
|
||||
visibility = {
|
||||
type = "group",
|
||||
name = L["Visibility"],
|
||||
order = 2,
|
||||
get = visibilityGetter,
|
||||
set = visibilitySetter,
|
||||
args = {
|
||||
info = {
|
||||
order = 1,
|
||||
type = "description",
|
||||
name = L["The bar default is to be visible all the time, you can configure conditions here to control when the bar should be hidden."] .. "\n",
|
||||
},
|
||||
fadeout = {
|
||||
order = 5,
|
||||
name = L["Fade Out"],
|
||||
desc = L["Enable the FadeOut mode"],
|
||||
type = "toggle",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
width = "full",
|
||||
},
|
||||
fadeoutalpha = {
|
||||
order = 6,
|
||||
name = L["Fade Out Alpha"],
|
||||
desc = L["Configure the Fade Out Alpha"],
|
||||
type = "range",
|
||||
min = 0, max = 1, step = 0.05,
|
||||
isPercent = true,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
fadeoutdelay = {
|
||||
order = 7,
|
||||
name = L["Fade Out Delay"],
|
||||
desc = L["Configure the Fade Out Delay"],
|
||||
type = "range",
|
||||
min = 0, max = 1, step = 0.01,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
fadeNl = {
|
||||
order = 8,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
always = {
|
||||
order = 10,
|
||||
type = "toggle",
|
||||
name = L["Always Hide"],
|
||||
desc = L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
possess = {
|
||||
order = 15,
|
||||
type = "toggle",
|
||||
name = L["Hide when Possessing"],
|
||||
desc = L["Hide this bar when you are possessing a NPC."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
vehicle = {
|
||||
order = 16,
|
||||
type = "toggle",
|
||||
name = L["Hide on Vehicle"],
|
||||
desc = L["Hide this bar when you are riding on a vehicle."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
vehicleui = {
|
||||
order = 17,
|
||||
type = "toggle",
|
||||
name = L["Hide with Vehicle UI"],
|
||||
desc = L["Hide this bar when the game wants to show a vehicle UI."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
combat = {
|
||||
order = 20,
|
||||
type = "toggle",
|
||||
name = L["Hide in Combat"],
|
||||
desc = L["This bar will be hidden once you enter combat."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
nocombat = {
|
||||
order = 21,
|
||||
type = "toggle",
|
||||
name = L["Hide out of Combat"],
|
||||
desc = L["This bar will be hidden whenever you are not in combat."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
pet = {
|
||||
order = 30,
|
||||
type = "toggle",
|
||||
name = L["Hide with pet"],
|
||||
desc = L["Hide this bar when you have a pet."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
nopet = {
|
||||
order = 31,
|
||||
type = "toggle",
|
||||
name = L["Hide without pet"],
|
||||
desc = L["Hide this bar when you have no pet."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
stance = {
|
||||
order = 50,
|
||||
type = "multiselect",
|
||||
name = L["Hide in Stance/Form"],
|
||||
desc = L["Hide this bar in a specific Stance or Form."],
|
||||
values = getStanceTable,
|
||||
hidden = function() return (not stanceClasses[class]) end,
|
||||
disabled = customEnabled,
|
||||
},
|
||||
customNl = {
|
||||
order = 98,
|
||||
type = "description",
|
||||
name = "\n",
|
||||
},
|
||||
customHeader = {
|
||||
order = 99,
|
||||
type = "header",
|
||||
name = L["Custom Conditionals"],
|
||||
},
|
||||
custom = {
|
||||
order = 100,
|
||||
type = "toggle",
|
||||
name = L["Use Custom Condition"],
|
||||
desc = L["Enable the use of a custom condition, disabling all of the above."],
|
||||
},
|
||||
customCopy = {
|
||||
order = 101,
|
||||
type = "execute",
|
||||
name = L["Copy Conditionals"],
|
||||
desc = L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."],
|
||||
func = customCopy,
|
||||
},
|
||||
customDesc = {
|
||||
order = 102,
|
||||
type = "description",
|
||||
name = L["Note: Enabling Custom Conditionals will disable all of the above settings!"],
|
||||
},
|
||||
customdata = {
|
||||
order = 103,
|
||||
type = "input",
|
||||
name = L["Custom Conditionals"],
|
||||
desc = L["You can use any macro conditionals in the custom string, using \"show\" and \"hide\" as values.\n\nExample: [combat]hide;show"],
|
||||
width = "full",
|
||||
multiline = true,
|
||||
disabled = customDisabled,
|
||||
},
|
||||
},
|
||||
},
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Positioning"],
|
||||
order = 20,
|
||||
args = {
|
||||
info = {
|
||||
order = 1,
|
||||
type = "description",
|
||||
name = L["The Positioning options here will allow you to position the bar to your liking and with an absolute precision."],
|
||||
},
|
||||
point = {
|
||||
order = 10,
|
||||
type = "select",
|
||||
name = L["Anchor"],
|
||||
desc = L["Change the current anchor point of the bar."],
|
||||
values = validAnchors,
|
||||
get = posGet,
|
||||
set = posSet,
|
||||
},
|
||||
scale = {
|
||||
order = 11,
|
||||
name = L["Scale"],
|
||||
desc = L["Configure the scale of the bar."],
|
||||
type = "range",
|
||||
min = .1, max = 2, step = 0.05,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
nl1 = {
|
||||
order = 12,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
x = {
|
||||
order = 20,
|
||||
type = "input",
|
||||
name = L["X Offset"],
|
||||
desc = L["Offset in X direction (horizontal) from the given anchor point."],
|
||||
get = posGet,
|
||||
set = posSet,
|
||||
dialogControl = "NumberEditBox",
|
||||
},
|
||||
y = {
|
||||
order = 21,
|
||||
type = "input",
|
||||
name = L["Y Offset"],
|
||||
desc = L["Offset in Y direction (vertical) from the given anchor point."],
|
||||
get = posGet,
|
||||
set = posSet,
|
||||
dialogControl = "NumberEditBox",
|
||||
},
|
||||
nl2 = {
|
||||
order = 25,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
centerhorz = {
|
||||
order = 31,
|
||||
type = "execute",
|
||||
name = L["Center Horizontally"],
|
||||
desc = L["Centers the bar horizontally on screen."],
|
||||
func = centerHorz,
|
||||
},
|
||||
centervert = {
|
||||
order = 31,
|
||||
type = "execute",
|
||||
name = L["Center Vertically"],
|
||||
desc = L["Centers the bar vertically on screen."],
|
||||
func = centerVert,
|
||||
},
|
||||
nl2 = {
|
||||
order = 35,
|
||||
type = "description",
|
||||
name = " ",
|
||||
},
|
||||
reset = {
|
||||
order = 40,
|
||||
type = "execute",
|
||||
name = L["Reset Position"],
|
||||
desc = L["Reset the position of this bar completly if it ended up off-screen and you cannot reach it anymore."],
|
||||
func = resetPos,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return Bartender4:NewOptionObject(otbl)
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
|
||||
--[[===================================================================================
|
||||
Bar Options
|
||||
===================================================================================]]--
|
||||
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
|
||||
local function round(num, idp)
|
||||
local mult = 10^(idp or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
-- option utilty functions
|
||||
local optGetter, optSetter, visibilityGetter, visibilitySetter, customEnabled, customDisabled, customCopy, clickThroughVis, posGet, posSet, centerHorz, centerVert, resetPos
|
||||
do
|
||||
local getBar, optionMap, callFunc
|
||||
-- maps option keys to function names
|
||||
optionMap = {
|
||||
alpha = "ConfigAlpha",
|
||||
scale = "ConfigScale",
|
||||
fadeout = "FadeOut",
|
||||
fadeoutalpha = "FadeOutAlpha",
|
||||
fadeoutdelay = "FadeOutDelay",
|
||||
clickthrough = "ClickThrough",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the barregistry table
|
||||
function getBar(id)
|
||||
local bar = barregistry[tostring(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Get", option)
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Set", option, ...)
|
||||
end
|
||||
|
||||
function visibilityGetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return bar:GetVisibilityOption(option, ...)
|
||||
end
|
||||
|
||||
function visibilitySetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
bar:SetVisibilityOption(option, ...)
|
||||
end
|
||||
|
||||
function customEnabled(info)
|
||||
local bar = getBar(info[2])
|
||||
return bar:GetVisibilityOption("custom")
|
||||
end
|
||||
|
||||
function customDisabled(info)
|
||||
local bar = getBar(info[2])
|
||||
return not bar:GetVisibilityOption("custom")
|
||||
end
|
||||
|
||||
function customCopy(info)
|
||||
local bar = getBar(info[2])
|
||||
bar:CopyCustomConditionals()
|
||||
end
|
||||
|
||||
function clickThroughVis(info)
|
||||
local bar = getBar(info[2])
|
||||
return (not bar.ClickThroughSupport)
|
||||
end
|
||||
|
||||
function posGet(info)
|
||||
local bar = getBar(info[2])
|
||||
local opt = info.arg or info[#info]
|
||||
if opt == "x" or opt == "y" then
|
||||
local v = bar.config.position[opt]
|
||||
return tostring(round(v, 5))
|
||||
end
|
||||
return bar.config.position[opt]
|
||||
end
|
||||
|
||||
function posSet(info, value)
|
||||
local bar = getBar(info[2])
|
||||
local opt = info.arg or info[#info]
|
||||
if opt == "x" or opt == "y" then
|
||||
value = tonumber(value)
|
||||
end
|
||||
bar.config.position[opt] = value
|
||||
bar:LoadPosition()
|
||||
end
|
||||
|
||||
function centerHorz(info)
|
||||
local bar = getBar(info[2])
|
||||
local pos = bar.config.position
|
||||
local x_mod = (pos.growHorizontal == "RIGHT") and -1 or 1
|
||||
pos.x = (bar.overlay:GetWidth() / 2) * pos.scale * x_mod
|
||||
if pos.point == "CENTER" or pos.point == "LEFT" or pos.point == "RIGHT" then -- no special handling
|
||||
pos.point = "CENTER"
|
||||
else
|
||||
pos.point = pos.point:gsub("LEFT", ""):gsub("RIGHT", "")
|
||||
end
|
||||
bar:LoadPosition()
|
||||
end
|
||||
|
||||
function centerVert(info)
|
||||
local bar = getBar(info[2])
|
||||
local pos = bar.config.position
|
||||
local y_mod = (pos.growVertical == "DOWN") and 1 or -1
|
||||
pos.y = (bar.overlay:GetHeight() / 2) * pos.scale * y_mod
|
||||
if pos.point == "CENTER" or pos.point == "TOP" or pos.point == "BOTTOM" then -- no special handling
|
||||
pos.point = "CENTER"
|
||||
else
|
||||
pos.point = pos.point:gsub("TOP", ""):gsub("BOTTOM", "")
|
||||
end
|
||||
bar:LoadPosition()
|
||||
end
|
||||
|
||||
function resetPos(info)
|
||||
local bar = getBar(info[2])
|
||||
local pos = bar.config.position
|
||||
local x_mod = (pos.growHorizontal == "RIGHT") and -1 or 1
|
||||
local y_mod = (pos.growVertical == "DOWN") and 1 or -1
|
||||
pos.x = (bar.overlay:GetWidth() / 2) * pos.scale * x_mod
|
||||
pos.y = (bar.overlay:GetHeight() / 2) * pos.scale * y_mod
|
||||
pos.point = "CENTER"
|
||||
bar:LoadPosition()
|
||||
end
|
||||
end
|
||||
|
||||
local _, class = UnitClass("player")
|
||||
local stanceClasses = {
|
||||
DRUID = true,
|
||||
HERO = true,
|
||||
WARRIOR = true,
|
||||
WARLOCK = true,
|
||||
PRIEST = true,
|
||||
ROGUE = true,
|
||||
}
|
||||
|
||||
local function getStanceTable()
|
||||
local tbl = {}
|
||||
|
||||
if class ~= "WARRIOR" then
|
||||
tbl[0] = L["No Stance/Form"]
|
||||
end
|
||||
|
||||
local num = GetNumShapeshiftForms()
|
||||
for i = 1, num do
|
||||
tbl[i] = select(2, GetShapeshiftFormInfo(i))
|
||||
end
|
||||
-- HACK: Metamorphosis work around, it is on slot 1 in GetShapeshiftFormInfo() but stance:2 is active..
|
||||
if class == "WARLOCK" and tbl[1] == GetSpellInfo(59672) then
|
||||
tbl[2], tbl[1] = tbl[1], nil
|
||||
end
|
||||
|
||||
if class == "ROGUE" and tbl[1] == GetSpellInfo(51713) then -- shadow dance hack
|
||||
tbl[3], tbl[1] = tbl[1], nil
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
local validAnchors = {
|
||||
CENTER = "CENTER",
|
||||
LEFT = "LEFT",
|
||||
RIGHT = "RIGHT",
|
||||
TOP = "TOP",
|
||||
TOPLEFT = "TOPLEFT",
|
||||
TOPRIGHT = "TOPRIGHT",
|
||||
BOTTOM = "BOTTOM",
|
||||
BOTTOMLEFT = "BOTTOMLEFT",
|
||||
BOTTOMRIGHT = "BOTTOMRIGHT",
|
||||
}
|
||||
|
||||
local options
|
||||
function Bar:GetOptionObject()
|
||||
local otbl = {
|
||||
general = {
|
||||
type = "group",
|
||||
cmdInline = true,
|
||||
name = L["General Settings"],
|
||||
order = 1,
|
||||
args = {
|
||||
styleheader = {
|
||||
order = 10,
|
||||
type = "header",
|
||||
name = L["Bar Style & Layout"],
|
||||
},
|
||||
alpha = {
|
||||
order = 20,
|
||||
name = L["Alpha"],
|
||||
desc = L["Configure the alpha of the bar."],
|
||||
type = "range",
|
||||
min = 0, max = 1, bigStep = 0.05,
|
||||
isPercent = true,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
scale = {
|
||||
order = 30,
|
||||
name = L["Scale"],
|
||||
desc = L["Configure the scale of the bar."],
|
||||
type = "range",
|
||||
min = 0, softMin = .1, softMax = 2, bigStep = 0.05,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
clickthrough = {
|
||||
order = 200,
|
||||
name = L["Click-Through"],
|
||||
desc = L["Disable any reaction to mouse events on this bar, making the bar click-through."],
|
||||
type = "toggle",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
hidden = clickThroughVis,
|
||||
width = "full",
|
||||
},
|
||||
},
|
||||
},
|
||||
visibility = {
|
||||
type = "group",
|
||||
name = L["Visibility"],
|
||||
order = 2,
|
||||
get = visibilityGetter,
|
||||
set = visibilitySetter,
|
||||
args = {
|
||||
info = {
|
||||
order = 1,
|
||||
type = "description",
|
||||
name = L["The bar default is to be visible all the time, you can configure conditions here to control when the bar should be hidden."] .. "\n",
|
||||
},
|
||||
fadeout = {
|
||||
order = 5,
|
||||
name = L["Fade Out"],
|
||||
desc = L["Enable the FadeOut mode"],
|
||||
type = "toggle",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
width = "full",
|
||||
},
|
||||
fadeoutalpha = {
|
||||
order = 6,
|
||||
name = L["Fade Out Alpha"],
|
||||
desc = L["Configure the Fade Out Alpha"],
|
||||
type = "range",
|
||||
min = 0, max = 1, bigStep = 0.05,
|
||||
isPercent = true,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
fadeoutdelay = {
|
||||
order = 7,
|
||||
name = L["Fade Out Delay"],
|
||||
desc = L["Configure the Fade Out Delay"],
|
||||
type = "range",
|
||||
min = 0, softMax = 1, bigStep = 0.01,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
fadeNl = {
|
||||
order = 8,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
always = {
|
||||
order = 10,
|
||||
type = "toggle",
|
||||
name = L["Always Hide"],
|
||||
desc = L["You can set the bar to be always hidden, if you only wish to access it using key-bindings."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
possess = {
|
||||
order = 15,
|
||||
type = "toggle",
|
||||
name = L["Hide when Possessing"],
|
||||
desc = L["Hide this bar when you are possessing a NPC."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
vehicle = {
|
||||
order = 16,
|
||||
type = "toggle",
|
||||
name = L["Hide on Vehicle"],
|
||||
desc = L["Hide this bar when you are riding on a vehicle."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
vehicleui = {
|
||||
order = 17,
|
||||
type = "toggle",
|
||||
name = L["Hide with Vehicle UI"],
|
||||
desc = L["Hide this bar when the game wants to show a vehicle UI."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
combat = {
|
||||
order = 20,
|
||||
type = "toggle",
|
||||
name = L["Hide in Combat"],
|
||||
desc = L["This bar will be hidden once you enter combat."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
nocombat = {
|
||||
order = 21,
|
||||
type = "toggle",
|
||||
name = L["Hide out of Combat"],
|
||||
desc = L["This bar will be hidden whenever you are not in combat."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
pet = {
|
||||
order = 30,
|
||||
type = "toggle",
|
||||
name = L["Hide with pet"],
|
||||
desc = L["Hide this bar when you have a pet."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
nopet = {
|
||||
order = 31,
|
||||
type = "toggle",
|
||||
name = L["Hide without pet"],
|
||||
desc = L["Hide this bar when you have no pet."],
|
||||
disabled = customEnabled,
|
||||
},
|
||||
stance = {
|
||||
order = 50,
|
||||
type = "multiselect",
|
||||
name = L["Hide in Stance/Form"],
|
||||
desc = L["Hide this bar in a specific Stance or Form."],
|
||||
values = getStanceTable,
|
||||
hidden = function() return (not stanceClasses[class]) end,
|
||||
disabled = customEnabled,
|
||||
},
|
||||
customNl = {
|
||||
order = 98,
|
||||
type = "description",
|
||||
name = "\n",
|
||||
},
|
||||
customHeader = {
|
||||
order = 99,
|
||||
type = "header",
|
||||
name = L["Custom Conditionals"],
|
||||
},
|
||||
custom = {
|
||||
order = 100,
|
||||
type = "toggle",
|
||||
name = L["Use Custom Condition"],
|
||||
desc = L["Enable the use of a custom condition, disabling all of the above."],
|
||||
},
|
||||
customCopy = {
|
||||
order = 101,
|
||||
type = "execute",
|
||||
name = L["Copy Conditionals"],
|
||||
desc = L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."],
|
||||
func = customCopy,
|
||||
},
|
||||
customDesc = {
|
||||
order = 102,
|
||||
type = "description",
|
||||
name = L["Note: Enabling Custom Conditionals will disable all of the above settings!"],
|
||||
},
|
||||
customdata = {
|
||||
order = 103,
|
||||
type = "input",
|
||||
name = L["Custom Conditionals"],
|
||||
desc = L["You can use any macro conditionals in the custom string, using \"show\" and \"hide\" as values.\n\nExample: [combat]hide;show"],
|
||||
width = "full",
|
||||
multiline = true,
|
||||
disabled = customDisabled,
|
||||
},
|
||||
},
|
||||
},
|
||||
position = {
|
||||
type = "group",
|
||||
name = L["Positioning"],
|
||||
order = 20,
|
||||
args = {
|
||||
info = {
|
||||
order = 1,
|
||||
type = "description",
|
||||
name = L["The Positioning options here will allow you to position the bar to your liking and with an absolute precision."],
|
||||
},
|
||||
point = {
|
||||
order = 10,
|
||||
type = "select",
|
||||
name = L["Anchor"],
|
||||
desc = L["Change the current anchor point of the bar."],
|
||||
values = validAnchors,
|
||||
get = posGet,
|
||||
set = posSet,
|
||||
},
|
||||
scale = {
|
||||
order = 11,
|
||||
name = L["Scale"],
|
||||
desc = L["Configure the scale of the bar."],
|
||||
type = "range",
|
||||
min = 0, softMin = .1, softMax = 2, bigStep = 0.05,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
nl1 = {
|
||||
order = 12,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
x = {
|
||||
order = 20,
|
||||
type = "input",
|
||||
name = L["X Offset"],
|
||||
desc = L["Offset in X direction (horizontal) from the given anchor point."],
|
||||
get = posGet,
|
||||
set = posSet,
|
||||
dialogControl = "NumberEditBox",
|
||||
},
|
||||
y = {
|
||||
order = 21,
|
||||
type = "input",
|
||||
name = L["Y Offset"],
|
||||
desc = L["Offset in Y direction (vertical) from the given anchor point."],
|
||||
get = posGet,
|
||||
set = posSet,
|
||||
dialogControl = "NumberEditBox",
|
||||
},
|
||||
nl2 = {
|
||||
order = 25,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
centerhorz = {
|
||||
order = 31,
|
||||
type = "execute",
|
||||
name = L["Center Horizontally"],
|
||||
desc = L["Centers the bar horizontally on screen."],
|
||||
func = centerHorz,
|
||||
},
|
||||
centervert = {
|
||||
order = 31,
|
||||
type = "execute",
|
||||
name = L["Center Vertically"],
|
||||
desc = L["Centers the bar vertically on screen."],
|
||||
func = centerVert,
|
||||
},
|
||||
nl2 = {
|
||||
order = 35,
|
||||
type = "description",
|
||||
name = " ",
|
||||
},
|
||||
reset = {
|
||||
order = 40,
|
||||
type = "execute",
|
||||
name = L["Reset Position"],
|
||||
desc = L["Reset the position of this bar completly if it ended up off-screen and you cannot reach it anymore."],
|
||||
func = resetPos,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return Bartender4:NewOptionObject(otbl)
|
||||
end
|
||||
|
||||
+131
-131
@@ -1,131 +1,131 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
--[[===================================================================================
|
||||
Bar Options
|
||||
===================================================================================]]--
|
||||
|
||||
-- option utilty functions
|
||||
local optGetter, optSetter
|
||||
do
|
||||
local getBar, optionMap, callFunc
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
-- maps option keys to function names
|
||||
optionMap = {
|
||||
rows = "Rows",
|
||||
padding = "Padding",
|
||||
zoom = "Zoom",
|
||||
macrotext = "HideMacroText",
|
||||
hotkey = "HideHotkey",
|
||||
vgrowth = "VGrowth",
|
||||
hgrowth = "HGrowth",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the barregistry table
|
||||
function getBar(id)
|
||||
local bar = barregistry[tostring(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Get", option)
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Set", option, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function ButtonBar:GetOptionObject()
|
||||
local obj = Bar.GetOptionObject()
|
||||
local otbl_general = {
|
||||
padding = {
|
||||
order = 40,
|
||||
type = "range",
|
||||
name = L["Padding"],
|
||||
desc = L["Configure the padding of the buttons."],
|
||||
min = -10, max = 20, step = 1,
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
zoom = {
|
||||
order = 59,
|
||||
name = L["Zoom"],
|
||||
type = "toggle",
|
||||
desc = L["Toggle Button Zoom\nFor more style options you need to install ButtonFacade"],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
hidden = function() return LibStub("LibButtonFacade", true) and true or false end,
|
||||
},
|
||||
rows = {
|
||||
order = 70,
|
||||
name = L["Rows"],
|
||||
desc = L["Number of rows."],
|
||||
type = "range",
|
||||
min = 1, max = 12, step = 1,
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
vgrowth = {
|
||||
order = 75,
|
||||
name = L["Vertical Growth"],
|
||||
desc = L["Vertical growth direction for this bar."],
|
||||
type = "select",
|
||||
values = {UP = L["Up"], DOWN = L["Down"]},
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hgrowth = {
|
||||
order = 76,
|
||||
name = L["Horizontal Growth"],
|
||||
desc = L["Horizontal growth direction for this bar."],
|
||||
type = "select",
|
||||
values = {LEFT = L["Left"], RIGHT = L["Right"]},
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hidedesc = {
|
||||
order = 80,
|
||||
name = L["Button Look"],
|
||||
type = "header",
|
||||
},
|
||||
macrotext = {
|
||||
order = 81,
|
||||
type = "toggle",
|
||||
name = L["Hide Macro Text"],
|
||||
desc = L["Hide the Macro Text on the buttons of this bar."],
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hotkey = {
|
||||
order = 82,
|
||||
type = "toggle",
|
||||
name = L["Hide Hotkey"],
|
||||
desc = L["Hide the Hotkey on the buttons of this bar."],
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
}
|
||||
obj:AddElementGroup("general", otbl_general)
|
||||
return obj
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
--[[===================================================================================
|
||||
Bar Options
|
||||
===================================================================================]]--
|
||||
|
||||
-- option utilty functions
|
||||
local optGetter, optSetter
|
||||
do
|
||||
local getBar, optionMap, callFunc
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
-- maps option keys to function names
|
||||
optionMap = {
|
||||
rows = "Rows",
|
||||
padding = "Padding",
|
||||
zoom = "Zoom",
|
||||
macrotext = "HideMacroText",
|
||||
hotkey = "HideHotkey",
|
||||
vgrowth = "VGrowth",
|
||||
hgrowth = "HGrowth",
|
||||
}
|
||||
|
||||
-- retrieves a valid bar object from the barregistry table
|
||||
function getBar(id)
|
||||
local bar = barregistry[tostring(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Get", option)
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info[#info]
|
||||
return callFunc(bar, "Set", option, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function ButtonBar:GetOptionObject()
|
||||
local obj = Bar.GetOptionObject()
|
||||
local otbl_general = {
|
||||
padding = {
|
||||
order = 40,
|
||||
type = "range",
|
||||
name = L["Padding"],
|
||||
desc = L["Configure the padding of the buttons."],
|
||||
softMin = -10, softMax = 20, bigStep = 1,
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
zoom = {
|
||||
order = 59,
|
||||
name = L["Zoom"],
|
||||
type = "toggle",
|
||||
desc = L["Toggle Button Zoom\nFor more style options you need to install ButtonFacade"],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
hidden = function() return LibStub("LibButtonFacade", true) and true or false end,
|
||||
},
|
||||
rows = {
|
||||
order = 70,
|
||||
name = L["Rows"],
|
||||
desc = L["Number of rows."],
|
||||
type = "range",
|
||||
min = 1, max = 12, step = 1,
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
vgrowth = {
|
||||
order = 75,
|
||||
name = L["Vertical Growth"],
|
||||
desc = L["Vertical growth direction for this bar."],
|
||||
type = "select",
|
||||
values = {UP = L["Up"], DOWN = L["Down"]},
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hgrowth = {
|
||||
order = 76,
|
||||
name = L["Horizontal Growth"],
|
||||
desc = L["Horizontal growth direction for this bar."],
|
||||
type = "select",
|
||||
values = {LEFT = L["Left"], RIGHT = L["Right"]},
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hidedesc = {
|
||||
order = 80,
|
||||
name = L["Button Look"],
|
||||
type = "header",
|
||||
},
|
||||
macrotext = {
|
||||
order = 81,
|
||||
type = "toggle",
|
||||
name = L["Hide Macro Text"],
|
||||
desc = L["Hide the Macro Text on the buttons of this bar."],
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
hotkey = {
|
||||
order = 82,
|
||||
type = "toggle",
|
||||
name = L["Hide Hotkey"],
|
||||
desc = L["Hide the Hotkey on the buttons of this bar."],
|
||||
set = optSetter,
|
||||
get = optGetter,
|
||||
},
|
||||
}
|
||||
obj:AddElementGroup("general", otbl_general)
|
||||
return obj
|
||||
end
|
||||
|
||||
+49
-49
@@ -1,49 +1,49 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local MicroMenuMod = Bartender4:GetModule("MicroMenu")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function MicroMenuMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Micro Menu"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Micro Menu"],
|
||||
desc = L["Configure the Micro Menu"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
self.optionobject.table.general.args.padding.min = -30
|
||||
Bartender4:RegisterBarOptions("MicroMenu", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local MicroMenuMod = Bartender4:GetModule("MicroMenu")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function MicroMenuMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Micro Menu"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Micro Menu"],
|
||||
desc = L["Configure the Micro Menu"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
self.optionobject.table.general.args.padding.min = -30
|
||||
Bartender4:RegisterBarOptions("MicroMenu", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
+55
-49
@@ -1,49 +1,55 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
|
||||
if not HasMultiCastActionBar or select(2, UnitClass("player")) ~= "SHAMAN" then return end
|
||||
|
||||
-- fetch upvalues
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
|
||||
local MultiCastMod = Bartender4:GetModule("MultiCast")
|
||||
|
||||
function MultiCastMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = Bar:GetOptionObject()
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Totem Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 100,
|
||||
type = "group",
|
||||
name = L["Totem Bar"],
|
||||
desc = L["Configure the Totem Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("MultiCast", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
|
||||
if not HasMultiCastActionBar then return end
|
||||
|
||||
local classMask = UnitClassMask("player")
|
||||
|
||||
if not bit.contains(EnumUtil.CombineMasks(Enum.ClassMask.SHAMAN, Enum.ClassMask.HERO), classMask) then
|
||||
return
|
||||
end
|
||||
|
||||
-- fetch upvalues
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
|
||||
local MultiCastMod = Bartender4:GetModule("MultiCast")
|
||||
|
||||
function MultiCastMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = Bar:GetOptionObject()
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Totem Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 100,
|
||||
type = "group",
|
||||
name = L["Totem Bar"],
|
||||
desc = L["Configure the Totem Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("MultiCast", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
+316
-326
@@ -1,326 +1,316 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
|
||||
|
||||
local getFunc, setFunc
|
||||
do
|
||||
function getFunc(info)
|
||||
return (info.arg and Bartender4.db.profile[info.arg] or Bartender4.db.profile[info[#info]])
|
||||
end
|
||||
|
||||
function setFunc(info, value)
|
||||
local key = info.arg or info[#info]
|
||||
Bartender4.db.profile[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
local KB = LibStub("LibKeyBound-1.0")
|
||||
local LDBIcon = LibStub("LibDBIcon-1.0", true)
|
||||
local function getOptions()
|
||||
if not Bartender4.options then
|
||||
Bartender4.options = {
|
||||
type = "group",
|
||||
name = "Bartender4",
|
||||
icon = "Interface\\Icons\\INV_Drink_05",
|
||||
childGroups = "tree",
|
||||
plugins = {},
|
||||
args = {
|
||||
lock = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = L["Lock"],
|
||||
desc = L["Lock all bars."],
|
||||
get = function() return Bartender4.Locked end,
|
||||
set = function(info, value) Bartender4[value and "Lock" or "Unlock"](Bartender4) end,
|
||||
width = "half",
|
||||
},
|
||||
buttonlock = {
|
||||
order = 2,
|
||||
type = "toggle",
|
||||
name = L["Button Lock"],
|
||||
desc = L["Lock the buttons."],
|
||||
get = function() return Bartender4.db.profile.buttonlock end,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.buttonlock = value
|
||||
Bartender4.Bar:ForAll("ForAll", "SetAttribute", "buttonlock", value)
|
||||
end,
|
||||
},
|
||||
minimapIcon = {
|
||||
order = 3,
|
||||
type = "toggle",
|
||||
name = L["Minimap Icon"],
|
||||
desc = L["Show a Icon to open the config at the Minimap"],
|
||||
get = function() return not Bartender4.db.profile.minimapIcon.hide end,
|
||||
set = function(info, value) Bartender4.db.profile.minimapIcon.hide = not value; LDBIcon[value and "Show" or "Hide"](LDBIcon, "Bartender4") end,
|
||||
disabled = function() return not LDBIcon end,
|
||||
},
|
||||
kb = {
|
||||
order = 4,
|
||||
type = "execute",
|
||||
name = L["Key Bindings"],
|
||||
desc = L["Switch to key-binding mode"],
|
||||
func = function()
|
||||
KB:Toggle()
|
||||
AceConfigDialog:Close("Bartender4")
|
||||
end,
|
||||
},
|
||||
bars = {
|
||||
order = 20,
|
||||
type = "group",
|
||||
name = L["Bars"],
|
||||
args = {
|
||||
options = {
|
||||
type = "group",
|
||||
order = 0,
|
||||
name = function(info) if info.uiType == "dialog" then return "" else return L["Bar Options"] end end,
|
||||
guiInline = true,
|
||||
args = {
|
||||
blizzardVehicle = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = L["Use Blizzard Vehicle UI"],
|
||||
desc = L["Enable the use of the Blizzard Vehicle UI, hiding any Bartender4 bars in the meantime."],
|
||||
width = "full",
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
if UnitHasVehicleUI("player") then
|
||||
Bartender4:Print(L["You have to exit the vehicle in order to be able to change the Vehicle UI settings."])
|
||||
return
|
||||
end
|
||||
Bartender4.db.profile.blizzardVehicle = value
|
||||
Bartender4:UpdateBlizzardVehicle()
|
||||
end,
|
||||
},
|
||||
selfcastmodifier = {
|
||||
order = 10,
|
||||
type = "toggle",
|
||||
name = L["Self-Cast by modifier"],
|
||||
desc = L["Toggle the use of the modifier-based self-cast functionality."],
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.selfcastmodifier = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
setselfcastmod = {
|
||||
order = 20,
|
||||
type = "select",
|
||||
name = L["Self-Cast Modifier"],
|
||||
desc = L["Select the Self-Cast Modifier"],
|
||||
get = function(info) return GetModifiedClick("SELFCAST") end,
|
||||
set = function(info, value) SetModifiedClick("SELFCAST", value); SaveBindings(GetCurrentBindingSet() or 1) end,
|
||||
values = { NONE = L["None"], ALT = L["ALT"], SHIFT = L["SHIFT"], CTRL = L["CTRL"] },
|
||||
},
|
||||
selfcast_nl = {
|
||||
order = 30,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
focuscastmodifier = {
|
||||
order = 50,
|
||||
type = "toggle",
|
||||
name = L["Focus-Cast by modifier"],
|
||||
desc = L["Toggle the use of the modifier-based focus-cast functionality."],
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.focuscastmodifier = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
setfocuscastmod = {
|
||||
order = 60,
|
||||
type = "select",
|
||||
name = L["Focus-Cast Modifier"],
|
||||
desc = L["Select the Focus-Cast Modifier"],
|
||||
get = function(info) return GetModifiedClick("FOCUSCAST") end,
|
||||
set = function(info, value) SetModifiedClick("FOCUSCAST", value); SaveBindings(GetCurrentBindingSet() or 1) end,
|
||||
values = { NONE = L["None"], ALT = L["ALT"], SHIFT = L["SHIFT"], CTRL = L["CTRL"] },
|
||||
},
|
||||
focuscast_nl = {
|
||||
order = 70,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
selfcastrightclick = {
|
||||
order = 80,
|
||||
type = "toggle",
|
||||
name = L["Right-click Self-Cast"],
|
||||
desc = L["Toggle the use of the right-click self-cast functionality."],
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.selfcastrightclick = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
rightclickselfcast_nl = {
|
||||
order = 90,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
range = {
|
||||
order = 100,
|
||||
name = L["Out of Range Indicator"],
|
||||
desc = L["Configure how the Out of Range Indicator should display on the buttons."],
|
||||
type = "select",
|
||||
style = "dropdown",
|
||||
get = function()
|
||||
return Bartender4.db.profile.outofrange
|
||||
end,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.outofrange = value
|
||||
Bartender4.Bar:ForAll("ApplyConfig")
|
||||
end,
|
||||
values = { none = L["No Display"], button = L["Full Button Mode"], hotkey = L["Hotkey Mode"] },
|
||||
},
|
||||
colors = {
|
||||
order = 130,
|
||||
type = "group",
|
||||
guiInline = true,
|
||||
name = L["Colors"],
|
||||
get = function(info)
|
||||
local color = Bartender4.db.profile.colors[info[#info]]
|
||||
return color.r, color.g, color.b
|
||||
end,
|
||||
set = function(info, r, g, b)
|
||||
local color = Bartender4.db.profile.colors[info[#info]]
|
||||
color.r, color.g, color.b = r, g, b
|
||||
Bartender4.Bar:ForAll("ApplyConfig")
|
||||
end,
|
||||
args = {
|
||||
range = {
|
||||
order = 1,
|
||||
type = "color",
|
||||
name = L["Out of Range Indicator"],
|
||||
desc = L["Specify the Color of the Out of Range Indicator"],
|
||||
},
|
||||
mana = {
|
||||
order = 2,
|
||||
type = "color",
|
||||
name = L["Out of Mana Indicator"],
|
||||
desc = L["Specify the Color of the Out of Mana Indicator"],
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip = {
|
||||
order = 200,
|
||||
name = L["Button Tooltip"],
|
||||
type = "select",
|
||||
desc = L["Configure the Button Tooltip."],
|
||||
values = { ["disabled"] = L["Disabled"], ["nocombat"] = L["Disabled in Combat"], ["enabled"] = L["Enabled"] },
|
||||
get = function() return Bartender4.db.profile.tooltip end,
|
||||
set = function(info, value) Bartender4.db.profile.tooltip = value end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
faq = {
|
||||
name = L["FAQ"],
|
||||
desc = L["Frequently Asked Questions"],
|
||||
type = "group",
|
||||
order = 200,
|
||||
args = {
|
||||
faq = {
|
||||
type = "description",
|
||||
name = L["FAQ_TEXT"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Bartender4.options.plugins.profiles = { profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(Bartender4.db) }
|
||||
for k,v in Bartender4:IterateModules() do
|
||||
if v.SetupOptions then
|
||||
v:SetupOptions()
|
||||
end
|
||||
end
|
||||
end
|
||||
return Bartender4.options
|
||||
end
|
||||
|
||||
function Bartender4:ChatCommand(input)
|
||||
if InCombatLockdown() then
|
||||
self:Print(L["Cannot access options during combat."])
|
||||
return
|
||||
end
|
||||
if not input or input:trim() == "" then
|
||||
LibStub("AceConfigDialog-3.0"):Open("Bartender4")
|
||||
else
|
||||
LibStub("AceConfigCmd-3.0").HandleCommand(Bartender4, "bt", "Bartender4", input)
|
||||
end
|
||||
end
|
||||
|
||||
function Bartender4:SetupOptions()
|
||||
LibStub("AceConfig-3.0"):RegisterOptionsTable("Bartender4", getOptions)
|
||||
AceConfigDialog:SetDefaultSize("Bartender4", 680,525)
|
||||
local optFunc = function()
|
||||
if InCombatLockdown() then return end
|
||||
AceConfigDialog:Open("Bartender4")
|
||||
--[[
|
||||
local status = AceConfigDialog:GetStatusTable("Bartender4")
|
||||
if not status.groups then status.groups = {} end
|
||||
if not status.groups.groups then status.groups.groups = {} end
|
||||
status.groups.groups["actionbars"] = true
|
||||
]]
|
||||
end
|
||||
self:RegisterChatCommand( "bar", "ChatCommand")
|
||||
self:RegisterChatCommand( "bt", "ChatCommand")
|
||||
self:RegisterChatCommand( "bt4", "ChatCommand")
|
||||
self:RegisterChatCommand( "bartender", "ChatCommand")
|
||||
self:RegisterChatCommand( "bartender4", "ChatCommand")
|
||||
end
|
||||
|
||||
function Bartender4:RegisterModuleOptions(key, table)
|
||||
if not self.options then
|
||||
error("Options table has not been created yet, respond to the callback!", 2)
|
||||
end
|
||||
self.options.plugins[key] = { [key] = table }
|
||||
end
|
||||
|
||||
function Bartender4:RegisterBarOptions(id, table)
|
||||
if not self.options then
|
||||
error("Options table has not been created yet, respond to the callback!", 2)
|
||||
end
|
||||
self.options.args.bars.args[id] = table
|
||||
end
|
||||
|
||||
local optionParent = {}
|
||||
function optionParent:NewCategory(category, data)
|
||||
self.table[category] = data
|
||||
end
|
||||
|
||||
local ov = nil
|
||||
function optionParent:AddElement(category, element, data, ...)
|
||||
local lvl = self.table[category]
|
||||
for i = 1, select('#', ...) do
|
||||
local key = select(i, ...)
|
||||
if not (lvl.args[key] and lvl.args[key].args) then
|
||||
error(("Sub-Level Key %s does not exist in options group or is no sub-group."):format(key), ov and 3 or 2)
|
||||
end
|
||||
lvl = lvl.args[key]
|
||||
end
|
||||
|
||||
lvl.args[element] = data
|
||||
end
|
||||
|
||||
function optionParent:AddElementGroup(category, data, ...)
|
||||
ov = true
|
||||
for k,v in pairs(data) do
|
||||
self:AddElement(category, k, v, ...)
|
||||
end
|
||||
ov = nil
|
||||
end
|
||||
|
||||
function Bartender4:NewOptionObject(otbl)
|
||||
if not otbl then otbl = {} end
|
||||
local tbl = { table = otbl }
|
||||
for k, v in pairs(optionParent) do
|
||||
tbl[k] = v
|
||||
end
|
||||
|
||||
return tbl
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
|
||||
|
||||
local getFunc, setFunc
|
||||
do
|
||||
function getFunc(info)
|
||||
return (info.arg and Bartender4.db.profile[info.arg] or Bartender4.db.profile[info[#info]])
|
||||
end
|
||||
|
||||
function setFunc(info, value)
|
||||
local key = info.arg or info[#info]
|
||||
Bartender4.db.profile[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
local KB = LibStub("LibKeyBound-1.0")
|
||||
local LDBIcon = LibStub("LibDBIcon-1.0", true)
|
||||
local function getOptions()
|
||||
if not Bartender4.options then
|
||||
Bartender4.options = {
|
||||
type = "group",
|
||||
name = "Bartender4",
|
||||
icon = "Interface\\Icons\\INV_Drink_05",
|
||||
childGroups = "tree",
|
||||
plugins = {},
|
||||
args = {
|
||||
lock = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = L["Lock"],
|
||||
desc = L["Lock all bars."],
|
||||
get = function() return Bartender4.Locked end,
|
||||
set = function(info, value) Bartender4[value and "Lock" or "Unlock"](Bartender4) end,
|
||||
width = "half",
|
||||
},
|
||||
buttonlock = {
|
||||
order = 2,
|
||||
type = "toggle",
|
||||
name = L["Button Lock"],
|
||||
desc = L["Lock the buttons."],
|
||||
get = function() return Bartender4.db.profile.buttonlock end,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.buttonlock = value
|
||||
Bartender4.Bar:ForAll("ForAll", "SetAttribute", "buttonlock", value)
|
||||
end,
|
||||
},
|
||||
minimapIcon = {
|
||||
order = 3,
|
||||
type = "toggle",
|
||||
name = L["Minimap Icon"],
|
||||
desc = L["Show a Icon to open the config at the Minimap"],
|
||||
get = function() return not Bartender4.db.profile.minimapIcon.hide end,
|
||||
set = function(info, value) Bartender4.db.profile.minimapIcon.hide = not value; LDBIcon[value and "Show" or "Hide"](LDBIcon, "Bartender4") end,
|
||||
disabled = function() return not LDBIcon end,
|
||||
},
|
||||
kb = {
|
||||
order = 4,
|
||||
type = "execute",
|
||||
name = L["Key Bindings"],
|
||||
desc = L["Switch to key-binding mode"],
|
||||
func = function()
|
||||
KB:Toggle()
|
||||
AceConfigDialog:Close("Bartender4")
|
||||
end,
|
||||
},
|
||||
bars = {
|
||||
order = 20,
|
||||
type = "group",
|
||||
name = L["Bars"],
|
||||
args = {
|
||||
options = {
|
||||
type = "group",
|
||||
order = 0,
|
||||
name = function(info) if info.uiType == "dialog" then return "" else return L["Bar Options"] end end,
|
||||
guiInline = true,
|
||||
args = {
|
||||
blizzardVehicle = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = L["Use Blizzard Vehicle UI"],
|
||||
desc = L["Enable the use of the Blizzard Vehicle UI, hiding any Bartender4 bars in the meantime."],
|
||||
width = "full",
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
if UnitHasVehicleUI("player") then
|
||||
Bartender4:Print(L["You have to exit the vehicle in order to be able to change the Vehicle UI settings."])
|
||||
return
|
||||
end
|
||||
Bartender4.db.profile.blizzardVehicle = value
|
||||
Bartender4:UpdateBlizzardVehicle()
|
||||
end,
|
||||
},
|
||||
selfcastmodifier = {
|
||||
order = 10,
|
||||
type = "toggle",
|
||||
name = L["Self-Cast by modifier"],
|
||||
desc = L["Toggle the use of the modifier-based self-cast functionality."],
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.selfcastmodifier = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
setselfcastmod = {
|
||||
order = 20,
|
||||
type = "select",
|
||||
name = L["Self-Cast Modifier"],
|
||||
desc = L["Select the Self-Cast Modifier"],
|
||||
get = function(info) return GetModifiedClick("SELFCAST") end,
|
||||
set = function(info, value) SetModifiedClick("SELFCAST", value); SaveBindings(GetCurrentBindingSet() or 1) end,
|
||||
values = { NONE = L["None"], ALT = L["ALT"], SHIFT = L["SHIFT"], CTRL = L["CTRL"] },
|
||||
},
|
||||
selfcast_nl = {
|
||||
order = 30,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
focuscastmodifier = {
|
||||
order = 50,
|
||||
type = "toggle",
|
||||
name = L["Focus-Cast by modifier"],
|
||||
desc = L["Toggle the use of the modifier-based focus-cast functionality."],
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.focuscastmodifier = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
setfocuscastmod = {
|
||||
order = 60,
|
||||
type = "select",
|
||||
name = L["Focus-Cast Modifier"],
|
||||
desc = L["Select the Focus-Cast Modifier"],
|
||||
get = function(info) return GetModifiedClick("FOCUSCAST") end,
|
||||
set = function(info, value) SetModifiedClick("FOCUSCAST", value); SaveBindings(GetCurrentBindingSet() or 1) end,
|
||||
values = { NONE = L["None"], ALT = L["ALT"], SHIFT = L["SHIFT"], CTRL = L["CTRL"] },
|
||||
},
|
||||
focuscast_nl = {
|
||||
order = 70,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
selfcastrightclick = {
|
||||
order = 80,
|
||||
type = "toggle",
|
||||
name = L["Right-click Self-Cast"],
|
||||
desc = L["Toggle the use of the right-click self-cast functionality."],
|
||||
get = getFunc,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.selfcastrightclick = value
|
||||
Bartender4.Bar:ForAll("UpdateSelfCast")
|
||||
end,
|
||||
},
|
||||
rightclickselfcast_nl = {
|
||||
order = 90,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
range = {
|
||||
order = 100,
|
||||
name = L["Out of Range Indicator"],
|
||||
desc = L["Configure how the Out of Range Indicator should display on the buttons."],
|
||||
type = "select",
|
||||
style = "dropdown",
|
||||
get = function()
|
||||
return Bartender4.db.profile.outofrange
|
||||
end,
|
||||
set = function(info, value)
|
||||
Bartender4.db.profile.outofrange = value
|
||||
Bartender4.Bar:ForAll("ApplyConfig")
|
||||
end,
|
||||
values = { none = L["No Display"], button = L["Full Button Mode"], hotkey = L["Hotkey Mode"] },
|
||||
},
|
||||
colors = {
|
||||
order = 130,
|
||||
type = "group",
|
||||
guiInline = true,
|
||||
name = L["Colors"],
|
||||
get = function(info)
|
||||
local color = Bartender4.db.profile.colors[info[#info]]
|
||||
return color.r, color.g, color.b
|
||||
end,
|
||||
set = function(info, r, g, b)
|
||||
local color = Bartender4.db.profile.colors[info[#info]]
|
||||
color.r, color.g, color.b = r, g, b
|
||||
Bartender4.Bar:ForAll("ApplyConfig")
|
||||
end,
|
||||
args = {
|
||||
range = {
|
||||
order = 1,
|
||||
type = "color",
|
||||
name = L["Out of Range Indicator"],
|
||||
desc = L["Specify the Color of the Out of Range Indicator"],
|
||||
},
|
||||
mana = {
|
||||
order = 2,
|
||||
type = "color",
|
||||
name = L["Out of Mana Indicator"],
|
||||
desc = L["Specify the Color of the Out of Mana Indicator"],
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip = {
|
||||
order = 200,
|
||||
name = L["Button Tooltip"],
|
||||
type = "select",
|
||||
desc = L["Configure the Button Tooltip."],
|
||||
values = { ["disabled"] = L["Disabled"], ["nocombat"] = L["Disabled in Combat"], ["enabled"] = L["Enabled"] },
|
||||
get = function() return Bartender4.db.profile.tooltip end,
|
||||
set = function(info, value) Bartender4.db.profile.tooltip = value end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
faq = {
|
||||
name = L["FAQ"],
|
||||
desc = L["Frequently Asked Questions"],
|
||||
type = "group",
|
||||
order = 200,
|
||||
args = {
|
||||
faq = {
|
||||
type = "description",
|
||||
name = L["FAQ_TEXT"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Bartender4.options.plugins.profiles = { profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(Bartender4.db) }
|
||||
for k,v in Bartender4:IterateModules() do
|
||||
if v.SetupOptions then
|
||||
v:SetupOptions()
|
||||
end
|
||||
end
|
||||
end
|
||||
return Bartender4.options
|
||||
end
|
||||
|
||||
function Bartender4:ChatCommand(input)
|
||||
if InCombatLockdown() then
|
||||
self:Print(L["Cannot access options during combat."])
|
||||
return
|
||||
end
|
||||
if not input or input:trim() == "" then
|
||||
LibStub("AceConfigDialog-3.0"):Open("Bartender4")
|
||||
else
|
||||
LibStub("AceConfigCmd-3.0").HandleCommand(Bartender4, "bt", "Bartender4", input)
|
||||
end
|
||||
end
|
||||
|
||||
function Bartender4:SetupOptions()
|
||||
LibStub("AceConfig-3.0"):RegisterOptionsTable("Bartender4", getOptions)
|
||||
AceConfigDialog:SetDefaultSize("Bartender4", 680,525)
|
||||
self:RegisterChatCommand( "bar", "ChatCommand")
|
||||
self:RegisterChatCommand( "bt", "ChatCommand")
|
||||
self:RegisterChatCommand( "bt4", "ChatCommand")
|
||||
self:RegisterChatCommand( "bartender", "ChatCommand")
|
||||
self:RegisterChatCommand( "bartender4", "ChatCommand")
|
||||
end
|
||||
|
||||
function Bartender4:RegisterModuleOptions(key, table)
|
||||
if not self.options then
|
||||
error("Options table has not been created yet, respond to the callback!", 2)
|
||||
end
|
||||
self.options.plugins[key] = { [key] = table }
|
||||
end
|
||||
|
||||
function Bartender4:RegisterBarOptions(id, table)
|
||||
if not self.options then
|
||||
error("Options table has not been created yet, respond to the callback!", 2)
|
||||
end
|
||||
self.options.args.bars.args[id] = table
|
||||
end
|
||||
|
||||
local optionParent = {}
|
||||
function optionParent:NewCategory(category, data)
|
||||
self.table[category] = data
|
||||
end
|
||||
|
||||
local ov = nil
|
||||
function optionParent:AddElement(category, element, data, ...)
|
||||
local lvl = self.table[category]
|
||||
for i = 1, select('#', ...) do
|
||||
local key = select(i, ...)
|
||||
if not (lvl.args[key] and lvl.args[key].args) then
|
||||
error(("Sub-Level Key %s does not exist in options group or is no sub-group."):format(key), ov and 3 or 2)
|
||||
end
|
||||
lvl = lvl.args[key]
|
||||
end
|
||||
|
||||
lvl.args[element] = data
|
||||
end
|
||||
|
||||
function optionParent:AddElementGroup(category, data, ...)
|
||||
ov = true
|
||||
for k,v in pairs(data) do
|
||||
self:AddElement(category, k, v, ...)
|
||||
end
|
||||
ov = nil
|
||||
end
|
||||
|
||||
function Bartender4:NewOptionObject(otbl)
|
||||
if not otbl then otbl = {} end
|
||||
local tbl = { table = otbl }
|
||||
for k, v in pairs(optionParent) do
|
||||
tbl[k] = v
|
||||
end
|
||||
|
||||
return tbl
|
||||
end
|
||||
|
||||
+19
-19
@@ -1,19 +1,19 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||
..\FrameXML\UI.xsd">
|
||||
<Script file="AceGUIWidget-NumberEditBox.lua"/>
|
||||
|
||||
<Script file="Options.lua"/>
|
||||
|
||||
<Script file="Bar.lua"/>
|
||||
<Script file="ButtonBar.lua"/>
|
||||
<Script file="StateBar.lua"/>
|
||||
|
||||
<Script file="ActionBar.lua"/>
|
||||
<Script file="BagBar.lua"/>
|
||||
<Script file="MicroMenu.lua"/>
|
||||
<Script file="PetBar.lua"/>
|
||||
<Script file="StanceBar.lua"/>
|
||||
<Script file="RepXPBar.lua"/>
|
||||
<Script file="VehicleBar.lua"/>
|
||||
<Script file="MultiCastBar.lua"/>
|
||||
</Ui>
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||
..\FrameXML\UI.xsd">
|
||||
<Script file="AceGUIWidget-NumberEditBox.lua"/>
|
||||
|
||||
<Script file="Options.lua"/>
|
||||
|
||||
<Script file="Bar.lua"/>
|
||||
<Script file="ButtonBar.lua"/>
|
||||
<Script file="StateBar.lua"/>
|
||||
|
||||
<Script file="ActionBar.lua"/>
|
||||
<Script file="BagBar.lua"/>
|
||||
<Script file="MicroMenu.lua"/>
|
||||
<Script file="PetBar.lua"/>
|
||||
<Script file="StanceBar.lua"/>
|
||||
<Script file="RepXPBar.lua"/>
|
||||
<Script file="VehicleBar.lua"/>
|
||||
<Script file="MultiCastBar.lua"/>
|
||||
</Ui>
|
||||
|
||||
+51
-51
@@ -1,51 +1,51 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local PetBarMod = Bartender4:GetModule("PetBar")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function PetBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
|
||||
self.optionobject.table.general.args.rows.max = 10
|
||||
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the PetBar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Pet Bar"],
|
||||
desc = L["Configure the Pet Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("PetBar", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local PetBarMod = Bartender4:GetModule("PetBar")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function PetBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
|
||||
self.optionobject.table.general.args.rows.max = 10
|
||||
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the PetBar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Pet Bar"],
|
||||
desc = L["Configure the Pet Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("PetBar", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
+85
-85
@@ -1,85 +1,85 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
-- fetch upvalues
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
|
||||
local RepBarMod = Bartender4:GetModule("RepBar")
|
||||
|
||||
function RepBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = Bar:GetOptionObject()
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Reputation Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 100,
|
||||
type = "group",
|
||||
name = L["Reputation Bar"],
|
||||
desc = L["Configure the Reputation Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("Rep", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
local XPBarMod = Bartender4:GetModule("XPBar")
|
||||
|
||||
function XPBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = Bar:GetOptionObject()
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the XP Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 101,
|
||||
type = "group",
|
||||
name = L["XP Bar"],
|
||||
desc = L["Configure the XP Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("XP", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
-- fetch upvalues
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
|
||||
local RepBarMod = Bartender4:GetModule("RepBar")
|
||||
|
||||
function RepBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = Bar:GetOptionObject()
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Reputation Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 100,
|
||||
type = "group",
|
||||
name = L["Reputation Bar"],
|
||||
desc = L["Configure the Reputation Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("Rep", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
local XPBarMod = Bartender4:GetModule("XPBar")
|
||||
|
||||
function XPBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = Bar:GetOptionObject()
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the XP Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 101,
|
||||
type = "group",
|
||||
name = L["XP Bar"],
|
||||
desc = L["Configure the XP Bar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
Bartender4:RegisterBarOptions("XP", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
+51
-51
@@ -1,51 +1,51 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
-- module
|
||||
local StanceBarMod = Bartender4:GetModule("StanceBar")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function StanceBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the StanceBar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Stance Bar"],
|
||||
desc = L["Configure the Stance Bar"],
|
||||
childGroups = "tab",
|
||||
disabled = function(info) return GetNumShapeshiftForms() == 0 end,
|
||||
}
|
||||
Bartender4:RegisterBarOptions("StanceBar", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
-- module
|
||||
local StanceBarMod = Bartender4:GetModule("StanceBar")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function StanceBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the StanceBar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["Stance Bar"],
|
||||
desc = L["Configure the Stance Bar"],
|
||||
childGroups = "tab",
|
||||
disabled = function(info) return GetNumShapeshiftForms() == 0 end,
|
||||
}
|
||||
Bartender4:RegisterBarOptions("StanceBar", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
+286
-286
@@ -1,286 +1,286 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
local StateBar = Bartender4.StateBar.prototype
|
||||
|
||||
local optGetter, optSetter, getBar
|
||||
do
|
||||
local optionMap, callFunc
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
|
||||
optionMap = {
|
||||
stance = "StanceStateOption",
|
||||
enabled = "StateOption",
|
||||
def_state = "DefaultState",
|
||||
states = "StateOption",
|
||||
actionbar = "StateOption",
|
||||
possess = "StateOption",
|
||||
autoassist = "ConfigAutoAssist",
|
||||
customEnabled = "StateOption",
|
||||
custom = "StateOption",
|
||||
customCopy = "CopyCustomConditionals",
|
||||
}
|
||||
-- retrieves a valid bar object from the barregistry table
|
||||
function getBar(id)
|
||||
local bar = barregistry[tostring(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info.arg or info[#info]
|
||||
return callFunc(bar, "Get", option, info[#info])
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info.arg or info[#info]
|
||||
return callFunc(bar, "Set", option, info[#info], ...)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local hasStances
|
||||
|
||||
local validStanceTable = {
|
||||
[0] = L["Don't Page"],
|
||||
(L["Page %2d"]):format(1),
|
||||
(L["Page %2d"]):format(2),
|
||||
(L["Page %2d"]):format(3),
|
||||
(L["Page %2d"]):format(4),
|
||||
(L["Page %2d"]):format(5),
|
||||
(L["Page %2d"]):format(6),
|
||||
(L["Page %2d"]):format(7),
|
||||
(L["Page %2d"]):format(8),
|
||||
(L["Page %2d"]):format(9),
|
||||
(L["Page %2d"]):format(10)
|
||||
}
|
||||
|
||||
|
||||
local _, playerclass = UnitClass("player")
|
||||
|
||||
local function createOptionGroup(k, id)
|
||||
local tbl = {
|
||||
order = 10 * k,
|
||||
type = "select",
|
||||
arg = "stance",
|
||||
values = validStanceTable,
|
||||
name = Bartender4.StanceMap[playerclass][k].name,
|
||||
}
|
||||
return tbl
|
||||
end
|
||||
|
||||
local disabledFunc = function(info)
|
||||
local bar = getBar(info[2])
|
||||
return not bar:GetStateOption("enabled")
|
||||
end
|
||||
|
||||
local stateOffOrCustomOn = function(info)
|
||||
local bar = getBar(info[2])
|
||||
return (not bar:GetStateOption("enabled")) or (bar:GetStateOption("customEnabled"))
|
||||
end
|
||||
|
||||
local stateOffOrCustomOff = function(info)
|
||||
local bar = getBar(info[2])
|
||||
return (not bar:GetStateOption("enabled")) or (not bar:GetStateOption("customEnabled"))
|
||||
end
|
||||
|
||||
function StateBar:GetOptionObject()
|
||||
local obj = ButtonBar.GetOptionObject()
|
||||
local options = {
|
||||
enabled = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable State-based Button Swaping"],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
sep1 = {
|
||||
order = 2,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
autoassist = {
|
||||
order = 3,
|
||||
type = "toggle",
|
||||
name = L["Auto-Assist"],
|
||||
desc = L["Enable Auto-Assist for this bar.\n Auto-Assist will automatically try to cast on your target's target if your target is no valid target for the selected spell."],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
width = "full",
|
||||
},
|
||||
possess = {
|
||||
order = 5,
|
||||
type = "toggle",
|
||||
name = L["Possess Bar"],
|
||||
desc = L["Switch this bar to the Possess Bar when possessing a npc (eg. Mind Control)"],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
},
|
||||
actionbar = {
|
||||
order = 6,
|
||||
type = "toggle",
|
||||
name = L["ActionBar Paging"],
|
||||
desc = L["Enable Bar Switching based on the actionbar controls provided by the game. \nSee Blizzard Key Bindings for assignments - Usually Shift-Mouse Wheel and Shift+1 - Shift+6."],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
},
|
||||
def_desc = {
|
||||
order = 10,
|
||||
type = "description",
|
||||
name = L["The default behaviour of this bar when no state-based paging option affects it."],
|
||||
},
|
||||
def_state = {
|
||||
order = 11,
|
||||
type = "select",
|
||||
name = L["Default Bar State"],
|
||||
values = validStanceTable,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
},
|
||||
modifiers = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
inline = true,
|
||||
name = "",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
args = {
|
||||
header = {
|
||||
order = 1,
|
||||
type = "header",
|
||||
name = L["Modifier Based Switching"],
|
||||
},
|
||||
ctrl = {
|
||||
order = 10,
|
||||
type = "select",
|
||||
name = L["CTRL"],
|
||||
arg = "states",
|
||||
values = validStanceTable,
|
||||
desc = (L["Configure actionbar paging when the %s key is down."]):format(L["CTRL"]),
|
||||
--width = "half",
|
||||
},
|
||||
alt = {
|
||||
order = 15,
|
||||
type = "select",
|
||||
name = L["ALT"],
|
||||
arg = "states",
|
||||
values = validStanceTable,
|
||||
desc = (L["Configure actionbar paging when the %s key is down."]):format(L["ALT"]),
|
||||
--width = "half",
|
||||
},
|
||||
shift = {
|
||||
order = 20,
|
||||
type = "select",
|
||||
name = L["SHIFT"],
|
||||
arg = "states",
|
||||
values = validStanceTable,
|
||||
desc = (L["Configure actionbar paging when the %s key is down."]):format(L["SHIFT"]),
|
||||
--width = "half",
|
||||
},
|
||||
},
|
||||
},
|
||||
stances = {
|
||||
order = 20,
|
||||
type = "group",
|
||||
inline = true,
|
||||
name = "",
|
||||
hidden = function() return not (Bartender4.StanceMap[playerclass]) end,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
args = {
|
||||
stance_header = {
|
||||
order = 1,
|
||||
type = "header",
|
||||
name = L["Stance Configuration"],
|
||||
},
|
||||
},
|
||||
},
|
||||
customNl = {
|
||||
order = 48,
|
||||
type = "description",
|
||||
name = "\n",
|
||||
},
|
||||
customHeader = {
|
||||
order = 49,
|
||||
type = "header",
|
||||
name = L["Custom Conditionals"],
|
||||
},
|
||||
customEnabled = {
|
||||
order = 50,
|
||||
type = "toggle",
|
||||
name = L["Use Custom Condition"],
|
||||
desc = L["Enable the use of a custom condition, disabling all of the above."],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = disabledFunc,
|
||||
--width = "double",
|
||||
},
|
||||
customCopy = {
|
||||
order = 51,
|
||||
type = "execute",
|
||||
name = L["Copy Conditionals"],
|
||||
desc = L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."],
|
||||
func = optSetter,
|
||||
disabled = disabledFunc,
|
||||
},
|
||||
customDesc = {
|
||||
order = 52,
|
||||
type = "description",
|
||||
name = L["Note: Enabling Custom Conditionals will disable all of the above settings!"],
|
||||
},
|
||||
custom = {
|
||||
order = 55,
|
||||
type = "input",
|
||||
name = L["Custom Conditionals"],
|
||||
desc = L["You can use any macro conditionals in the custom string, using the number of the bar as target value.\nExample: [form:1]9;0"],
|
||||
width = "full",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOff,
|
||||
multiline = true,
|
||||
},
|
||||
}
|
||||
|
||||
do
|
||||
local defstancemap = Bartender4.StanceMap[playerclass]
|
||||
if defstancemap then
|
||||
for k,v in pairs(defstancemap) do
|
||||
if not options.stances.args[v.id] then
|
||||
options.stances.args[v.id] = createOptionGroup(k, v.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local states = {
|
||||
type = "group",
|
||||
name = L["State Configuration"],
|
||||
order = 5,
|
||||
args = options,
|
||||
}
|
||||
obj:NewCategory("state", states)
|
||||
|
||||
return obj
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local Bar = Bartender4.Bar.prototype
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
local StateBar = Bartender4.StateBar.prototype
|
||||
|
||||
local optGetter, optSetter, getBar
|
||||
do
|
||||
local optionMap, callFunc
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
|
||||
optionMap = {
|
||||
stance = "StanceStateOption",
|
||||
enabled = "StateOption",
|
||||
def_state = "DefaultState",
|
||||
states = "StateOption",
|
||||
actionbar = "StateOption",
|
||||
possess = "StateOption",
|
||||
autoassist = "ConfigAutoAssist",
|
||||
customEnabled = "StateOption",
|
||||
custom = "StateOption",
|
||||
customCopy = "CopyCustomConditionals",
|
||||
}
|
||||
-- retrieves a valid bar object from the barregistry table
|
||||
function getBar(id)
|
||||
local bar = barregistry[tostring(id)]
|
||||
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
|
||||
return bar
|
||||
end
|
||||
|
||||
-- calls a function on the bar
|
||||
function callFunc(bar, type, option, ...)
|
||||
local func = type .. (optionMap[option] or option)
|
||||
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
|
||||
return bar[func](bar, ...)
|
||||
end
|
||||
|
||||
-- universal function to get a option
|
||||
function optGetter(info)
|
||||
local bar = getBar(info[2])
|
||||
local option = info.arg or info[#info]
|
||||
return callFunc(bar, "Get", option, info[#info])
|
||||
end
|
||||
|
||||
-- universal function to set a option
|
||||
function optSetter(info, ...)
|
||||
local bar = getBar(info[2])
|
||||
local option = info.arg or info[#info]
|
||||
return callFunc(bar, "Set", option, info[#info], ...)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local hasStances
|
||||
|
||||
local validStanceTable = {
|
||||
[0] = L["Don't Page"],
|
||||
(L["Page %2d"]):format(1),
|
||||
(L["Page %2d"]):format(2),
|
||||
(L["Page %2d"]):format(3),
|
||||
(L["Page %2d"]):format(4),
|
||||
(L["Page %2d"]):format(5),
|
||||
(L["Page %2d"]):format(6),
|
||||
(L["Page %2d"]):format(7),
|
||||
(L["Page %2d"]):format(8),
|
||||
(L["Page %2d"]):format(9),
|
||||
(L["Page %2d"]):format(10)
|
||||
}
|
||||
|
||||
|
||||
local _, playerclass = UnitClass("player")
|
||||
|
||||
local function createOptionGroup(k, id)
|
||||
local tbl = {
|
||||
order = 10 * k,
|
||||
type = "select",
|
||||
arg = "stance",
|
||||
values = validStanceTable,
|
||||
name = Bartender4.StanceMap[playerclass][k].name,
|
||||
}
|
||||
return tbl
|
||||
end
|
||||
|
||||
local disabledFunc = function(info)
|
||||
local bar = getBar(info[2])
|
||||
return not bar:GetStateOption("enabled")
|
||||
end
|
||||
|
||||
local stateOffOrCustomOn = function(info)
|
||||
local bar = getBar(info[2])
|
||||
return (not bar:GetStateOption("enabled")) or (bar:GetStateOption("customEnabled"))
|
||||
end
|
||||
|
||||
local stateOffOrCustomOff = function(info)
|
||||
local bar = getBar(info[2])
|
||||
return (not bar:GetStateOption("enabled")) or (not bar:GetStateOption("customEnabled"))
|
||||
end
|
||||
|
||||
function StateBar:GetOptionObject()
|
||||
local obj = ButtonBar.GetOptionObject()
|
||||
local options = {
|
||||
enabled = {
|
||||
order = 1,
|
||||
type = "toggle",
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable State-based Button Swaping"],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
},
|
||||
sep1 = {
|
||||
order = 2,
|
||||
type = "description",
|
||||
name = "",
|
||||
},
|
||||
autoassist = {
|
||||
order = 3,
|
||||
type = "toggle",
|
||||
name = L["Auto-Assist"],
|
||||
desc = L["Enable Auto-Assist for this bar.\n Auto-Assist will automatically try to cast on your target's target if your target is no valid target for the selected spell."],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
width = "full",
|
||||
},
|
||||
possess = {
|
||||
order = 5,
|
||||
type = "toggle",
|
||||
name = L["Possess Bar"],
|
||||
desc = L["Switch this bar to the Possess Bar when possessing a npc (eg. Mind Control)"],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
},
|
||||
actionbar = {
|
||||
order = 6,
|
||||
type = "toggle",
|
||||
name = L["ActionBar Paging"],
|
||||
desc = L["Enable Bar Switching based on the actionbar controls provided by the game. \nSee Blizzard Key Bindings for assignments - Usually Shift-Mouse Wheel and Shift+1 - Shift+6."],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
},
|
||||
def_desc = {
|
||||
order = 10,
|
||||
type = "description",
|
||||
name = L["The default behaviour of this bar when no state-based paging option affects it."],
|
||||
},
|
||||
def_state = {
|
||||
order = 11,
|
||||
type = "select",
|
||||
name = L["Default Bar State"],
|
||||
values = validStanceTable,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
},
|
||||
modifiers = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
inline = true,
|
||||
name = "",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
args = {
|
||||
header = {
|
||||
order = 1,
|
||||
type = "header",
|
||||
name = L["Modifier Based Switching"],
|
||||
},
|
||||
ctrl = {
|
||||
order = 10,
|
||||
type = "select",
|
||||
name = L["CTRL"],
|
||||
arg = "states",
|
||||
values = validStanceTable,
|
||||
desc = (L["Configure actionbar paging when the %s key is down."]):format(L["CTRL"]),
|
||||
--width = "half",
|
||||
},
|
||||
alt = {
|
||||
order = 15,
|
||||
type = "select",
|
||||
name = L["ALT"],
|
||||
arg = "states",
|
||||
values = validStanceTable,
|
||||
desc = (L["Configure actionbar paging when the %s key is down."]):format(L["ALT"]),
|
||||
--width = "half",
|
||||
},
|
||||
shift = {
|
||||
order = 20,
|
||||
type = "select",
|
||||
name = L["SHIFT"],
|
||||
arg = "states",
|
||||
values = validStanceTable,
|
||||
desc = (L["Configure actionbar paging when the %s key is down."]):format(L["SHIFT"]),
|
||||
--width = "half",
|
||||
},
|
||||
},
|
||||
},
|
||||
stances = {
|
||||
order = 20,
|
||||
type = "group",
|
||||
inline = true,
|
||||
name = "",
|
||||
hidden = function() return not (Bartender4.StanceMap[playerclass]) end,
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOn,
|
||||
args = {
|
||||
stance_header = {
|
||||
order = 1,
|
||||
type = "header",
|
||||
name = L["Stance Configuration"],
|
||||
},
|
||||
},
|
||||
},
|
||||
customNl = {
|
||||
order = 48,
|
||||
type = "description",
|
||||
name = "\n",
|
||||
},
|
||||
customHeader = {
|
||||
order = 49,
|
||||
type = "header",
|
||||
name = L["Custom Conditionals"],
|
||||
},
|
||||
customEnabled = {
|
||||
order = 50,
|
||||
type = "toggle",
|
||||
name = L["Use Custom Condition"],
|
||||
desc = L["Enable the use of a custom condition, disabling all of the above."],
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = disabledFunc,
|
||||
--width = "double",
|
||||
},
|
||||
customCopy = {
|
||||
order = 51,
|
||||
type = "execute",
|
||||
name = L["Copy Conditionals"],
|
||||
desc = L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."],
|
||||
func = optSetter,
|
||||
disabled = disabledFunc,
|
||||
},
|
||||
customDesc = {
|
||||
order = 52,
|
||||
type = "description",
|
||||
name = L["Note: Enabling Custom Conditionals will disable all of the above settings!"],
|
||||
},
|
||||
custom = {
|
||||
order = 55,
|
||||
type = "input",
|
||||
name = L["Custom Conditionals"],
|
||||
desc = L["You can use any macro conditionals in the custom string, using the number of the bar as target value.\nExample: [form:1]9;0"],
|
||||
width = "full",
|
||||
get = optGetter,
|
||||
set = optSetter,
|
||||
disabled = stateOffOrCustomOff,
|
||||
multiline = true,
|
||||
},
|
||||
}
|
||||
|
||||
do
|
||||
local defstancemap = Bartender4.StanceMap[playerclass]
|
||||
if defstancemap then
|
||||
for k,v in pairs(defstancemap) do
|
||||
if not options.stances.args[v.id] then
|
||||
options.stances.args[v.id] = createOptionGroup(k, v.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local states = {
|
||||
type = "group",
|
||||
name = L["State Configuration"],
|
||||
order = 5,
|
||||
args = options,
|
||||
}
|
||||
obj:NewCategory("state", states)
|
||||
|
||||
return obj
|
||||
end
|
||||
|
||||
+49
-49
@@ -1,49 +1,49 @@
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local VehicleBarMod = Bartender4:GetModule("Vehicle")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function VehicleBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Vehicle Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["VehicleBar"],
|
||||
desc = L["Configure the VehicleBar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
self.optionobject.table.general.args.padding.min = -30
|
||||
Bartender4:RegisterBarOptions("Vehicle", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
--[[
|
||||
Copyright (c) 2009, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
|
||||
All rights reserved.
|
||||
]]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
|
||||
|
||||
local VehicleBarMod = Bartender4:GetModule("Vehicle")
|
||||
|
||||
-- fetch upvalues
|
||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||
|
||||
function VehicleBarMod:SetupOptions()
|
||||
if not self.options then
|
||||
self.optionobject = ButtonBar:GetOptionObject()
|
||||
self.optionobject.table.general.args.rows.max = self.button_count
|
||||
local enabled = {
|
||||
type = "toggle",
|
||||
order = 1,
|
||||
name = L["Enabled"],
|
||||
desc = L["Enable the Vehicle Bar"],
|
||||
get = function() return self.db.profile.enabled end,
|
||||
set = "ToggleModule",
|
||||
handler = self,
|
||||
}
|
||||
self.optionobject:AddElement("general", "enabled", enabled)
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
type = "group",
|
||||
name = L["General Settings"],
|
||||
cmdInline = true,
|
||||
order = 1,
|
||||
args = {
|
||||
enabled = enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
self.options = {
|
||||
order = 30,
|
||||
type = "group",
|
||||
name = L["VehicleBar"],
|
||||
desc = L["Configure the VehicleBar"],
|
||||
childGroups = "tab",
|
||||
}
|
||||
self.optionobject.table.general.args.padding.min = -30
|
||||
Bartender4:RegisterBarOptions("Vehicle", self.options)
|
||||
end
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user