Download
(101Kb)
Download
Updated: 02-28-10 11:20 PM
Pictures
File Info
Updated:02-28-10 11:20 PM
Created:unknown
Downloads:42,558
Favorites:207
MD5:

RantTooltip  Popular! (More than 5000 hits)

Version: 0.28
by: Stuck [More]

RantTooltip (GUI) Options here.

(NOTE: If you plan on using a layout other than the default layout, you need to delete the RantTooltip_Layout folder first.)

RantTooltip is a tooltip addon that was influenced by oUF to include a layout system for tooltips. You'll find it very similar to oUF. A sample layout is included, based on p3lim's oUF layout. It was designed to match p3lim's layout due to my personal use of it. I take no credit for the design.

The documentation included in the zip file should give you all the information you need on how you create your own tooltip layout.

For everyone who prefers the original RantTooltip look, I've uploaded a layout called RantTooltip Classic.

-[Rum] (Stuck)

0.28 - "<" and ">" will now be colored according to the tag variable the encompass.
- The last player's talent spec will now be cached. This will stop the "Loading" text from flashing in some cases.

0.27 - Colons next to tag variables are no longer colored to be consistent with the adjacent variable. This was conflicting with tag updates.
- Added two more new tags: $curshort and $maxshort. These variables will display health and power values but will reduce their size if necessary.
- For example: 125000 becomes 125k. 1500000 becomes 1.5m.
- Added a $spec tag which will display the player's current spec - their talent tree with the most points in it.
- Do not use $spec and $talents in the same conditional. It will not work. If you want them on the same line, put them in separate conditionals, like this:
Code:
"{Talents: [$spec]}{ ($talents)}",
instead of:
Code:
"{Talents: [$spec] ($talents)}",

0.26 - Added $talents tag which displays the player's talents.
- Fixed a small issue with tag updates.
- Fixed an error concerning layouts without raid icons or combat icons.
- Various small changes.

0.25 - Fixed a few errors involving the DeleteLine function and unit tags.
- Updated the library.
- Other minor changes.

0.24 - Fixed a tag update issues that concerned "$target".
- Added PreOnSizeChanged and PostOnSizeChanged functions for every tooltip.
- Fixed an issue concerning GameTooltip.FindLine in the library.

0.23 - Updated a few things.
- Colons are now colored according to the tag variable to the left of them.
- Fixed and changed the library.
- Cleaned up code.
- Other miscellaneous changes.

0.22 - Fixed a conflict with GearScore. GearScore tooltip text now displays properly.
-Add override functions (i.e.):
GameTooltip.OverrideSetDefaultAnchor(self, parent)
GameTooltip:PreSetUnit(unit)
GameTooltip:PostSetUnit(unit)
GameTooltip:PreOnShow()
GameTooltip:PostOnShow()
GameTooltip:PreOnHide()
GameTooltip:PostOnHide()
GameTooltip:OverrideUpdateHealthBar(bar, cur, max)
GameTooltip:PreUpdateHealthBar(bar, cur, max)
GameTooltip:PostUpdateHealthBar(bar, cur, max)
GameTooltip:OverrideUpdatePowerBar(bar, cur, max)
GameTooltip:PreUpdatePowerBar(bar, cur, max)
GameTooltip:PostUpdatePowerBar(bar, cur, max)

0.21 - Fixed health bar text, fixed text color, and a few other things changed.

0.2 - Updated to fix memory problem.
Optional Files (0)


Post A Reply Comment Options
Unread 01-29-10, 06:15 PM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by Amenity
No idea what that could be. I even went through all my code and disabled everything that changed the border except for its' initial definition, and it still did it.

Nope. I had set it for every one. I even copy/pasted it to set it for each tooltip manually and still nothing.

Makes sense, yeah. Doesn't explain why it wouldn't work at all, though.
I don't know what to tell you, using PostOnSizeChanged to change the border color works fine with the RantTooltip_Classic layout. The problem is either with your layout or your other addons. Try using RantTooltip_Classic and see if it changes item tooltip border colors properly. If it does, the problem is with your layout, if it doesn't, the problem is with some other addon you have that may be interfering.

Originally posted by Amenity
Uhh...


What the....
Ahh, didn't realize that would happen. Sorry about that. I'll be fixing this for the next update then. For now:

Code:
if self:IsObjectType("GameTooltip") then
--put the OnTooltipSetItem and OnHide functions here
end
Last edited by Stuck : 01-29-10 at 06:19 PM.
Report comment to moderator  
Reply With Quote
Unread 01-29-10, 06:05 PM  
Amenity
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Originally posted by Stuck
If it is changing for only a fraction of a second, something is interfering with it.

No idea what that could be. I even went through all my code and disabled everything that changed the border except for its' initial definition, and it still did it.

The self.PostOnSizeChanged function should be set for every tooltip, not just the GameTooltip. That's why it's not working for the ItemRefTooltip (the tooltip that shows when you click an item link), etc.
Nope. I had set it for every one. I even copy/pasted it to set it for each tooltip manually and still nothing.

The reason OnSizeChanged is better than OnShow for this kind of thing, is because when the item is set for the ItemRefTooltip, the tooltip doesn't have to show itself if it's already shown. For example, if you clicked an item link and had the ItemRefTooltip open and clicked another item link with the tooltip still open, the item on the tooltip would change but the tooltip wouldn't have to show again because it's already shown, however, it would change size. So, if you used OnShow to change the border color for the ItemRefTooltip based on the item quality, it wouldn't always work properly.
Makes sense, yeah. Doesn't explain why it wouldn't work at all, though.

You could try this instead:

Code:
self:HookScript("OnTooltipSetItem", function()
   if self:GetItem() then
      --change border color here
   end
end)

self:HookScript("OnHide", function()
   if self:GetItem() then
      --change border back to the default color
   end
end)
I just use OnSizeChanged for the sake of simplicity.

edit: if HookScript doesn't work for the code above, use SetScript instead.
Uhh...

DropDownList1MenuBackdrop doesn't have a "OnTooltipSetItem" script
What the....
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 01-29-10, 05:16 PM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by Amenity
Almost there...

1. Has to be called on PreOnShow. PostOnSizeChanged will only change it for a fraction of a second.

2. Doesn't work for linked items, comparison tooltips, or addons that work off of these principles (such as AtlasLoot).
If it is changing for only a fraction of a second, something is interfering with it.

The self.PostOnSizeChanged function should be set for every tooltip, not just the GameTooltip. That's why it's not working for the ItemRefTooltip (the tooltip that shows when you click an item link), etc.

The reason OnSizeChanged is better than OnShow for this kind of thing, is because when the item is set for the ItemRefTooltip, the tooltip doesn't have to show itself if it's already shown. For example, if you clicked an item link and had the ItemRefTooltip open and clicked another item link with the tooltip still open, the item on the tooltip would change but the tooltip wouldn't have to show again because it's already shown, however, it would change size. So, if you used OnShow to change the border color for the ItemRefTooltip based on the item quality, it wouldn't always work properly.

You could try this instead:

Code:
self:HookScript("OnTooltipSetItem", function()
   if self:GetItem() then
      --change border color here
   end
end)

self:HookScript("OnHide", function()
   if self:GetItem() then
      --change border back to the default color
   end
end)
I just use OnSizeChanged for the sake of simplicity.

edit: if HookScript doesn't work for the code above, use SetScript instead.
Last edited by Stuck : 01-29-10 at 05:28 PM.
Report comment to moderator  
Reply With Quote
Unread 01-29-10, 04:43 PM  
Amenity
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Almost there...

1. Has to be called on PreOnShow. PostOnSizeChanged will only change it for a fraction of a second.

2. Doesn't work for linked items, comparison tooltips, or addons that work off of these principles (such as AtlasLoot).
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 01-29-10, 03:53 PM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by Amenity
Ok, I'm about to go insane. I've been working on this for a couple hours now, trying every single way I can think of to get this to work and coming up with either nothing or errors all over the place...

Coloured borders. In my self.PostSetUnit for GameTooltip, I've got

lua Code:
  1. self:SetBackdropBorderColor(GameTooltip_UnitColor(unit))
which works perfectly...except for items.

However, the $name text is coloured by item quality...and according to what I could find in RantTooltip.lua...
Yeah, that should work perfectly for unit tooltips. This won't work for item tooltips because item tooltips aren't units.

If you want to color item borders by item quality you could do this:

Code:
	self.PostOnSizeChanged = function()
		if self:GetItem() then
			local link = select(2,self:GetItem())
			local rarity = select(3,GetItemInfo(link)) or 1
			self:SetBackdropBorderColor(GetItemQualityColor(rarity))
		elseif self ~= GameTooltip then --because unit tooltips on the GameTooltip will be changing color based on the unit
			self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b)
		end
	end
This is the best way I've found to set the border color of an item tooltip. There's an example of this in the RantTooltip_Classic layout.

Originally posted by Amenity
lua Code:
  1. ["$name"] = function(unit) return RantTooltip:RGBHex(GameTooltip_UnitColor(unit))..UnitName(unit).."|r" end,
...it's using the exact same method.

The $name tag only applies to unit tooltips, not item tooltips. GameTooltip_UnitColor only works for units.

Hope this helps.
Last edited by Stuck : 01-29-10 at 03:55 PM.
Report comment to moderator  
Reply With Quote
Unread 01-29-10, 03:19 PM  
Amenity
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Ok, I'm about to go insane. I've been working on this for a couple hours now, trying every single way I can think of to get this to work and coming up with either nothing or errors all over the place...

Coloured borders. In my self.PostSetUnit for GameTooltip, I've got

lua Code:
  1. self:SetBackdropBorderColor(GameTooltip_UnitColor(unit))
which works perfectly...except for items.

However, the $name text is coloured by item quality...and according to what I could find in RantTooltip.lua...

lua Code:
  1. ["$name"] = function(unit) return RantTooltip:RGBHex(GameTooltip_UnitColor(unit))..UnitName(unit).."|r" end,
...it's using the exact same method.



I've tried all kinds of stuff, in all kinds of locations. I've even tried some stuff that's just plain ridiculous, like

lua Code:
  1. item = GameTooltip:GetItem()
  2.     a, b, itemcolor = GetItemInfo(item)
  3.     r, g, b = GetItemQualityColor(itemcolor)
  4.     self:SetBackdropBorderColor(r, g, b)
in an if-then statement.

At this point my brain is so fried from this simple little bugger I don't even know where to go from here. (lol)
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 01-29-10, 01:18 PM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by Gregory
hello ! i've had some problems with addon:

1. tooltips doesnt always shows for raid frames. don't know why and can't find any pattern. they just random show or doesn't. same unit can once doesn't show tooltip and show on next mouseover. i'm using shadowed uf and had no such problem with another tooltip mods.
Hi Gregory,

I'll look into the problem of the tooltip not showing sometimes on raid frames. I think I have an idea of what you're talking about. I suspect problem with damage meters is a problem with damage meters. Could you elaborate? What are you mousing over on the damage meter bars.

Yeah, I can add a talents cache. I didn't think of it when adding the $talents tag. Thanks.

Originally posted by Tarquino
Is it possible to add the Player's Title to the Tooltip before the $name function? This was a feature that aTooltip had (which broke with patch 3.3) and just wanted to know how to add it as a tag to use within this awesome tooltip mod.
You can change this by opening your default layout, which should be RantTooltip_Layout.lua. Look for the line that says "RantTooltip:SetUnitTags{" and below it there should be a string with tags in it, such as "$dnd$name", etc. Change $name to $tname. That will display the player's title.
Report comment to moderator  
Reply With Quote
Unread 01-29-10, 08:59 AM  
Tarquino
A Kobold Labourer

Forum posts: 0
File comments: 16
Uploads: 0
Is it possible to add the Player's Title to the Tooltip before the $name function? This was a feature that aTooltip had (which broke with patch 3.3) and just wanted to know how to add it as a tag to use within this awesome tooltip mod.

Thanks

[edit] Just realized that titles are now a protected function by Blizzard...sucks
Last edited by Tarquino : 01-29-10 at 09:40 AM.
Report comment to moderator  
Reply With Quote
Unread 01-28-10, 01:35 PM  
Gregory
A Kobold Labourer

Forum posts: 0
File comments: 76
Uploads: 0
hello ! i've had some problems with addon:

1. tooltips doesnt always shows for raid frames. don't know why and can't find any pattern. they just random show or doesn't. same unit can once doesn't show tooltip and show on next mouseover. i'm using shadowed uf and had no such problem with another tooltip mods.

2. tooltip aligned to wrong place when mousover skada damage meter bars. everything else seems appear on cursor.

and have one suggestion:

1. is it possible to make some talents cache ? when you try to look someone in crowd overlapping with other ppls or person moving it's just jump all the time between "loading" and talents data.

i'm using default layout just added talents.
Report comment to moderator  
Reply With Quote
Unread 01-28-10, 07:10 AM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by Aesh
Hi Stuck ty for the update
but $curshort ,$maxshort seems to not work.
or i missing something.
trying with last ranttootip
Seems to be working for me. Keep in mind, it only affects values above 100k.
Report comment to moderator  
Reply With Quote
Unread 01-28-10, 04:49 AM  
Aesh
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 11
File comments: 56
Uploads: 5
Hi Stuck ty for the update
but $curshort ,$maxshort seems to not work.
or i missing something.
trying with last ranttootip
Code:
statusBar.Tags = "{$curshort - $perc %}"
or
Code:
statusBar.Tags = "{$curshort}"
or
Code:
statusBar.Tags = "$curshort"
nothing hapened ,
Report comment to moderator  
Reply With Quote
Unread 01-27-10, 11:02 PM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by Hexe
Is there a way to have it return the name of the spec instead of just the numbers? (Demonology instead of 10/50/10) Or possibly both?
$spec

Just added that with the latest update. Make sure you don't use $spec and $talents in the same conditional. If you want them on the same line make sure you put them in different conditionals, like this:

Code:
"{Talents: [$spec]}{ ($talents)}",
Originally posted by EmpireDawn
Is there a way to display the health as percentage below the guild, race etc? I wanted to get rid of the statusbar, but the health percentage would be nice to have.
EmpireDawn, I decided against adding tags like this, for now. I may add them in the future.

If you want tags like this, you can put this in your layout:

Code:
for _, tag in ipairs{"cur", "curshort", "max", "maxshort", "perc", "miss"} do
	RantTooltip.Tags["$hp"..tag] = function(unit)
		return RantTooltip.Tags["$"..tag](unit, "Health")
	end
	RantTooltip.Tags["$mp"..tag] = function(unit)
		return RantTooltip.Tags["$"..tag](unit, "Power")
	end
end
Last edited by Stuck : 01-27-10 at 11:10 PM.
Report comment to moderator  
Reply With Quote
Unread 01-27-10, 08:44 PM  
Hexe
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 14
File comments: 26
Uploads: 2
Is there a way to have it return the name of the spec instead of just the numbers? (Demonology instead of 10/50/10) Or possibly both?
Report comment to moderator  
Reply With Quote
Unread 01-27-10, 04:12 AM  
EmpireDawn
A Defias Bandit

Forum posts: 2
File comments: 9
Uploads: 0
Awesome. Thanks Stuck
Report comment to moderator  
Reply With Quote
Unread 01-26-10, 08:41 PM  
Stuck
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 127
Uploads: 14
Originally posted by leks0d
Is it possible to use short values of HP/MP?
Like 11563HP>11.6k, 12456785>12.5m etc.
I'll add this in for the next update.

Originally posted by EmpireDawn
Is there a way to display the health as percentage below the guild, race etc? I wanted to get rid of the statusbar, but the health percentage would be nice to have.
As of right now the health tags only work on the healthbar. I've been meaning to change this. For now you could add this to your layout:

Code:
RantTooltip.Tags["$hpperc"] = function(unit)
    return RantTooltip.Tags["$perc"](unit, "Health")
end
After adding that to your layout you can put "$hpperc" anywhere in the RantTooltip.SetUnitTags table. For example:

Code:
"{Health: $hpperc%}",
Originally posted by Hexe
I'm getting this error anytime I mouse over anything that would give me a tooltip.
Any ideas?
What layout are you using?

Try adding this to your layout if it isn't already there:

Code:
RantTooltip:SetInitialAnchor("CURSOR", 0, 0)
That will anchor the tooltip to the cursor.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: