Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-20-12, 06:51 PM   #1
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Attempting To Bring oUF_Fail Up-To-Speed

Hey Everyone,

Looking through the errors that oUF_Fail was throwing on the current beta build and reading through this forum I've updated oUF.Tags to the correct the oUF.Tags.Events and oUF.Tags.Methods in the layout's tags.lua seemed to cure everything (so far -- I haven't been able to test the layout on every single class).

However, I'm seeing this Lua error on my Warrior (but not my Mage):
Lua Code:
  1. Message: Interface\AddOns\oUF_Fail\tags.lua:178: attempt to index field 'UnitlessTagEvents' (a nil value)
  2. Time: 08/20/12 19:39:16
  3. Count: 1
  4. Stack: Interface\AddOns\oUF_Fail\tags.lua:178: in main chunk
  5.  
  6. Locals: addon = "oUF_Fail"
  7. ns = <table> {
  8.  cfg = <unnamed> {
  9.  }
  10. }
  11. cfg = <unnamed> {
  12.  0 = <userdata>
  13.  TargetX = 0
  14.  showTargetBuffs = true
  15.  showLFDIcons = true
  16.  PlayerRelativePoint = "CENTER"
  17.  TotX = 10
  18.  FocusX = -64
  19.  TargetRelativePoint = "CENTER"
  20.  ShowIncHeals = true
  21.  PartyX = -365
  22.  showRunebar = true
  23.  PlayerX = -248
  24.  showpet = true
  25.  buffsOnlyShowPlayer = false
  26.  RCheckIcon = true
  27.  ShowParty = true
  28.  party_leader_icon = true
  29.  font = "Interface\AddOns\oUF_Fail\media\Neuropol.ttf"
  30.  PlayerY = -200
  31.  healthbarfontsize = 36
  32.  smallfont = "Interface\AddOns\oUF_Fail\media\Emblem.ttf"
  33.  showShardbar = true
  34.  showEclipsebar = true
  35.  TotY = 6
  36.  ShowPlayerName = false
  37.  FocusY = 390
  38.  showtot = true
  39.  showAuraWatch = true
  40.  scale = 0.9
  41.  highlight_texture = "Interface\AddOns\oUF_Fail\media\raidbg"
  42.  backdrop_texture = "Interface\AddOns\oUF_Fail\media\backdrop"
  43.  enableDebuffHighlight = true
  44.  debuffhighlight_texture = "Interface\AddOns\oUF_Fail\media\debuff_highlight"
  45.  statusbar_texture = "Interface\AddOns\oUF_Fail\media\healthbar"
  46.  showfocustarget = true
  47.  FocusRelativePoint = "TOPRIGHT"
  48.  ShowRaid = true
  49.  Castbars = true
  50.  showVengeance = true
  51.  TargetY = -152
  52.  TotRelativePoint = "TOPRIGHT"
  53.  showTotemBar = true
  54.  spark = "Interface\AddOns\oUF_Fail\media\spark"
  55.  showHolybar = true
  56.  RaidX = -200
  57.  backdrop_edge_texture = "Interface\AddOns\oUF_Fail\media\backdrop_edge"
  58.  raidScale = 1
  59.  showPlayerAuras = false
  60.  showRaidDebuffs = true
  61.  debuffsOnlyShowPlayer = false
  62.  powerbar_texture = "Interface\AddOns\oUF_Fail\media\powerbar"
  63.  debuffBorder = "Interface\AddOns\oUF_Fail\media\iconborder"
  64.  showfocus = true
  65.  PartyY = -45
  66.  RaidY = -530
  67.  showTargetDebuffs = true
  68. }
  69. SVal = <function> defined @Interface\AddOns\oUF_Fail\tags.lua:4
  70. hex = <function> defined @Interface\AddOns\oUF_Fail\tags.lua:16
  71. (*temporary) = nil
  72. (*temporary) = <function> defined @Interface\AddOns\oUF_Fail\tags.lua:142
  73. (*temporary) = <table> {
  74.  __index = <table> {
  75.  }
  76. }
  77. (*temporary) = <table> {
  78.  tapped = <table> {
  79.  }
  80.  reaction = <table> {
  81.  }
  82.  power = <table> {
  83.  }
  84.  health = <table> {
  85.  }
  86.  class = <table> {
  87.  }
  88.  disconnected = <table> {
  89.  }
  90.  smooth = <table> {
  91.  }
  92. }
  93. (*temporary) = <table> {
  94.  __index = <table> {
  95.  }
  96. }
  97. (*temporary) = <table> {
  98.  1 = <table> {
  99.  }
  100.  2 = <table> {
  101.  }
  102.  3 = <table> {
  103.  }
  104.  5 = <table> {
  105.  }
  106.  6 = <table> {
  107.  }
  108.  7 = <table> {
  109.  }
  110.  8 = <table> {
  111.  }
  112.  FUEL = <table> {
  113.  }
  114.  SOUL_SHARDS = <table> {
  115.  }
  116.  9 = <table> {
  117.  }
  118.  HOLY_POWER = <table> {
  119.  }
  120.  FOCUS = <table> {
  121.  }
  122.  MANA = <table> {
  123.  }
  124.  LIGHT_FORCE = <table> {
  125.  }
  126.  RUNIC_POWER = <table> {
  127.  }
  128.  AMMOSLOT = <table> {
  129.  }
  130.  0 = <table> {
  131.  }
  132.  RAGE = <table> {
  133.  }
  134.  RUNES = <table> {
  135.  }
  136.  ECLIPSE = <table> {
  137.  }
  138.  ENERGY = <table> {
  139.  }
  140. }
  141. (*temporary) = 0
  142. (*temporary) = 1
  143. (*temporary) = "attempt to index field 'UnitlessTagEvents' (a nil value)"


And here's the tags.lua file:

Lua Code:
  1. local addon, ns = ...
  2. local cfg = ns.cfg
  3.  
  4. local SVal = function(val)
  5.     if val then
  6.         if (val >= 1e6) then
  7.             return ("%.1fm"):format(val / 1e6)
  8.         elseif (val >= 1e3) then
  9.             return ("%.1fk"):format(val / 1e3)
  10.         else
  11.             return ("%d"):format(val)
  12.         end
  13.     end
  14. end
  15.  
  16. local function hex(r, g, b)
  17.     if r then
  18.         if (type(r) == 'table') then
  19.             if(r.r) then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end
  20.         end
  21.         return ('|cff%02x%02x%02x'):format(r * 255, g * 255, b * 255)
  22.     end
  23. end
  24.  
  25. pcolors = setmetatable({
  26.     power = setmetatable({
  27.         ["MANA"] = {0.14, 0.35, 1.0},
  28.         ["RAGE"] = {1.0, 0.0, 0.0},
  29.         ["RUNIC_POWER"] = {0.44, 0.44, 0.44},
  30.         ["FOCUS"] = {1.0,0.75,0.25},
  31.         ["ENERGY"] = {1.0, 0.9, 0.35},
  32.         ["HAPPINESS"] = {0.0, 1.0, 1.0},
  33.         --["RUNES"] = {0.50, 0.50, 0.50},
  34.         ["AMMOSLOT"] = {0.80, 0.60, 0.00},
  35.         ["FUEL"] = {0.0, 0.55, 0.5},
  36.         ["SOUL_SHARDS"] = {0.46, 0.32, 0.87},
  37.         ["POWER_TYPE_HEAT"] = {0.55,0.57,0.61},
  38.         ["POWER_TYPE_OOZE"] = {0.76,1,0},
  39.         ["POWER_TYPE_BLOOD_POWER"] = {0.7,0,1},
  40.     }, {__index = oUF.colors.power}),
  41. }, {__index = oUF.colors})
  42.  
  43. oUF.Tags.Methods["fail:lfdrole"] = function(unit)
  44.     local role = UnitGroupRolesAssigned(unit)
  45.     if role == "HEALER" then
  46.         return "|cff8AFF30Heals|r"
  47.     elseif role == "TANK" then
  48.         return "|cffFFF130Tank|r"
  49.     elseif role == "DAMAGER" then
  50.         return "|cffFF6161DPS|r"
  51.     end
  52. end
  53.    
  54. oUF.Tags.Events["fail:lfdrole"] = "PARTY_MEMBERS_CHANGED PLAYER_ROLES_ASSIGNED"
  55.  
  56. oUF.Tags.Methods['fail:hp']  = function(u)
  57.   if UnitIsDead(u) or UnitIsGhost(u) or not UnitIsConnected(u) then
  58.     return oUF.Tags.Methods['fail:DDG'](u)
  59.   else
  60.     local per = oUF.Tags.Methods['perhp'](u).."%" or 0
  61.     local min, max = UnitHealth(u), UnitHealthMax(u)
  62.     if u == "player" or u == "target" then
  63.       --if min~=max then
  64.         --return "|cFFFFAAAA"..SVal(min).."|r/"..SVal(max).."   "..per --Default
  65.         --return "|cFFFFAAAA"..SVal(min).."   "..per --Mine
  66.       --else
  67.       --  return SVal(max).."   "..per --Default
  68.     --  end
  69.     --else
  70.       return per
  71.     end
  72.   end
  73. end
  74. oUF.Tags.Events['fail:hp'] = 'UNIT_HEALTH'
  75.  
  76. oUF.Tags.Methods['fail:raidhp']  = function(u)
  77.   if UnitIsDead(u) or UnitIsGhost(u) or not UnitIsConnected(u) then
  78.     return oUF.Tags.Methods['fail:DDG'](u)
  79.   else
  80.     local per = oUF.Tags.Methods['perhp'](u).."%" or 0
  81.     return per
  82.   end
  83. end
  84. oUF.Tags.Events['fail:raidhp'] = 'UNIT_HEALTH'
  85.  
  86. oUF.Tags.Methods['fail:color'] = function(u, r)
  87.     local _, class = UnitClass(u)
  88.     local reaction = UnitReaction(u, "player")
  89.    
  90.     if UnitIsDead(u) or UnitIsGhost(u) or not UnitIsConnected(u) then
  91.         return "|cffA0A0A0"
  92.     elseif (UnitIsTapped(u) and not UnitIsTappedByPlayer(u)) then
  93.         return hex(oUF.colors.tapped)
  94.     elseif (UnitIsPlayer(u)) then
  95.         return hex(oUF.colors.class[class])
  96.     elseif reaction then
  97.         return hex(oUF.colors.reaction[reaction])
  98.     else
  99.         return hex(1, 1, 1)
  100.     end
  101. end
  102. oUF.Tags.Events['fail:color'] = 'UNIT_REACTION UNIT_HEALTH UNIT_HAPPINESS'
  103.  
  104. oUF.Tags.Methods["fail:afkdnd"] = function(unit)
  105.    
  106.     return UnitIsAFK(unit) and "" or UnitIsDND(unit) and "" or ""
  107. end
  108. oUF.Tags.Events["fail:afkdnd"] = 'PLAYER_FLAGS_CHANGED UNIT_POWER UNIT_MAXPOWER'
  109.  
  110. oUF.Tags.Methods['fail:DDG'] = function(u)
  111.     if UnitIsDead(u) then
  112.         return "|cffCFCFCF Dead|r"
  113.     elseif UnitIsGhost(u) then
  114.         return "|cffCFCFCF Ghost|r"
  115.     elseif not UnitIsConnected(u) then
  116.         return "|cffCFCFCF D/C|r"
  117.     end
  118. end
  119. oUF.Tags.Events['fail:DDG'] = 'UNIT_HEALTH'
  120.  
  121. oUF.Tags.Methods['fail:power']  = function(u)
  122.     local min, max = UnitPower(u), UnitPowerMax(u)
  123.     if min~=max then
  124.         return SVal(min).."/"..SVal(max)
  125.     else
  126.         return SVal(max)
  127.     end
  128. end
  129. oUF.Tags.Events['fail:power'] = 'UNIT_POWER UNIT_MAXPOWER'
  130.  
  131. oUF.Tags.Methods['fail:pp'] = function(u)
  132.     if u == "player" or u == "target" then
  133.         local _, str = UnitPowerType(u)
  134.         if str then
  135.             return hex(pcolors.power[str] or {250/255,  75/255,  60/255})..SVal(UnitPower(u))
  136.         end
  137.     end
  138. end
  139. oUF.Tags.Events['fail:pp'] = 'UNIT_POWER UNIT_MAXPOWER'
  140.  
  141. -- Level
  142. oUF.Tags.Methods["fail:level"] = function(unit)
  143.    
  144.     local c = UnitClassification(unit)
  145.     local l = UnitLevel(unit)
  146.     local d = GetQuestDifficultyColor(l)
  147.    
  148.     local str = l
  149.        
  150.     if l <= 0 then l = "??" end
  151.    
  152.     if c == "worldboss" then
  153.         str = string.format("|cff%02x%02x%02xBoss|r",250,20,0)
  154.     elseif c == "eliterare" then
  155.         str = string.format("|cff%02x%02x%02x%s|r|cff0080FFR|r+",d.r*255,d.g*255,d.b*255,l)
  156.     elseif c == "elite" then
  157.         str = string.format("|cff%02x%02x%02x%s|r+",d.r*255,d.g*255,d.b*255,l)
  158.     elseif c == "rare" then
  159.         str = string.format("|cff%02x%02x%02x%s|r|cff0080FFR|r",d.r*255,d.g*255,d.b*255,l)
  160.     else
  161.         if not UnitIsConnected(unit) then
  162.             str = "??"
  163.         else
  164.             if UnitIsPlayer(unit) then
  165.                 str = string.format("|cff%02x%02x%02x%s",d.r*255,d.g*255,d.b*255,l)
  166.             elseif UnitPlayerControlled(unit) then
  167.                 str = string.format("|cff%02x%02x%02x%s",d.r*255,d.g*255,d.b*255,l)
  168.             else
  169.                 str = string.format("|cff%02x%02x%02x%s",d.r*255,d.g*255,d.b*255,l)
  170.             end
  171.         end    
  172.     end
  173.    
  174.     return str
  175. end
  176. oUF.Tags.Events["fail:level"] = "UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED"
  177.  
  178. oUF.UnitlessTagEvents.PLAYER_REGEN_DISABLED = true
  179. oUF.UnitlessTagEvents.PLAYER_REGEN_ENABLED = true

I believe am using the most recent oUF from the Github (pressing download gives me haste-oUF-1.5.13-314-g3102b9a.zip which I installed -- not sure if there's an actual 1.6 zip file somewhere else?) and I'm not entirely sure what those last two lines should be or if they're even necessary in MoP? Any help is appreciated.

Thanks!
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Attempting To Bring oUF_Fail Up-To-Speed


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off