Thread Tools Display Modes
12-21-08, 03:12 PM   #141
grimman
A Fallenroot Satyr
 
grimman's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 28
Originally Posted by haste View Post
Fixed on git.
New bug found! :P
self.Name:SetText(UnitName(unit)) in my updateName function does not display the correct text for tapped mobs. So far I've only checked dead+tapped mobs, so I'm not sure living+tapped mobs display the same behavior.
The fontstring has the value of the last mob targeted.

The colouring done in the same function works nicely though.

Edit: Tested using version 1.3.0 as well as version 1.3.1.
 
12-21-08, 03:42 PM   #142
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
There is no .Name element in oUF anymore, so you have to handle all the updating yourself. Take a look at how Lily does this for example.

I don't set any OnShow update in Lily however, since the function is called from the UNIT_HEALTH function.
 
12-21-08, 03:57 PM   #143
grimman
A Fallenroot Satyr
 
grimman's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 28
Originally Posted by haste View Post
There is no .Name element in oUF anymore, so you have to handle all the updating yourself. Take a look at how Lily does this for example.

I don't set any OnShow update in Lily however, since the function is called from the UNIT_HEALTH function.
AHA, you had snuck an event in inside the updateHealth function too. :P
Since my layout is based on your Lily layout the code is practically identical in some places. Thanks once more!
Any performance difference between using this method and using tags?
 
12-21-08, 04:17 PM   #144
wcshadow
A Defias Bandit
Join Date: Oct 2008
Posts: 3
sorry im not very knowledgable in lua, but is there a way to port, oUF D3Orbs to 1.3.x , so i can get the names of myself and the mobs to show again

Last edited by wcshadow : 12-21-08 at 04:20 PM.
 
12-21-08, 04:26 PM   #145
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by grimman View Post
Any performance difference between using this method and using tags?
I haven't done any benchmarks, so I can't give you any numbers. It will be slower than writing the updating yourself.
 
12-21-08, 07:24 PM   #146
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
I get the following error whenever something AURA related happens (self buff, eating, debuff):

Code:
ouf.lua:94: Attempt to call field '?' (a nil value)
I see the warning, but it doesn't seem to have any ill effects. Even if I remove all of my Aura handling code, it still shows up.

I hesitate to file a bug report because other than the warning, nothing seems wrong.

This seems to fix it:

Code:
if (self[event]) then
  self[event](self, event, ...)
end
Dunno if that fix has any bad consequences, but I haven't seen any so far.
 
12-21-08, 07:41 PM   #147
Celil
A Defias Bandit
Join Date: Oct 2008
Posts: 2
with the update today (1.3.1) i got this errormessage every time if something changes in the UnitFrames (e.g. joining party, hp-loss, etc):

oUF\ouf.lua:94: attempt to call field '?' (a nil vlaue)

Anyone an idea where this bug come?
 
12-21-08, 09:16 PM   #148
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Kellen View Post
This seems to fix it:

Code:
if (self[event]) then
  self[event](self, event, ...)
end
Dunno if that fix has any bad consequences, but I haven't seen any so far.
You'll want to add a print if it can't find the event there. It's your layout registering an event, but not setting any handler on it.

Originally Posted by Celil View Post
Anyone an idea where this bug come?
See above.
 
12-21-08, 09:36 PM   #149
Celil
A Defias Bandit
Join Date: Oct 2008
Posts: 2
I should get used to reading all posts, thanks a lot

Last edited by Celil : 12-21-08 at 09:44 PM.
 
12-21-08, 11:13 PM   #150
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
You'll want to add a print if it can't find the event there. It's your layout registering an event, but not setting any handler on it.


See above.
Add an detailed error print to that event handler by default, it would ease up the mess on these forums.

I have one, but I added that myself
 
12-22-08, 01:45 AM   #151
Blood Druid
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
Originally Posted by haste View Post
.__elements is used for OnShow updates of the frame.
:RegisterEvent() is used for ordinary event handling.

I don't use .__elements in oUF_Lily, because the UNIT_HEALTH function will make the OnShow call for me.
ок, it is clear, I spoke that there is no sense to call function of show of name UNIT_NAME_UPDATE as UNIT_HEALTH update, i.e. it is not necessary to refresh so often UnitName...
I am am disturbed by additional load

Such question:
if to make so in Style

local UnitDraw = function (self, unit)
.....
self:RegisterEvent (' UNIT_NAME_UPDATE ', updateName)
table.insert (self. __ elements, updateName)
.....
end


or


local updateHealth = function (self, event, unit, bar, min, max)
....
self:UNIT_NAME_UPDATE (event, unit)
...
end

local UnitDraw = function (self, unit)
.....
self:RegisterEvent (' UNIT_NAME_UPDATE ', updateName)
.....
end


it too most?
 
12-22-08, 04:01 AM   #152
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
In Lily I make a call from UNIT_HEALTH to UNIT_NAME_UPDATE because I have the named colored gray if the unit is tapped. This isn't needed in most other cases however.
 
12-22-08, 06:14 AM   #153
Blood Druid
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
Originally Posted by haste View Post
In Lily I make a call from UNIT_HEALTH to UNIT_NAME_UPDATE because I have the named colored gray if the unit is tapped. This isn't needed in most other cases however.
I have already understood it, simply I ask as more correctly to make as in the first case or how in the second?
 
12-22-08, 06:24 AM   #154
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
It depends on how often you would want to update the name. The first solution will make it only update when the event fires, or when the frame is forced to update all elements (OnShow). While the second solution will update it every time the health changes for the unit, and when the frame is forced to do a full update.
 
12-23-08, 06:50 PM   #155
Mordog
A Deviate Faerie Dragon
Join Date: Feb 2008
Posts: 17
Originally Posted by haste View Post
You'll want to add a print if it can't find the event there. It's your layout registering an event, but not setting any handler on it.
Code:
if (self[event]) then
  self[event](self, event, ...)
end
See above.
can someone tell me were to add this?
 
12-23-08, 07:10 PM   #156
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Mordog View Post
can someone tell me were to add this?
Code:
if (self[event]) then
  self[event](self, event, ...)
else
  print(string.format('Object %s (%s) attempted to call event [%s], which has no handler.', tostring(self), tostring(self.unit), event))
end
 
12-23-08, 07:14 PM   #157
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
Code:
if (self[event]) then
  self[event](self, event, ...)
else
  print(string.format('Object %s (%s) attempted to call event [%s], which has no handler.', tostring(self), tostring(self.unit), event))
end
Please add that as a default
 
12-23-08, 07:19 PM   #158
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Maybe, but most likely no.
 
12-23-08, 07:38 PM   #159
Mordog
A Deviate Faerie Dragon
Join Date: Feb 2008
Posts: 17
works, no message in the chatframe. thank you
 
12-24-08, 12:57 AM   #160
Blood Druid
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
Originally Posted by haste View Post
It depends on how often you would want to update the name. The first solution will make it only update when the event fires, or when the frame is forced to update all elements (OnShow). While the second solution will update it every time the health changes for the unit, and when the frame is forced to do a full update.
Thanks Haste, the answer settling that it was required to understand

by the way are a new problem:
with vehicle, if in combat to quit from vehicle that units do not vary back, i.e. "player" remains "pet"

as it to correct?
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - General discussion


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