Thread Tools Display Modes
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
08-20-12, 09:34 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The tag system has changed; oUF.UnitlessTagEvents no longer exists, and has been replaced with oUF.Tags.SharedEvents.

Here is an example of a working tag using non-unit events from oUF_Phanx:
Code:
oUF.Tags.Events["leadericon"] = "PARTY_LEADER_CHANGED PARTY_MEMBERS_CHANGED"
oUF.Tags.SharedEvents["PARTY_LEADER_CHANGED"] = true
oUF.Tags.SharedEvents["PARTY_MEMBERS_CHANGED"] = true
oUF.Tags.Methods["leadericon"] = function(unit)
	if UnitIsGroupLeader(unit) then
		return [[|TInterface\GroupFrame\UI-Group-LeaderIcon:0|t]]
	elseif UnitInRaid(unit) and UnitIsGroupAssistant(unit) then
		return [[|TInterface\GroupFrame\UI-Group-AssistantIcon:0|t]]
	end
end
Compare with a tag using unit events:
Code:
oUF.Tags.Events["powercolor"] = "UNIT_DISPLAYPOWER"
oUF.Tags.Methods["powercolor"] = function(unit)
	local _, type = UnitPowerType(unit)
	local color = ns.colors.power[type] or ns.colors.power.FUEL
	return ("|cff%02x%02x%02x"):format(color[1] * 255, color[2] * 255, color[3] * 255)
end
You will probably need to rewrite all of the tag definitions in your own layout to work with the new system.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-20-12, 09:54 PM   #3
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Thanks, Phanx... that worked. I figured they had changed, but I wasn't sure to what because I'm using oUF_Karma as a reference and didn't see those lines in the tags.lua file. Both oUF_Karma and oUF_Fail are fairly similar layouts which were created by the same author in Cataclysm (and he doesn't seem to be updating either one). However, someone else has already updated oUF_Karma for MoP and I'm just trying to go through what he's fixed in Karma and apply it to Fail (if I can).

It's obviously not exactly working out 100% and while some changes are successful, others are not. I will probably be back within the next few days with some other issues if I can't get them worked out (other classes that just aren't playing nice and an odd texture issue on my party frames).

Thanks again.
  Reply With Quote
08-21-12, 01:20 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If by "odd texture issue" you mean you're seeing a green texture you didn't put there, try running frame:SetNormalTexture(nil) on your frames.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-04-12, 08:08 PM   #5
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Originally Posted by Phanx View Post
If by "odd texture issue" you mean you're seeing a green texture you didn't put there, try running frame:SetNormalTexture(nil) on your frames.
Apologies for getting back to this late, but I haven't had a chance to really play much lately. Here's the error I'm seeing upon entering a party/raid/instance/etc:



It actually seems to be an error with the Warrior's old ability Vigilance (50720) and I don't see where oUF_Fail is looking for it. Here's what it's doing to my party/raid frames:




Now, here's AuraWatch.lua:

lua Code:
  1. --[[------------------------------------------------------------------------------------------------------
  2. oUF_AuraWatch by Astromech
  3. Please leave comments, suggestions, and bug reports on this addon's WoWInterface page
  4.  
  5. To setup, create a table named AuraWatch in your unit frame. There are several options
  6. you can specify, as explained below.
  7.    
  8.     icons
  9.         Mandatory!
  10.         A table of frames to be used as icons. oUF_Aurawatch does not position
  11.         these frames, so you must do so yourself. Each icon needs a spellID entry,
  12.         which is the spell ID of the aura to watch. Table should be set up
  13.         such that values are icon frames, but the keys can be anything.
  14.        
  15.         Note each icon can have several options set as well. See below.
  16.     strictMatching
  17.         Default: false
  18.         If true, AuraWatch will only show an icon if the specific aura
  19.         with the specified spell id is on the unit. If false, AuraWatch
  20.         will show the icon if any aura with the same name and icon texture
  21.         is on the unit. Strict matching can be undesireable because most
  22.         ranks of an aura have different spell ids.
  23.     missingAlpha
  24.         Default 0.75
  25.         The alpha value for icons of auras which have faded from the unit.
  26.     presentAlpha
  27.         Default 1
  28.         The alpha value for icons or auras present on the unit.
  29.     onlyShowMissing
  30.         Default false
  31.         If this is true, oUF_AW will hide icons if they are present on the unit.
  32.     onlyShowPresent
  33.         Default false
  34.         If this is true, oUF_AW will hide icons if they have expired from the unit.
  35.     customIcons
  36.         Default false
  37.         If this is true, oUF_AW will not create any frames or textures for your
  38.         icons. It assumes you will handle it.
  39.     fromUnits
  40.         Default {["player"] = true, ["pet"] = true, ["vehicle"] = true}
  41.         A table of units from which auras can originate. Have the units be the keys
  42.         and "true" be the values.
  43.     anyUnit
  44.         Default false
  45.         Set to true for oUF_AW to to show an aura no matter what unit it
  46.         originates from. This will override any fromUnits setting.
  47.     PostCreateIcon
  48.         Default nil
  49.         A function to call when an icon is created to modify it, such as adding
  50.         a border or repositioning the count fontstring. Leave as nil to ignore.
  51.         The arguements are: AuraWatch table, icon, auraSpellID, auraName, unitFrame
  52.     PostResetIcon
  53.         Default nil
  54.         A function to call when an icon is reset, that is an aura has been applied
  55.         or refreshed. This is passed the AuraWatch frame, the icon, aura stack count,
  56.         duration, and remaining time, as per a UnitAura call.
  57.     PostExpireIcon
  58.         Default nil
  59.         A function to call when an icon is expired, that is an aura has disappeared.
  60.         This is passed the AuraWatch frame and the icon.
  61.     OverrideResetIcon
  62.         Default nil
  63.         Provide this function to handle the ResetIcon process yourself.
  64.     OverrideExpireIcon
  65.         Default nil
  66.         Provide this function to handle the ExpireIcon process yourself.
  67.  
  68. Below are options set on a per icon basis. Set these as fields in the icon frames.
  69.  
  70. The following settings can be overridden from the AuraWatch table on a per-aura basis:
  71.     onlyShowMissing
  72.     onlyShowPresent
  73.     fromUnits
  74.     anyUnit
  75.        
  76. The following settings are unique to icons:
  77.    
  78.     spellID
  79.         Mandatory!
  80.         The spell id of the aura, as explained above.
  81.    
  82. Here is an example of how to set oUF_AW up:
  83.  
  84.     local createAuraWatch = function(self, unit)
  85.         local auras = {}
  86.        
  87.         -- A table of spellIDs to create icons for
  88.         -- To find spellIDs, look up a spell on [url]www.wowhead.com[/url] and look at the URL
  89.         -- [url]http://www.wowhead.com/?spell=SPELL_ID[/url]
  90.         local spellIDs = { ... }
  91.        
  92.         auras.presentAlpha = 1
  93.         auras.missingAlpha = .7
  94.         auras.PostCreateIcon = myCustomIconSkinnerFunction
  95.         -- Set any other AuraWatch settings
  96.         auras.icons = {}
  97.         for i, sid in pairs(spellIDs) do
  98.             local icon = CreateFrame("Frame", nil, self)
  99.             icon.spellID = sid
  100.             -- set the dimensions and positions
  101.             icon:SetWidth(24)
  102.             icon:SetHeight(24)
  103.             icon:SetPoint("BOTTOM", self, "BOTTOM", 0, 28 * i)
  104.             auras.icons[sid] = icon
  105.             -- Set any other AuraWatch icon settings
  106.         end
  107.         self.AuraWatch = auras
  108.     end
  109. -----------------------------------------------------------------------------------------------------------]]
  110.  
  111. local _, ns = ...
  112. local oUF = ns.oUF or _G.oUF
  113. assert(oUF, "oUF_AuraWatch cannot find an instance of oUF. If your oUF is embedded into a layout, it may not be embedded properly.")
  114.  
  115. local UnitAura, UnitGUID = UnitAura, UnitGUID
  116. local GUIDs = {}
  117.  
  118. local PLAYER_UNITS = {
  119.     player = true,
  120.     vehicle = true,
  121.     pet = true,
  122. }
  123.  
  124. local SetupGUID
  125. do
  126.     local cache = setmetatable({}, {__type = "k"})
  127.  
  128.     local frame = CreateFrame"Frame"
  129.     frame:SetScript("OnEvent", function(self, event)
  130.         for k,t in pairs(GUIDs) do
  131.             GUIDs[k] = nil
  132.             wipe(t)
  133.             cache[t] = true
  134.         end
  135.     end)
  136.     frame:RegisterEvent"PLAYER_REGEN_ENABLED"
  137.     frame:RegisterEvent"PLAYER_ENTERING_WORLD"
  138.    
  139.     function SetupGUID(guid)
  140.         local t = next(cache)
  141.         if t then
  142.             cache[t] = nil
  143.         else
  144.             t = {}
  145.         end
  146.         GUIDs[guid] = t
  147.     end
  148. end
  149.  
  150. local function DefaultResetIcon(watch, icon, count, duration, remaining)
  151.     if not icon.onlyShowMissing then
  152.         if icon.cd then
  153.             if duration and duration > 0 then
  154.                 icon.cd:SetCooldown(remaining - duration, duration)
  155.                 icon.cd:Show()
  156.             else
  157.                 icon.cd:Hide()
  158.             end
  159.         end
  160.         if icon.count then
  161.             icon.count:SetText(count > 1 and count)
  162.         end
  163.         if icon.overlay then
  164.             icon.overlay:Hide()
  165.         end
  166.         icon:SetAlpha(watch.presentAlpha)
  167.         icon:Show()
  168.         if watch.PostResetIcon then watch.PostResetIcon(watch, icon) end
  169.     end
  170. end
  171.  
  172. local function ResetIcon(watch, icon, ...)
  173.     if watch.OverrideResetIcon then
  174.         watch.OverrideResetIcon(watch, icon, ...)
  175.     else
  176.         DefaultResetIcon(watch, icon, ...)
  177.     end
  178. end
  179.  
  180. local function DefaultExpireIcon(watch, icon)
  181.     if not icon.onlyShowPresent then
  182.         if icon.cd then
  183.             icon.cd:Hide()
  184.         end
  185.         if icon.count then
  186.             icon.count:SetText()
  187.         end
  188.         icon:SetAlpha(watch.missingAlpha)
  189.         if icon.overlay then
  190.             icon.overlay:Show()
  191.         end
  192.         icon:Show()
  193.         if watch.PostExpireIcon then watch.PostExpireIcon(watch, icon) end
  194.     end
  195. end
  196.  
  197. local function ExpireIcon(watch, icon, ...)
  198.     if watch.OverrideExpireIcon then
  199.         watch.OverrideExpireIcon(watch, icon, ...)
  200.     else
  201.         DefaultExpireIcon(watch, icon, ...)
  202.     end
  203. end
  204.  
  205. local Update
  206. do
  207.     local found = {}
  208.     function Update(frame, event, unit)
  209.         if frame.unit ~= unit then return end
  210.         local watch = frame.AuraWatch
  211.         local index, icons = 1, watch.watched
  212.         local _, name, texture, count, duration, remaining, caster, key, icon, spellid
  213.         local filter = "HELPFUL"
  214.         local guid = UnitGUID(unit)
  215.         if not GUIDs[guid] then SetupGUID(guid) end
  216.        
  217.         for key, icon in pairs(icons) do
  218.             icon:Hide()
  219.         end
  220.        
  221.         while true do
  222.             name, _, texture, count, _, duration, remaining, caster, _, _, spellid = UnitAura(unit, index, filter)
  223.             if not name then
  224.                 if filter == "HELPFUL" then
  225.                     filter = "HARMFUL"
  226.                     index = 1
  227.                 else
  228.                     break
  229.                 end
  230.             else
  231.                 if watch.strictMatching then
  232.                     key = spellid
  233.                 else
  234.                     key = name..texture
  235.                 end
  236.                 icon = icons[key]
  237.                 if icon and (icon.anyUnit or (caster and icon.fromUnits[caster])) then
  238.                     ResetIcon(watch, icon, count, duration, remaining)
  239.                     GUIDs[guid][key] = true
  240.                     found[key] = true
  241.                 end
  242.                 index = index + 1
  243.             end
  244.         end
  245.        
  246.         for key in pairs(GUIDs[guid]) do
  247.             if icons[key] and not found[key] then
  248.                 ExpireIcon(watch, icons[key])
  249.             end
  250.         end
  251.        
  252.         wipe(found)
  253.     end
  254. end
  255.  
  256. local function SetupIcons(self)
  257.  
  258.     local watch = self.AuraWatch
  259.     local icons = watch.icons
  260.     watch.watched = {}
  261.     if not watch.missingAlpha then watch.missingAlpha = 0.75 end
  262.     if not watch.presentAlpha then watch.presentAlpha = 1 end
  263.    
  264.     for _,icon in pairs(icons) do
  265.    
  266.         local name, _, image = GetSpellInfo(icon.spellID)
  267.         if not name then error("oUF_AuraWatch error: no spell with "..tostring(icon.spellID).." spell ID exists") end
  268.         icon.name = name
  269.    
  270.         if not watch.customIcons then
  271.             local cd = CreateFrame("Cooldown", nil, icon)
  272.             cd:SetAllPoints(icon)
  273.             icon.cd = cd
  274.  
  275.             local tex = icon:CreateTexture(nil, "BACKGROUND")
  276.             tex:SetAllPoints(icon)
  277.             tex:SetTexture(image)
  278.             icon.icon = tex
  279.            
  280.             local overlay = icon:CreateTexture(nil, "OVERLAY")
  281.             overlay:SetTexture"Interface\\Buttons\\UI-Debuff-Overlays"
  282.             overlay:SetAllPoints(icon)
  283.             overlay:SetTexCoord(.296875, .5703125, 0, .515625)
  284.             overlay:SetVertexColor(1, 0, 0)
  285.             icon.overlay = overlay
  286.  
  287.             local count = icon:CreateFontString(nil, "OVERLAY")
  288.             count:SetFontObject(NumberFontNormal)
  289.             count:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -1, 0)
  290.             icon.count = count
  291.         end
  292.  
  293.         if icon.onlyShowMissing == nil then
  294.             icon.onlyShowMissing = watch.onlyShowMissing
  295.         end
  296.         if icon.onlyShowPresent == nil then
  297.             icon.onlyShowPresent = watch.onlyShowPresent
  298.         end
  299.         if icon.fromUnits == nil then
  300.             icon.fromUnits = watch.fromUnits or PLAYER_UNITS
  301.         end
  302.         if icon.anyUnit == nil then
  303.             icon.anyUnit = watch.anyUnit
  304.         end
  305.        
  306.         if watch.strictMatching then
  307.             watch.watched[icon.spellID] = icon
  308.         else
  309.             watch.watched[name..image] = icon
  310.         end
  311.  
  312.         if watch.PostCreateIcon then watch:PostCreateIcon(icon, icon.spellID, name, self) end
  313.     end
  314. end
  315.  
  316. local function ForceUpdate(element)
  317.     return Update(element.__owner, 'ForceUpdate', element.__owner.unit)
  318. end
  319.  
  320. local function Enable(self)
  321.     if self.AuraWatch then
  322.         self.AuraWatch.__owner = self
  323.         self.AuraWatch.ForceUpdate = ForceUpdate
  324.        
  325.         self:RegisterEvent("UNIT_AURA", Update)
  326.         SetupIcons(self)
  327.         return true
  328.     else
  329.         return false
  330.     end
  331. end
  332.  
  333. local function Disable(self)
  334.     if self.AuraWatch then
  335.         self:UnregisterEvent("UNIT_AURA", Update)
  336.         for _,icon in pairs(self.AuraWatch.icons) do
  337.             icon:Hide()
  338.         end
  339.     end
  340. end
  341.  
  342. oUF:AddElement("AuraWatch", Update, Enable, Disable)

Here's the block of code in question [256 - 314]:

(Line 12 in this block is 267)
lua Code:
  1. local function SetupIcons(self)
  2.  
  3.     local watch = self.AuraWatch
  4.     local icons = watch.icons
  5.     watch.watched = {}
  6.     if not watch.missingAlpha then watch.missingAlpha = 0.75 end
  7.     if not watch.presentAlpha then watch.presentAlpha = 1 end
  8.    
  9.     for _,icon in pairs(icons) do
  10.    
  11.         local name, _, image = GetSpellInfo(icon.spellID)
  12.         if not name then error("oUF_AuraWatch error: no spell with "..tostring(icon.spellID).." spell ID exists") end
  13.         icon.name = name
  14.    
  15.         if not watch.customIcons then
  16.             local cd = CreateFrame("Cooldown", nil, icon)
  17.             cd:SetAllPoints(icon)
  18.             icon.cd = cd
  19.  
  20.             local tex = icon:CreateTexture(nil, "BACKGROUND")
  21.             tex:SetAllPoints(icon)
  22.             tex:SetTexture(image)
  23.             icon.icon = tex
  24.            
  25.             local overlay = icon:CreateTexture(nil, "OVERLAY")
  26.             overlay:SetTexture"Interface\\Buttons\\UI-Debuff-Overlays"
  27.             overlay:SetAllPoints(icon)
  28.             overlay:SetTexCoord(.296875, .5703125, 0, .515625)
  29.             overlay:SetVertexColor(1, 0, 0)
  30.             icon.overlay = overlay
  31.  
  32.             local count = icon:CreateFontString(nil, "OVERLAY")
  33.             count:SetFontObject(NumberFontNormal)
  34.             count:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -1, 0)
  35.             icon.count = count
  36.         end
  37.  
  38.         if icon.onlyShowMissing == nil then
  39.             icon.onlyShowMissing = watch.onlyShowMissing
  40.         end
  41.         if icon.onlyShowPresent == nil then
  42.             icon.onlyShowPresent = watch.onlyShowPresent
  43.         end
  44.         if icon.fromUnits == nil then
  45.             icon.fromUnits = watch.fromUnits or PLAYER_UNITS
  46.         end
  47.         if icon.anyUnit == nil then
  48.             icon.anyUnit = watch.anyUnit
  49.         end
  50.        
  51.         if watch.strictMatching then
  52.             watch.watched[icon.spellID] = icon
  53.         else
  54.             watch.watched[name..image] = icon
  55.         end
  56.  
  57.         if watch.PostCreateIcon then watch:PostCreateIcon(icon, icon.spellID, name, self) end
  58.     end
  59. end

I'm unsure of what exactly I'm supposed to be looking for because neither "50720" nor "Vigilance" are anywhere in that file. At the moment this seems to only be Warrior-specific as it's not happening with my Paladin (but she's another story altogether). If anyone needs me to link other Lua files from this layout, do not hesitate to ask.
  Reply With Quote
09-04-12, 10:05 PM   #6
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
MiRai the Vigilance tag is in the lib.lua.
Somewhere around 1370 if I remember correctly for the oUF_Karma lib.lua
Its part of the auras setup for aurawatch. The error isn't helpful in finding it. I just had to search through the files to find it.

It looks like this:
Code:
WARRIOR = {
   50720, --Vigilance
},
I just pulled the line out with the vigilance spellid. And problem solved.
Code:
WARRIOR = {
},
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"

Last edited by Unkn : 09-04-12 at 10:06 PM. Reason: PS. I'm a girl :)
  Reply With Quote
09-04-12, 11:10 PM   #7
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Originally Posted by Unkn View Post
MiRai the Vigilance tag is in the lib.lua.
Somewhere around 1370 if I remember correctly for the oUF_Karma lib.lua
Its part of the auras setup for aurawatch. The error isn't helpful in finding it. I just had to search through the files to find it.
Outstanding!

I can't test it right at this moment but I updated the Spell ID in the lib.lua file.

Thanks, again.
  Reply With Quote

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

Thread Tools
Display Modes

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