stub for a petbar - not worky yet
This commit is contained in:
@@ -26,3 +26,4 @@ ActionBars.lua
|
|||||||
ActionBarPrototype.lua
|
ActionBarPrototype.lua
|
||||||
ActionBarStates.lua
|
ActionBarStates.lua
|
||||||
StanceBar.lua
|
StanceBar.lua
|
||||||
|
PetBar.lua
|
||||||
|
|||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
--[[ $Id: StanceBar.lua 61678 2008-02-17 01:37:33Z nevcairiel $ ]]
|
||||||
|
|
||||||
|
-- register module
|
||||||
|
local PetBarMod = Bartender4:NewModule("PetBar")
|
||||||
|
|
||||||
|
-- fetch upvalues
|
||||||
|
local ActionBars = Bartender4:GetModule("ActionBars")
|
||||||
|
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||||
|
|
||||||
|
-- create prototype information
|
||||||
|
local PetBar = setmetatable({}, {__index = ButtonBar})
|
||||||
|
local PetButtonPrototype = CreateFrame("CheckButton")
|
||||||
|
local PetButton_MT = {__index = PetButtonPrototype}
|
||||||
|
|
||||||
|
local defaults = { profile = Bartender4:Merge({
|
||||||
|
enabled = true,
|
||||||
|
scale = 1.5,
|
||||||
|
}, Bartender4.ButtonBar.defaults) }
|
||||||
|
|
||||||
|
function PetBarMod:OnInitialize()
|
||||||
|
self.db = Bartender4.db:RegisterNamespace("PetBar", defaults)
|
||||||
|
|
||||||
|
self:SetupOptions()
|
||||||
|
end
|
||||||
|
|
||||||
|
function PetBarMod:OnEnable()
|
||||||
|
if not self.bar then
|
||||||
|
self.bar = setmetatable(Bartender4.ButtonBar:Create("Pet", nil, self.db.profile), {__index = PetBar})
|
||||||
|
|
||||||
|
self.bar:ClearSetPoint("CENTER")
|
||||||
|
self.bar:ApplyConfig()
|
||||||
|
self.bar:SetScript("OnEvent", PetBar.OnEvent)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PetBarMod:OnDisable()
|
||||||
|
if not self.bar then return end
|
||||||
|
self.bar:UnregisterAllEvents()
|
||||||
|
self.bar:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
function PetBarMod:SetupOptions()
|
||||||
|
self.options = Bartender4.ButtonBar.prototype:GetOptionObject()
|
||||||
|
|
||||||
|
ActionBars.options.args["pet"] = {
|
||||||
|
order = 30,
|
||||||
|
type = "group",
|
||||||
|
name = "Pet Bar",
|
||||||
|
desc = "Configure the Pet Bar",
|
||||||
|
childGroups = "tab",
|
||||||
|
}
|
||||||
|
ActionBars.options.args["stance"].args = self.options.table
|
||||||
|
end
|
||||||
|
|
||||||
|
function PetBarMod:ApplyConfig()
|
||||||
|
self.bar:ApplyConfig(self.db.profile)
|
||||||
|
end
|
||||||
+6
-1
@@ -1,8 +1,13 @@
|
|||||||
--[[ $Id$ ]]
|
--[[ $Id$ ]]
|
||||||
|
|
||||||
|
-- register module
|
||||||
local StanceBarMod = Bartender4:NewModule("StanceBar")
|
local StanceBarMod = Bartender4:NewModule("StanceBar")
|
||||||
|
|
||||||
|
-- fetch upvalues
|
||||||
local ActionBars = Bartender4:GetModule("ActionBars")
|
local ActionBars = Bartender4:GetModule("ActionBars")
|
||||||
local ButtonBar = Bartender4.ButtonBar.prototype
|
local ButtonBar = Bartender4.ButtonBar.prototype
|
||||||
|
|
||||||
|
-- create prototype information
|
||||||
local StanceBar = setmetatable({}, {__index = ButtonBar})
|
local StanceBar = setmetatable({}, {__index = ButtonBar})
|
||||||
local StanceButtonPrototype = CreateFrame("CheckButton")
|
local StanceButtonPrototype = CreateFrame("CheckButton")
|
||||||
local StanceButton_MT = {__index = StanceButtonPrototype}
|
local StanceButton_MT = {__index = StanceButtonPrototype}
|
||||||
@@ -20,7 +25,7 @@ end
|
|||||||
|
|
||||||
function StanceBarMod:OnEnable()
|
function StanceBarMod:OnEnable()
|
||||||
if not self.bar then
|
if not self.bar then
|
||||||
self.bar = setmetatable(Bartender4.ButtonBar:Create("stance", nil, self.db.profile), {__index = StanceBar})
|
self.bar = setmetatable(Bartender4.ButtonBar:Create("Stance", nil, self.db.profile), {__index = StanceBar})
|
||||||
|
|
||||||
self.bar:ClearSetPoint("CENTER")
|
self.bar:ClearSetPoint("CENTER")
|
||||||
self.bar:ApplyConfig()
|
self.bar:ApplyConfig()
|
||||||
|
|||||||
Reference in New Issue
Block a user