Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ===================================================================
- -- Party Initialization.
- -- ===================================================================
- local _, AddonTable = ...
- if (not AddonTable.Config.enabledUnits["party"]) then return end
- -- ===================================================================
- -- Party Style Function.
- -- ===================================================================
- local function PartyPetStyle(self)
- -- Configuration.
- self.width = 115
- self.height = 19
- self.hpBarHeight = 17
- self.HeaderUnit = true
- -- Spell range options.
- self.SpellRange = {
- insideAlpha = 1,
- outsideAlpha = 0.3
- }
- -- Unit frame properties.
- AddonTable:SharedProperties(self)
- -- Generate unit frame elements.
- AddonTable:GenerateBackground(self)
- AddonTable:GenerateHealthBar(self)
- AddonTable:GenerateNameText(self)
- AddonTable:GenerateDeficitText(self)
- -- Unit frame options.
- self.Health.colorReaction = true
- end
- local function PartyStyle(self)
- -- Isolate the party pet frames and pass them to their own function.
- if (self:GetAttribute("unitsuffix") == "pet") then
- return PartyPetStyle(self)
- end
- -- Configuration.
- self.width = 206
- self.height = 45
- self.hpBarHeight = 28
- self.powerBarHeight = 14
- self.HeaderUnit = true
- -- Spell range options.
- self.SpellRange = {
- insideAlpha = 1,
- outsideAlpha = 0.3
- }
- -- Unit frame properties.
- AddonTable:SharedProperties(self)
- -- Generate unit frame elements.
- AddonTable:GenerateBackground(self)
- AddonTable:GenerateHealthBar(self)
- AddonTable:GenerateDivider(self)
- AddonTable:GeneratePowerBar(self)
- AddonTable:GenerateNameText(self)
- AddonTable:GenerateHealthText(self)
- AddonTable:GenerateClassificationText(self)
- AddonTable:GeneratePowerText(self)
- AddonTable:GenerateAuras(self, "buff", 19, 10, 1, "RIGHT", "DOWN", 5, "TOPLEFT", "TOPLEFT", self, "BOTTOMLEFT", 0, -1)
- AddonTable:GenerateAuras(self, "debuff", 19, 10, 1, "LEFT", "DOWN", 5, "TOPRIGHT", "TOPRIGHT", self, "BOTTOMRIGHT", 0, -1)
- -- Unit frame options.
- self.Health.colorDisconnected = true
- self.Health.colorClass = true
- end
- -- ===================================================================
- -- Header Constants.
- -- ===================================================================
- local initialConfigFunction = format([[
- -- Differentiate between player units and their pets.
- if (self:GetAttribute("unitsuffix") == "pet") then
- self:SetWidth(%d)
- self:SetHeight(%d)
- self:SetScale(%d)
- else
- self:SetWidth(%d)
- self:SetHeight(%d)
- self:SetScale(%f)
- end
- ]], 115, 19, 1, 206, 45, AddonTable.Config.scale)
- local customVisibility = "custom [@raid6, exists] hide; [group:party] show; hide"
- -- ===================================================================
- -- Spawn Party.
- -- ===================================================================
- oUF:RegisterStyle("oUF_ClamsodaParty", PartyStyle)
- oUF:SetActiveStyle("oUF_ClamsodaParty")
- local party = oUF:SpawnHeader("oUF_ClamsodaParty", nil, customVisibility,
- "oUF-initialConfigFunction", initialConfigFunction,
- "template", "oUF_ClamsodaPartyPets",
- "showParty", true,
- "columnAnchorPoint", "BOTTOM",
- "point", "BOTTOM",
- "yOffset", 41
- )
- -- Why doesn't this anchor perfectly?
- party:SetPoint("BOTTOMRIGHT", oUF_ClamsodaPlayer, "BOTTOMLEFT", -16, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement