Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(1 MB)
Download
Updated: 10-17-14 11:25 AM
Pictures
File Info
Compatibility:
Siege of Orgrimmar (5.4)
Escalation (5.3)
Updated:10-17-14 11:25 AM
Created:unknown
Downloads:213,110
Favorites:1,952
MD5:
Categories:Bags, Bank, Inventory, Character Advancement, Mail, TradeSkill Mods
Altoholic  Popular! (More than 5000 hits)
Version: 6.0.001
by: Thaoky [More]
Hi, my name is Thaoky, and I'm an Altoholic

Altoholic is an Ace 3 addon written for people who dedicate most of their time to leveling alts, and who want to have as much information as possible in one addon. The main feature of the addon is the search functionality which allows users to search their alts' bags or loot tables in an Auction-House-like frame (see screenshots). All this with multiple-realms/accounts support.

Paypal donations accepted at : thaoky.altoholic@yahoo.com



About the addon & the author

I've been playing WoW since the European release, and I used to rely on addons like character viewer to check my alts' inventory, but since it was more or less abandoned and not always stable for me, I decided to write an addon myself and to improve the search feature as much as I could. I hope you'll enjoy it as much as I do

The addon has been in development since December 2007 and was officially released in late March 2008. It's still not final, and although it has considerably evolved since the initial release, there are still a lot of things I haven't had time to implement yet.
Please note that this is my first addon, and that English is not my native language.

Features:

- Languages supported: enUS, frFR, deDE, esES, ruRU, zhCN & zhTW.

- Account-wide data summary:
  • Characters' talents: Full talent trees & glyphs are supported for both specializations.
  • Money, /played, rest xp for each character, subtotals by realm, and grandtotals for the account.
  • Bag usage: see at a glance which characters should get bigger bags (bag size, free slots and types included)
  • Characters' skills: skill summary on one screen, namely the 2 main professions + the 3 secondary skills as well as riding. I may add more if there's demand. Profession cooldowns included.
  • Reputations: a list of all the reputations of the current realm's characters. You can see at a glance if all your alts are at least honored with Honor Hold if you want to get the new 2.4 blue PVP set. Suggestions on how to gring reputations will be available soon.

- View containers (bags, bank, keyring) of all alts, on all realms.

- Guild banks : You have 10 alts in 10 different guilds on the same server, all of them with access to a guild bank ? Not a problem, you can see them all here.

- E-mail: allows you to see which alts have mail without having to reconnect them. The addon will tell you when mail is about to expire on a character. Threshold configurable (up to 15 days). Multiple realm support as well. Mails sent to a known alt (one you've logged on at least once) will be visible in the addon without having to reconnect it.

- Equipment: See the equipment of the current realm's alts in one screen. Very useful when purchasing stuff for your alts at the AH. Multiple realms supported. Right-clicking any equipment piece will allow you to find an upgrade, this feature is similar to the official wow armory feature, and is quite performant, even though it doesn't match the accuracy of the official one.

- Search: the most important feature of the addon, it uses an AH-like frame to display search results. You can either search bags on the current realm, on all realms, or a loot table.
The loot table is a table based on AtlasLoot, but which contains only item id's, and therefore keeps memory usage minimal.

The Search menu allows you to find items based on their name (even partial), level, type or rarity, almost like at the AH. It is also possible to search known recipes.

- Quest Log: See the quest logs of all your alts, as well as an indication of which alts are on a specific quest. Clicking on a quest link in the chat log will tell you which alts are on that quest.

- Suggestions: Currently, only profession leveling suggestions are available when mousing over your current level in a specific profession. Suggestions are based on the leveling guides posted on the official US forums (credit goes to their respective authors). The addon also suggests you where to quest/grind xp depending on your character level.

Suggestions were also added for the most recent factions. More to come later.

- Auction house: You can see which auctions/bids you've placed with an alt without being logged in or being at the AH.

- Professions: You can browse all known recipes in a thotbot like frame (see screenshot).

- Mounts & Pets of all your alts.

- Achievements are tracked for all you alts (see screenshot).

- Guild Members: a list of your connected guildmates, along with their alts (if they're using Altoholic too), and their average item level. Clicking their AiL will also allow you to "remotely" inspect their equipment.

- Guild Skills: a list of altoholic users in your guild, along with their alts and direct profession links. All professions are available in one click.

- Guild Bank tabs: a list of altoholic users and the time at which they last visited the guild bank. If you haven't visited the guild bank for a few days, you can remotely update your local data without going to a capital city.

FAQ

The FAQ has been moved here : http://www.wowinterface.com/portal.php?id=372&a=faq


Credits

- I'd like to thank my guild, Odysseüs on EU-Marécages de Zangar, for assisting me since the earliest phases, thanks guys for everything you've done
- Thanks to the wowace community, you've been very helpful and this addon would not be there without the technical answers you gave me (especially Xinhuan, author of BankItems)
- Thanks to all the guys who are behind AtlasLoot, keeping the loot table up-to-date is a tremendous work, and the search functionality of Altoholic would not be what it is without your hard work.
- Thanks to Ayindi (wowace) & sLiz3r (curse) for the German translation.
- Thanks to NightOwl (wowace) for the zhTW translation.
- Thanks to Wang (wowace) for the zhCN translation.
- Thanks to Hellbot for the ruRU translation.
- Thanks to Laumac for the frFR translation.
- Thanks to IrregularByte for the esES translation.
- Brykrys for the LinkWrangler support.
Join the #altoholic IRC channel on Freenode : irc://irc.freenode.net:6667/

IMPORTANT NOTE: As with every new expansion, many things have changed in the API, and it is REQUIRED to clear your Saved Variables for the addon.
This means cleaning the following files in \WTF\Account\<your_account>\SavedVariables : Altoholic.lua & All DataStore*.lua

There WILL be bugs if you use your old files without cleaning them first.
Some fixes to work around API changes are too time consuming, so cleaning is required. A meager price to pay once per expansion.

6.0.001 (17/10/2014)

- Added a pane in the Grids tab to track LFR lockouts across alts.
- Added support for the new void storage tab + reagent bank.
- Updated achievement lists.
- Updated tradeskills data (Grids tab)
- Fixed WoD related issues.
- DataStore_Reputations: fixed WoD compatibility.
- DataStore_Reputations: LibBabble-Factions is back.
Note : seriously Blizzard why on earth is GetFactionInfoByID no longer returning data for the opposite faction's reputations?
- DataStore_Talents: talents & glyph scanning is temporarily fully disabled. UI is still missing too, sorry about that.
- DataStore_Quests: fixed WoD compatibility.
- DataStore_Containers: Added support for the new void storage tab.
- DataStore_Containers: Added support for the new reagent bank.
- LibCraftInfo: updated for WoD.
- LibCraftLevels: updated for WoD.
- LibCraftReagent: updated for WoD.
- Currencies pane: removed unrequired tooltip.


5.4.009 (08/08/2014)

- Uncommented the code that actually deletes linked realms.. silly me !
- DataStore_Crafts: reworked the processing of events that actually trigger profession scanning.
Note: The current implementation is based (not 100%) on how professions are scanned in Ackis Recipe List (thanks Ackis :D).
So far the tests I have made show a serious improvement, but the way events are triggered may not be 100% consistent, especially with regards to the TRADE_SKILL_UPDATE event.
The addon should no longer miss scans (please report if you notice problems).
- DataStore_Mails: fixed some problems related to merged realms, it should now work without problems anymore.
- DataStore_Mails: fixed issues where mail attachments (sent or returned) could be saved twice in the recipient's mailbox.

Changes by ckaotik (Huge thanks !)
- DataStore : Read addon version from .toc
- DataStore : Current character/guild key can now be used by character/guild based methods
- DataStore : added a few methods to support overriding methods
- Many minor fixes in DataStore_Achievements, Agenda, Containers, Crafts, Inventory, Mails, Talents
- DataStore_Quests : fixed tracking of completed quests

5.4.008 (27/07/2014)

- Fixed MoP factions showing up as numbers.
- Suggested leveling zones are back in the account summary.
- Added an option to reset links between merged realms (some realms were marked as linked though they were not)
=> DataStore dropdown in the Account Summary
- Added an option to completely reset the DataStore databases, without having to manually delete the files in the SavedVariables folder
=> DataStore dropdown in the Account Summary

- Added an option to remember the faction filter across sessions. (Grids -> Reputations)
- Added an option to remember the currency filter across sessions. (Grids -> Currencies)
- Added an option to remember the companion filter across sessions. (Grids -> Companions)
- Added an option to remember the mount filter across sessions. (Grids -> Mounts)
- Added an option to remember the tradeskills filter across sessions. (Grids -> Tradeskills)
- Added an option to remember the archaeology filter across sessions. (Grids -> Archaeology)
- Item counts for guilds on merged realms should now be visible too (sorry can't test this myself).


5.4.007 (24/07/2014)

- Added missing faction "Emperor Shaohao".
- Altoholic: removed LibBabble-Faction
- DataStore_Reputations: removed LibBabble-Faction.
- Fixed lua error when using the search function.

5.4.006 (22/07/2014)

- Fixed double item counts in the tooltip.
- Improved the search functionality to be less restrictive.
- DataStore_Containers now triggers extra events for client addons.
- DataStore_Inventory now triggers extra events for client addons.
- DataStore_Auctions now triggers extra events for client addons.
- DataStore_Mails now triggers extra events for client addons.

5.4.005 (21/07/2014)

- Fixed bugs related to full names (name+realm) in the Guild tab.
- Added a pane in the account summary to show the PVE & PVP currencies.
- Added tooltip support for connected realms.
Note: DataStore needs to learn about connected realms, to do so, send 1 mail to an alt on a connected realm.
The connection is understood both ways (realm A to B, and B to A) with a single mail.
If you are connected to more than 1 realm, send 1 mail per link.
Ex: for 3 realms, send 1 mail from realm A to B, one from A to C, and one from B to C.
The mail can consist of just text, no attachment or gold required.
- Added an option to show/hide item count from connected realms.
- Added support for mails sent to/returned from alts on connected realms.
Note: Realm names are packed ("Marécage de Zangar" => "MarécagedeZangar") by Blizzard, this is supported.
If you notice something weird with your realm, please report it.
- Altoholic: removed LibBabble-Zone
- Updated the internal loot table and removed duplicate entries also found in LPT.
- DataStore_Inventory: removed LibBabble-Zone.
- DataStore_Reputations: removed LibBabble-Zone.
- Removed leveling suggestions from the character level tooltip in the account summary, as this information is now part of the game's world map.
- Updated the AiL tooltip, level 60 & 70 dungeons are now commented (tooltip was getting long), and level 90 was added. (Thanks Pseudopath on WoWinterface)
- Fixed issues related to scanning void storage (Thanks Lombra !)
- Several minor fixes (Thanks Lombra again !!)

Older patch notes : see changelog.txt
Archived Files (41)
File Name
Version
Size
Author
Date
5.4.009
1MB
Thaoky
08-08-14 09:23 AM
5.4.008
1MB
Thaoky
07-27-14 07:36 AM
5.4.007
1MB
Thaoky
07-24-14 10:32 AM
5.4.006
1MB
Thaoky
07-22-14 07:40 AM
5.4.004
1MB
Thaoky
10-07-13 10:09 AM
5.4.003
1MB
Thaoky
10-06-13 01:37 AM
5.4.002
1MB
Thaoky
09-17-13 10:26 AM
5.4.001
1MB
Thaoky
09-11-13 09:46 AM
5.3.003
2MB
Thaoky
08-01-13 07:10 AM
5.3.002
1MB
Thaoky
05-29-13 12:28 PM
5.3.001
1MB
Thaoky
05-28-13 11:29 AM
5.2.001
1MB
Thaoky
03-12-13 04:02 AM
5.1.002
1MB
Thaoky
02-24-13 06:19 AM
5.1.001
1MB
Thaoky
11-29-12 11:00 AM
5.0.003
1MB
Thaoky
11-28-12 12:14 PM
5.0.002
1MB
Thaoky
10-06-12 04:56 AM
5.0.001d
1MB
Thaoky
09-13-12 12:08 PM
5.0.001c
1MB
Thaoky
09-03-12 10:59 AM
5.0.001b
1MB
Thaoky
09-02-12 11:38 AM
5.0.001
1MB
Thaoky
09-02-12 05:27 AM
4.3.003b
1MB
Thaoky
05-05-12 03:43 AM
4.3.003
1MB
Thaoky
05-04-12 08:51 AM
4.3.002
1MB
Thaoky
01-29-12 05:05 AM
4.3.001
1MB
Thaoky
12-10-11 03:24 PM
4.2.002
1MB
Thaoky
10-30-11 04:59 AM
4.2.001
1MB
Thaoky
06-29-11 12:20 PM
4.1.001b
1MB
Thaoky
05-01-11 09:31 AM
4.1.001
1MB
Thaoky
04-30-11 01:06 PM
4.0.006b
1MB
Thaoky
04-02-11 11:55 PM
4.0.006
1MB
Thaoky
03-02-11 08:03 AM
4.0.005d
1MB
Thaoky
02-16-11 10:11 AM
4.0.005c
1MB
Thaoky
02-15-11 07:28 AM
4.0.005b
1MB
Thaoky
02-11-11 09:23 AM
4.0.005
1MB
Thaoky
12-03-10 09:24 AM
4.0.004c
1MB
Thaoky
11-24-10 12:25 PM
4.0.004b
1MB
Thaoky
11-21-10 08:00 AM
4.0.004
1MB
Thaoky
11-20-10 07:28 AM
4.0.003
1MB
Thaoky
10-26-10 04:49 AM
4.0.002
1MB
Thaoky
10-17-10 06:39 AM
4.0.001
1MB
Thaoky
10-15-10 09:02 AM
4.0.001
1MB
Thaoky
10-15-10 08:04 AM


Post A Reply Comment Options
Unread 06-14-09, 10:38 AM  
Thaoky
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 609
Uploads: 2
Originally posted by cypsyan
Feature request

could you add a tooltip to the bar icon that display profession cooldown+items timers like "Broker Trade Cooldown" do

http://www.wowinterface.com/download...Cooldowns.html
take care if you watch this addons code because it has some bug saving variable(like CD finish while its not but when you open trade windows its still in CD (but addon update itself, while some other addons cant))
Profession CD's are tracked in the addon's calendar, and there are also warnings when the CD is about to be ready & so on. Isn't that enough ? I mean, I would rather enhance the current calendar implementation than lean towards a tooltip (which, although minimal, was the previous implementation).

Let me know more, I'm really keen on improving the current implementation.
Thaoky is offline Report comment to moderator  
Reply With Quote
Unread 06-14-09, 07:30 AM  
acceleratum
A Kobold Labourer

Forum posts: 0
File comments: 4
Uploads: 0
Awesome addon, solved almost all my problems, to be absolutely perfect it needs 2 things tho:

Currency panel for chars (Honor, stone keeper shards, emblems etc..)

Saved Raids/heroics: I use savedinstances addon wich is great but all of this in altoholic would allow me to get rid of other addons.

Great Addon anyway, keep up the good work.
acceleratum is offline Report comment to moderator  
Reply With Quote
Unread 06-14-09, 06:06 AM  
Strongbow
A Deviate Faerie Dragon
 
Strongbow's Avatar

Forum posts: 11
File comments: 96
Uploads: 0
I'm getting this error in the latest version.

-Edit- I'm not using FuBar so that might be the problem, I'm a LDB user =)

Code:
Date: 2009-06-14 14:04:38
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\Altoholic\Altoholic.lua line 2261:
   attempt to call method 'IsFuBarMinimapAttached' (a nil value)
Debug:
   (tail call): ?
   Altoholic\Altoholic.lua:2261: ?()
   ...ker\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146:
      ...ker\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146
   [string "safecall Dispatcher[3]"]:4:
      [string "safecall Dispatcher[3]"]:4
   [C]: ?
   [string "safecall Dispatcher[3]"]:13: ?()
   ...ker\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:91: Fire()
   ...\AddOns\Altoholic\libs\AceEvent-3.0\AceEvent-3.0.lua:119:
      ...\AddOns\Altoholic\libs\AceEvent-3.0\AceEvent-3.0.lua:118
-Strongbow-
Last edited by Strongbow : 06-14-09 at 06:08 AM.
Strongbow is offline Report comment to moderator  
Reply With Quote
Unread 06-14-09, 04:44 AM  
cypsyan
A Kobold Labourer

Forum posts: 0
File comments: 45
Uploads: 0
Feature request

could you add a tooltip to the bar icon that display profession cooldown+items timers like "Broker Trade Cooldown" do

http://www.wowinterface.com/download...Cooldowns.html
take care if you watch this addons code because it has some bug saving variable(like CD finish while its not but when you open trade windows its still in CD (but addon update itself, while some other addons cant))
cypsyan is offline Report comment to moderator  
Reply With Quote
Unread 06-14-09, 01:01 AM  
Thaoky
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 609
Uploads: 2
Originally posted by cypsyan
i dont have FTP server account to give link of SS but error is in the end of my post
few days dont have event tooltip (look like they have mysterious egg (end event))
and this only by mouse over the day




Date: 2009-06-14 12:58:54
ID: 1
Error occured in: Global
Count: 22
Message: ..\AddOns\Altoholic\Frames\Calendar.lua line 359:
bad argument #2 to 'format' (string expected, got nil)
Debug:
(tail call): ?
[C]: ?
[C]: format()
Altoholic\Frames\Calendar.lua:359: OnEnter()
[string "*:OnEnter"]:1:
[string "*:OnEnter"]:1
Good news: I managed to reproduce it, should be fixed soon.

edit: fixed in .003b
Last edited by Thaoky : 06-14-09 at 01:43 AM.
Thaoky is offline Report comment to moderator  
Reply With Quote
Unread 06-14-09, 01:00 AM  
Thaoky
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 609
Uploads: 2
Originally posted by AnrDaemon
Well, the AddLine API reference on wowprogramming is (was) wrong.
It has only five parameters - GameTooltip:AddLine(text, r, g, b, wrap)
That's why my initial editings didn't worked >.>
I just checked, there's a mistake on my side, I do not need 5 "1" at the end of AddLine. The last one is useless (don't know where I got it from xD), but the fourth (wrap) remains necessary to me.
Thaoky is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 08:02 PM  
cypsyan
A Kobold Labourer

Forum posts: 0
File comments: 45
Uploads: 0
i dont have FTP server account to give link of SS but error is in the end of my post
few days dont have event tooltip (look like they have mysterious egg (end event))
and this only by mouse over the day




Date: 2009-06-14 12:58:54
ID: 1
Error occured in: Global
Count: 22
Message: ..\AddOns\Altoholic\Frames\Calendar.lua line 359:
bad argument #2 to 'format' (string expected, got nil)
Debug:
(tail call): ?
[C]: ?
[C]: format()
Altoholic\Frames\Calendar.lua:359: OnEnter()
[string "*:OnEnter"]:1:
[string "*:OnEnter"]:1
cypsyan is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 05:32 PM  
AnrDaemon
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 115
File comments: 2388
Uploads: 6
Originally posted by cypsyan
hi thaoky, im getting this error with calendar as well on clicking or simply by passing the cursor over some event, and im playing US version
Over which events? Screenshot please.
And copy of error dump.
Last edited by AnrDaemon : 06-13-09 at 05:32 PM.
AnrDaemon is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 05:31 PM  
AnrDaemon
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 115
File comments: 2388
Uploads: 6
Well, the AddLine API reference on wowprogramming is (was) wrong.
It has only five parameters - GameTooltip:AddLine(text, r, g, b, wrap)
That's why my initial editings didn't worked >.>
AnrDaemon is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 05:26 PM  
cypsyan
A Kobold Labourer

Forum posts: 0
File comments: 45
Uploads: 0
hi thaoky, im getting this error with calendar as well on clicking or simply by passing the cursor over some event, and im playing US version
cypsyan is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 01:57 PM  
AnrDaemon
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 115
File comments: 2388
Uploads: 6
Originally posted by Thaoky
Nice !

I'd assume that gets rid of the double display of data when informant is present, I'll get this into the addon soon.
That was original intention, barring the temptation of having some finer control over info placement and such.
But the coding transparency is a nice addition, too.

Originally posted by Thaoky
edit: made a few tests, it's partially convincing so far, my problem lies with the hook on GameTooltip:Show which I used to display information on gathering nodes. I need more time to dig this issue, but if I can't it would be a dealbreaker at this point.
I think it could be resolved. Library intended to be able to hook to any tooltip in game. Including custom tooltips.
Didn't digged deeper into the issue.

Originally posted by Thaoky
In addition to this, lines like
Code:
tooltip:AddLine(self.RecipeCache, 1, 1, 1, 1, 1);
Must stay as they are, because the last parameter is used to wrap the line when its too long, and this is not supported by LibExtraTip.
That's strange news, it is really that bad?
I didn't got time to come to the longer lines which would be need to be wrapped (mounts/pets list f.e.), gonna see how it works, now.
And try to get in touch with library author(s).
Hacking this ability into library shouldn't be hard, but this is something that should be there as library API function.

Mmm... and i just came across the proposal to alter API in a usual way...
/me going to write some lines of code
AnrDaemon is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 05:57 AM  
Thaoky
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 609
Uploads: 2
Originally posted by AnrDaemon
Well, nevermind.

That's all!
You can further simplify it's look by linking to nTipHelper instead of LibExtratip, but I think it's not worth the overhead.
Nice !

I'd assume that gets rid of the double display of data when informant is present, I'll get this into the addon soon.

edit: made a few tests, it's partially convincing so far, my problem lies with the hook on GameTooltip:Show which I used to display information on gathering nodes. I need more time to dig this issue, but if I can't it would be a dealbreaker at this point.

In addition to this, lines like
Code:
tooltip:AddLine(self.RecipeCache, 1, 1, 1, 1, 1);
Must stay as they are, because the last parameter is used to wrap the line when its too long, and this is not supported by LibExtraTip.
Last edited by Thaoky : 06-13-09 at 09:37 AM.
Thaoky is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 05:55 AM  
Thaoky
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 609
Uploads: 2
Re: Bug

Originally posted by tripler
When selecting the option to add Altoholic to Fubar V3.6 I receive the following error:
I just fixed these issues too btw.
Thaoky is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 05:54 AM  
Thaoky
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 609
Uploads: 2
Originally posted by Wall
getting

[2009/06/12 21:07:27-643-x2]: Altoholic-v3.1.003\Frames\Calendar.lua:359: bad argument #2 to 'format' (string expected, got nil)
Altoholic-v3.1.003\Frames\Calendar.lua:359: in function `OnEnter'
<string>:"*:OnEnter":1: in function <[string "*:OnEnter"]:1>

and

[2009/06/12 21:07:28-643-x2]: Altoholic-v3.1.003\Frames\Calendar.lua:487: attempt to index local 's' (a nil value)
Altoholic-v3.1.003\Frames\Calendar.lua:343: in function `OnClick'
<string>:"*:OnClick":1: in function <[string "*:OnClick"]:1>

when mouse over an event on the calendar
I'd need to know in which language you're playing and get a screenshot of the calendar pane + error message if possible, it would greatly help

Thanks in advance.
Thaoky is offline Report comment to moderator  
Reply With Quote
Unread 06-13-09, 12:25 AM  
AnrDaemon
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 115
File comments: 2388
Uploads: 6
Well, nevermind.
Code:
-- Experiment begin here
local libTT = LibStub("LibExtraTip-1")

function Altoholic.Tooltip.LextGameTooltip(tooltip, item, quantity, ...)

	local self = Altoholic.Tooltip
	local name, link = ...
	if link then
		self:ProcessEx(tooltip, name, item, ...)
	end

end

function Altoholic.Tooltip:ProcessEx(tooltip, name, link, ...)
	--	*** Note about tooltips ***
	--	If an error occurs with a specific item, like a gathering node, make sure its item id is valid in core.lua
	--	28/12/2008: I fixed an issue with black lotus, which did not display its counters at all, this was due to an invalid item id

	local itemID = Altoholic:GetIDFromLink(link)

	-- if there's no cached item id OR if it's different from the previous one ..
	if (not self.CachedItemID) or
		(self.CachedItemID and (itemID ~= self.CachedItemID)) then

		self.RecipeCache = nil

		-- these are the cpu intensive parts of the update .. so do them only if necessary
		self.CachedSource = nil
		if Altoholic.Options:Get("TooltipSource") == 1 then
			local Instance, Boss = Altoholic.Loots:GetSource(itemID)

			self.CachedItemID = itemID			-- we have searched this ID ..

			if Instance then
				self.CachedSource = GOLD .. L["Source"]..  ": |cff00ff9a" .. Instance .. ", " .. Boss
			end
		end

		-- .. then check player bags to see how many times he owns this item, and where
		if Altoholic.Options:Get("TooltipCount") == 1 or Altoholic.Options:Get("TooltipTotal") == 1 then
			self.CachedCount = Altoholic:GetItemCount(itemID) -- if one of the 2 options is active, do the count
			if self.CachedCount > 0 then
				self.CachedTotal = GOLD .. L["Total owned"] .. ": |cff00ff9a" .. self.CachedCount
			else
				self.CachedTotal = nil
			end
		end
	end

	-- add item cooldown text
	local owner = tooltip:GetOwner()
	if owner and owner.startTime then
		libTT:AddLine(tooltip, format(ITEM_COOLDOWN_TIME,
				SecondsToTime(owner.duration - (GetTime() - owner.startTime))), nil, nil, nil, true);
	end

	if (Altoholic.Options:Get("TooltipCount") == 1) then			-- add count per character
		libTT:AddLine(tooltip, " ", nil, nil, nil, true);
		for CharacterName, c in pairs (V.ItemCount) do
			libTT:AddDoubleLine(tooltip, CharacterName,  TEAL .. c, nil, nil, nil, nil, nil, nil, true);
		end
	end

	if (Altoholic.Options:Get("TooltipTotal") == 1) and (self.CachedTotal) then		-- add total count
		libTT:AddLine(tooltip, self.CachedTotal, nil, nil, nil, true);
	end

	if self.CachedSource then		-- add item source
		libTT:AddLine(tooltip, " ", nil, nil, nil, true);
		libTT:AddLine(tooltip, self.CachedSource, nil, nil, nil, true);
	end

	-- Altoholic:CheckMaterialUtility(itemID)

	if Altoholic.Options:Get("TooltipItemID") == 1 then
		local iLevel = select(4, GetItemInfo(itemID))

		if iLevel then
			libTT:AddLine(tooltip, " ", nil, nil, nil, true);
			libTT:AddDoubleLine(tooltip, "Item ID: " .. GREEN .. itemID,  "iLvl: " .. GREEN .. iLevel, nil, nil, nil, nil, nil, nil, true);
--			tooltip:AddLine(TEAL .. select(10, GetItemInfo(itemID)));		-- texture path
		end
	end

	local companionID = Altoholic:GetCompanionSpellID(itemID)
	if companionID then
		libTT:AddLine(tooltip, "<pets-todo>", nil, nil, nil, true);
		-- self:WhoKnowsPet(companionID, "CRITTER", tooltip)
		return	-- it's certainly not a recipe if we passed here
	end

	local mountID = Altoholic:GetMountSpellID(itemID)
	if mountID then
		libTT:AddLine(tooltip, "<mounts-todo>", nil, nil, nil, true);
		-- self:WhoKnowsPet(mountID, "MOUNT", tooltip)
		return	-- it's certainly not a recipe if we passed here
	end


	if Altoholic.Options:Get("TooltipRecipeInfo") == 0 then return end -- exit if recipe information is not wanted

	local _, _, _, _, _, itemType, itemSubType = ... -- Reuse already called GetItemInfo(itemID)
	if itemType ~= BI["Recipe"] then return end		-- exit if not a recipe
	if itemSubType == BI["Book"] then return end		-- exit if it's a book

	if not self.RecipeCache then
		local tooltipName = tooltip:GetName()
		local reqLevel
		for i = 2, tooltip:NumLines() do			-- parse all tooltip lines, one by one
			local tooltipText = _G[tooltipName .. "TextLeft" .. i]:GetText()
			if tooltipText then
				if string.find(tooltipText, "%d+") then	-- try to find a numeric value ..
					reqLevel = tonumber(string.sub(tooltipText, string.find(tooltipText, "%d+")))
					break
				end
			end
		end
		self.RecipeCache = self:WhoKnowsRecipe(itemSubType, link, reqLevel)
	end

	if self.RecipeCache then
		libTT:AddLine(tooltip, " ", nil, nil, nil, true);
		libTT:AddLine(tooltip, self.RecipeCache, nil, nil, nil, true);
	end
end

if libTT then
  libTT:RegisterTooltip(GameTooltip)
  libTT:RegisterTooltip(ItemRefTooltip)
  libTT:AddCallback(Altoholic.Tooltip.LextGameTooltip, 350)
end

-- Experiment end here
That's all!
You can further simplify it's look by linking to nTipHelper instead of LibExtratip, but I think it's not worth the overhead.
AnrDaemon is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.