Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.76 KB | None | 0 0
  1. if C["unitframes"].classbar then
  2. if T.myclass == "DRUID" then
  3. local eclipseBar = CreateFrame('Frame', nil, self)
  4. eclipseBar:Point("BOTTOM", self, "TOP", 0, 3)
  5. eclipseBar:Size(frameWidth+4, 8)
  6. eclipseBar:SetFrameStrata("MEDIUM")
  7. eclipseBar:SetFrameLevel(8)
  8. eclipseBar:SetTemplate("Default")
  9. eclipseBar:SetBackdropColor(0,0,0)
  10. eclipseBar:SetScript("OnShow", function() T.EclipseDisplay(self, false) end)
  11. eclipseBar:SetScript("OnUpdate", function() T.EclipseDisplay(self, true) end) -- just forcing 1 update on login for buffs/shadow/etc.
  12. eclipseBar:SetScript("OnHide", function() T.EclipseDisplay(self, false) end)
  13.  
  14. local lunarBar = CreateFrame('StatusBar', nil, eclipseBar)
  15. lunarBar:SetPoint('LEFT', eclipseBar, 'LEFT', 2, 0)
  16. lunarBar:SetSize(eclipseBar:GetWidth()-4, eclipseBar:GetHeight()-4)
  17. lunarBar:SetStatusBarTexture(normTex)
  18. lunarBar:SetStatusBarColor(.30, .52, .90)
  19. eclipseBar.LunarBar = lunarBar
  20.  
  21. local solarBar = CreateFrame('StatusBar', nil, eclipseBar)
  22. solarBar:SetPoint('LEFT', lunarBar:GetStatusBarTexture(), 'RIGHT', 0, 0)
  23. solarBar:SetSize(eclipseBar:GetWidth()-4, eclipseBar:GetHeight()-4)
  24. solarBar:SetStatusBarTexture(normTex)
  25. solarBar:SetStatusBarColor(.80, .82, .60)
  26. eclipseBar.SolarBar = solarBar
  27.  
  28. local eclipseBarText = eclipseBar:CreateFontString(nil, 'OVERLAY')
  29. eclipseBarText:SetPoint('TOP', panel)
  30. eclipseBarText:SetPoint('BOTTOM', panel)
  31. eclipseBarText:SetFont(font, fontsize, fontflags)
  32. eclipseBar.PostUpdatePower = T.EclipseDirection
  33.  
  34. -- hide "low mana" text on load if eclipseBar is show
  35. if eclipseBar and eclipseBar:IsShown() then FlashInfo.ManaLevel:SetAlpha(0) end
  36.  
  37. self.EclipseBar = eclipseBar
  38. self.EclipseBar.Text = eclipseBarText
  39. end
  40.  
  41. -- set holy power bar or shard bar
  42. if (T.myclass == "WARLOCK" or T.myclass == "PALADIN") then
  43. local bars = CreateFrame("Frame", nil, self)
  44. bars:SetPoint("BOTTOM", self, "TOP", 0, 3)
  45. bars:Width(frameWidth+4)
  46. bars:Height(8)
  47. bars:SetTemplate("ThickBorder")
  48. bars:SetFrameLevel(2)
  49. bars:SetBackdropColor(0,0,0)
  50.  
  51. for i = 1, 3 do
  52. bars[i]=CreateFrame("StatusBar", self:GetName().."_Shard"..i, self)
  53. bars[i]:Height(bars:GetHeight()-4)
  54. bars[i]:Width((frameWidth-2)/3)
  55.  
  56. bars[i]:SetStatusBarTexture(normTex)
  57. bars[i]:GetStatusBarTexture():SetHorizTile(false)
  58.  
  59. bars[i].bg = bars[i]:CreateTexture(nil, 'BORDER')
  60.  
  61. if T.myclass == "WARLOCK" then
  62. bars[i]:SetStatusBarColor(255/255,101/255,101/255)
  63. bars[i].bg:SetTexture(255/255,101/255,101/255)
  64. elseif T.myclass == "PALADIN" then
  65. bars[i]:SetStatusBarColor(228/255,225/255,16/255)
  66. bars[i].bg:SetTexture(228/255,225/255,16/255)
  67. end
  68. if i == 1 then
  69. bars[i]:SetPoint("LEFT", bars, "LEFT", 2, 0)
  70. bars[i]:Width(bars[i]:GetWidth()+1)
  71. bars[i].bg:SetAllPoints(bars[i])
  72. else
  73. bars[i]:Point("LEFT", bars[i-1], "RIGHT", 1, 0)
  74. bars[i].bg:SetAllPoints(bars[i])
  75. end
  76.  
  77. bars[i].bg:SetTexture(normTex)
  78. bars[i].bg:SetAlpha(.15)
  79. end
  80.  
  81. if T.myclass == "WARLOCK" then
  82. bars.Override = T.UpdateShards
  83. self.SoulShards = bars
  84. elseif T.myclass == "PALADIN" then
  85. bars.Override = T.UpdateHoly
  86. self.HolyPower = bars
  87. end
  88. end
  89.  
  90. -- deathknight runes
  91. if T.myclass == "DEATHKNIGHT" then
  92.  
  93. local Runes = CreateFrame("Frame", nil, self)
  94. Runes:Point("BOTTOMLEFT", self, "TOPLEFT", 0,3)
  95. Runes:Height(8)
  96. Runes:SetWidth(frameWidth+4)
  97. Runes:SetTemplate("Default")
  98. Runes:SetBackdropColor(0, 0, 0)
  99.  
  100. for i = 1, 6 do
  101. Runes[i] = CreateFrame("StatusBar", self:GetName().."_Runes"..i, health)
  102. Runes[i]:Height(Runes:GetHeight()-4)
  103. Runes[i]:Width((frameWidth-5)/6)
  104. if (i == 1) then
  105. Runes[i]:Point("LEFT", Runes, "LEFT", 2, 0)
  106. Runes[i]:Width(Runes[i]:GetWidth()+1)
  107. else
  108. Runes[i]:Point("TOPLEFT", Runes[i-1], "TOPRIGHT", 1, 0)
  109. end
  110. Runes[i]:SetStatusBarTexture(normTex)
  111. Runes[i]:GetStatusBarTexture():SetHorizTile(false)
  112. end
  113.  
  114. self.Runes = Runes
  115. end
  116.  
  117. -- shaman totem bar
  118. if T.myclass == "SHAMAN" then
  119.  
  120. local TotemFrame = CreateFrame("Frame", self:GetName().."_TotemFrame", self)
  121. TotemFrame:SetPoint("BOTTOM", self, "TOP", 0, 3)
  122. TotemFrame:Width(frameWidth+4)
  123. TotemFrame:Height(8)
  124. TotemFrame:SetTemplate("ThickBorder")
  125. TotemFrame:SetFrameLevel(2)
  126. TotemFrame:SetBackdropColor(0,0,0)
  127.  
  128. local TotemBar = {}
  129. TotemBar.Destroy = true
  130. for i = 1, 4 do
  131. TotemBar[i] = CreateFrame("StatusBar", self:GetName().."_TotemBar"..i, self)
  132. if (i == 1) then
  133. TotemBar[i]:SetPoint("LEFT", TotemFrame, "LEFT", 2, 0)
  134. else
  135. TotemBar[i]:SetPoint("TOPLEFT", TotemBar[i-1], "TOPRIGHT", TukuiDB.Scale(1), 0)
  136. end
  137. TotemBar[i]:SetStatusBarTexture(normTex)
  138. TotemBar[i]:Width((TotemFrame:GetWidth()-7) / 4)
  139. TotemBar[i]:Height(TotemFrame:GetHeight()-4)
  140.  
  141. TotemBar[i]:SetFrameLevel(3)
  142. TotemBar[i]:SetMinMaxValues(0, 1)
  143.  
  144. TotemBar[i].bg = TotemBar[i]:CreateTexture(nil, "BORDER")
  145. TotemBar[i].bg:SetAllPoints(TotemBar[i])
  146. TotemBar[i].bg:SetTexture(normTex)
  147. TotemBar[i].bg.multiplier = 0.1
  148. end
  149. self.TotemBar = TotemBar
  150. end
  151. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement