Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 48.18 KB | None | 0 0
  1. if not TukuiCF["unitframes"].enable == true then return end
  2.  
  3. ------------------------------------------------------------------------
  4. --  local variables
  5. ------------------------------------------------------------------------
  6.  
  7. local db = TukuiCF["unitframes"]
  8. local font1 = TukuiCF["media"].pixelfont
  9. local font1size = TukuiCF["media"].pixelfontsize
  10. local font2 = TukuiCF["media"].font
  11. local fonttags = "MONOCHROMEOUTLINE"
  12. local normTex = TukuiCF["media"].normTex
  13. local glowTex = TukuiCF["media"].glowTex
  14. local bubbleTex = TukuiCF["media"].bubbleTex
  15.  
  16. local backdrop = {
  17.     bgFile = TukuiCF["media"].blank,
  18.     insets = {top = -TukuiDB.mult, left = -TukuiDB.mult, bottom = -TukuiDB.mult, right = -TukuiDB.mult},
  19. }
  20.  
  21. ------------------------------------------------------------------------
  22. --  Layout
  23. ------------------------------------------------------------------------
  24.  
  25. local function Shared(self, unit)
  26.     -- set our own colors
  27.     self.colors = TukuiDB.oUF_colors
  28.    
  29.     -- register click
  30.     self:RegisterForClicks("LeftButtonDown", "RightButtonDown")
  31.     self:SetScript('OnEnter', UnitFrame_OnEnter)
  32.     self:SetScript('OnLeave', UnitFrame_OnLeave)
  33.    
  34.     -- menu? lol
  35.     self.menu = TukuiDB.SpawnMenu
  36.  
  37.     -- backdrop for every units
  38.     self:SetBackdrop(backdrop)
  39.     self:SetBackdropColor(0, 0, 0)
  40.    
  41.     ------------------------------------------------------------------------
  42.     --  Player and Target units layout (mostly mirror'd)
  43.     ------------------------------------------------------------------------
  44.    
  45.     if (unit == "player" or unit == "target") then
  46.         -- health bar
  47.         local health = CreateFrame('StatusBar', self:GetName().."_Health", self)   
  48.         health:SetAllPoints(self)
  49.         health:SetStatusBarTexture(normTex)
  50.        
  51.         -- create a panel
  52.         local panel = CreateFrame("Frame", self:GetName().."_Panel", self)
  53.         panel:SetAllPoints(health)
  54.         panel:SetFrameStrata("MEDIUM")
  55.         panel:SetBackdropBorderColor(unpack(TukuiCF["media"].bordercolor))
  56.         self.panel = panel
  57.                
  58.         -- health bar background
  59.         local healthBG = health:CreateTexture(nil, 'BORDER')
  60.         healthBG:SetAllPoints()
  61.         healthBG:SetTexture(unpack(db.healthBG))
  62.    
  63.         health.value = TukuiDB.SetFontString(panel, font1, font1size, fonttags)
  64.         health.value:SetPoint("RIGHT", panel, "RIGHT", TukuiDB.Scale(-4), 0)
  65.         health.PostUpdate = TukuiDB.PostUpdateHealth
  66.                
  67.         self.Health = health
  68.         self.Health.bg = healthBG
  69.  
  70.         health.frequentUpdates = true
  71.         if db.showsmooth == true then
  72.             health.Smooth = true
  73.         end
  74.        
  75.         if db.unicolor == true then
  76.             health.colorTapping = false
  77.             health.colorDisconnected = false
  78.             health.colorClass = false
  79.             health:SetStatusBarColor(unpack(db.health))
  80.             healthBG:SetVertexColor(unpack(db.healthBG))       
  81.         else
  82.             health.colorDisconnected = true
  83.             health.colorTapping = true 
  84.             health.colorClass = true
  85.             health.colorReaction = true        
  86.         end
  87.  
  88.         -- power
  89.         local power = CreateFrame('StatusBar', self:GetName().."_Power", self)
  90.         power:SetHeight(TukuiDB.Scale(4))
  91.         if unit == "player" then
  92.             power:SetPoint("RIGHT", health, "BOTTOMRIGHT", -5, 0)
  93.             power:SetPoint("LEFT", health, "BOTTOM", 3, 0)
  94.         else
  95.             power:SetPoint("LEFT", health, "BOTTOMLEFT", 5, 0)
  96.             power:SetPoint("RIGHT", health, "BOTTOM", 3, 0)
  97.         end
  98.         power:SetStatusBarTexture(normTex)
  99.        
  100.         local powerBG = power:CreateTexture(nil, 'BORDER')
  101.         powerBG:SetAllPoints(power)
  102.         powerBG:SetTexture(normTex)
  103.         powerBG.multiplier = 0.3
  104.        
  105.         local powerBorder = CreateFrame("Frame", self:GetName().."_PowerBorder", self)
  106.         powerBorder:SetAllPoints(power)
  107.         powerBorder:SetBackdrop({
  108.           bgFile = TukuiCF["media"].blank,
  109.           insets = { left = -1, right = -1, top = -1, bottom = -1}
  110.         })
  111.         powerBorder:SetBackdropColor(0, 0, 0)
  112.        
  113.         power.value = TukuiDB.SetFontString(panel, font1, font1size, fonttags)
  114.         power.value:SetPoint("LEFT", panel, "LEFT", TukuiDB.Scale(4), 0)
  115.         power.PreUpdate = TukuiDB.PreUpdatePower
  116.         power.PostUpdate = TukuiDB.PostUpdatePower
  117.                
  118.         self.Power = power
  119.         self.Power.bg = powerBG
  120.        
  121.         --Frame Levels
  122.         panel:SetFrameLevel(10)
  123.         power:SetFrameLevel(5)
  124.         powerBorder:SetFrameLevel(4)
  125.         health:SetFrameLevel(3)
  126.        
  127.         power.frequentUpdates = true
  128.         power.colorDisconnected = true
  129.  
  130.         if db.showsmooth == true then
  131.             power.Smooth = true
  132.         end
  133.        
  134.         if db.unicolor == true then
  135.             power.colorTapping = true
  136.             power.colorClass = true
  137.             powerBG.multiplier = 0.1               
  138.         else
  139.             power.colorPower = true
  140.         end
  141.  
  142.         -- portraits
  143.         if (db.charportrait == true) then
  144.             local portrait = CreateFrame("PlayerModel", nil, self)
  145.             portrait:SetFrameLevel(8)
  146.             portrait:SetHeight(unpack(db.plyrScale))
  147.             portrait:SetWidth(42)
  148.             portrait:SetAlpha(1)
  149.            
  150.             -- Portrait Border / Background
  151.             local portraitBorder = CreateFrame("Frame", "portraitBorder", self)
  152.             portraitBorder:SetPoint("TOPLEFT", portrait, "TOPLEFT", -1, 1)
  153.             portraitBorder:SetPoint("BOTTOMRIGHT", portrait, "BOTTOMRIGHT", 1, -1)
  154.             TukuiDB.SetThinTemplate(portraitBorder)
  155.            
  156.             if unit == "player" then
  157.                 portrait:SetPoint("TOPRIGHT", self, "TOPLEFT", -4, 0)
  158.                 portrait:SetPoint("BOTTOMRIGHT", self, "BOTTOMLEFT", -4, 0)
  159.             elseif unit == "target" then
  160.                 portrait:SetPoint("TOPLEFT", self, "TOPRIGHT", 4, 0)
  161.                 portrait:SetPoint("BOTTOMLEFT", self, "BOTTOMRIGHT", 4, 0)
  162.             end
  163.             table.insert(self.__elements, TukuiDB.HidePortrait)
  164.             self.Portrait = portrait
  165.         end
  166.  
  167.         if (unit == "player") then
  168.             -- combat icon
  169.             local Combat = health:CreateTexture(nil, "OVERLAY")
  170.             Combat:SetHeight(TukuiDB.Scale(19))
  171.             Combat:SetWidth(TukuiDB.Scale(19))
  172.             Combat:SetPoint("LEFT",0,1)
  173.             Combat:SetVertexColor(0.69, 0.31, 0.31)
  174.             self.Combat = Combat
  175.  
  176.             -- custom info (low mana warning)
  177.             FlashInfo = CreateFrame("Frame", "FlashInfo", self)
  178.             FlashInfo:SetScript("OnUpdate", TukuiDB.UpdateManaLevel)
  179.             FlashInfo.parent = self
  180.             FlashInfo:SetToplevel(true)
  181.             FlashInfo:SetAllPoints(panel)
  182.             FlashInfo.ManaLevel = TukuiDB.SetFontString(FlashInfo, font1, font1size, fonttags)
  183.             FlashInfo.ManaLevel:SetPoint("CENTER", panel, "CENTER", 0, 0)
  184.             self.FlashInfo = FlashInfo
  185.            
  186.             -- pvp status text
  187.             local status = TukuiDB.SetFontString(panel, font1, font1size, fonttags)
  188.             status:SetPoint("CENTER", panel, "CENTER", 0, 0)
  189.             status:SetTextColor(0.69, 0.31, 0.31, 0)
  190.             self.Status = status
  191.             self:Tag(status, "[pvp]")
  192.            
  193.             -- leader icon
  194.             local Leader = health:CreateTexture(nil, "OVERLAY")
  195.             Leader:SetHeight(TukuiDB.Scale(14))
  196.             Leader:SetWidth(TukuiDB.Scale(14))
  197.             Leader:SetPoint("TOPLEFT", TukuiDB.Scale(2), TukuiDB.Scale(8))
  198.             self.Leader = Leader
  199.            
  200.             -- master looter
  201.             local MasterLooter = health:CreateTexture(nil, "OVERLAY")
  202.             MasterLooter:SetHeight(TukuiDB.Scale(14))
  203.             MasterLooter:SetWidth(TukuiDB.Scale(14))
  204.             self.MasterLooter = MasterLooter
  205.             self:RegisterEvent("PARTY_LEADER_CHANGED", TukuiDB.MLAnchorUpdate)
  206.             self:RegisterEvent("PARTY_MEMBERS_CHANGED", TukuiDB.MLAnchorUpdate)
  207.                        
  208.             -- the threat bar on info left panel ? :P
  209.             if (db.showthreat == true) then
  210.                 local ThreatBar = CreateFrame("StatusBar", self:GetName()..'_ThreatBar', TukuiInfoLeft)
  211.                 ThreatBar:SetFrameLevel(5)
  212.                 ThreatBar:SetPoint("TOPLEFT", TukuiInfoLeft, TukuiDB.Scale(2), TukuiDB.Scale(-2))
  213.                 ThreatBar:SetPoint("BOTTOMRIGHT", TukuiInfoLeft, TukuiDB.Scale(-2), TukuiDB.Scale(2))
  214.              
  215.                 ThreatBar:SetStatusBarTexture(normTex)
  216.                 ThreatBar:GetStatusBarTexture():SetHorizTile(false)
  217.                 ThreatBar:SetBackdrop(backdrop)
  218.                 ThreatBar:SetBackdropColor(0, 0, 0, 0)
  219.            
  220.                 ThreatBar.Text = TukuiDB.SetFontString(ThreatBar, font2, 12)
  221.                 ThreatBar.Text:SetPoint("RIGHT", ThreatBar, "RIGHT", TukuiDB.Scale(-30), 0)
  222.        
  223.                 ThreatBar.Title = TukuiDB.SetFontString(ThreatBar, font2, 12)
  224.                 ThreatBar.Title:SetText(tukuilocal.unitframes_ouf_threattext)
  225.                 ThreatBar.Title:SetPoint("LEFT", ThreatBar, "LEFT", TukuiDB.Scale(30), 0)
  226.                      
  227.                 ThreatBar.bg = ThreatBar:CreateTexture(nil, 'BORDER')
  228.                 ThreatBar.bg:SetAllPoints(ThreatBar)
  229.                 ThreatBar.bg:SetTexture(0.1,0.1,0.1)
  230.            
  231.                 ThreatBar.useRawThreat = false
  232.                 self.ThreatBar = ThreatBar
  233.             end
  234.            
  235.             -- show druid mana when shapeshifted in bear, cat or whatever
  236.             if TukuiDB.myclass == "DRUID" then
  237.                 CreateFrame("Frame"):SetScript("OnUpdate", function() TukuiDB.UpdateDruidMana(self) end)
  238.                 local DruidMana = TukuiDB.SetFontString(health, font1, font1size, fonttags)
  239.                 DruidMana:SetTextColor(1, 0.49, 0.04)
  240.                 self.DruidMana = DruidMana
  241.                
  242.                 local eclipseBar = CreateFrame('Frame', nil, self)
  243.                 eclipseBar:SetPoint("LEFT", self, "BOTTOMLEFT", 5, 0)
  244.                 eclipseBar:SetSize(TukuiDB.Scale((TukuiDB.Scale((unpack(db.plyrScale)/2)-7))), TukuiDB.Scale(power:GetHeight()))
  245.                 eclipseBar:SetFrameStrata("MEDIUM")
  246.                 eclipseBar:SetFrameLevel(8)
  247.                 TukuiDB.SetTemplate(eclipseBar)
  248.                 eclipseBar:SetBackdropColor(0,0,0)
  249.                 eclipseBar:SetScript("OnShow", function() TukuiDB.EclipseDisplay(self, false) end)
  250.                 eclipseBar:SetScript("OnUpdate", function() TukuiDB.EclipseDisplay(self, true) end) -- just forcing 1 update on login for buffs/shadow/etc.
  251.                 eclipseBar:SetScript("OnHide", function() TukuiDB.EclipseDisplay(self, false) end)
  252.                
  253.                 local lunarBar = CreateFrame('StatusBar', nil, eclipseBar)
  254.                 lunarBar:SetPoint('LEFT', eclipseBar, 'LEFT', 0, 0)
  255.                 lunarBar:SetSize(eclipseBar:GetWidth(), eclipseBar:GetHeight())
  256.                 lunarBar:SetStatusBarTexture(normTex)
  257.                 lunarBar:SetStatusBarColor(.30, .52, .90)
  258.                 eclipseBar.LunarBar = lunarBar
  259.  
  260.                 local solarBar = CreateFrame('StatusBar', nil, eclipseBar)
  261.                 solarBar:SetPoint('LEFT', lunarBar:GetStatusBarTexture(), 'RIGHT', 0, 0)
  262.                 solarBar:SetSize(eclipseBar:GetWidth(), eclipseBar:GetHeight())
  263.                 solarBar:SetStatusBarTexture(normTex)
  264.                 solarBar:SetStatusBarColor(.80, .82,  .60)
  265.                 eclipseBar.SolarBar = solarBar
  266.  
  267.                 local eclipseBarText = solarBar:CreateFontString(nil, 'OVERLAY')
  268.                 eclipseBarText:SetPoint('TOP', panel)
  269.                 eclipseBarText:SetPoint('BOTTOM', panel)
  270.                 eclipseBarText:SetFont(font1, font1size, fonttags)
  271.                 eclipseBar.Text = eclipseBarText
  272.  
  273.                 self.EclipseBar = eclipseBar
  274.             end
  275.  
  276.             -- set holy power bar or shard bar
  277.             if (TukuiDB.myclass == "WARLOCK" or TukuiDB.myclass == "PALADIN") then
  278.                 local bars = CreateFrame("Frame", nil, self)
  279.                 bars:SetPoint("LEFT", self, "BOTTOMLEFT", 5, 0)
  280.                 bars:SetWidth(TukuiDB.Scale((unpack(db.plyrScale)/2)-7))
  281.                 bars:SetHeight(TukuiDB.Scale(power:GetHeight()))
  282.                 TukuiDB.SetTemplate(bars)
  283.                 bars:SetBackdropBorderColor(0,0,0,0)
  284.                 bars:SetBackdropColor(0,0,0)
  285.                 bars:SetFrameLevel(5)
  286.                
  287.                 for i = 1, 3 do                
  288.                     bars[i]=CreateFrame("StatusBar", self:GetName().."_Shard"..i, self)
  289.                     bars[i]:SetHeight(TukuiDB.Scale(power:GetHeight()))                
  290.                     bars[i]:SetStatusBarTexture(normTex)
  291.                     bars[i]:GetStatusBarTexture():SetHorizTile(false)
  292.                     bars[i]:SetFrameLevel(5)
  293.                    
  294.                     bars[i].bg = bars[i]:CreateTexture(nil, 'BORDER')
  295.                    
  296.                     if TukuiDB.myclass == "WARLOCK" then
  297.                         bars[i]:SetStatusBarColor(255/255,101/255,101/255)
  298.                         bars[i].bg:SetTexture(255/255,101/255,101/255)
  299.                     elseif TukuiDB.myclass == "PALADIN" then
  300.                         bars[i]:SetStatusBarColor(228/255,225/255,16/255)
  301.                         bars[i].bg:SetTexture(228/255,225/255,16/255)
  302.                     end
  303.                    
  304.                     bars[i]:SetWidth(TukuiDB.Scale(bars:GetWidth()/3)-1)
  305.                    
  306.                     if i == 1 then
  307.                         bars[i]:SetPoint("LEFT", bars)
  308.                         bars[i].bg:SetAllPoints(bars[i])
  309.                     else
  310.                         bars[i]:SetPoint("LEFT", bars[i-1], "RIGHT", TukuiDB.Scale(1), 0)
  311.                         bars[i].bg:SetAllPoints(bars[i])
  312.                     end
  313.                    
  314.                     bars[i].bg:SetTexture(normTex)                 
  315.                     bars[i].bg:SetAlpha(.15)
  316.                 end
  317.                
  318.                 if TukuiDB.myclass == "WARLOCK" then
  319.                     bars.Override = TukuiDB.UpdateShards               
  320.                     self.SoulShards = bars
  321.                 elseif TukuiDB.myclass == "PALADIN" then
  322.                     bars.Override = TukuiDB.UpdateHoly
  323.                     self.HolyPower = bars
  324.                 end
  325.             end
  326.  
  327.             -- deathknight runes
  328.             if TukuiDB.myclass == "DEATHKNIGHT" and db.runebar == true then
  329.                
  330.                 local Runes = CreateFrame("Frame", nil, self)
  331.                 Runes:SetPoint("LEFT", self, "BOTTOMLEFT", 5, 0)
  332.                 Runes:SetHeight(TukuiDB.Scale(power:GetHeight()))
  333.                 Runes:SetWidth(TukuiDB.Scale((unpack(db.plyrScale)/2)-7))
  334.                 Runes:SetBackdrop(backdrop)
  335.                 Runes:SetBackdropColor(0, 0, 0)
  336.                 Runes:SetFrameLevel(5)
  337.                
  338.                 for i = 1, 6 do
  339.                     Runes[i] = CreateFrame("StatusBar", self:GetName().."_Runes"..i, self)
  340.                     Runes[i]:SetHeight(TukuiDB.Scale(power:GetHeight()))
  341.                     Runes[i]:SetWidth((Runes:GetWidth() / 6) - 0.75)
  342.                     if (i == 1) then
  343.                         Runes[i]:SetPoint("LEFT", self, "BOTTOMLEFT", 5, 0)
  344.                     else
  345.                         Runes[i]:SetPoint("TOPLEFT", Runes[i-1], "TOPRIGHT", TukuiDB.Scale(1), 0)
  346.                     end
  347.                     Runes[i]:SetStatusBarTexture(normTex)
  348.                     Runes[i]:GetStatusBarTexture():SetHorizTile(false)
  349.                     Runes[i]:SetFrameLevel(5)
  350.                 end
  351.  
  352.                 self.Runes = Runes
  353.             end
  354.            
  355.             -- shaman totem bar
  356.             if TukuiDB.myclass == "SHAMAN" and db.totemtimer == true then
  357.                 local TotemFrame = CreateFrame("Frame", nil, self)
  358.                 TotemFrame:SetPoint("LEFT", self, "BOTTOMLEFT", 5, 0)
  359.                 TotemFrame:SetWidth(TukuiDB.Scale((unpack(db.plyrScale)/2)-7))
  360.                 TotemFrame:SetHeight(TukuiDB.Scale(power:GetHeight()))
  361.                 TukuiDB.SetTemplate(TotemFrame)
  362.                 TotemFrame:SetBackdropBorderColor(0,0,0,0)
  363.                 TotemFrame:SetBackdropColor(0,0,0)
  364.                 TotemFrame:SetFrameLevel(5)
  365.                
  366.                 local TotemBar = {}
  367.                 TotemBar.Destroy = true
  368.                 for i = 1, 4 do
  369.                     TotemBar[i] = CreateFrame("StatusBar", self:GetName().."_TotemBar"..i, self)
  370.                     if (i == 1) then
  371.                         TotemBar[i]:SetPoint("LEFT", TotemFrame)   
  372.                         TotemBar[i]:SetWidth(TotemFrame:GetWidth() / 4)                    
  373.                     else
  374.                         TotemBar[i]:SetPoint("TOPLEFT", TotemBar[i-1], "TOPRIGHT", TukuiDB.Scale(1), 0)
  375.                         TotemBar[i]:SetWidth(TotemFrame:GetWidth() / 4-1)      
  376.                     end
  377.                     TotemBar[i]:SetStatusBarTexture(normTex)
  378.                     TotemBar[i]:SetHeight(TukuiDB.Scale(power:GetHeight()))
  379.                    
  380.                    
  381.                     TotemBar[i]:SetFrameLevel(5)
  382.                     TotemBar[i]:SetMinMaxValues(0, 1)
  383.  
  384.                     TotemBar[i].bg = TotemBar[i]:CreateTexture(nil, "BORDER")
  385.                     TotemBar[i].bg:SetAllPoints(TotemBar[i])
  386.                     TotemBar[i].bg:SetTexture(normTex)
  387.                     TotemBar[i].bg.multiplier = 0.3
  388.                 end
  389.                 self.TotemBar = TotemBar
  390.             end
  391.            
  392.             -- script for pvp status and low mana
  393.             self:SetScript("OnEnter", function(self)
  394.                 FlashInfo.ManaLevel:Hide() status:SetAlpha(1) UnitFrame_OnEnter(self)
  395.             end)
  396.             self:SetScript("OnLeave", function(self)
  397.                 FlashInfo.ManaLevel:Show() status:SetAlpha(0) UnitFrame_OnLeave(self)
  398.             end)
  399.         end
  400.        
  401.         if (unit == "target") then         
  402.             -- Unit name on target
  403.             local Name = health:CreateFontString(nil, "OVERLAY")
  404.             Name:SetPoint("LEFT", panel, "LEFT", TukuiDB.Scale(4), 0)
  405.             Name:SetJustifyH("LEFT")
  406.             Name:SetFont(font1, font1size, fonttags)
  407.  
  408.             self:Tag(Name, '[Tukui:getnamecolor][Tukui:namelong] [Tukui:diffcolor][level] [shortclassification]')
  409.             self.Name = Name
  410.            
  411.             -- combo points on target
  412.             local CPointsAnchor = CreateFrame("frame", "ComboPointsContainer", self)
  413.             CPointsAnchor:SetWidth(TukuiDB.Scale((unpack(db.plyrScale)/2)-7))
  414.             CPointsAnchor:SetHeight(4)
  415.             CPointsAnchor:SetPoint("LEFT", oUF_Tukz_player, "BOTTOMLEFT", 5, 0)
  416.            
  417.             local CPoints = {}
  418.             CPoints.unit = PlayerFrame.unit
  419.             for i = 1, 5 do
  420.                 CPoints[i] = CreateFrame('StatusBar', "ComboPoint"..i, self)
  421.                 CPoints[i]:SetHeight(TukuiDB.Scale(4))
  422.                 CPoints[i]:SetWidth((CPointsAnchor:GetWidth() / 5) -1)
  423.                 CPoints[i]:SetStatusBarTexture(TukuiCF["media"].normTex)
  424.                 CPoints[i]:GetStatusBarTexture():SetHorizTile(false)
  425.                 CPoints[i]:SetFrameLevel(20)
  426.                 CPoints[i]:SetFrameStrata("HIGH")
  427.                 if i == 1 then
  428.                     CPoints[i]:SetPoint("LEFT", oUF_Tukz_player, "BOTTOMLEFT", 5, 0)
  429.                 else
  430.                     CPoints[i]:SetPoint("TOPLEFT", CPoints[i-1], "TOPRIGHT", TukuiDB.Scale(1), 0)
  431.                 end
  432.                    
  433.                 local border = CreateFrame("Frame", "ComboPoint"..i.."Border", CPoints[i])
  434.                 TukuiDB.CreatePanel(border, CPoints[i]:GetWidth()+2, CPoints[i]:GetHeight()+2, "CENTER", CPoints[i] , "CENTER" ,0,0)
  435.                 border:SetPoint("TOPLEFT", 0, 0)
  436.                 border:SetPoint("BOTTOMRIGHT", 0, 0)
  437.                 border:SetBackdropColor(0,0,0)
  438.                 border:SetFrameStrata("MEDIUM")
  439.                 border:SetFrameLevel(19)
  440.             end
  441.            
  442.             CPoints[1]:SetStatusBarColor(0.69, 0.31, 0.31)
  443.             CPoints[2]:SetStatusBarColor(0.69, 0.31, 0.31)
  444.             CPoints[3]:SetStatusBarColor(0.65, 0.63, 0.35)
  445.             CPoints[4]:SetStatusBarColor(0.65, 0.63, 0.35)
  446.             CPoints[5]:SetStatusBarColor(0.33, 0.59, 0.33)
  447.            
  448.             self.CPoints = CPoints
  449.             self:RegisterEvent("UNIT_COMBO_POINTS", TukuiDB.UpdateCPoints)
  450.         end
  451.  
  452.         if (unit == "target" and db.targetauras) or (unit == "player" and db.playerauras) then
  453.             local buffs = CreateFrame("Frame", nil, self)
  454.             local debuffs = CreateFrame("Frame", nil, self)
  455.            
  456.             buffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -1, 5)
  457.            
  458.             buffs:SetHeight(23)
  459.             buffs:SetWidth(unpack(TukuiCF.unitframes.plyrScale))
  460.             buffs.size = 23
  461.             buffs.num = 9
  462.             buffs.spacing = 2
  463.             buffs.initialAnchor = 'TOPLEFT'
  464.             buffs.PostCreateIcon = TukuiDB.PostCreateAura
  465.             buffs.PostUpdateIcon = TukuiDB.PostUpdateAura
  466.             self.Buffs = buffs 
  467.                        
  468.             debuffs:SetHeight(23)
  469.             debuffs:SetWidth(unpack(TukuiCF.unitframes.plyrScale))
  470.             debuffs:SetPoint("BOTTOMRIGHT", buffs, "TOPRIGHT", 2, buffs.spacing)
  471.             debuffs.size = 23
  472.             debuffs.num = 27
  473.             debuffs.spacing = 2
  474.             debuffs.initialAnchor = 'TOPRIGHT'
  475.             debuffs["growth-y"] = "UP"
  476.             debuffs["growth-x"] = "LEFT"
  477.             debuffs.PostCreateIcon = TukuiDB.PostCreateAura
  478.             debuffs.PostUpdateIcon = TukuiDB.PostUpdateAura
  479.             self.Debuffs = debuffs
  480.         end
  481.        
  482.         -- cast bar for player and target
  483.         if (db.unitcastbar == true) then
  484.             -- castbar of player and target
  485.             local castbar = CreateFrame("StatusBar", self:GetName().."_Castbar", self)
  486.             castbar:SetStatusBarTexture(normTex)
  487.            
  488.             castbar.bg = castbar:CreateTexture(nil, "BORDER")
  489.             castbar.bg:SetAllPoints(castbar)
  490.             castbar.bg:SetTexture(normTex)
  491.             castbar.bg:SetVertexColor(0.15, 0.15, 0.15)
  492.             castbar:SetFrameLevel(6)
  493.             castbar:SetHeight(16)
  494.             castbar:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -7)
  495.             castbar:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -7)
  496.            
  497.             local castBorder = CreateFrame("Frame", "CastbarBorder", castbar)
  498.             castBorder:SetPoint("TOPLEFT", castbar, "TOPLEFT", 0, 0)
  499.             castBorder:SetPoint("BOTTOMRIGHT", castbar, "BOTTOMRIGHT", 0, 0)
  500.             castBorder:SetBackdrop(backdrop)
  501.             castBorder:SetFrameLevel(5)
  502.             castBorder:SetBackdropColor(0, 0, 0)
  503.            
  504.             castbar.CustomTimeText = TukuiDB.CustomCastTimeText
  505.             castbar.CustomDelayText = TukuiDB.CustomCastDelayText
  506.             castbar.PostCastStart = TukuiDB.CheckCast
  507.             castbar.PostChannelStart = TukuiDB.CheckChannel
  508.  
  509.             castbar.time = TukuiDB.SetFontString(castbar, font1, font1size, fonttags)
  510.             castbar.time:SetPoint("RIGHT", castbar, "RIGHT", TukuiDB.Scale(-4), 1)
  511.             castbar.time:SetTextColor(0.84, 0.75, 0.65)
  512.             castbar.time:SetJustifyH("RIGHT")
  513.  
  514.             castbar.Text = TukuiDB.SetFontString(castbar, font1, font1size, fonttags)
  515.             castbar.Text:SetPoint("LEFT", castbar, "LEFT", TukuiDB.Scale(4), 1)
  516.             castbar.Text:SetTextColor(0.84, 0.75, 0.65)
  517.            
  518.             if db.cbicons == true then
  519.                 castbar.button = CreateFrame("Frame", nil, castbar)
  520.                 castbar.button:SetHeight(castbar:GetHeight()+2)
  521.                 castbar.button:SetWidth(castbar:GetHeight()+2)
  522.                 TukuiDB.SetThinTemplate(castbar.button)
  523.  
  524.                 castbar.icon = castbar.button:CreateTexture(nil, "ARTWORK")
  525.                 castbar.icon:SetPoint("TOPLEFT", castbar.button, TukuiDB.Scale(1), TukuiDB.Scale(-1))
  526.                 castbar.icon:SetPoint("BOTTOMRIGHT", castbar.button, TukuiDB.Scale(-1), TukuiDB.Scale(1))
  527.                 castbar.icon:SetTexCoord(0.08, 0.92, 0.08, .92)
  528.            
  529.                 if unit == "player" then
  530.                     castbar.button:SetPoint("RIGHT", castbar, "LEFT", -3, 0)
  531.                 elseif unit == "target" then
  532.                     castbar.button:SetPoint("LEFT", castbar, "RIGHT", 3, 0)    
  533.                 end
  534.             end
  535.            
  536.             -- cast bar latency on player
  537.             if unit == "player" and db.cblatency == true then
  538.                 castbar.safezone = castbar:CreateTexture(nil, "ARTWORK")
  539.                 castbar.safezone:SetTexture(normTex)
  540.                 castbar.safezone:SetVertexColor(0.69, 0.31, 0.31, 0.75)
  541.                 castbar.SafeZone = castbar.safezone
  542.             end
  543.                    
  544.             self.Castbar = castbar
  545.             self.Castbar.Time = castbar.time
  546.             self.Castbar.Icon = castbar.icon
  547.         end
  548.        
  549.         -- add combat feedback support
  550.         if db.combatfeedback == true then
  551.             local CombatFeedbackText
  552.             CombatFeedbackText = TukuiDB.SetFontString(health, font1, font1size, fonttags)
  553.             CombatFeedbackText:SetPoint("CENTER", 0, 1)
  554.             CombatFeedbackText.colors = {
  555.                 DAMAGE = {0.69, 0.31, 0.31},
  556.                 CRUSHING = {0.69, 0.31, 0.31},
  557.                 CRITICAL = {0.69, 0.31, 0.31},
  558.                 GLANCING = {0.69, 0.31, 0.31},
  559.                 STANDARD = {0.84, 0.75, 0.65},
  560.                 IMMUNE = {0.84, 0.75, 0.65},
  561.                 ABSORB = {0.84, 0.75, 0.65},
  562.                 BLOCK = {0.84, 0.75, 0.65},
  563.                 RESIST = {0.84, 0.75, 0.65},
  564.                 MISS = {0.84, 0.75, 0.65},
  565.                 HEAL = {0.33, 0.59, 0.33},
  566.                 CRITHEAL = {0.33, 0.59, 0.33},
  567.                 ENERGIZE = {0.31, 0.45, 0.63},
  568.                 CRITENERGIZE = {0.31, 0.45, 0.63},
  569.             }
  570.             self.CombatFeedbackText = CombatFeedbackText
  571.         end
  572.        
  573.         if db.healcomm then
  574.             local mhpb = CreateFrame('StatusBar', nil, self.Health)
  575.             mhpb:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  576.             mhpb:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  577.             if TukuiDB.lowversion then
  578.                 mhpb:SetWidth(186)
  579.             else
  580.                 mhpb:SetWidth(250)
  581.             end
  582.             mhpb:SetStatusBarTexture(normTex)
  583.             mhpb:SetStatusBarColor(0, 1, 0.5, 0.25)
  584.             mhpb:SetMinMaxValues(0,1)
  585.  
  586.             local ohpb = CreateFrame('StatusBar', nil, self.Health)
  587.             ohpb:SetPoint('TOPLEFT', mhpb:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  588.             ohpb:SetPoint('BOTTOMLEFT', mhpb:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  589.             ohpb:SetWidth(250)
  590.             ohpb:SetStatusBarTexture(normTex)
  591.             ohpb:SetStatusBarColor(0, 1, 0, 0.25)
  592.  
  593.             self.HealPrediction = {
  594.                 myBar = mhpb,
  595.                 otherBar = ohpb,
  596.                 maxOverflow = 1,
  597.             }
  598.         end
  599.        
  600.         -- player aggro
  601.         if db.playeraggro == true then
  602.             table.insert(self.__elements, TukuiDB.UpdateThreat)
  603.             self:RegisterEvent('PLAYER_TARGET_CHANGED', TukuiDB.UpdateThreat)
  604.             self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', TukuiDB.UpdateThreat)
  605.             self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', TukuiDB.UpdateThreat)
  606.         end
  607.     end
  608.    
  609.     ------------------------------------------------------------------------
  610.     --  Target of Target unit layout
  611.     ------------------------------------------------------------------------
  612.    
  613.     if (unit == "targettarget") then
  614.         -- health bar
  615.         local health = CreateFrame('StatusBar', nil, self)
  616.         health:SetAllPoints(self)
  617.         health:SetStatusBarTexture(normTex)
  618.        
  619.         -- create panel if higher version
  620.         local panel = CreateFrame("Frame", nil, self)
  621.         panel:SetAllPoints(health)
  622.         panel:SetFrameLevel(10)
  623.         panel:SetFrameStrata("MEDIUM")
  624.         self.panel = panel
  625.        
  626.         local healthBG = health:CreateTexture(nil, 'BORDER')
  627.         healthBG:SetAllPoints()
  628.         healthBG:SetTexture(.1, .1, .1)
  629.        
  630.         self.Health = health
  631.         self.Health.bg = healthBG
  632.        
  633.         health.frequentUpdates = true
  634.         if db.showsmooth == true then
  635.             health.Smooth = true
  636.         end
  637.        
  638.         if db.unicolor == true then
  639.             health.colorDisconnected = false
  640.             health.colorClass = false
  641.             health:SetStatusBarColor(unpack(db.health))
  642.             healthBG:SetVertexColor(unpack(db.healthBG))   
  643.         else
  644.             health.colorDisconnected = true
  645.             health.colorClass = true
  646.             health.colorReaction = true        
  647.         end
  648.        
  649.         -- Unit name
  650.         local Name = health:CreateFontString(nil, "OVERLAY")
  651.         Name:SetPoint("CENTER", panel, "CENTER", 0, 0)
  652.         Name:SetFont(font1, font1size, fonttags)
  653.         Name:SetJustifyH("CENTER")
  654.  
  655.         self:Tag(Name, '[Tukui:getnamecolor][Tukui:namemedium]')
  656.         self.Name = Name
  657.        
  658.         if db.totdebuffs == true and TukuiDB.lowversion ~= true then
  659.             local debuffs = CreateFrame("Frame", nil, health)
  660.             debuffs:SetHeight(20)
  661.             debuffs:SetWidth(127)
  662.             debuffs.size = 20
  663.             debuffs.spacing = 2
  664.             debuffs.num = 6
  665.  
  666.             debuffs:SetPoint("TOPLEFT", health, "TOPLEFT", -0.5, 24)
  667.             debuffs.initialAnchor = "TOPLEFT"
  668.             debuffs["growth-y"] = "UP"
  669.             debuffs.PostCreateIcon = TukuiDB.PostCreateAura
  670.             debuffs.PostUpdateIcon = TukuiDB.PostUpdateAura
  671.             self.Debuffs = debuffs
  672.         end
  673.     end
  674.    
  675.     ------------------------------------------------------------------------
  676.     --  Pet unit layout
  677.     ------------------------------------------------------------------------
  678.    
  679.     if (unit == "pet") then
  680.         -- health bar
  681.         local health = CreateFrame('StatusBar', self:GetName().."_Health", self)
  682.         health:SetAllPoints(self)
  683.         health:SetStatusBarTexture(normTex)
  684.        
  685.         -- create panel if higher version
  686.         local panel = CreateFrame("Frame", self:GetName().."_Panel", self)
  687.         panel:SetAllPoints(health)
  688.         panel:SetFrameLevel(10)
  689.         panel:SetFrameStrata("MEDIUM")
  690.         self.panel = panel
  691.        
  692.         local healthBG = health:CreateTexture(nil, 'BORDER')
  693.         healthBG:SetAllPoints()
  694.         healthBG:SetTexture(.1, .1, .1)
  695.  
  696.         self.Health = health
  697.         self.Health.bg = healthBG
  698.        
  699.         health.frequentUpdates = true
  700.         if db.showsmooth == true then
  701.             health.Smooth = true
  702.         end
  703.        
  704.         if db.unicolor == true then
  705.             health.colorDisconnected = false
  706.             health.colorClass = false
  707.             health:SetStatusBarColor(unpack(db.health))
  708.             healthBG:SetVertexColor(unpack(db.healthBG))   
  709.         else
  710.             health.colorDisconnected = true
  711.             health.colorClass = true
  712.             health.colorReaction = true
  713.             if TukuiDB.myclass == "HUNTER" then
  714.                 health.colorHappiness = true
  715.             end
  716.         end
  717.        
  718.         -- power
  719.         local power = CreateFrame('StatusBar', self:GetName().."_Power", self)
  720.         power:SetHeight(TukuiDB.Scale(4))
  721.         power:SetPoint("RIGHT", health, "BOTTOMRIGHT", -5, 0)
  722.         power:SetPoint("LEFT", health, "BOTTOM", 3, 0)
  723.         power:SetStatusBarTexture(normTex)
  724.         power:SetFrameStrata("HIGH")
  725.        
  726.        
  727.         power.frequentUpdates = true
  728.         power.colorPower = true
  729.         if db.showsmooth == true then
  730.             power.Smooth = true
  731.         end
  732.  
  733.         local powerBG = power:CreateTexture(nil, 'BORDER')
  734.         powerBG:SetAllPoints(power)
  735.         powerBG:SetTexture(normTex)
  736.         powerBG.multiplier = 0.3
  737.        
  738.         local powerBorder = CreateFrame("Frame", self:GetName().."_PowerBorder", self)
  739.         powerBorder:SetAllPoints(power)
  740.         powerBorder:SetBackdrop({
  741.           bgFile = TukuiCF["media"].blank,
  742.           insets = { left = -1, right = -1, top = -1, bottom = -1}
  743.         })
  744.         powerBorder:SetBackdropColor(0, 0, 0)
  745.         powerBorder:SetFrameLevel(4)
  746.                
  747.         self.Power = power
  748.         self.Power.bg = powerBG
  749.                
  750.         -- Unit name
  751.         local Name = health:CreateFontString(nil, "OVERLAY")
  752.         Name:SetPoint("CENTER", panel, "CENTER", 0, 0)
  753.         Name:SetFont(font1, font1size, fonttags)
  754.         Name:SetJustifyH("CENTER")
  755.  
  756.         self:Tag(Name, '[Tukui:getnamecolor][Tukui:namemedium] [Tukui:diffcolor][level]')
  757.         self.Name = Name
  758.        
  759.         -- Portraits
  760.         if (db.charportrait == true) then
  761.             local portrait = CreateFrame("PlayerModel", nil, self)
  762.             portrait:SetFrameLevel(8)
  763.             portrait:SetHeight(unpack(db.plyrScale))
  764.             portrait:SetWidth(42)
  765.             portrait:SetAlpha(1)
  766.            
  767.             -- Portrait Border / Background
  768.             local portraitBorder = CreateFrame("Frame", "portraitBorder", self)
  769.             portraitBorder:SetPoint("TOPLEFT", portrait, "TOPLEFT", -1, 1)
  770.             portraitBorder:SetPoint("BOTTOMRIGHT", portrait, "BOTTOMRIGHT", 1, -1)
  771.             TukuiDB.SetThinTemplate(portraitBorder)
  772.            
  773.             portrait:SetPoint("TOPRIGHT", self, "TOPLEFT", -4, 0)
  774.             portrait:SetPoint("BOTTOMRIGHT", self, "BOTTOMLEFT", -4, 0)
  775.            
  776.             table.insert(self.__elements, TukuiDB.HidePortrait)
  777.             self.Portrait = portrait
  778.         end
  779.        
  780.         if (db.unitcastbar == true) then
  781.             -- castbar of player and target
  782.             local castbar = CreateFrame("StatusBar", self:GetName().."_Castbar", self)
  783.             castbar:SetStatusBarTexture(normTex)
  784.            
  785.             castbar.bg = castbar:CreateTexture(nil, "BORDER")
  786.             castbar.bg:SetAllPoints(castbar)
  787.             castbar.bg:SetTexture(normTex)
  788.             castbar.bg:SetVertexColor(0.15, 0.15, 0.15)
  789.             castbar:SetFrameLevel(6)
  790.             castbar:SetHeight(16)
  791.             castbar:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -7)
  792.             castbar:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -7)
  793.            
  794.             local castBorder = CreateFrame("Frame", "CastbarBorder", castbar)
  795.             castBorder:SetPoint("TOPLEFT", castbar, "TOPLEFT", 0, 0)
  796.             castBorder:SetPoint("BOTTOMRIGHT", castbar, "BOTTOMRIGHT", 0, 0)
  797.             castBorder:SetBackdrop(backdrop)
  798.             castBorder:SetFrameLevel(5)
  799.             castBorder:SetBackdropColor(0, 0, 0)
  800.            
  801.             castbar.CustomTimeText = TukuiDB.CustomCastTimeText
  802.             castbar.CustomDelayText = TukuiDB.CustomCastDelayText
  803.             castbar.PostCastStart = TukuiDB.CheckCast
  804.             castbar.PostChannelStart = TukuiDB.CheckChannel
  805.  
  806.             castbar.time = TukuiDB.SetFontString(castbar, font1, font1size, fonttags)
  807.             castbar.time:SetPoint("RIGHT", castbar, "RIGHT", TukuiDB.Scale(-4), 0)
  808.             castbar.time:SetTextColor(0.84, 0.75, 0.65)
  809.             castbar.time:SetJustifyH("RIGHT")
  810.  
  811.             castbar.Text = TukuiDB.SetFontString(castbar, font1, font1size, fonttags)
  812.             castbar.Text:SetPoint("LEFT", castbar, "LEFT", TukuiDB.Scale(4), 0)
  813.             castbar.Text:SetTextColor(0.84, 0.75, 0.65)
  814.                
  815.             self.Castbar = castbar
  816.             self.Castbar.Time = castbar.time
  817.        
  818.             -- Castbar Icon
  819.             if db.cbicons == true then
  820.                 castbar.button = CreateFrame("Frame", nil, castbar)
  821.                 castbar.button:SetHeight(castbar:GetHeight()+2)
  822.                 castbar.button:SetWidth(castbar:GetHeight()+2)
  823.                 TukuiDB.SetThinTemplate(castbar.button)
  824.  
  825.                 castbar.icon = castbar.button:CreateTexture(nil, "ARTWORK")
  826.                 castbar.icon:SetPoint("TOPLEFT", castbar.button, TukuiDB.Scale(1), TukuiDB.Scale(-1))
  827.                 castbar.icon:SetPoint("BOTTOMRIGHT", castbar.button, TukuiDB.Scale(-1), TukuiDB.Scale(1))
  828.                 castbar.icon:SetTexCoord(0.08, 0.92, 0.08, .92)
  829.            
  830.                 castbar.button:SetPoint("RIGHT", castbar, "LEFT", -3, 0)
  831.            
  832.                 self.Castbar.Icon = castbar.icon
  833.             end
  834.         end
  835.         -- update pet name, this should fix "UNKNOWN" pet names on pet unit.
  836.         self:RegisterEvent("UNIT_PET", TukuiDB.UpdatePetInfo)
  837.     end
  838.  
  839.  
  840.     ------------------------------------------------------------------------
  841.     --  Focus unit layout
  842.     ------------------------------------------------------------------------
  843.    
  844.     if (unit == "focus") then
  845.         -- create health bar
  846.         local health = CreateFrame('StatusBar', nil, self)
  847.         health:SetPoint("TOPLEFT")
  848.         health:SetPoint("BOTTOMRIGHT")
  849.         health:SetStatusBarTexture(normTex)
  850.         health:GetStatusBarTexture():SetHorizTile(false)
  851.        
  852.         local healthBG = health:CreateTexture(nil, 'BORDER')
  853.         healthBG:SetAllPoints()
  854.         healthBG:SetTexture(.1, .1, .1)
  855.        
  856.         health.value = TukuiDB.SetFontString(health, font1, font1size, fonttags)
  857.         health.value:SetPoint("RIGHT", health, "RIGHT", TukuiDB.Scale(-4), 0)
  858.         health.PostUpdate = TukuiDB.PostUpdateHealth
  859.        
  860.         self.Health = health
  861.         self.Health.bg = healthBG
  862.        
  863.         health.frequentUpdates = true
  864.         if db.showsmooth == true then
  865.             health.Smooth = true
  866.         end
  867.        
  868.         if db.unicolor == true then
  869.             health.colorDisconnected = false
  870.             health.colorClass = false
  871.             health:SetStatusBarColor(unpack(db.health))
  872.             healthBG:SetVertexColor(unpack(db.healthBG))   
  873.         else
  874.             health.colorDisconnected = true
  875.             health.colorClass = true
  876.             health.colorReaction = true
  877.         end
  878.        
  879.         -- Unit name
  880.         local Name = health:CreateFontString(nil, "OVERLAY")
  881.         Name:SetPoint("LEFT", health, "LEFT", TukuiDB.Scale(4), 0)
  882.         Name:SetJustifyH("LEFT")
  883.         Name:SetFont(font1, font1size, fonttags)
  884.         Name:SetShadowColor(0, 0, 0)
  885.  
  886.         self:Tag(Name, '[Tukui:getnamecolor][Tukui:namelong] [Tukui:diffcolor][level] [shortclassification]')
  887.         self.Name = Name
  888.  
  889.         -- create focus debuff feature
  890.         if db.focusdebuffs == true then
  891.             local debuffs = CreateFrame("Frame", nil, self)
  892.             debuffs:SetHeight(26)
  893.             debuffs:SetWidth(TukuiCF["panels"].tinfowidth - 10)
  894.             debuffs.size = 26
  895.             debuffs.spacing = 2
  896.             debuffs.num = 40
  897.                        
  898.             debuffs:SetPoint("TOPRIGHT", self, "TOPRIGHT", 2, 38)
  899.             debuffs.initialAnchor = "TOPRIGHT"
  900.             debuffs["growth-y"] = "UP"
  901.             debuffs["growth-x"] = "LEFT"
  902.            
  903.             debuffs.PostCreateIcon = TukuiDB.PostCreateAura
  904.             debuffs.PostUpdateIcon = TukuiDB.PostUpdateAura
  905.             self.Debuffs = debuffs
  906.         end
  907.        
  908.         -- focus cast bar in the center of the screen
  909.         if db.unitcastbar == true then
  910.             local castbar = CreateFrame("StatusBar", self:GetName().."_Castbar", self)
  911.             castbar:SetHeight(TukuiDB.Scale(20))
  912.             castbar:SetWidth(TukuiDB.Scale(240))
  913.             castbar:SetStatusBarTexture(normTex)
  914.             castbar:SetFrameLevel(6)
  915.             castbar:SetPoint("CENTER", UIParent, "CENTER", 0, 250)     
  916.            
  917.             castbar.bg = CreateFrame("Frame", nil, castbar)
  918.             TukuiDB.SetThinTemplate(castbar.bg)
  919.             castbar.bg:SetPoint("TOPLEFT", TukuiDB.Scale(-1), TukuiDB.Scale(1))
  920.             castbar.bg:SetPoint("BOTTOMRIGHT", TukuiDB.Scale(1), TukuiDB.Scale(-1))
  921.             castbar.bg:SetFrameLevel(5)
  922.             TukuiDB.CreateThinShadow(castbar.bg)
  923.            
  924.             castbar.time = TukuiDB.SetFontString(castbar, font1, font1size, fonttags)
  925.             castbar.time:SetPoint("RIGHT", castbar, "RIGHT", TukuiDB.Scale(-4), 0)
  926.             castbar.time:SetTextColor(0.84, 0.75, 0.65)
  927.             castbar.time:SetJustifyH("RIGHT")
  928.             castbar.CustomTimeText = CustomCastTimeText
  929.  
  930.             castbar.Text = TukuiDB.SetFontString(castbar, font1, font1size, fonttags)
  931.             castbar.Text:SetPoint("LEFT", castbar, "LEFT", TukuiDB.Scale(4), 0)
  932.             castbar.Text:SetTextColor(0.84, 0.75, 0.65)
  933.            
  934.             castbar.CustomDelayText = TukuiDB.CustomCastDelayText
  935.             castbar.PostCastStart = TukuiDB.CheckCast
  936.             castbar.PostChannelStart = TukuiDB.CheckChannel
  937.            
  938.             if db.cbicons == true then
  939.                 castbar.button = CreateFrame("Frame", nil, castbar)
  940.                 castbar.button:SetHeight(TukuiDB.Scale(40))
  941.                 castbar.button:SetWidth(TukuiDB.Scale(40))
  942.                 castbar.button:SetPoint("CENTER", 0, TukuiDB.Scale(50))
  943.                 TukuiDB.SetThinTemplate(castbar.button)
  944.  
  945.                 castbar.icon = castbar.button:CreateTexture(nil, "ARTWORK")
  946.                 castbar.icon:SetPoint("TOPLEFT", castbar.button, TukuiDB.Scale(1), TukuiDB.Scale(-1))
  947.                 castbar.icon:SetPoint("BOTTOMRIGHT", castbar.button, TukuiDB.Scale(-1), TukuiDB.Scale(1))
  948.                 castbar.icon:SetTexCoord(0.08, 0.92, 0.08, .92)
  949.                
  950.                 TukuiDB.CreateThinShadow(castbar.button)
  951.             end
  952.  
  953.             self.Castbar = castbar
  954.             self.Castbar.Time = castbar.time
  955.             self.Castbar.Icon = castbar.icon
  956.         end
  957.     end
  958.    
  959.     ------------------------------------------------------------------------
  960.     --  Focus target unit layout
  961.     ------------------------------------------------------------------------
  962.  
  963.     if (unit == "focustarget") then
  964.         -- create panel if higher version
  965.         local panel = CreateFrame("Frame", nil, self)
  966.         TukuiDB.CreateThinPanel(panel, 129, 17, "BOTTOM", self, "BOTTOM", 0, 0)
  967.         panel:SetSize(unpack(db.foctarScale))
  968.         panel:SetFrameLevel(2)
  969.         panel:SetFrameStrata("MEDIUM")
  970.         panel:SetBackdropBorderColor(0, 0, 0)
  971.         self.panel = panel
  972.        
  973.         -- health bar
  974.         local health = CreateFrame('StatusBar', nil, self)
  975.         health:SetPoint("TOPLEFT")
  976.         health:SetPoint("BOTTOMRIGHT")
  977.         health:SetStatusBarTexture(normTex)
  978.        
  979.         local healthBG = health:CreateTexture(nil, 'BORDER')
  980.         healthBG:SetAllPoints()
  981.         healthBG:SetTexture(.1, .1, .1)
  982.        
  983.         self.Health = health
  984.         self.Health.bg = healthBG
  985.        
  986.         health.frequentUpdates = true
  987.         if db.showsmooth == true then
  988.             health.Smooth = true
  989.         end
  990.        
  991.         if db.unicolor == true then
  992.             health.colorDisconnected = false
  993.             health.colorClass = false
  994.             health:SetStatusBarColor(unpack(db.health))
  995.             healthBG:SetVertexColor(unpack(db.healthBG))   
  996.         else
  997.             health.colorDisconnected = true
  998.             health.colorClass = true
  999.             health.colorReaction = true        
  1000.         end
  1001.        
  1002.         -- Unit name
  1003.         local Name = health:CreateFontString(nil, "OVERLAY")
  1004.         Name:SetPoint("CENTER", panel, "CENTER", 0, 0)
  1005.         Name:SetFont(font1, font1size, fonttags)
  1006.         Name:SetJustifyH("CENTER")
  1007.  
  1008.         self:Tag(Name, '[Tukui:getnamecolor][Tukui:namemedium] [Tukui:diffcolor][level]')
  1009.         self.Name = Name
  1010.     end
  1011.  
  1012.     ------------------------------------------------------------------------
  1013.     --  Arena or boss units layout (both mirror'd)
  1014.     ------------------------------------------------------------------------
  1015.    
  1016.     if (unit and unit:find("arena%d") and TukuiCF["arena"].unitframes == true) or (unit and unit:find("boss%d") and db.showboss == true) then
  1017.         -- Right-click focus on arena or boss units
  1018.         self:SetAttribute("type2", "focus")
  1019.        
  1020.         -- health
  1021.         local health = CreateFrame('StatusBar', nil, self)
  1022.         health:SetHeight(TukuiDB.Scale(22))
  1023.         health:SetPoint("TOPLEFT")
  1024.         health:SetPoint("TOPRIGHT")
  1025.         health:SetStatusBarTexture(normTex)
  1026.  
  1027.         health.frequentUpdates = true
  1028.         health.colorDisconnected = true
  1029.         if db.showsmooth == true then
  1030.             health.Smooth = true
  1031.         end
  1032.         health.colorClass = true
  1033.        
  1034.         local healthBG = health:CreateTexture(nil, 'BORDER')
  1035.         healthBG:SetAllPoints()
  1036.         healthBG:SetTexture(.1, .1, .1)
  1037.  
  1038.         health.value = TukuiDB.SetFontString(health, font1, font1size, fonttags)
  1039.         health.value:SetPoint("LEFT", TukuiDB.Scale(2), 0)
  1040.         health.PostUpdate = TukuiDB.PostUpdateHealth
  1041.                
  1042.         self.Health = health
  1043.         self.Health.bg = healthBG
  1044.        
  1045.         health.frequentUpdates = true
  1046.         if db.showsmooth == true then
  1047.             health.Smooth = true
  1048.         end
  1049.        
  1050.         if db.unicolor == true then
  1051.             health.colorDisconnected = false
  1052.             health.colorClass = false
  1053.             health:SetStatusBarColor(unpack(db.health))
  1054.             healthBG:SetVertexColor(unpack(db.healthBG))   
  1055.         else
  1056.             health.colorDisconnected = true
  1057.             health.colorClass = true
  1058.             health.colorReaction = true
  1059.         end
  1060.    
  1061.         -- power
  1062.         local power = CreateFrame('StatusBar', nil, self)
  1063.         power:SetHeight(TukuiDB.Scale(4))
  1064.         power:SetPoint("RIGHT", health, "BOTTOMRIGHT", -5, 0)
  1065.         power:SetPoint("LEFT", health, "BOTTOM", 3, 0)
  1066.         power:SetStatusBarTexture(normTex)
  1067.        
  1068.         power.frequentUpdates = true
  1069.         power.colorPower = true
  1070.         if db.showsmooth == true then
  1071.             power.Smooth = true
  1072.         end
  1073.  
  1074.         local powerBG = power:CreateTexture(nil, 'BORDER')
  1075.         powerBG:SetAllPoints(power)
  1076.         powerBG:SetTexture(normTex)
  1077.         powerBG.multiplier = 0.3
  1078.        
  1079.         power.value = TukuiDB.SetFontString(health, font1, font1size, fonttags)
  1080.         power.value:SetPoint("RIGHT", TukuiDB.Scale(-2), 0)
  1081.         power.PreUpdate = TukuiDB.PreUpdatePower
  1082.         power.PostUpdate = TukuiDB.PostUpdatePower
  1083.                
  1084.         self.Power = power
  1085.         self.Power.bg = powerBG
  1086.        
  1087.         -- names
  1088.         local Name = health:CreateFontString(nil, "OVERLAY")
  1089.         Name:SetPoint("CENTER", health, "CENTER", 0, 0)
  1090.         Name:SetJustifyH("CENTER")
  1091.         Name:SetFont(font1, font1size, fonttags)
  1092.         Name:SetShadowColor(0, 0, 0)
  1093.        
  1094.         self:Tag(Name, '[Tukui:getnamecolor][Tukui:namelong]')
  1095.         self.Name = Name
  1096.        
  1097.         -- create buff at left of unit if they are boss units
  1098.         if (unit and unit:find("boss%d")) then
  1099.             local buffs = CreateFrame("Frame", nil, self)
  1100.             buffs:SetHeight(26)
  1101.             buffs:SetWidth(252)
  1102.             buffs:SetPoint("RIGHT", self, "LEFT", TukuiDB.Scale(-4), 0)
  1103.             buffs.size = 26
  1104.             buffs.num = 3
  1105.             buffs.spacing = 2
  1106.             buffs.initialAnchor = 'RIGHT'
  1107.             buffs["growth-x"] = "LEFT"
  1108.             buffs.PostCreateIcon = TukuiDB.PostCreateAura
  1109.             buffs.PostUpdateIcon = TukuiDB.PostUpdateAura
  1110.             self.Buffs = buffs
  1111.         end
  1112.  
  1113.         -- create debuff for both arena and boss units
  1114.         local debuffs = CreateFrame("Frame", nil, self)
  1115.         debuffs:SetHeight(26)
  1116.         debuffs:SetWidth(200)
  1117.         debuffs:SetPoint('LEFT', self, 'RIGHT', TukuiDB.Scale(4), 0)
  1118.         debuffs.size = 26
  1119.         debuffs.num = 5
  1120.         debuffs.spacing = 2
  1121.         debuffs.initialAnchor = 'LEFT'
  1122.         debuffs["growth-x"] = "RIGHT"
  1123.         debuffs.PostCreateIcon = TukuiDB.PostCreateAura
  1124.         debuffs.PostUpdateIcon = TukuiDB.PostUpdateAura
  1125.         self.Debuffs = debuffs 
  1126.                
  1127.         -- trinket feature via trinket plugin
  1128.         if (TukuiCF.arena.unitframes) and (unit and unit:find('arena%d')) then
  1129.             local Trinketbg = CreateFrame("Frame", nil, self)
  1130.             Trinketbg:SetHeight(26)
  1131.             Trinketbg:SetWidth(26)
  1132.             Trinketbg:SetPoint("RIGHT", self, "LEFT", -6, 0)               
  1133.             TukuiDB.SetThinTemplate(Trinketbg)
  1134.             Trinketbg:SetFrameLevel(0)
  1135.             self.Trinketbg = Trinketbg
  1136.            
  1137.             local Trinket = CreateFrame("Frame", nil, Trinketbg)
  1138.             Trinket:SetAllPoints(Trinketbg)
  1139.             Trinket:SetPoint("TOPLEFT", Trinketbg, TukuiDB.Scale(1), TukuiDB.Scale(-1))
  1140.             Trinket:SetPoint("BOTTOMRIGHT", Trinketbg, TukuiDB.Scale(-1), TukuiDB.Scale(1))
  1141.             Trinket:SetFrameLevel(1)
  1142.             Trinket.trinketUseAnnounce = true
  1143.             self.Trinket = Trinket
  1144.         end
  1145.     end
  1146.  
  1147.     ------------------------------------------------------------------------
  1148.     --  Main tanks and Main Assists layout (both mirror'd)
  1149.     ------------------------------------------------------------------------
  1150.    
  1151.     if(self:GetParent():GetName():match"oUF_MainTank" or self:GetParent():GetName():match"oUF_MainAssist") then
  1152.         -- Right-click focus on maintank or mainassist units
  1153.         self:SetAttribute("type2", "focus")
  1154.        
  1155.         -- health
  1156.         local health = CreateFrame('StatusBar', nil, self)
  1157.         health:SetHeight(TukuiDB.Scale(20))
  1158.         health:SetPoint("TOPLEFT")
  1159.         health:SetPoint("TOPRIGHT")
  1160.         health:SetStatusBarTexture(normTex)
  1161.        
  1162.         local healthBG = health:CreateTexture(nil, 'BORDER')
  1163.         healthBG:SetAllPoints()
  1164.         healthBG:SetTexture(.1, .1, .1)
  1165.                
  1166.         self.Health = health
  1167.         self.Health.bg = healthBG
  1168.        
  1169.         health.frequentUpdates = true
  1170.         if db.showsmooth == true then
  1171.             health.Smooth = true
  1172.         end
  1173.        
  1174.         if db.unicolor == true then
  1175.             health.colorDisconnected = false
  1176.             health.colorClass = false
  1177.             health:SetStatusBarColor(unpack(db.health))
  1178.             healthBG:SetVertexColor(.1, .1, .1, 1)
  1179.         else
  1180.             health.colorDisconnected = true
  1181.             health.colorClass = true
  1182.             health.colorReaction = true
  1183.         end
  1184.        
  1185.         -- names
  1186.         local Name = health:CreateFontString(nil, "OVERLAY")
  1187.         Name:SetPoint("CENTER", health, "CENTER", 0, 0)
  1188.         Name:SetJustifyH("CENTER")
  1189.         Name:SetFont(font1, font1size, fonttags)
  1190.         Name:SetShadowColor(0, 0, 0)
  1191.        
  1192.         self:Tag(Name, '[Tukui:getnamecolor][Tukui:nameshort]')
  1193.         self.Name = Name
  1194.     end
  1195.  
  1196.     ------------------------------------------------------------------------
  1197.     --  Features we want for all units at the same time
  1198.     ------------------------------------------------------------------------
  1199.    
  1200.     -- here we create an invisible frame for all element we want to show over health/power.
  1201.     -- because we can only use self here, and self is under all elements.
  1202.     local InvFrame = CreateFrame("Frame", nil, self)
  1203.     InvFrame:SetFrameStrata("HIGH")
  1204.     InvFrame:SetFrameLevel(5)
  1205.     InvFrame:SetAllPoints()
  1206.    
  1207.     -- symbols, now put the symbol on the frame we created above.
  1208.     local RaidIcon = InvFrame:CreateTexture(nil, "OVERLAY")
  1209.     RaidIcon:SetTexture("Interface\\AddOns\\Tukui\\media\\textures\\raidicons.blp") -- thx hankthetank for texture
  1210.     RaidIcon:SetHeight(20)
  1211.     RaidIcon:SetWidth(20)
  1212.     RaidIcon:SetPoint("TOP", 0, 8)
  1213.     self.RaidIcon = RaidIcon
  1214.    
  1215.     return self
  1216. end
  1217.  
  1218. ------------------------------------------------------------------------
  1219. --  Default position of Tukui unitframes
  1220. ------------------------------------------------------------------------
  1221.  
  1222. -- for lower reso
  1223. local totdebuffs = 0
  1224. if db.totdebuffs then totdebuffs = 24 end
  1225.  
  1226. oUF:RegisterStyle('Tukz', Shared)
  1227.  
  1228. -- player
  1229. local player = oUF:Spawn('player', "oUF_Tukz_player")
  1230. player:SetPoint("BOTTOMRIGHT", InvTukuiActionBarBackground, "TOP", -10,33)
  1231. player:SetSize(unpack(db.plyrScale))
  1232.  
  1233. -- focus
  1234. local focus = oUF:Spawn('focus', "oUF_Tukz_focus")
  1235. focus:SetPoint("CENTER", TukuiInfoRight, "CENTER")
  1236. focus:SetSize(TukuiInfoRight:GetWidth(), TukuiInfoRight:GetHeight())
  1237.  
  1238. -- target
  1239. local target = oUF:Spawn('target', "oUF_Tukz_target")
  1240. target:SetPoint("BOTTOMLEFT", InvTukuiActionBarBackground, "TOP", 10,33)
  1241. target:SetSize(unpack(db.targScale))
  1242.  
  1243.  
  1244. -- tot
  1245. local tot = oUF:Spawn('targettarget', "oUF_Tukz_targettarget")
  1246. tot:SetPoint("TOPLEFT", TukuiSplitBarRightBG or InvTukuiActionBarBackground, "TOPRIGHT", 16,-1)
  1247. tot:SetSize(unpack(db.totScale))
  1248.  
  1249. -- pet
  1250. local pet = oUF:Spawn('pet', "oUF_Tukz_pet")
  1251. pet:SetPoint("TOPRIGHT", TukuiSplitBarLeftBG or InvTukuiActionBarBackground, "TOPLEFT", -16,-1)
  1252. pet:SetSize(unpack(db.petScale))
  1253.  
  1254. if db.showfocustarget then
  1255.     local focustarget = oUF:Spawn("focustarget", "oUF_Tukz_focustarget")
  1256.     focustarget:SetPoint("BOTTOM", 0, 224)
  1257.     focustarget:SetSize(unpack(db.foctarScale))
  1258. end
  1259.  
  1260. if TukuiCF.arena.unitframes then
  1261.     local arena = {}
  1262.     for i = 1, 5 do
  1263.         arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
  1264.         if i == 1 then
  1265.             arena[i]:SetPoint("BOTTOM", UIParent, "BOTTOM", 252, 260)
  1266.         else
  1267.             arena[i]:SetPoint("BOTTOM", arena[i-1], "TOP", 0, 10)
  1268.         end
  1269.         arena[i]:SetSize(unpack(db.arenaScale))
  1270.     end
  1271. end
  1272.  
  1273. if db.showboss then
  1274.     for i = 1,MAX_BOSS_FRAMES do
  1275.         local t_boss = _G["Boss"..i.."TargetFrame"]
  1276.         t_boss:UnregisterAllEvents()
  1277.         t_boss.Show = TukuiDB.dummy
  1278.         t_boss:Hide()
  1279.         _G["Boss"..i.."TargetFrame".."HealthBar"]:UnregisterAllEvents()
  1280.         _G["Boss"..i.."TargetFrame".."ManaBar"]:UnregisterAllEvents()
  1281.     end
  1282.  
  1283.     local boss = {}
  1284.     for i = 1, MAX_BOSS_FRAMES do
  1285.         boss[i] = oUF:Spawn("boss"..i, "oUF_Boss"..i)
  1286.         if i == 1 then
  1287.             boss[i]:SetPoint("BOTTOM", UIParent, "BOTTOM", 252, 260)
  1288.         else
  1289.             boss[i]:SetPoint('BOTTOM', boss[i-1], 'TOP', 0, 10)            
  1290.         end
  1291.         boss[i]:SetSize(unpack(db.bossScale))
  1292.     end
  1293. end
  1294.  
  1295. -- THIS NEED TO BE UPDATED FOR 4.0.1 BUT I'M RUNNING OUT OF TIME FOR A v12 RELEASE.
  1296. --[[
  1297. if db.maintank == true then
  1298.     local tank = oUF:SpawnHeader("oUF_MainTank", nil, 'raid, party, solo',
  1299.         "showRaid", true, "groupFilter", "MAINTANK", "yOffset", 5, "point" , "BOTTOM",
  1300.         "template", "oUF_tukzMtt"
  1301.     )
  1302.     tank:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
  1303. end
  1304.  
  1305. if db.mainassist == true then
  1306.     local assist = oUF:SpawnHeader("oUF_MainAssist", nil, 'raid, party, solo',
  1307.         "showRaid", true, "groupFilter", "MAINASSIST", "yOffset", 5, "point" , "BOTTOM",
  1308.         "template", "oUF_tukzMtt"
  1309.     )
  1310.     assist:SetPoint("CENTER", UIParent, "CENTER", 0, -100)
  1311. end
  1312. --]]
  1313.  
  1314. -- this is just a fake party to hide Blizzard frame if no Tukui raid layout are loaded.
  1315. local party = oUF:SpawnHeader("oUF_noParty", nil, "party", "showParty", true)
  1316.  
  1317. ------------------------------------------------------------------------
  1318. --  Just a command to test buffs/debuffs alignment
  1319. ------------------------------------------------------------------------
  1320.  
  1321. local testui = TestUI or function() end
  1322. TestUI = function()
  1323.     testui()
  1324.     UnitAura = function()
  1325.         -- name, rank, texture, count, dtype, duration, timeLeft, caster
  1326.         return 'penancelol', 'Rank 2', 'Interface\\Icons\\Spell_Holy_Penance', random(5), 'Magic', 0, 0, "player"
  1327.     end
  1328.     if(oUF) then
  1329.         for i, v in pairs(oUF.units) do
  1330.             if(v.UNIT_AURA) then
  1331.                 v:UNIT_AURA("UNIT_AURA", v.unit)
  1332.             end
  1333.         end
  1334.     end
  1335. end
  1336. SlashCmdList.TestUI = TestUI
  1337. SLASH_TestUI1 = "/testui"
  1338.  
  1339. ------------------------------------------------------------------------
  1340. -- Right-Click on unit frames menu.
  1341. -- Doing this to remove SET_FOCUS eveywhere.
  1342. -- SET_FOCUS work only on default unitframes.
  1343. -- Main Tank and Main Assist, use /maintank and /mainassist commands.
  1344. ------------------------------------------------------------------------
  1345.  
  1346. do
  1347.     UnitPopupMenus["SELF"] = { "PVP_FLAG", "LOOT_METHOD", "LOOT_THRESHOLD", "OPT_OUT_LOOT_TITLE", "LOOT_PROMOTE", "DUNGEON_DIFFICULTY", "RAID_DIFFICULTY", "RESET_INSTANCES", "RAID_TARGET_ICON", "SELECT_ROLE", "LEAVE", "CANCEL" };
  1348.     UnitPopupMenus["PET"] = { "PET_PAPERDOLL", "PET_RENAME", "PET_ABANDON", "PET_DISMISS", "CANCEL" };
  1349.     UnitPopupMenus["PARTY"] = { "MUTE", "UNMUTE", "PARTY_SILENCE", "PARTY_UNSILENCE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "WHISPER", "PROMOTE", "PROMOTE_GUIDE", "LOOT_PROMOTE", "VOTE_TO_KICK", "UNINVITE", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "RAID_TARGET_ICON", "SELECT_ROLE", "PVP_REPORT_AFK", "RAF_SUMMON", "RAF_GRANT_LEVEL", "CANCEL" }
  1350.     UnitPopupMenus["PLAYER"] = { "WHISPER", "INSPECT", "INVITE", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "RAID_TARGET_ICON", "RAF_SUMMON", "RAF_GRANT_LEVEL", "CANCEL" }
  1351.     UnitPopupMenus["RAID_PLAYER"] = { "MUTE", "UNMUTE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "WHISPER", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "RAID_TARGET_ICON", "SELECT_ROLE", "RAID_LEADER", "RAID_PROMOTE", "RAID_DEMOTE", "LOOT_PROMOTE", "RAID_REMOVE", "PVP_REPORT_AFK", "RAF_SUMMON", "RAF_GRANT_LEVEL", "CANCEL" };
  1352.     UnitPopupMenus["RAID"] = { "MUTE", "UNMUTE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "RAID_LEADER", "RAID_PROMOTE", "RAID_MAINTANK", "RAID_MAINASSIST", "RAID_TARGET_ICON", "LOOT_PROMOTE", "RAID_DEMOTE", "RAID_REMOVE", "PVP_REPORT_AFK", "CANCEL" };
  1353.     UnitPopupMenus["VEHICLE"] = { "RAID_TARGET_ICON", "VEHICLE_LEAVE", "CANCEL" }
  1354.     UnitPopupMenus["TARGET"] = { "RAID_TARGET_ICON", "CANCEL" }
  1355.     UnitPopupMenus["ARENAENEMY"] = { "CANCEL" }
  1356.     UnitPopupMenus["FOCUS"] = { "RAID_TARGET_ICON", "CANCEL" }
  1357.     UnitPopupMenus["BOSS"] = { "RAID_TARGET_ICON", "CANCEL" }
  1358. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement