Thread Tools Display Modes
03-21-12, 05:07 PM   #1
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Questions Regarding oUF_Fail

Hey guys, thanks for the help a few weeks ago with oUF_Karma but now I'm trying out oUF_Fail (same author). I've been tinkering around with it for most of today trying to tweak it how I'd like it but, I've run into a few issues at the moment.

1) How do I go about removing all text from the Raid Frames? [Answered]
2) How do I go about removing all text from the Party Frames? [Answered]
3) How do I go about removing the latency from the end of all cast bars? [Answered]
4) Where do I adjust how many buffs/debuffs are in each row for the Target frame? [Answered]

Please check post #8 for new questions.


Thanks a lot for everyone's help so far (especially p3lim and Phanx) with all my oUF questions.

Last edited by MiRai : 03-23-12 at 02:30 PM.
  Reply With Quote
03-21-12, 05:37 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I really wish people asking for help with a specific addon would provide a link to that addon's download page, so I didn't have to go hunt for it in order to try to help them... >_<

1) How do I go about removing all text from the Raid Frames?
The only text I see in the code (eg. I did not load the addon in-game) is the health text, which you can remove by commenting out the line in core.lua that creates it:

Code:
329.		lib.gen_hpstrings(self)
If there is any other text, please describe what information it shows, so I can find it in the code. I did not spend a huge amount of time searching.

2) How do I go about removing all text from the Party Frames?
Similiar to the raid frames, simply comment out the call to the function that creates the health bar text, in core.lua:
Code:
367.		lib.gen_hpstrings(self)
3) How do I go about removing the latency from the end of all cast bars?
In lib.lua, comment out the section of code that creates it:
Code:
    if f.mystyle == "player" then
      --latency (only for player unit)
      local z = s:CreateTexture(nil,"OVERLAY")
      z:SetTexture(cfg.statusbar_texture)
      z:SetVertexColor(1,0.1,0,.6)
      z:SetPoint("TOPRIGHT")
      z:SetPoint("BOTTOMRIGHT")
	  s:SetFrameLevel(1)
      s.SafeZone = z
      -- custom latency display
      local l = lib.gen_fontstring(s, cfg.font, 10, "THINOUTLINE")
      l:SetPoint("CENTER", -2, 17)
      l:SetJustifyH("RIGHT")
	  l:Hide()
      s.Lag = l
      f:RegisterEvent("UNIT_SPELLCAST_SENT", cast.OnCastSent)
    end
4) Where do I adjust how many buffs/debuffs are in each row for the Target frame?
In lib.lua find the functions that create buffs/debuffs:
Code:
705.  lib.createBuffs = function(f)
Code:
738.  lib.createDebuffs = function(f)
... and adjust the values as desired. If you want to make the icons bigger or smaller, and have the length of each row adjust automatically, change the size value. If you want to have a specific number of icons on each row, change the value passed to the SetWidth call from:
Code:
717.		b:SetWidth(f:GetWidth())
to something like:
Code:
		b:SetWidth(((b.size+b.spacing)*4)-b.spacing)
... where 4 is the number of icons you want to show on each row.
  Reply With Quote
03-21-12, 05:58 PM   #3
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Originally Posted by Phanx View Post
I really wish people asking for help with a specific addon would provide a link to that addon's download page, so I didn't have to go hunt for it in order to try to help them... >_<
Apologies...


The only text I see in the code (eg. I did not load the addon in-game) is the health text, which you can remove by commenting out the line in core.lua that creates it:

Code:
329.		lib.gen_hpstrings(self)
If there is any other text, please describe what information it shows, so I can find it in the code. I did not spend a huge amount of time searching.
Thanks that seems to have done it. I don't know why I was hesitant to comment that out...

In lib.lua, comment out the section of code that creates it:
Code:
    if f.mystyle == "player" then
      --latency (only for player unit)
      local z = s:CreateTexture(nil,"OVERLAY")
      z:SetTexture(cfg.statusbar_texture)
      z:SetVertexColor(1,0.1,0,.6)
      z:SetPoint("TOPRIGHT")
      z:SetPoint("BOTTOMRIGHT")
	  s:SetFrameLevel(1)
      s.SafeZone = z
      -- custom latency display
      local l = lib.gen_fontstring(s, cfg.font, 10, "THINOUTLINE")
      l:SetPoint("CENTER", -2, 17)
      l:SetJustifyH("RIGHT")
	  l:Hide()
      s.Lag = l
      f:RegisterEvent("UNIT_SPELLCAST_SENT", cast.OnCastSent)
    end

Commenting that out throws up this error:


Code:
Message: Interface\AddOns\oUF_Fail\castbar.lua:102: attempt to index local 'sf' (a nil value)
Time: 03/21/12 18:52:58
Count: 1
Stack: Interface\AddOns\oUF_Fail\castbar.lua:102: in function `PostCastStart'
Interface\AddOns\oUF\elements\castbar.lua:61: in function `func'
Interface\AddOns\oUF\events.lua:18: in function <Interface\AddOns\oUF\events.lua:16>
(tail call): ?

Locals: self = oUF_failCastbarplayer {
 0 = <userdata>
 PostCastStop = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:120
 CastingColor = <table> {
 }
 ChannelingColor = <table> {
 }
 Time = <unnamed> {
 }
 interrupt = true
 PostChannelStart = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:94
 casting = true
 FailColor = <table> {
 }
 castid = 111
 CompleteColor = <table> {
 }
 delay = 0
 max = 1.5
 Text = <unnamed> {
 }
 duration = 0
 PostCastStart = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:94
 Spark = <unnamed> {
 }
 __owner = oUF_failPlayer {
 }
 ForceUpdate = <function> defined @Interface\AddOns\oUF\elements\castbar.lua:378
 Icon = <unnamed> {
 }
 PostCastInterrupted = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:135
 PostChannelStop = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:129
 PostCastFailed = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:135
 OnUpdate = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:54
}
unit = "player"
name = "Red Proto-Drake"
rank = nil
text = 111
pcolor = <table> {
 1 = 1
 2 = 0.50196078431373
 3 = 0.50196078431373
}
interruptcb = <table> {
 1 = 0.37254901960784
 2 = 0.71372549019608
 3 = 1
}
sf = nil
(*temporary) = 364466.943
(*temporary) = 364466.943
(*temporary) = 0.71372549019608
(*temporary) = 1
(*temporary) = <userdata>
(*temporary) = "attempt to index local 'sf' (a nil value)"
cast = <unnamed> {
 0 = <userdata>
 setBarTicks = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:32
 OnCastbarUpdate = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:54
 PostCastStart = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:94
 PostCastStop = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:120
 PostChannelStop = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:129
 PostCastFailed = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:135
 OnCastSent = <function> defined @Interface\AddOns\oUF_Fail\castbar.lua:89
}
channelingTicks = <table> {
 Mind Sear = 5
 Soul Harvest = 4
 Tranquility = 4
 Hurricane = 10
 Drain Soul = 5
 Earthquake = 8
 Mind Flay = 3
 Penance = 2
 Blizzard = 5
 Arcane Missiles = 5
 Evocation = 4
 Drain Life = 5
 Rain of Fire = 4
}


Here's the castbar.lua code:


lua Code:
  1. local addon, ns = ...
  2.   local cfg = ns.cfg
  3.   local cast = CreateFrame("Frame")  
  4.  
  5.   -----------------------------
  6.   -- FUNCTIONS
  7.   -----------------------------
  8.   -- special thanks to Allez for coming up with this solution
  9. local channelingTicks = {
  10.     -- warlock
  11.     [GetSpellInfo(1120)] = 5, -- drain soul
  12.     [GetSpellInfo(689)] = 5, -- drain life
  13.     [GetSpellInfo(5740)] = 4, -- rain of fire
  14.     [GetSpellInfo(79268)] = 4, -- soul harvest
  15.     -- druid
  16.     [GetSpellInfo(740)] = 4, -- Tranquility
  17.     [GetSpellInfo(16914)] = 10, -- Hurricane
  18.     -- priest
  19.     [GetSpellInfo(15407)] = 3, -- mind flay
  20.     [GetSpellInfo(48045)] = 5, -- mind sear
  21.     [GetSpellInfo(47540)] = 2, -- penance
  22.     -- mage
  23.     [GetSpellInfo(5143)] = 5, -- arcane missiles
  24.     [GetSpellInfo(10)] = 5, -- blizzard
  25.     [GetSpellInfo(12051)] = 4, -- evocation
  26.     -- shaman
  27.     [GetSpellInfo(61882)] = 8 -- earthquake
  28. }
  29.  
  30. local ticks = {}
  31.  
  32. cast.setBarTicks = function(castBar, ticknum)
  33.     if ticknum and ticknum > 0 then
  34.         local delta = castBar:GetWidth() / ticknum
  35.         for k = 1, ticknum do
  36.             if not ticks[k] then
  37.                 ticks[k] = castBar:CreateTexture(nil, 'OVERLAY')
  38.                 ticks[k]:SetTexture(cfg.statusbar_texture)
  39.                 ticks[k]:SetVertexColor(0, 0, 0)
  40.                 ticks[k]:SetWidth(1)
  41.                 ticks[k]:SetHeight(castBar:GetHeight())
  42.             end
  43.             ticks[k]:ClearAllPoints()
  44.             ticks[k]:SetPoint("CENTER", castBar, "LEFT", delta * k, 0 )
  45.             ticks[k]:Show()
  46.         end
  47.     else
  48.         for k, v in pairs(ticks) do
  49.             v:Hide()
  50.         end
  51.     end
  52. end
  53.  
  54. cast.OnCastbarUpdate = function(self, elapsed)
  55.     local currentTime = GetTime()
  56.     if self.casting or self.channeling then
  57.         local parent = self:GetParent()
  58.         local duration = self.casting and self.duration + elapsed or self.duration - elapsed
  59.         if (self.casting and duration >= self.max) or (self.channeling and duration <= 0) then
  60.             self.casting = nil
  61.             self.channeling = nil
  62.             return
  63.         end
  64.         if parent.unit == 'player' then
  65.             if self.delay ~= 0 then
  66.                 self.Time:SetFormattedText('%.1f / |cffff0000%.1f|r', duration, self.casting and self.max + self.delay or self.max - self.delay)
  67.             else
  68.                 self.Time:SetFormattedText('%.1f / %.1f', duration, self.max)
  69.                 self.Lag:SetFormattedText("%d ms", self.SafeZone.timeDiff * 1000)
  70.             end
  71.         else
  72.             self.Time:SetFormattedText('%.1f / %.1f', duration, self.casting and self.max + self.delay or self.max - self.delay)
  73.         end
  74.         self.duration = duration
  75.         self:SetValue(duration)
  76.         self.Spark:SetPoint('CENTER', self, 'LEFT', (duration / self.max) * self:GetWidth(), 0)
  77.     else
  78.         self.Spark:Hide()
  79.         local alpha = self:GetAlpha() - 0.02
  80.         if alpha > 0 then
  81.             self:SetAlpha(alpha)
  82.         else
  83.             self.fadeOut = nil
  84.             self:Hide()
  85.         end
  86.     end
  87. end
  88.  
  89. cast.OnCastSent = function(self, event, unit, spell, rank)
  90.     if self.unit ~= unit or not self.Castbar.SafeZone then return end
  91.     self.Castbar.SafeZone.sendTime = GetTime()
  92. end
  93.  
  94. cast.PostCastStart = function(self, unit, name, rank, text)
  95.     local pcolor = {255/255, 128/255, 128/255}
  96.     local interruptcb = {95/255, 182/255, 255/255}
  97.     self:SetAlpha(1.0)
  98.     self.Spark:Show()
  99.     self:SetStatusBarColor(unpack(self.casting and self.CastingColor or self.ChannelingColor))
  100.     if unit == "player"then
  101.         local sf = self.SafeZone
  102.         sf.timeDiff = GetTime() - sf.sendTime
  103.         sf.timeDiff = sf.timeDiff > self.max and self.max or sf.timeDiff
  104.         sf:SetWidth(self:GetWidth() * sf.timeDiff / self.max)
  105.         sf:Show()
  106.         if self.casting then
  107.             cast.setBarTicks(self, 0)
  108.         else
  109.             local spell = UnitChannelInfo(unit)
  110.             self.channelingTicks = channelingTicks[spell] or 0
  111.             cast.setBarTicks(self, self.channelingTicks)
  112.         end
  113.     elseif (unit == "target" or unit == "focus") and not self.interrupt then
  114.         self:SetStatusBarColor(interruptcb[1],interruptcb[2],interruptcb[3],1)
  115.     else
  116.         self:SetStatusBarColor(pcolor[1], pcolor[2], pcolor[3],1)
  117.     end
  118. end
  119.  
  120. cast.PostCastStop = function(self, unit, name, rank, castid)
  121.     if not self.fadeOut then
  122.         self:SetStatusBarColor(unpack(self.CompleteColor))
  123.         self.fadeOut = true
  124.     end
  125.     self:SetValue(self.max)
  126.     self:Show()
  127. end
  128.  
  129. cast.PostChannelStop = function(self, unit, name, rank)
  130.     self.fadeOut = true
  131.     self:SetValue(0)
  132.     self:Show()
  133. end
  134.  
  135. cast.PostCastFailed = function(self, event, unit, name, rank, castid)
  136.     self:SetStatusBarColor(unpack(self.FailColor))
  137.     self:SetValue(self.max)
  138.     if not self.fadeOut then
  139.         self.fadeOut = true
  140.     end
  141.     self:Show()
  142. end
  143.   --hand the lib to the namespace for further usage
  144.   ns.cast = cast


I have yet to play with the width of the buffs but thanks for pointing me in the right direction.
  Reply With Quote
03-21-12, 11:19 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You need to comment out the parts of the code that try to manipulate the elements you already prevented from being created:

Line 69:
Code:
self.Lag:SetFormattedText("%d ms", self.SafeZone.timeDiff * 1000)
Lines 101-105:
Code:
        local sf = self.SafeZone
        sf.timeDiff = GetTime() - sf.sendTime
        sf.timeDiff = sf.timeDiff > self.max and self.max or sf.timeDiff
        sf:SetWidth(self:GetWidth() * sf.timeDiff / self.max)
        sf:Show()
There may be others; you should be able to find them pretty quickly for any sections of code that either check for the "player" unit or attempt to do anything with the Lag and/or SafeZone members.
  Reply With Quote
03-22-12, 07:46 AM   #5
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Thanks for taking the time to look at this stuff.

*EDITED OUT BECAUSE ISSUE IS FIXED*

Lines 90 and 91 also contain SafeZone text but, I'm not entirely sure whether I should be commenting out just 90 and 91 or 89 - 92. However, commenting out 89 - 92 seem to produce no change.

Here is my updated castbar.lua w/o 89 - 92 commented out:


lua Code:
  1. local addon, ns = ...
  2.   local cfg = ns.cfg
  3.   local cast = CreateFrame("Frame")  
  4.  
  5.   -----------------------------
  6.   -- FUNCTIONS
  7.   -----------------------------
  8.   -- special thanks to Allez for coming up with this solution
  9. local channelingTicks = {
  10.     -- warlock
  11.     [GetSpellInfo(1120)] = 5, -- drain soul
  12.     [GetSpellInfo(689)] = 5, -- drain life
  13.     [GetSpellInfo(5740)] = 4, -- rain of fire
  14.     [GetSpellInfo(79268)] = 4, -- soul harvest
  15.     -- druid
  16.     [GetSpellInfo(740)] = 4, -- Tranquility
  17.     [GetSpellInfo(16914)] = 10, -- Hurricane
  18.     -- priest
  19.     [GetSpellInfo(15407)] = 3, -- mind flay
  20.     [GetSpellInfo(48045)] = 5, -- mind sear
  21.     [GetSpellInfo(47540)] = 2, -- penance
  22.     -- mage
  23.     [GetSpellInfo(5143)] = 5, -- arcane missiles
  24.     [GetSpellInfo(10)] = 5, -- blizzard
  25.     [GetSpellInfo(12051)] = 4, -- evocation
  26.     -- shaman
  27.     [GetSpellInfo(61882)] = 8 -- earthquake
  28. }
  29.  
  30. local ticks = {}
  31.  
  32. cast.setBarTicks = function(castBar, ticknum)
  33.     if ticknum and ticknum > 0 then
  34.         local delta = castBar:GetWidth() / ticknum
  35.         for k = 1, ticknum do
  36.             if not ticks[k] then
  37.                 ticks[k] = castBar:CreateTexture(nil, 'OVERLAY')
  38.                 ticks[k]:SetTexture(cfg.statusbar_texture)
  39.                 ticks[k]:SetVertexColor(0, 0, 0)
  40.                 ticks[k]:SetWidth(1)
  41.                 ticks[k]:SetHeight(castBar:GetHeight())
  42.             end
  43.             ticks[k]:ClearAllPoints()
  44.             ticks[k]:SetPoint("CENTER", castBar, "LEFT", delta * k, 0 )
  45.             ticks[k]:Show()
  46.         end
  47.     else
  48.         for k, v in pairs(ticks) do
  49.             v:Hide()
  50.         end
  51.     end
  52. end
  53.  
  54. cast.OnCastbarUpdate = function(self, elapsed)
  55.     local currentTime = GetTime()
  56.     if self.casting or self.channeling then
  57.         local parent = self:GetParent()
  58.         local duration = self.casting and self.duration + elapsed or self.duration - elapsed
  59.         if (self.casting and duration >= self.max) or (self.channeling and duration <= 0) then
  60.             self.casting = nil
  61.             self.channeling = nil
  62.             return
  63.         end
  64.         if parent.unit == 'player' then
  65.             if self.delay ~= 0 then
  66.                 self.Time:SetFormattedText('%.1f / |cffff0000%.1f|r', duration, self.casting and self.max + self.delay or self.max - self.delay)
  67.             else
  68.                 self.Time:SetFormattedText('%.1f / %.1f', duration, self.max)
  69.                 --self.Lag:SetFormattedText("%d ms", self.SafeZone.timeDiff * 1000)
  70.             end
  71.         else
  72.             self.Time:SetFormattedText('%.1f / %.1f', duration, self.casting and self.max + self.delay or self.max - self.delay)
  73.         end
  74.         self.duration = duration
  75.         self:SetValue(duration)
  76.         self.Spark:SetPoint('CENTER', self, 'LEFT', (duration / self.max) * self:GetWidth(), 0)
  77.     else
  78.         self.Spark:Hide()
  79.         local alpha = self:GetAlpha() - 0.02
  80.         if alpha > 0 then
  81.             self:SetAlpha(alpha)
  82.         else
  83.             self.fadeOut = nil
  84.             self:Hide()
  85.         end
  86.     end
  87. end
  88.  
  89. cast.OnCastSent = function(self, event, unit, spell, rank)
  90.     if self.unit ~= unit or not self.Castbar.SafeZone then return end
  91.     self.Castbar.SafeZone.sendTime = GetTime()
  92. end
  93.  
  94. cast.PostCastStart = function(self, unit, name, rank, text)
  95.     local pcolor = {255/255, 128/255, 128/255}
  96.     local interruptcb = {95/255, 182/255, 255/255}
  97.     self:SetAlpha(1.0)
  98.     self.Spark:Show()
  99.     self:SetStatusBarColor(unpack(self.casting and self.CastingColor or self.ChannelingColor))
  100.     if unit == "player"then
  101.         --local sf = self.SafeZone
  102.         --sf.timeDiff = GetTime() - sf.sendTime
  103.         --sf.timeDiff = sf.timeDiff > self.max and self.max or sf.timeDiff
  104.         --sf:SetWidth(self:GetWidth() * sf.timeDiff / self.max)
  105.         --sf:Show()
  106.         if self.casting then
  107.             cast.setBarTicks(self, 0)
  108.         else
  109.             local spell = UnitChannelInfo(unit)
  110.             self.channelingTicks = channelingTicks[spell] or 0
  111.             cast.setBarTicks(self, self.channelingTicks)
  112.         end
  113.     elseif (unit == "target" or unit == "focus") and not self.interrupt then
  114.         self:SetStatusBarColor(interruptcb[1],interruptcb[2],interruptcb[3],1)
  115.     else
  116.         self:SetStatusBarColor(pcolor[1], pcolor[2], pcolor[3],1)
  117.     end
  118. end
  119.  
  120. cast.PostCastStop = function(self, unit, name, rank, castid)
  121.     if not self.fadeOut then
  122.         self:SetStatusBarColor(unpack(self.CompleteColor))
  123.         self.fadeOut = true
  124.     end
  125.     self:SetValue(self.max)
  126.     self:Show()
  127. end
  128.  
  129. cast.PostChannelStop = function(self, unit, name, rank)
  130.     self.fadeOut = true
  131.     self:SetValue(0)
  132.     self:Show()
  133. end
  134.  
  135. cast.PostCastFailed = function(self, event, unit, name, rank, castid)
  136.     self:SetStatusBarColor(unpack(self.FailColor))
  137.     self:SetValue(self.max)
  138.     if not self.fadeOut then
  139.         self.fadeOut = true
  140.     end
  141.     self:Show()
  142. end
  143.   --hand the lib to the namespace for further usage
  144.   ns.cast = cast


EDIT: I'm sorry, I did mess up the above and all is currently well. Thank you once again. My question still stands about lines 89 - 92 -- Should something on them be commented out as I do not currently see a visual difference but, those lines contain SafeZone text and I'm just trying to cover any future cast bar issues.

Last edited by MiRai : 03-22-12 at 08:37 AM.
  Reply With Quote
03-22-12, 03:43 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You don't need to comment those lines out, because they check to see if the SafeZone sub-element exists before trying to manipulate it.

If you are obsessively concerned about shaving off a CPU cycle or two, you could comment out the calls to the whole OnCastSent function from the player frame, but realistically speaking you would not see any difference, so I wouldn't bother.
  Reply With Quote
03-22-12, 06:37 PM   #7
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Originally Posted by Phanx View Post
You don't need to comment those lines out, because they check to see if the SafeZone sub-element exists before trying to manipulate it.

If you are obsessively concerned about shaving off a CPU cycle or two, you could comment out the calls to the whole OnCastSent function from the player frame, but realistically speaking you would not see any difference, so I wouldn't bother.
No, that's fine. Thank you again for all the help.
  Reply With Quote
03-23-12, 02:29 PM   #8
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
A few new questions that I have come up with. I've been playing with the code a lot today and have made some progress (yay me) but, some things are completely evading me. I've also updated the original post to reflect that there are new questions down here in this post.

Now, what I would like is for the Target's frame to look more like the Target of Target's frame (w/o class coloring the health percentage). This would mean removing the power and current/total health numbers. However, there are times that I would like to actually see the current health and power on mouse over (if possible). So, here are my questions:

How do I go about adjusting the Target frame to only show the unit's current health instead of current/total (when injured)?

How do I go about making the Target's current health text only show on mouse over?

How do I go about hiding the Target's power text and only make it show on mouse over?


Here are pastebin links to my Lua files since they are slightly different than the default:

core.lua
lib.lua
tags.lua

Also, here is a reference screenshot:




Also, is it at all possible to make the battleground countdown-to-start timer look like the Mirror Castbar of oUF_Fail?





Thanks again to everyone who has assisted me with my oUF questions so far.
  Reply With Quote
04-05-12, 04:35 AM   #9
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
I would also be interested in some info on how to style the battleground countdown-to-start timer, does someone have a hint?
  Reply With Quote
04-05-12, 07:27 AM   #10
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
I was actually laying low after the helpful people around here tore into that other guy. I did eventually figure how to manipulate the visibility of both the health and mana values per bar in the tags.lua file and my oUF_Fail is looking great.

Originally Posted by Irongunner View Post
I would also be interested in some info on how to style the battleground countdown-to-start timer, does someone have a hint?
I was just about to bump this as well asking for what I should be looking at in order to make that change because the only Lua I see about the mirror castbar is this:

lua Code:
  1. -- mirror castbar!
  2.   lib.gen_mirrorcb = function(f)
  3.     for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3',}) do  
  4.       for i, region in pairs({_G[bar]:GetRegions()}) do
  5.         if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  6.           region:Hide()
  7.         end
  8.       end
  9.       _G[bar..'Border']:Hide()
  10.       _G[bar]:SetParent(UIParent)
  11.       _G[bar]:SetScale(1)
  12.       _G[bar]:SetHeight(16)
  13.       _G[bar]:SetWidth(280)
  14.       _G[bar]:SetBackdropColor(.1,.1,.1)
  15.       _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  16.       _G[bar..'Background']:SetTexture(cfg.statusbar_texture)
  17.       _G[bar..'Background']:SetAllPoints(bar)
  18.       _G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
  19.       _G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
  20.       _G[bar..'Text']:ClearAllPoints()
  21.       _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
  22.       _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  23.       --glowing borders
  24.       local h = CreateFrame("Frame", nil, _G[bar])
  25.       h:SetFrameLevel(0)
  26.       h:SetPoint("TOPLEFT",-5,5)
  27.       h:SetPoint("BOTTOMRIGHT",5,-5)
  28.       lib.gen_backdrop(h)
  29.     end
  30.   end

I'm not even sure I'm going about this the correct why by calling it a mirror castbar. I believe /framestack is calling the frame "TimerTrackerTimer1" and "TimerTrackerTimer1StatusBar". Can I just make it look something like this?

lua Code:
  1. -- mirror castbar!
  2.   lib.gen_mirrorcb = function(f)
  3.     If for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3',}) do  
  4.          for i, region in pairs({_G[bar]:GetRegions()}) do
  5.            if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  6.              region:Hide()
  7.            end
  8.          end
  9.          _G[bar..'Border']:Hide()
  10.          _G[bar]:SetParent(UIParent)
  11.          _G[bar]:SetScale(1)
  12.          _G[bar]:SetHeight(16)
  13.          _G[bar]:SetWidth(280)
  14.          _G[bar]:SetBackdropColor(.1,.1,.1)
  15.          _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  16.          _G[bar..'Background']:SetTexture(cfg.statusbar_texture)
  17.          _G[bar..'Background']:SetAllPoints(bar)
  18.          _G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
  19.          _G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
  20.          _G[bar..'Text']:ClearAllPoints()
  21.          _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
  22.          _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  23.          --glowing borders
  24.          local h = CreateFrame("Frame", nil, _G[bar])
  25.          h:SetFrameLevel(0)
  26.          h:SetPoint("TOPLEFT",-5,5)
  27.          h:SetPoint("BOTTOMRIGHT",5,-5)
  28.          lib.gen_backdrop(h)
  29.        end
  30.     else for _, bar in pairs({'TimerTrackerTimer1','TimerTrackerTimer2','TimerTrackerTimer3',}) do  
  31.          for i, region in pairs({_G[bar]:GetRegions()}) do
  32.            if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  33.              region:Hide()
  34.            end
  35.          end
  36.          _G[bar..'Border']:Hide()
  37.          _G[bar]:SetParent(UIParent)
  38.          _G[bar]:SetScale(1)
  39.          _G[bar]:SetHeight(16)
  40.          _G[bar]:SetWidth(280)
  41.          _G[bar]:SetBackdropColor(.1,.1,.1)
  42.          _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  43.          _G[bar..'Background']:SetTexture(cfg.statusbar_texture)
  44.          _G[bar..'Background']:SetAllPoints(bar)
  45.          _G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
  46.          _G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
  47.          _G[bar..'Text']:ClearAllPoints()
  48.          _G[bar..'Text']:SetPoint('CENTER', TimerTrackerTimer1StatusBar, 0, 1)
  49.          _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  50.          --glowing borders
  51.          local h = CreateFrame("Frame", nil, _G[bar])
  52.          h:SetFrameLevel(0)
  53.          h:SetPoint("TOPLEFT",-5,5)
  54.          h:SetPoint("BOTTOMRIGHT",5,-5)
  55.          lib.gen_backdrop(h)
  56.        end
  57.   end

Don't laugh too hard I'm sure I'm murdering Lua.
  Reply With Quote
04-05-12, 05:54 PM   #11
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Before asking for help/feedback on your code, your first step should always be to load it in-game, or at least run it through a Lua syntax checker, and attempting to fix the basic syntax errors. In this case, "if for ... end else ... end" is not valid Lua syntax.

If the TimerTrackerN bars have the same structure as the MirrorTimerN bars, then you can just add them to the existing list of bars the "for ... end" loop should iterate over (on line #3):

Lua Code:
  1. -- mirror castbar!
  2.   lib.gen_mirrorcb = function(f)
  3.     for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3','TimerTrackerTimer1','TimerTrackerTimer2','TimerTrackerTimer3'}) do  
  4.       for i, region in pairs({_G[bar]:GetRegions()}) do
  5.         if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  6.           region:Hide()
  7.         end
  8.       end
  9.       _G[bar..'Border']:Hide()
  10.       _G[bar]:SetParent(UIParent)
  11.       _G[bar]:SetScale(1)
  12.       _G[bar]:SetHeight(16)
  13.       _G[bar]:SetWidth(280)
  14.       _G[bar]:SetBackdropColor(.1,.1,.1)
  15.       _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  16.       _G[bar..'Background']:SetTexture(cfg.statusbar_texture)
  17.       _G[bar..'Background']:SetAllPoints(bar)
  18.       _G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
  19.       _G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
  20.       _G[bar..'Text']:ClearAllPoints()
  21.       _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
  22.       _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  23.       --glowing borders
  24.       local h = CreateFrame("Frame", nil, _G[bar])
  25.       h:SetFrameLevel(0)
  26.       h:SetPoint("TOPLEFT",-5,5)
  27.       h:SetPoint("BOTTOMRIGHT",5,-5)
  28.       lib.gen_backdrop(h)
  29.     end
  30.   end
  Reply With Quote
04-06-12, 05:04 PM   #12
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Originally Posted by Phanx View Post
Before asking for help/feedback on your code, your first step should always be to load it in-game, or at least run it through a Lua syntax checker, and attempting to fix the basic syntax errors. In this case, "if for ... end else ... end" is not valid Lua syntax.
I understand. It was more of a half-ass pseudo code then anything else and I wasn't able to actually test anything in game until about 30 minutes ago.



Originally Posted by Phanx View Post
If the TimerTrackerN bars have the same structure as the MirrorTimerN bars, then you can just add them to the existing list of bars the "for ... end" loop should iterate over (on line #3):

Lua Code:
  1. -- mirror castbar!
  2.   lib.gen_mirrorcb = function(f)
  3.     for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3','TimerTrackerTimer1','TimerTrackerTimer2','TimerTrackerTimer3'}) do  
  4.       for i, region in pairs({_G[bar]:GetRegions()}) do
  5.         if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  6.           region:Hide()
  7.         end
  8.       end
  9.       _G[bar..'Border']:Hide()
  10.       _G[bar]:SetParent(UIParent)
  11.       _G[bar]:SetScale(1)
  12.       _G[bar]:SetHeight(16)
  13.       _G[bar]:SetWidth(280)
  14.       _G[bar]:SetBackdropColor(.1,.1,.1)
  15.       _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  16.       _G[bar..'Background']:SetTexture(cfg.statusbar_texture)
  17.       _G[bar..'Background']:SetAllPoints(bar)
  18.       _G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
  19.       _G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
  20.       _G[bar..'Text']:ClearAllPoints()
  21.       _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
  22.       _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  23.       --glowing borders
  24.       local h = CreateFrame("Frame", nil, _G[bar])
  25.       h:SetFrameLevel(0)
  26.       h:SetPoint("TOPLEFT",-5,5)
  27.       h:SetPoint("BOTTOMRIGHT",5,-5)
  28.       lib.gen_backdrop(h)
  29.     end
  30.   end

The above code actually breaks the raid frames (odd?). I tested it a few times typing it out myself and directly copying and pasting it in. Also, I just saw /framestack report up to TimerTrackerTimer5 (only one bar total was actually visible) but, my main concern was on line 21. MirrorTimer uses the MirrorTimerStatusBar but TimerTrackerTimer uses TimerTrackerTimerStatusBar. I am assuming that some modification needs to be done to line 21 and I'll have to try it later tonight. I know you just said it helps to try your own code first but, I won't be able to for several hours and I just wanted to post this in case anyone who might know the answer shows up before I am able to test it out. =)

Here is what I would test:
Lua Code:
  1. _G[bar..'Text']:ClearAllPoints()
  2.            If MirrorTimer1 == true Or MirrorTimer2 == true Or MirrorTimer3 == true Then
  3.                 _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
  4.           Else
  5.                 _G[bar..'Text']:SetPoint('CENTER', TimerTracker1StatusBar, 0, 1)
  6.           End
  7.       _G[bar..'StatusBar']:SetAllPoints(_G[bar])


EDIT: The [highlight] won't accept the first set of spaces on the first line.
  Reply With Quote
04-06-12, 09:47 PM   #13
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
The last post I made didn't work. I also tried to copy the entire chunk of code and rename the MirrorTimer parts to TimerTrackerTimer like so:

Lua Code:
  1. -- timer tracker!
  2.   lib.gen_timertracker = function(f)
  3.     for _, bar in pairs({'TimerTrackerTimer1','TimerTrackerTimer2','TimerTrackerTimer3','TimerTrackerTimer4','TimerTrackerTimer5'}) do
  4.       for i, region in pairs({_G[bar]:GetRegions()}) do
  5.         if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  6.           region:Hide()
  7.         end
  8.       end
  9.       _G[bar..'Border']:Hide()
  10.       _G[bar]:SetParent(UIParent)
  11.       _G[bar]:SetScale(1)
  12.       _G[bar]:SetHeight(16)
  13.       _G[bar]:SetWidth(280)
  14.       _G[bar]:SetBackdropColor(.1,.1,.1)
  15.       _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  16.       _G[bar..'Background']:SetTexture(cfg.statusbar_texture)
  17.       _G[bar..'Background']:SetAllPoints(bar)
  18.       _G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
  19.       _G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
  20.       _G[bar..'Text']:ClearAllPoints()
  21.       _G[bar..'Text']:SetPoint('CENTER', TimerTrackerTimer1StatusBar, 0, 1)
  22.       _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  23.       --glowing borders
  24.       local h = CreateFrame("Frame", nil, _G[bar])
  25.       h:SetFrameLevel(0)
  26.       h:SetPoint("TOPLEFT",-5,5)
  27.       h:SetPoint("BOTTOMRIGHT",5,-5)
  28.       lib.gen_backdrop(h)
  29.     end
  30.   end

And then add lib.gen_timertracker(self) right next to where lib.gen_mirrorcb(self) is in core.lua. That didn't work either and broke the target and targettarget frame of oUF_Fail. I recruited someone in an IRC channel who knows ~20% more Lua than I do (not much) and he couldn't figure it out either. He did point me towards a section of Skinner which skins the mirror castbar and battleground countdown timer like so:

Lua Code:
  1. function aObj:MirrorTimers()
  2.     if not self.db.profile.MirrorTimers.skin or self.initialized.MirrorTimers then return end
  3.     self.initialized.MirrorTimers = true
  4.  
  5.     self:add2Table(self.uiKeys2, "MirrorTimers")
  6.  
  7.     local objBG, objSB
  8.     for i = 1, MIRRORTIMER_NUMTIMERS do
  9.         objName = "MirrorTimer"..i
  10.         obj = _G[objName]
  11.         objBG = self:getRegion(obj, 1)
  12.         objSB = _G[objName.."StatusBar"]
  13.         self:removeRegions(obj, {3})
  14.         obj:SetHeight(obj:GetHeight() * 1.25)
  15.         self:moveObject{obj=_G[objName.."Text"], y=-2}
  16.         objBG:SetWidth(objBG:GetWidth() * 0.75)
  17.         objSB:SetWidth(objSB:GetWidth() * 0.75)
  18.         if self.db.profile.MirrorTimers.glaze then
  19.             self:glazeStatusBar(objSB, 0, objBG)
  20.         end
  21.     end
  22.  
  23.     -- Battleground/Arena Start Timer (4.1)
  24.     local function skinTT(tT)
  25.  
  26.         -- aObj:Debug("skinTT: [%s, %s]", tT, #tT.timerList)
  27.         for _, timer in pairs(tT.timerList) do
  28.             -- aObj:Debug("skinTT#2: [%s]", timer)
  29.             if not aObj.sbGlazed[timer.bar] then
  30.                 local bg = aObj:getRegion(timer.bar, 1)
  31.                 _G[timer.bar:GetName().."Border"]:SetTexture(nil) -- animations
  32.                 aObj:glazeStatusBar(timer.bar, 0, bg)
  33.                 aObj:moveObject{obj=bg, y=2} -- align bars
  34.             end
  35.         end
  36.  
  37.     end
  38.     self:SecureHookScript(TimerTracker, "OnEvent", function(this, event, ...)
  39.         -- self:Debug("TT_OE: [%s, %s]", this, event)
  40.         if event == "START_TIMER" then
  41.             skinTT(this)
  42.         end
  43.     end)
  44.     -- skin existing timers
  45.     skinTT(TimerTracker)
  46.  
  47. end

Looking at that I'm really not sure where to go from there.
  Reply With Quote
04-06-12, 09:58 PM   #14
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
1. If anything is "breaking", then there is almost certainly a Lua error occuring. Install the addon BugSack to see the error(s), and then post it/them here.

2. The original code should be mis-anchoring the bar text (the line #21 issue you pointed out).

Try this:
Lua Code:
  1. -- mirror castbar!
  2. lib.gen_mirrorcb = function(f)
  3.     for _, barName in pairs({
  4.         "MirrorTimer1",
  5.         "MirrorTimer2",
  6.         "MirrorTimer3",
  7.         "TimerTrackerTimer1",
  8.         "TimerTrackerTimer2",
  9.         "TimerTrackerTimer3",
  10.         "TimerTrackerTimer4",
  11.         "TimerTrackerTimer5",
  12.     }) do
  13.         local bar = _G[barName]
  14.         bar:SetParent(UIParent)
  15.         bar:SetScale(1)
  16.         bar:SetHeight(16)
  17.         bar:SetWidth(280)
  18.         bar:SetBackdropColor(0.1, 0.1, 0.1)
  19.  
  20.         for _, region in pairs({ bar:GetRegions() }) do
  21.             if region.GetTexture and region:GetTexture() == "SolidTexture" then
  22.                 region:Hide()
  23.             end
  24.         end
  25.  
  26.         local border = _G[barName.."Border"]
  27.         border:Hide()
  28.  
  29.         local background = bar:CreateTexture(barName.."Background", "BACKGROUND")
  30.         background:SetTexture(cfg.statusbar_texture)
  31.         background:SetAllPoints(bar)
  32.         background:SetVertexColor(.15,.15,.15,.75)
  33.  
  34.         local statusbar = _G[barName.."StatusBar"]
  35.         statusbar:SetAllPoints(bar)
  36.  
  37.         local text = _G[barName.."Text"]
  38.         text:SetFont(cfg.font, 14, "THINOUTLINE")
  39.         text:ClearAllPoints()
  40.         text:SetPoint("CENTER", statusbar, 0, 1)
  41.  
  42.         local glow = CreateFrame("Frame", nil, bar)
  43.         glow:SetFrameLevel(0)
  44.         glow:SetPoint("TOPLEFT", -5, 5)
  45.         glow:SetPoint("BOTTOMRIGHT", 5, -5)
  46.         lib.gen_backdrop(glow)
  47.     end
  48. end
In addition to fixing #2, I also rewrote it a bit to improve readability and reduce the number of slow and hard-to-read global lookups.

If it does not work as expected, see #1.
  Reply With Quote
04-06-12, 10:36 PM   #15
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Sorry Phanx, you were right... my Lua errors were turned off in the game options. After turning them back on this is the error I get:

Code:
Message: Interface\AddOns\oUF_Fail\lib.lua:613: attempt to index local 'bar' (a nil value)
Time: 04/06/12 23:18:25
Count: 1
Stack: Interface\AddOns\oUF_Fail\lib.lua:613: in function `gen_mirrorcb'
Interface\AddOns\oUF_Fail\core.lua:162: in function <Interface\AddOns\oUF_Fail\core.lua:130>
(tail call): ?
Interface\AddOns\oUF\ouf.lua:271: in function <Interface\AddOns\oUF\ouf.lua:201>
(tail call): ?
Interface\AddOns\oUF\ouf.lua:560: in function `Spawn'
Interface\AddOns\oUF_Fail\core.lua:510: in function `func'
Interface\AddOns\oUF\factory.lua:17: in function <Interface\AddOns\oUF\factory.lua:13>
(tail call): ?

Locals: f = oUF_failTarget {
 0 = <userdata>
 Highlight = <unnamed> {
 }
 Power = <unnamed> {
 }
 __tags = <table> {
 }
 PLAYER_ENTERING_WORLD = <function> defined @Interface\AddOns\oUF\ouf.lua:144
 mystyle = "target"
 unit = "target"
 menu = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:79
 Castbar = oUF_failCastbartarget {
 }
 Health = <unnamed> {
 }
 RaidIcon = <unnamed> {
 }
 __elements = <table> {
 }
 style = "fail"
}
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
 1 = "MirrorTimer1"
 2 = "MirrorTimer2"
 3 = "MirrorTimer3"
 4 = "TimerTrackerTimer1"
 5 = "TimerTrackerTimer2"
 6 = "TimerTrackerTimer3"
 7 = "TimerTrackerTimer4"
 8 = "TimerTrackerTimer5"
}
(for control) = 4
_ = 4
barName = "TimerTrackerTimer1"
bar = nil
(*temporary) = "TimerTrackerTimer1"
(*temporary) = nil
(*temporary) = MirrorTimer3StatusBar {
 0 = <userdata>
}
(*temporary) = MirrorTimer3Text {
 0 = <userdata>
}
(*temporary) = <unnamed> {
 0 = <userdata>
}
(*temporary) = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:60
(*temporary) = <unnamed> {
 0 = <userdata>
}
(*temporary) = <function> defined =[C]:-1
(*temporary) = <unnamed> {
 0 = <userdata>
}
(*temporary) = 0
(*temporary) = "attempt to index local 'bar' (a nil value)"
cfg = <unnamed> {
 0 = <userdata>
 TargetX = 0
 showTargetBuffs = true
 showLFDIcons = true
 PlayerRelativePoint = "CENTER"
 TotX = 10
 FocusX = -64
 TargetRelativePoint = "CENTER"
 ShowIncHeals = true
 PartyX = -242
 showRunebar = true
 PlayerX = -238
 showpet = true
 buffsOnlyShowPlayer = false
 RCheckIcon = true
 ShowParty = true
 party_leader_icon = true
 font = "Interface\AddOns\oUF_Fail\media\Neuropol.ttf"
 PlayerY = -200
 healthbarfontsize = 36
 smallfont = "Interface\AddOns\oUF_Fail\media\Emblem.ttf"
 showShardbar = true
 showEclipsebar = true
 TotY = 6
 ShowPlayerName = false
 FocusY = 390
 showtot = true
 showAuraWatch = true
 scale = 1
 highlight_texture = "Interface\AddOns\oUF_Fail\media\raidbg"
 backdrop_texture = "Interface\AddOns\oUF_Fail\media\backdrop"
 enableDebuffHighlight = true
 debuffhighlight_texture = "Interface\AddOns\oUF_Fail\media\debuff_highlight"
 statusbar_texture = "Interface\AddOns\oUF_Fail\media\healthbar"
 showfocustarget = true
 FocusRelativePoint = "TOPRIGHT"
 ShowRaid = true
 Castbars = true
 showVengeance = true
 TargetY = -152
 TotRelativePoint = "TOPRIGHT"
 showTotemBar = true
 spark = "Interface\AddOns\oUF_Fail\media\spark"
 showHolybar = true
 RaidX = -200
 backdrop_edge_texture = "Interface\AddOns\oUF_Fail\media\backdrop_edge"
 raidScale = 1
 showPlayerAuras = false
 showRaidDebuffs = true
 debuffsOnlyShowPlayer = false
 powerbar_texture = "Interface\AddOns\oUF_Fail\media\powerbar"
 debuffBorder = "Interface\AddOns\oUF_Fail\media\iconborder"
 showfocus = true
 PartyY = -50
 RaidY = -520
 showTargetDebuffs = true
}
lib = <unnamed> {
 0 = <userdata>
 gen_totemback = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:72
 ReadyCheck = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:1038
 createBuffs = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:771
 CreateThreatBorder = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:410
 addQuestIcon = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:345
 RogueComboPoints = <function> defined @Interface\AddOns\oUF_Fail\lib.lua:1145
 UpdateThreat = <function> defined @Interface\AddOns\oUF_Fail\

Line 613 in my lib.lua file is line 13 in your chunk of code. If Bugsack prints out Lua errors with better information than the default UI I can get it for you tomorrow after I wake up but, I'm off for the night (it's way past my normal bedtime). Thank you for all the help you've given me so far.
  Reply With Quote
04-07-12, 12:17 AM   #16
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I'm assuming you are talking about my most recent code and that you omitted the comment on line #1, so your line #13 is my line #14, in which case that error is occuring because no frame named "TimerTrackerTimer1" exists at the time the code is running.

Double-check the frame name. If it is not actually "TimerTrackerTimerN" then simply correcting the names in the list should resolve the issue. If the name is correct, then it must not be created yet at login, so you would need to either (a) more extensively modify the layout to detect when the timer bars are created, and skin them at that time, or (b) figure out which Blizzard_* addon creates the timer bars and force it to load at login.
  Reply With Quote
04-07-12, 10:52 AM   #17
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Originally Posted by Phanx View Post
I'm assuming you are talking about my most recent code and that you omitted the comment on line #1, so your line #13 is my line #14, in which case that error is occuring because no frame named "TimerTrackerTimer1" exists at the time the code is running.

Double-check the frame name. If it is not actually "TimerTrackerTimerN" then simply correcting the names in the list should resolve the issue.
Upon logging in there is no TimerTrackerTimer present (I do not see the hidden frame with /fstack) until you join a battleground and the timer actually appears. After the BG is over and you are ported back to your original location, the frame is still there (but hidden) until after a /reload of the UI.

I also jumped into a BG to test out the new code because the frame isn't present until you join one but, alas, the same error was given and again all oUF frames seem to be broken except the Player frame (target, targettarget, and raidframes all revert to Blizzard default).

To make sure I'm actually providing the correct info I took a screenshot of two /framestacks in two different battlegrounds while hovering over the timer area.




While the StatusBar portion isn't present in the bottom tooltip, it was there if I moved my mouse just slightly.

Originally Posted by Phanx View Post
If the name is correct, then it must not be created yet at login, so you would need to either (a) more extensively modify the layout to detect when the timer bars are created, and skin them at that time, or (b) figure out which Blizzard_* addon creates the timer bars and force it to load at login.
As much as I would like to be able to try both of your suggestions, they sound like they're really out of my reach with the little Lua knowledge I have at the moment. I've learned a lot (although so little overall) from tinkering with oUF and I'm very content with the modifications I've made to this layout so far (as small as they might be). It's just slightly annoying that this one timer that uses the default Blizzard frame feels out of place from the rest of my UI.

I'm going to head over to the Blizzard Macro & UI forum and throw this their way to see if someone knows something more about these infamous TimerTrackerTimer bars. I thank you for your time and effort Phanx and I feel bad that you're the only one assisting me with this (not that I'm entitled to any assistance at all ).
  Reply With Quote
04-07-12, 12:56 PM   #18
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Looking at the 4.3.3.15354 files from go-hero.net, I found that Timer.lua and Timer.xml both hold the term TimerTracker in them.

I've also made a post on the WoW Macro & UI forums to see what feedback I would get from there.

http://us.battle.net/wow/en/forum/topic/4362521168

Timer.lua
lua Code:
  1. TIMER_MINUTES_DISPLAY = "%d:%02d"
  2.  
  3. TIMER_MEDIUM_MARKER = 11;
  4. TIMER_LARGE_MARKER = 6;
  5. TIMER_UPDATE_INTERVAL = 10;
  6.  
  7. TIMER_NUMBERS_SETS = {};
  8. TIMER_NUMBERS_SETS["BigGold"]  = {  texture = "Interface\\Timer\\BigTimerNumbers",
  9.                                     w=256, h=170, texW=1024, texH=512,
  10.                                     numberHalfWidths = {
  11.                                         --0,   1,   2,   3,   4,   5,   6,   7,   8,   9,
  12.                                         35/128, 14/128, 33/128, 32/128, 36/128, 32/128, 33/128, 29/128, 31/128, 31/128,
  13.                                     }
  14.                                 }
  15.  
  16.  
  17. function TimerTracker_OnLoad(self)
  18.     self.timerList = {};
  19.     self:RegisterEvent("START_TIMER");
  20.     self:RegisterEvent("PLAYER_ENTERING_WORLD");
  21. end
  22.  
  23.  
  24. function StartTimer_OnShow(self)
  25.     self.time = self.endTime - GetTime();
  26.     if self.time <= 0 then
  27.         self:Hide();
  28.         self.isFree = true;
  29.     elseif self.startNumbers:IsPlaying() then
  30.         self.startNumbers:Stop();
  31.         self.startNumbers:Play();
  32.     end
  33. end
  34.  
  35. function GetPlayerFactionGroup()
  36.     local factionGroup = UnitFactionGroup("player");
  37.     -- this might be a rated BG or wargame and if so the player's faction might be altered
  38.     if ( not IsActiveBattlefieldArena() ) then
  39.         factionGroup = PLAYER_FACTION_GROUP[GetBattlefieldArenaFaction()];
  40.     end
  41.    
  42.     return factionGroup
  43. end
  44.  
  45. function TimerTracker_OnEvent(self, event, ...)
  46.    
  47.     if event == "START_TIMER" then
  48.         local timerType, timeSeconds, totalTime  = ...;
  49.         local timer;
  50.         local numTimers = 0;
  51.         local isTimerRuning = false;
  52.        
  53.         for a,b in pairs(self.timerList) do
  54.             if b.type == timerType and not b.isFree then
  55.                 timer = b;
  56.                 isTimerRuning = true;
  57.                 break;
  58.             end
  59.         end
  60.  
  61.         if isTimerRuning then
  62.             -- don't interupt the final count down
  63.             if not timer.startNumbers:IsPlaying() then
  64.                 timer.time = timeSeconds;
  65.             end
  66.            
  67.             local factionGroup = GetPlayerFactionGroup();
  68.  
  69.             if ( not timer.factionGroup or (timer.factionGroup ~= factionGroup) ) then
  70.                 timer.faction:SetTexture("Interface\\Timer\\"..factionGroup.."-Logo");
  71.                 timer.factionGlow:SetTexture("Interface\\Timer\\"..factionGroup.."Glow-Logo");
  72.                 timer.factionGroup = factionGroup;
  73.             end
  74.         else
  75.             for a,b in pairs(self.timerList) do
  76.                 if not timer and b.isFree then
  77.                     timer = b;
  78.                 else
  79.                     numTimers = numTimers + 1;
  80.                 end
  81.             end
  82.            
  83.            
  84.             if not timer then
  85.                 timer = CreateFrame("FRAME", self:GetName().."Timer"..(#self.timerList+1), UIParent, "StartTimerBar");
  86.                 self.timerList[#self.timerList+1] = timer;
  87.             end
  88.            
  89.            
  90.             timer:ClearAllPoints();
  91.             timer:SetPoint("TOP", 0, -155 - (24*numTimers));
  92.            
  93.             timer.isFree = false;
  94.             timer.type = timerType;
  95.             timer.time = timeSeconds;
  96.             timer.endTime = GetTime() + timeSeconds;
  97.             timer.bar:SetMinMaxValues(0, totalTime);
  98.             timer.style = TIMER_NUMBERS_SETS["BigGold"];
  99.            
  100.             timer.digit1:SetTexture(timer.style.texture);
  101.             timer.digit2:SetTexture(timer.style.texture);
  102.             timer.digit1:SetSize(timer.style.w/2, timer.style.h/2);
  103.             timer.digit2:SetSize(timer.style.w/2, timer.style.h/2);
  104.             --This is to compensate texture size not affecting GetWidth() right away.
  105.             timer.digit1.width, timer.digit2.width = timer.style.w/2, timer.style.w/2;
  106.            
  107.             timer.digit1.glow = timer.glow1;
  108.             timer.digit2.glow = timer.glow2;
  109.             timer.glow1:SetTexture(timer.style.texture.."Glow");
  110.             timer.glow2:SetTexture(timer.style.texture.."Glow");
  111.            
  112.             local factionGroup = GetPlayerFactionGroup();
  113.             if ( factionGroup ) then
  114.                 timer.faction:SetTexture("Interface\\Timer\\"..factionGroup.."-Logo");
  115.                 timer.factionGlow:SetTexture("Interface\\Timer\\"..factionGroup.."Glow-Logo");
  116.             end
  117.             timer.factionGroup = factionGroup;
  118.             timer.updateTime = TIMER_UPDATE_INTERVAL;
  119.             timer:SetScript("OnUpdate", StartTimer_BigNumberOnUpdate);
  120.             timer:Show();
  121.         end
  122.     elseif event == "PLAYER_ENTERING_WORLD" then
  123.         for a,timer in pairs(self.timerList) do
  124.             timer.time = nil;
  125.             timer.type = nil;
  126.             timer.isFree = nil;
  127.             timer:SetScript("OnUpdate", nil);
  128.             timer.fadeBarOut:Stop();
  129.             timer.fadeBarIn:Stop();
  130.             timer.startNumbers:Stop();
  131.             timer.factionAnim:Stop();
  132.             timer.bar:SetAlpha(0);
  133.         end
  134.     end
  135. end
  136.  
  137.  
  138. function StartTimer_BigNumberOnUpdate(self, elasped)
  139.     self.time = self.endTime - GetTime();
  140.     self.updateTime = self.updateTime - elasped;
  141.     local minutes, seconds = floor(self.time/60), floor(mod(self.time, 60));
  142.  
  143.    
  144.     if self.time < TIMER_MEDIUM_MARKER then
  145.         self.fadeBarOut:Play();
  146.         self.barShowing = false;
  147.         self.anchorCenter = false;
  148.         self:SetScript("OnUpdate", nil);
  149.     elseif not self.barShowing then
  150.         self.fadeBarIn:Play();
  151.         self.barShowing = true;
  152.     elseif self.updateTime <= 0 then
  153.         ValidateTimer(self.type);
  154.         self.updateTime = TIMER_UPDATE_INTERVAL;
  155.     end
  156.  
  157.     self.bar:SetValue(self.time);
  158.     self.bar.timeText:SetText(string.format(TIMER_MINUTES_DISPLAY, minutes, seconds));
  159. end
  160.  
  161.  
  162. function StartTimer_BarOnlyOnUpdate(self, elasped)
  163.     self.time = self.endTime - GetTime();
  164.     local minutes, seconds = floor(self.time/60), mod(self.time, 60);
  165.  
  166.     self.bar:SetValue(self.time);
  167.     self.bar.timeText:SetText(string.format(TIMER_MINUTES_DISPLAY, minutes, seconds));
  168.    
  169.     if self.time < 0 then
  170.         self:SetScript("OnUpdate", nil);
  171.         self.barShowing = false;
  172.         self.isFree = true;
  173.         self:Hide();
  174.     end
  175.    
  176.     if not self.barShowing then
  177.         self.fadeBarIn:Play();
  178.         self.barShowing = true;
  179.     end
  180. end
  181.  
  182.  
  183. function StartTimer_SetTexNumbers(self, ...)
  184.     local digits = {...}
  185.     local timeDigits = floor(self.time);
  186.     local digit;
  187.     local style = self.style;
  188.     local i = 1;
  189.    
  190.     local texCoW = style.w/style.texW;
  191.     local texCoH = style.h/style.texH;
  192.     local l,r,t,b;
  193.     local columns = floor(style.texW/style.w);
  194.     local numberOffset = 0;
  195.     local numShown = 0;
  196.    
  197.     while digits[i] do -- THIS WILL DISPLAY SECOND AS A NUMBER 2:34 would be 154
  198.         if timeDigits > 0 then
  199.             digit = mod(timeDigits, 10);
  200.            
  201.             digits[i].hw = style.numberHalfWidths[digit+1]*digits[i].width;
  202.             numberOffset  = numberOffset + digits[i].hw;
  203.            
  204.             l = mod(digit, columns) * texCoW;
  205.             r = l + texCoW;
  206.             t = floor(digit/columns) * texCoH;
  207.             b = t + texCoH;
  208.             digits[i]:SetTexCoord(l,r,t,b);
  209.             digits[i].glow:SetTexCoord(l,r,t,b);
  210.            
  211.             timeDigits = floor(timeDigits/10); 
  212.             numShown = numShown + 1;           
  213.         else
  214.             digits[i]:SetTexCoord(0,0,0,0);
  215.             digits[i].glow:SetTexCoord(0,0,0,0);
  216.         end
  217.         i = i + 1;
  218.     end
  219.    
  220.    
  221.     if numberOffset > 0 then
  222.         PlaySoundKitID(25477, "SFX", false);
  223.         digits[1]:ClearAllPoints();
  224.         if self.anchorCenter then
  225.             digits[1]:SetPoint("CENTER", UIParent, "CENTER", numberOffset - digits[1].hw, 0);
  226.         else
  227.             digits[1]:SetPoint("CENTER", self, "CENTER", numberOffset - digits[1].hw, 0);
  228.         end
  229.        
  230.         for i=2,numShown do
  231.             digits[i]:ClearAllPoints();
  232.             digits[i]:SetPoint("CENTER", digits[i-1], "CENTER", -(digits[i].hw + digits[i-1].hw), 0)
  233.             i = i + 1;
  234.         end
  235.     end
  236. end
  237.  
  238.  
  239.  
  240. function StartTimer_NumberAnimOnFinished(self)
  241.     self.time = self.time - 1;
  242.     if self.time > 0 then
  243.         if self.time < TIMER_LARGE_MARKER then
  244.             if not self.anchorCenter then
  245.                 self.anchorCenter = true;
  246.                 --This is to compensate texture size not affecting GetWidth() right away.
  247.                 self.digit1.width, self.digit2.width = self.style.w, self.style.w;
  248.                 self.digit1:SetSize(self.style.w, self.style.h);
  249.                 self.digit2:SetSize(self.style.w, self.style.h);
  250.             end
  251.         end
  252.    
  253.         self.startNumbers:Play();
  254.     else
  255.         self.isFree = true;
  256.         PlaySoundKitID(25478);
  257.         self.factionAnim:Play();
  258.     end
  259. end


Timer.xml
xml Code:
  1. <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
  2. ..\FrameXML\UI.xsd">
  3.     <Script file="Timer.lua"/>
  4.  
  5.    
  6.     <Frame name="StartTimerBar" virtual="true" hidden="true">
  7.         <Animations>
  8.             <AnimationGroup parentKey="fadeBarIn">
  9.                 <Alpha target="$parentStatusBar" change="1.0" duration="1.9" order="1"/>
  10.                 <Scripts>
  11.                     <OnPlay>
  12.                         local frame = self:GetParent();
  13.                         frame.bar:SetAlpha(0);
  14.                     </OnPlay>
  15.                     <OnFinished>
  16.                         local frame = self:GetParent();
  17.                         frame.bar:SetAlpha(1);
  18.                     </OnFinished>
  19.                 </Scripts>
  20.             </AnimationGroup>
  21.             <AnimationGroup parentKey="fadeBarOut">
  22.                 <Alpha target="$parentStatusBar" change="-1.0" duration="0.9" order="1"/>
  23.                 <Scripts>
  24.                     <OnFinished>
  25.                         local frame = self:GetParent();
  26.                         frame.bar:SetAlpha(0);
  27.                         -- Subtract this animations time
  28.                         frame.time = frame.time - 0.9
  29.                         frame.startNumbers:Play();
  30.                     </OnFinished>
  31.                 </Scripts>
  32.             </AnimationGroup>
  33.            
  34.             <AnimationGroup parentKey="startNumbers">
  35.                 <Scale target="$parentDigit1" scaleX="0.25" scaleY="0.25" duration="0.0" order="1"/>
  36.                 <Scale target="$parentDigit2" scaleX="0.25" scaleY="0.25" duration="0.0" order="1"/>
  37.                 <Scale target="$parentGlow1" scaleX="0.25" scaleY="0.25" duration="0.0" order="1"/>
  38.                 <Scale target="$parentGlow2" scaleX="0.25" scaleY="0.25" duration="0.0" order="1"/>
  39.                 <Alpha target="$parentDigit1" change="1"                duration="0.0" order="1"/>
  40.                 <Alpha target="$parentDigit2" change="1"                duration="0.0" order="1"/>
  41.                 <Alpha target="$parentGlow1" change="1"                 duration="0.0" order="1"/>
  42.                 <Alpha target="$parentGlow2" change="1"                 duration="0.0" order="1"/>
  43.                
  44.                
  45.                 <Scale target="$parentDigit1" scaleX="4" scaleY="4" duration="0.3" smoothing="OUT" order="2"/>
  46.                 <Scale target="$parentDigit2" scaleX="4" scaleY="4" duration="0.3" smoothing="OUT" order="2"/>
  47.                 <Scale target="$parentGlow1" scaleX="4" scaleY="4" duration="0.3" smoothing="OUT" order="2"/>
  48.                 <Scale target="$parentGlow2" scaleX="4" scaleY="4" duration="0.3" smoothing="OUT" order="2"/>
  49.                 <Alpha target="$parentGlow1" change="-1.0"          duration="0.3" smoothing="IN" order="2"/>
  50.                 <Alpha target="$parentGlow2" change="-1.0"          duration="0.3" smoothing="IN" order="2"/>
  51.                
  52.                
  53.                 <Scale target="$parentDigit1" startDelay="0.6" scaleX="1.2" scaleY="1.2"    duration="0.1" order="3"/>
  54.                 <Scale target="$parentDigit2" startDelay="0.6" scaleX="1.2" scaleY="1.2"    duration="0.1" order="3"/>
  55.                 <Alpha target="$parentDigit1" startDelay="0.6" change="-1.0"            duration="0.1" order="3"/>
  56.                 <Alpha target="$parentDigit2" startDelay="0.6" change="-1.0"            duration="0.1" order="3"/>
  57.                 <Scripts>
  58.                     <OnPlay>
  59.                         local frame = self:GetParent();
  60.                         StartTimer_SetTexNumbers(frame, frame.digit1, frame.digit2)
  61.                     </OnPlay>
  62.                     <OnFinished>
  63.                         local frame = self:GetParent();
  64.                         StartTimer_NumberAnimOnFinished(frame)
  65.                     </OnFinished>
  66.                 </Scripts>
  67.             </AnimationGroup>
  68.            
  69.             <AnimationGroup parentKey="factionAnim">
  70.                 <Scale target="$parentFaction"      scaleX="0.25" scaleY="0.25" duration="0.0" order="1"/>
  71.                 <Scale target="$parentFactionGlow"  scaleX="0.25" scaleY="0.25" duration="0.0" order="1"/>
  72.                
  73.                 <Alpha target="$parentFaction"      change="1"                  duration="0.0" order="2"/>
  74.                 <Alpha target="$parentFactionGlow"  change="1"                  duration="0.0" order="2"/>
  75.                
  76.                
  77.                 <Scale target="$parentFaction"      scaleX="4" scaleY="4"   duration="0.4" smoothing="OUT" order="3"/>
  78.                 <Scale target="$parentFactionGlow"  scaleX="4" scaleY="4"   duration="0.4" smoothing="OUT" order="3"/>
  79.                 <Alpha target="$parentFactionGlow"  change="-1.0"           duration="0.4" smoothing="IN" order="3"/>
  80.                
  81.                
  82.                 <Scale target="$parentFaction" startDelay="0.6" scaleX="1.4" scaleY="1.4"   duration="0.2" smoothing="OUT" order="4"/>
  83.                 <Alpha target="$parentFaction" startDelay="0.6" change="-1.0"               duration="0.2" smoothing="OUT" order="4"/>
  84.             </AnimationGroup>
  85.         </Animations>
  86.         <Size x="206" y="26"/>
  87.         <Layers>
  88.             <Layer level="OVERLAY">
  89.                 <Texture name="$parentDigit1" parentKey="digit1" alpha="0"/>
  90.                 <Texture name="$parentDigit2" parentKey="digit2" alpha="0"/>
  91.                 <Texture name="$parentFaction" parentKey="faction" alpha="0">
  92.                     <Size x="256" y="256"/>
  93.                     <Anchors>
  94.                         <Anchor point="CENTER" relativeTo="UIParent" x="0" y="0"/>
  95.                     </Anchors>
  96.                 </Texture>
  97.             </Layer>
  98.             <Layer level="OVERLAY" textureSubLevel="2">
  99.                 <Texture name="$parentGlow1" parentKey="glow1" alpha="0">
  100.                     <Anchors>
  101.                         <Anchor point="TOPLEFT" relativeTo="$parentDigit1" x="0" y="0"/>
  102.                         <Anchor point="BOTTOMRIGHT" relativeTo="$parentDigit1" x="0" y="0"/>
  103.                     </Anchors>
  104.                 </Texture>
  105.                 <Texture name="$parentGlow2" parentKey="glow2" alpha="0">
  106.                     <Anchors>
  107.                         <Anchor point="TOPLEFT" relativeTo="$parentDigit2" x="0" y="0"/>
  108.                         <Anchor point="BOTTOMRIGHT" relativeTo="$parentDigit2" x="0" y="0"/>
  109.                     </Anchors>
  110.                 </Texture>
  111.                 <Texture name="$parentFactionGlow" parentKey="factionGlow" alpha="0">
  112.                     <Anchors>
  113.                         <Anchor point="TOPLEFT" relativeTo="$parentFaction" x="0" y="0"/>
  114.                         <Anchor point="BOTTOMRIGHT" relativeTo="$parentFaction" x="0" y="0"/>
  115.                     </Anchors>
  116.                 </Texture>
  117.             </Layer>
  118.         </Layers>
  119.         <Frames>
  120.             <StatusBar name="$parentStatusBar" useParentLevel="true" parentKey="bar" alpha="0">
  121.                 <Size x="195" y="13"/>
  122.                 <Anchors>
  123.                     <Anchor point="TOP" x="0" y="-2"/>
  124.                 </Anchors>
  125.                 <Layers>
  126.                     <Layer level="BACKGROUND">
  127.                         <Texture>
  128.                             <Size x="195" y="13"/>
  129.                             <Anchors>
  130.                                 <Anchor point="TOP" x="0" y="-2"/>
  131.                             </Anchors>
  132.                             <Color r="0" g="0" b="0" a="0.5"/>
  133.                         </Texture>     
  134.                     </Layer>
  135.                     <Layer level="OVERLAY">
  136.                         <Texture name="$parentBorder" file="Interface\CastingBar\UI-CastingBar-Border">
  137.                             <Size x="256" y="64"/>
  138.                             <Anchors>
  139.                                 <Anchor point="TOP" x="0" y="25"/>
  140.                             </Anchors>
  141.                         </Texture>
  142.                         <FontString name="$parentTimeText" inherits="GameFontHighlight" justifyH="CENTER" parentKey="timeText">
  143.                             <Size x="0" y="9"/>
  144.                             <Anchors>
  145.                                 <Anchor point="CENTER" x="0" y="0"/>
  146.                             </Anchors>
  147.                         </FontString>
  148.                     </Layer>
  149.                 </Layers>
  150.                 <BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
  151.                 <BarColor r="1" g="0.0" b="0.0" />
  152.             </StatusBar>
  153.         </Frames>
  154.         <Scripts>
  155.             <OnShow function="StartTimer_OnShow"/>
  156.         </Scripts>
  157.     </Frame>
  158.    
  159.     <Frame name="TimerTracker" toplevel="true" parent="UIParent" hidden="true">
  160.         <Size x="0" y="0"/>
  161.         <Anchors>
  162.             <Anchor point="BOTTOMLEFT" x="0" y="0"/>
  163.         </Anchors>
  164.         <Scripts>
  165.             <OnLoad function="TimerTracker_OnLoad"/>
  166.             <OnEvent function="TimerTracker_OnEvent"/>
  167.         </Scripts>
  168.     </Frame>
  169. </Ui>

Last edited by MiRai : 04-07-12 at 12:59 PM.
  Reply With Quote
04-07-12, 02:08 PM   #19
MiRai
A Warpwood Thunder Caller
Join Date: Jul 2011
Posts: 96
Choonster from the WoW forums whipped up this code in an attempt for a fix:

Lua Code:
  1. local function SkinBar(barName)
  2.     local bar = type(barName) == "string" and _G[barName] or barName
  3.     bar:SetParent(UIParent)
  4.     bar:SetScale(1)
  5.     bar:SetHeight(16)
  6.     bar:SetWidth(280)
  7.     bar:SetBackdropColor(0.1, 0.1, 0.1)
  8.    
  9.     for _, region in pairs({ bar:GetRegions() }) do
  10.         if region.GetTexture and region:GetTexture() == "SolidTexture" then
  11.             region:Hide()
  12.         end
  13.     end
  14.    
  15.     local border = _G[barName.."Border"]
  16.     border:Hide()
  17.    
  18.     local background = bar:CreateTexture(barName.."Background", "BACKGROUND")
  19.     background:SetTexture(cfg.statusbar_texture)
  20.     background:SetAllPoints(bar)
  21.     background:SetVertexColor(.15,.15,.15,.75)
  22.    
  23.     local statusbar = _G[barName.."StatusBar"]
  24.     statusbar:SetAllPoints(bar)
  25.    
  26.     local text = _G[barName.."Text"]
  27.     text:SetFont(cfg.font, 14, "THINOUTLINE")
  28.     text:ClearAllPoints()
  29.     text:SetPoint("CENTER", statusbar, 0, 1)
  30.    
  31.     local glow = CreateFrame("Frame", nil, bar)
  32.     glow:SetFrameLevel(0)
  33.     glow:SetPoint("TOPLEFT", -5, 5)
  34.     glow:SetPoint("BOTTOMRIGHT", 5, -5)
  35.     lib.gen_backdrop(glow)
  36. end
  37.  
  38. -- mirror castbar!
  39. lib.gen_mirrorcb = function(f)
  40.     for _, barName in pairs({"MirrorTimer1", "MirrorTimer2", "MirrorTimer3"}) do
  41.         SkinBar(barName)
  42.     end
  43. end
  44.  
  45. -- timers
  46. TimerTracker:HookScript("OnEvent", function(self, event, ...))
  47.     if event == "START_TIMER" then
  48.         for i, timer in ipairs(self.timerList) do
  49.             SkinBar(timer)
  50.         end
  51.     end
  52. end

However, it is throwing up this error:
Code:
Message: Interface\AddOns\oUF_Fail\lib.lua:694: unexpected symbol near ')'
Time: 04/07/12 14:05:17
Count: 1
Stack: 
Locals:

Line 694 is line 46 above and I tried changing ... to .. just to see what it wants and it tells me it expects '...' so, I don't know what unexpected symbol it's seeing?
  Reply With Quote
04-07-12, 09:14 PM   #20
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The parenthesis at the end of line 46 should be at the end of line 52 instead.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Questions Regarding oUF_Fail

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