Advertisement
Guest User

Untitled

a guest
Nov 18th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.53 KB | None | 0 0
  1. -- ===================================================================
  2. -- Party Initialization.
  3. -- ===================================================================
  4.     local _, AddonTable = ...
  5.     if (not AddonTable.Config.enabledUnits["party"]) then return end
  6.  
  7. -- ===================================================================
  8. -- Party Style Function.
  9. -- ===================================================================
  10.     local function PartyPetStyle(self)
  11.         -- Configuration.
  12.         self.width       = 115
  13.         self.height      = 19
  14.         self.hpBarHeight = 17
  15.         self.HeaderUnit  = true
  16.  
  17.         -- Spell range options.
  18.         self.SpellRange = {
  19.             insideAlpha  = 1,
  20.             outsideAlpha = 0.3
  21.         }
  22.  
  23.         -- Unit frame properties.
  24.         AddonTable:SharedProperties(self)
  25.  
  26.         -- Generate unit frame elements.
  27.         AddonTable:GenerateBackground(self)
  28.         AddonTable:GenerateHealthBar(self)
  29.  
  30.         AddonTable:GenerateNameText(self)
  31.         AddonTable:GenerateDeficitText(self)
  32.  
  33.         -- Unit frame options.
  34.         self.Health.colorReaction = true
  35.     end
  36.  
  37.     local function PartyStyle(self)
  38.         -- Isolate the party pet frames and pass them to their own function.
  39.         if (self:GetAttribute("unitsuffix") == "pet") then
  40.             return PartyPetStyle(self)
  41.         end
  42.  
  43.         -- Configuration.
  44.         self.width          = 206
  45.         self.height         = 45
  46.         self.hpBarHeight    = 28
  47.         self.powerBarHeight = 14
  48.         self.HeaderUnit     = true
  49.  
  50.         -- Spell range options.
  51.         self.SpellRange = {
  52.             insideAlpha  = 1,
  53.             outsideAlpha = 0.3
  54.         }
  55.  
  56.         -- Unit frame properties.
  57.         AddonTable:SharedProperties(self)
  58.  
  59.         -- Generate unit frame elements.
  60.         AddonTable:GenerateBackground(self)
  61.         AddonTable:GenerateHealthBar(self)
  62.         AddonTable:GenerateDivider(self)
  63.         AddonTable:GeneratePowerBar(self)
  64.  
  65.         AddonTable:GenerateNameText(self)
  66.         AddonTable:GenerateHealthText(self)
  67.         AddonTable:GenerateClassificationText(self)
  68.         AddonTable:GeneratePowerText(self)
  69.  
  70.         AddonTable:GenerateAuras(self, "buff", 19, 10, 1, "RIGHT", "DOWN", 5, "TOPLEFT", "TOPLEFT", self, "BOTTOMLEFT", 0, -1)
  71.         AddonTable:GenerateAuras(self, "debuff", 19, 10, 1, "LEFT", "DOWN", 5, "TOPRIGHT", "TOPRIGHT", self, "BOTTOMRIGHT", 0, -1)
  72.  
  73.         -- Unit frame options.
  74.         self.Health.colorDisconnected = true
  75.         self.Health.colorClass        = true
  76.     end
  77.  
  78. -- ===================================================================
  79. -- Header Constants.
  80. -- ===================================================================
  81.     local initialConfigFunction = format([[
  82.         -- Differentiate between player units and their pets.
  83.         if (self:GetAttribute("unitsuffix") == "pet") then
  84.             self:SetWidth(%d)
  85.             self:SetHeight(%d)
  86.             self:SetScale(%d)
  87.         else
  88.             self:SetWidth(%d)
  89.             self:SetHeight(%d)
  90.             self:SetScale(%f)
  91.         end
  92.     ]], 115, 19, 1, 206, 45, AddonTable.Config.scale)
  93.  
  94.     local customVisibility = "custom [@raid6, exists] hide; [group:party] show; hide"
  95.  
  96. -- ===================================================================
  97. -- Spawn Party.
  98. -- ===================================================================
  99.     oUF:RegisterStyle("oUF_ClamsodaParty", PartyStyle)
  100.     oUF:SetActiveStyle("oUF_ClamsodaParty")
  101.  
  102.     local party = oUF:SpawnHeader("oUF_ClamsodaParty", nil, customVisibility,
  103.         "oUF-initialConfigFunction", initialConfigFunction,
  104.         "template",                  "oUF_ClamsodaPartyPets",
  105.         "showParty",                 true,
  106.         "columnAnchorPoint",         "BOTTOM",
  107.         "point",                     "BOTTOM",
  108.         "yOffset",                   41
  109.     )
  110.  
  111.     -- Why doesn't this anchor perfectly?
  112.     party:SetPoint("BOTTOMRIGHT", oUF_ClamsodaPlayer, "BOTTOMLEFT", -16, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement