WoW BlueTracker Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
Poster: Tem at 10/21/2005 5:45:39 PM PDT
Subject: Slouken: Will this crash your workload?
   I've been in the process of writing an addon that plays with Item tooltips. It reads the tooltip and parses out the item's stats then compares it with the stats on the items you are wearing. Then it goes about changing the item tooltip to add + and - indicators on the stats. Then it needs to add lines into the middle of the tooltip for the stats the item doesn't have.

At first I thought this would be a trivial afair of doing an Addline with the last line and moving everything down with SetText. Turns out that any line that uses the "magic" wrapping allowed by the last parameter to AddLine (all the item tooltips use this), will completely blow it's wrapping when you move it down this way. So I set about the only other solution I could come up with (actually I think it was suggested by Iriel. I can't recall exactly) Scan the tooltip and rebuild it. I have this working perfectly -- well almost perfectly. It scans the tooltip returning a table with the contents. Then lets me insert rows into it and call a BuildTooltip function that takes a table an rebuilds the tooltip from scratch.

The problem with this method is that it is forced to do quite a few nontrivial actions. Under normal conditions this is fine, but in places like while hovering over the bag slots, the tooltip gets updated every frame because the item *might* have a cooldown that needs to be refreshed. This quickly increases memory usage to levels that are unacceptable (up to 500kb/sec) which brings me to the point of my post. If native GameTooltip:InsertLine and GameTooltip:InsertDoubleLine methods were added, this could avoid the problems incurred by implementing them in LUA. So, um... Please?

Edit: typos...

[ post edited by Tem ]


What more work?
I don't wanna do that.
Yes m'Lord.
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=249843&p=#post249843
 
Poster: slouken at 10/21/2005 7:17:11 PM PDT
Subject: Re: Slouken: Will this crash your workload?
   Why don't you just reuse the same table?
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=249843&p=#post249908

View all recent official Blue Posts

WoW Blue Tracker: Archiving World of Warcraft Blue Posts
since March 2005
Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
 

Why Ads?