This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
It's real easy to do:RepXPBar.lua - Add this code:-- register modulelocal PetXPBarMod = Bartender4:NewModule("PetXPBar")
-- create prototype informationlocal PetXPBar = setmetatable({}, {__index = Bar})
function PetXPBarMod:OnInitialize() self.db = Bartender4.db:RegisterNamespace("PetXPBar", defaults) self:SetEnabledState(self.db.profile.enabled)end
function PetXPBarMod:OnEnable() if not self.bar then self.bar = setmetatable(Bartender4.Bar:Create("PetXP", self.db.profile, L["PetXP Bar"]), {__index = PetXPBar}) self.bar.content= PetPaperDollFrameExpBar self.bar.content:SetParent(self.bar) self.bar.content:Show() self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1) -- TODO: real start position self.bar:SetPoint("CENTER") end self.bar:Enable() self:ToggleOptions() self.bar:ApplyConfig(self.db.profile)end
PetXPBarMod.ApplyConfig = RepBarMod.ApplyConfigPetXPBar.ApplyConfig = RepBar.ApplyConfigPetXPBar.PerformLayout = RepBar.PerformLayout
In Options directory:RepXPBar.lua - Add this code:local PetXPBarMod = Bartender4:GetModule("PetXPBar")
function PetXPBarMod:SetupOptions() if not self.options then self.optionobject = Bar:GetOptionObject() local enabled = { type = "toggle", order = 1, name = L["Enabled"], desc = L["Enable the PetXP 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["PetXP Bar"], desc = L["Configure the PetXP Bar"], childGroups = "tab", } Bartender4:RegisterBarOptions("PetXP", self.options) end self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptionsend
In locale directory:enUS.lua - Add entries:L["Configure the PetXP Bar"] = trueL["Enable the PetXP Bar"] = trueL["PetXP Bar"] = true
--Hodor, Draka.
Is the Pet XP Bar something thats usually displayed in the BottomBar Cluster? I don't think it is, thats why BT4 won't touch it.
Ahh, I see. Guess I'll patch it in on my own then (and again after every release.)
To post a comment, please login or register a new account.