Added very basic Reputation/XP Bar modules
Support for the XP and Reputation Bar, Bartender4 hides them so it can show them again. Disabled by default. Note: The XP Bar hides itself when you reach max-level, and the Reputation Bar hides itself if you are not tracking any reputation.
This commit is contained in:
@@ -11,4 +11,5 @@
|
||||
<Script file="MicroMenu.lua"/>
|
||||
<Script file="PetBar.lua"/>
|
||||
<Script file="StanceBar.lua"/>
|
||||
<Script file="RepXPBar.lua"/>
|
||||
</Ui>
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
-- 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
|
||||
Reference in New Issue
Block a user