View Single Post
02-14-12, 03:00 AM   #12
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Phanx View Post
You're going to have to post the whole file... unless your code is overwriting the :SetScript method somewhere else, I can't see how that line of code could produce that error.
Indeed, don't see how the error is made really.

LUA Code:
  1. if AftermathhUI.ouf.showraid == false then return end
  2.  
  3. local parent, ns = ...
  4. local oUF = ns.oUF or oUF
  5.  
  6. local function RaidFrames(self, unit)
  7.     if AftermathhUI.ouf.dropdownmenu == true then
  8.         self.menu = CreateDropDown
  9.     end
  10.     self:RegisterForClicks('AnyDown')
  11.     if AftermathhUI.ouf.tooltiponraid == true then
  12.         self:SetScript('OnEnter', UnitFrame_OnEnter)
  13.         self:SetScript('OnLeave', UnitFrame_OnLeave)
  14.     end
  15.     self:SetAttribute('*type2', 'menu')
  16.    
  17.     self:SetBackdrop({
  18.         bgFile = AftermathhUI.media.blank,
  19.         insets = {top = -1, left = -1, bottom = -1, right = -1},
  20.     })
  21.     self:SetBackdropColor(0, 0, 0, 0.4)
  22.  
  23.     self.Health = CreateFrame('StatusBar', nil, self)
  24.     self.Health:SetStatusBarTexture(AftermathhUI.media.texture)
  25.     if AftermathhUI.ouf.custombarcoloronraid == true then
  26.         self.Health:SetStatusBarColor(unpack(AftermathhUI.ouf.healthbarcolorraid))
  27.     end
  28.     self.Health:SetParent(self)
  29.     self.Health:SetAllPoints(self)
  30.     self.Health.Smooth = true
  31.     self.Health.frequentUpdates = true
  32.     if AftermathhUI.ouf.custombarcoloronraid == false then
  33.         self.Health.colorClass = true
  34.     end
  35.     --CreateBorderLight(self.Health, AftermathhUI.media.bordersize-1, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 2)
  36.    
  37.     if AftermathhUI.ouf.raidframesvertical == true then
  38.         self.Health:SetOrientation('VERTICAL')
  39.     end
  40.  
  41.     self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
  42.     self.Health.bg:SetAllPoints(self.Health)
  43.     self.Health.bg:SetTexture(AftermathhUI.media.texture)
  44.     self.Health.bg:SetVertexColor(0,0,0,0.6)
  45.    
  46.     local HealthText = self.Health:CreateFontString(nil, 'OVERLAY')
  47.     HealthText:SetFont(AftermathhUI.media.font3, 11, AftermathhUI.media.fontflag)
  48.     HealthText:SetPoint('TOP', 1, -20)
  49.     if AftermathhUI.media.shadowoffset == true then
  50.         HealthText:SetShadowOffset(1, -1)
  51.         HealthText:SetShadowColor(0,0,0)
  52.     end
  53.     self:Tag(HealthText, '[Aftermathh:Deficit]')
  54.  
  55.     self.Name = self.Health:CreateFontString(nil, 'OVERLAY')
  56.     self.Name:SetPoint('TOP', 0, -6)
  57.     self.Name:SetFont(AftermathhUI.media.font, 11, AftermathhUI.media.fontflag)
  58.     if AftermathhUI.media.shadowoffset == true then
  59.         self.Name:SetShadowOffset(1, -1)
  60.         self.Name:SetShadowColor(0, 0, 0)
  61.     end
  62.     if AftermathhUI.ouf.custombarcoloronraid == true then
  63.         self:Tag(self.Name, '[raidcolor][Aftermathh:RaidName]')
  64.     end
  65.     if AftermathhUI.ouf.custombarcoloronraid == false then
  66.         self:Tag(self.Name, '|cffffffff[Aftermathh:RaidName]|r')
  67.     end
  68.  
  69.     local InvisFrame = CreateFrame("Frame", nil, self)
  70.     InvisFrame:SetFrameStrata("MEDIUM")
  71.     InvisFrame:SetFrameLevel(5)
  72.     InvisFrame:SetAllPoints()
  73.    
  74.     self.MasterLooter = InvisFrame:CreateTexture('$parentMasterLooterIcon', 'OVERLAY', self)
  75.     self.MasterLooter:SetSize(11, 11)
  76.     self.MasterLooter:SetPoint('RIGHT', self.Health, 'TOPRIGHT', 2, 2)
  77.    
  78.     self.Assistant = InvisFrame:CreateTexture(nil, 'OVERLAY', self)
  79.     self.Assistant:SetSize(12, 12)
  80.     self.Assistant:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  81.    
  82.     self.Leader = InvisFrame:CreateTexture('$parentLeaderIcon', 'OVERLAY', self)
  83.     self.Leader:SetSize(12, 12)
  84.     self.Leader:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  85.    
  86.     self.RaidIcon = InvisFrame:CreateTexture(nil, 'OVERLAY')
  87.     self.RaidIcon:SetSize(17, 17)
  88.     self.RaidIcon:SetPoint('CENTER', self, 'TOP')
  89.  
  90.     self.ReadyCheck = InvisFrame:CreateTexture(nil, 'OVERLAY')
  91.     self.ReadyCheck:SetSize(31, 25)
  92.     self.ReadyCheck:SetPoint('CENTER')  
  93.     self.ReadyCheck.delayTime = 4
  94.     self.ReadyCheck.fadeTime = 1
  95.    
  96.     if AftermathhUI.ouf.showroleicon == true then
  97.         self.LFDRole = InvisFrame:CreateTexture(nil, 'OVERLAY')
  98.         self.LFDRole:SetPoint('CENTER', self, 'BOTTOM', -1, 1)
  99.         self.LFDRole:SetSize(14, 14)
  100.         self.LFDRole:SetTexture(AftermathhUI.media.lfd)
  101.         self.LFDRole:SetDesaturated(1)
  102.     end
  103.  
  104.     if AftermathhUI.ouf.showaggroonraidframes == true then
  105.         table.insert(self.__elements, UpdateThreatRaid)
  106.         self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateThreatRaid)
  107.         self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', UpdateThreatRaid)
  108.         self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', UpdateThreatRaid)
  109.     end
  110.  
  111.     if AftermathhUI.ouf.aurawatch == true and AftermathhUI.ouf.gridlayout == true and AftermathhUI.ouf.dpslayout == false then
  112.         CreateAuraWatch(self,unit)
  113.     end
  114.    
  115.     if AftermathhUI.ouf.raiddebuffs == true then
  116.         self.RaidDebuffs = CreateFrame('Frame', nil, self)
  117.         self.RaidDebuffs:SetSize(20, 20)
  118.         self.RaidDebuffs:SetPoint('CENTER', self)
  119.         self.RaidDebuffs:SetFrameStrata('HIGH')
  120.        
  121.         local PerfectBorders = 768/string.match(GetCVar("gxResolution"), "%d+x(%d+)")/0.89999997615814
  122.         self.RaidDebuffs:SetBackdrop({
  123.             bgFile = AftermathhUI.media.borderlight,
  124.             insets = {top = -4+PerfectBorders, left = -4+PerfectBorders, bottom = -4+PerfectBorders, right = -4+PerfectBorders},
  125.         })
  126.  
  127.         self.RaidDebuffs.icon = self.RaidDebuffs:CreateTexture(nil, 'ARTWORK')
  128.         self.RaidDebuffs.icon:SetTexCoord(.07,.93,.07,.93)
  129.         self.RaidDebuffs.icon:SetAllPoints(self.RaidDebuffs)
  130.        
  131.         self.RaidDebuffs.cd = CreateFrame('Cooldown', nil, self.RaidDebuffs)
  132.         self.RaidDebuffs.cd:SetAllPoints(self.RaidDebuffs)
  133.        
  134.         local overlayFrame = CreateFrame("frame", nil, self.RaidDebuffs, nil)
  135.         overlayFrame:SetFrameStrata("HIGH")
  136.         overlayFrame:SetFrameLevel(5)
  137.    
  138.         self.RaidDebuffs.count = self.RaidDebuffs:CreateFontString(nil, 'OVERLAY')
  139.         self.RaidDebuffs.count:SetParent(overlayFrame)
  140.         self.RaidDebuffs.count:SetFont(AftermathhUI.media.font, 12, AftermathhUI.media.fontflag)
  141.         if AftermathhUI.media.shadowoffset == true then
  142.             self.RaidDebuffs.count:SetShadowOffset(1, -1)
  143.             self.RaidDebuffs.count:SetShadowColor(0, 0, 0)
  144.         end
  145.         self.RaidDebuffs.count:ClearAllPoints()
  146.         self.RaidDebuffs.count:SetPoint('TOPRIGHT', self.RaidDebuffs, 2, 3)
  147.     end
  148.    
  149.     if AftermathhUI.ouf.healprediction == true then
  150.         local myBars = CreateFrame('StatusBar', nil, self.Health)
  151.         myBars:SetStatusBarTexture(AftermathhUI.media.texture)
  152.         myBars:SetStatusBarColor(0, 1, 0.5, 0.45)
  153.         myBars:SetSize(55, 38)
  154.         if AftermathhUI.ouf.raidframesvertical == true then
  155.             myBars:SetOrientation("VERTICAL")
  156.             myBars:SetPoint('BOTTOM', self.Health:GetStatusBarTexture(), 'TOP', 0, 0)
  157.             myBars:SetSize(59, 39)
  158.         else
  159.             myBars:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  160.             myBars:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  161.         end
  162.  
  163.         local otherBars = CreateFrame('StatusBar', nil, myBars)
  164.         otherBars:SetStatusBarTexture(AftermathhUI.media.texture)
  165.         otherBars:SetStatusBarColor(0, 0.5, 1, 0.45)
  166.         otherBars:SetSize(55, 38)
  167.         if AftermathhUI.ouf.raidframesvertical == true then
  168.             otherBars:SetOrientation("VERTICAL")
  169.             otherBars:SetPoint('BOTTOM', myBars:GetStatusBarTexture(), 'TOP', 0, 0)
  170.             otherBars:SetSize(59, 39)
  171.         else
  172.             otherBars:SetPoint('TOPLEFT', myBars:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  173.             otherBars:SetPoint('BOTTOMLEFT', myBars:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  174.         end
  175.        
  176.         self.HealPrediction = {
  177.             myBar = myBars,
  178.             otherBar = otherBars,
  179.             maxOverflow = 1,
  180.         }
  181.     end
  182.  
  183.     self.SpellRange = {
  184.         insideAlpha = 1,
  185.         outsideAlpha = 0.3,
  186.     }
  187.  
  188.     return self
  189. end
  190.  
  191. oUF:RegisterStyle('Aftermathh_Raid', RaidFrames)
  192. oUF:Factory(function(self)
  193.     self:SetActiveStyle('Aftermathh_Raid')
  194.    
  195.     if AftermathhUI.ouf.showraid == true then
  196.         if AftermathhUI.ouf.gridlayout == true and AftermathhUI.ouf.dpslayout == false then
  197.             local Raid = self:SpawnHeader("AftermathhRaidGrid", nil, 'solo,party,raid',
  198.                 'showPlayer', true,
  199.                 'showRaid', true,
  200.                 'showParty', true,
  201.                 'showSolo', true,
  202.                 'xoffset', 7,
  203.                 'yOffset', 0,
  204.                 'point', 'LEFT',
  205.                 'groupFilter', '1,2,3,4,5,6,7,8',
  206.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  207.                 'groupBy', 'GROUP',
  208.                 'maxColumns', 5,
  209.                 'unitsPerColumn', 5,
  210.                 'columnSpacing', 6,
  211.                 'columnAnchorPoint', 'TOP',
  212.                 'oUF-initialConfigFunction', [[
  213.                     self:SetWidth(59)
  214.                     self:SetHeight(38)
  215.                     self:SetScale(1)
  216.                 ]]
  217.             )  
  218.             Raid:SetPoint('LEFT', UIParent, 221, -54)
  219.         end
  220.         if AftermathhUI.ouf.gridlayout == false and AftermathhUI.ouf.dpslayout == true then
  221.             local Raid = self:SpawnHeader("AftermathhRaid", nil, 'solo,party,raid',
  222.                 'showPlayer', true,
  223.                 'showRaid', true,
  224.                 'showParty', false,
  225.                 'showSolo', false,
  226.                 'xoffset', 12,
  227.                 'yOffset', -5,
  228.                 'point', 'LEFT',
  229.                 'groupFilter', '1,2,3,4,5,6,7,8',
  230.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  231.                 'groupBy', 'GROUP',
  232.                 'maxColumns', 12,
  233.                 'unitsPerColumn', 5,
  234.                 'columnSpacing', 12,
  235.                 'columnAnchorPoint', 'TOP',
  236.                 'oUF-initialConfigFunction', [[
  237.                     self:SetWidth(45)
  238.                     self:SetHeight(38)
  239.                     self:SetScale(1)
  240.                 ]]
  241.             )  
  242.             Raid:SetPoint('TOPLEFT', UIParent, 10, -9)
  243.         end
  244.     end
  245. end)
  Reply With Quote