[1.7.3] Roster Tooltip Mod for Gems and Enchants (v1.3)

Item tooltips with Gem Sockets and Enchantment coloring

Moderator: ds

[1.7.3] Roster Tooltip Mod for Gems and Enchants (v1.3)

Postby ds » Mon Feb 19, 2007 9:49 pm

Over the weekend I decided I wanted to have the cool looking Tooltip with Gems being shown and bring back Enchantment coloring for the tooltips.

I discovered that CP does not pass the color in the tooltip any longer (maybe in the future it will be come back?) So I decided the only way to get that information is to work with the WoW Item IDs. This also allowed me to find Gems in the items and color them and put the Icon next to them like WoW.exe does. To do this it requires a database of the Gem Sockets IDs (not the same as the Gem Item IDs). The same is true for the enchantments. More on this later.

Stop reading this if you run a non English version of the roster, this release will not work--if this mod turns out to be worthwhile I will make a localized version.

How the Mod works:

I added onto the current function colorTooltip();
It now takes another arg $itemid. When this is passed to colorTooltip(); it will do the additional parsing for Sockets and Enchantments. (No need for this parsing for other tooltips--recipe lists, general tooltips, etc).

Added two new functions to the file commonfunctions.lib.php
parseItemId($itemid); & parseTooltipEnchantments($parsedToolTip, $itemid);
$itemid = the wow itemid string
$parsedToolTip = the parsed tooltip from the function colorToolTip();

parseTooltipEnchantments(); returns a final parsed tooltip variable to colorToolTip for final processing though OverLib.

I added a new file called lib/WoW_IDs.php.
This file contains the database (in 2 arrays) of the Enchantment ID's ($enchantment_ids) and Gem ID's ($gem_ids). The Enchantment ID array is pretty complete as I was able to find this information at http://www.wowwiki.com/EnchantId this data is Pre WoW 2.0 and Before the Rating System but I think I have converted all the data correctly. I am missing some of the new high level enchantments but if you have tooltip debugging enabled it will alert you of this and show the Enchantment ID. When this happens just post the information here and I will add it to the file.

The format of $enchantment_ids is as follows:

'EnchantID' => 'Enchant Text'
'2646' => '+25 Agility',


The other part is the Gem database. This is far from complete but I have added (i think) all known gems in the game HOWEVER most of the data does not have the SOCKETED_ID number required for the tooltip to parse out correctly. For example:
Code: Select all
$gem_ids = array
(
'30601' => array
(
'name' => 'Beaming Fire Opal',
'txt'  => 'Dodge Rating +5 and Resilience Rating +4',
'img'  => 'INV_Jewelcrafting_NobleTopaz_03',
),

The number "30601" is the ItemID of the gem itself; to make the tooltip work correctly we need to know its Socketed_ID. The only way I know how to get this information is to socket the gem! So what I have done is to look on the roster and find all the gems people have socketed and change the Item ID to the Socketed_ID. The tooltip will report any new GemIDs in the tooltip for you, you just have to open the file and add the socketed ID and your set! (also please post your new gems on this site so we all can benefit from your findings).
Here is an example of a "Corrected" GemID:
Code: Select all
'2698' => array  //corrected
(
'name' => 'Solid Azure Moonstone',
'txt'  => '+9 Stamina',
'img'  => 'INV_Misc_Gem_AzureDraenite_02',
),


Two other things to note about the new file WoW_IDs.php:
At the top of the file you will find two defines,
Code: Select all
define('TOOLTIP_DEBUG', 1);  // debug information
define('OVERLIB_WIDTH', 325); // width in pixels, Roster default is 200.


With the added data in the tooltip I found it necessary to increase the size of the tooltip box. You can easily change this with the new define.

Also you can disable the additional debugging information passed to tooltips. (change the 1 to a 0)

That is about it for the workings of the mod. I am not the best explaining things but I will do my best to support this Mod if people like it and use it.

Attached are the Changed Files and added files for WoW Roster 1.7.3 DO NOT USE THIS ON ANY OTHER VERSION!!!!!!

If you want me to make a post with all the changes I made in a Find/Replace code let me know.

To see the Mod in action check out my guild site here:
http://wow.roa-guild.org/roster/
Attachments
dstooltip_ss_1.jpg
Here is a Screen Shot of v1.3.
dstooltip_ss_1.jpg (80.2 KiB) Viewed 1505 times
wow_ids_rev5.zip
Here is Rev 5 of WoW_IDs.php.

Added many thanks to Subxero and DiscoWay!
(12.57 KiB) Downloaded 166 times
ds_tooltip_mod_v1.3.zip
Version 1.3 of ds_tooltip mod.
This version fixes some problems in v1.2.
Included WoW_IDs.php (rev 5) in this zip file so back yours up if you have new gems/enchant data!
(29 KiB) Downloaded 170 times
Last edited by ds on Tue Feb 27, 2007 3:12 am, edited 6 times in total.
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby Niryk » Mon Feb 19, 2007 10:17 pm

Yes, actually a .diff would be great please as I had waited until 1.7.3 to start a lot of customization with the roster, and though they're not all live yet, I'd like to not have to start them over, but I'd also really like to put this in as we have a lot of people who are using socketed items by now and have good stuff in those sockets.
User avatar
Niryk
WR.net Apprentice
WR.net Apprentice
 
Posts: 33
Joined: Fri Nov 17, 2006 5:31 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby Diska » Tue Feb 20, 2007 10:23 am

Looks great ds001, nice work, hope we'll see this or something alike upstream!
I found one error: You have the image url (img/) and extension (.png) hardcoded. Personally I use jpg and not png. My icons are at the default location so the hardcoded url didn't bother me.
Also, after the enchants you add a line break that isn't there normally, I removed that for myself.
I guess you already realise that you're missing a meta socket icon? Get it here: http://www.unbridled.eu/roster/img/Metasocket.png

Something weird seems to be happening to some items of this person: http://www.unbridled.eu/roster/char.php ... er=Arathor
The Chest, Pants and Boots don't seem to get parsed at all, no debugging information shows up either.

The socket bonus gets converted to a gem too if the text matches :)
Check it out on the legs here: http://www.unbridled.eu/roster/char.php ... er=Arathor

This char has +9 stamina on bracers enchant, but the bracers also has +9 stamina out of the box. Both get colored green: http://www.unbridled.eu/roster/char.php ... er=Arathor
Last edited by Diska on Tue Feb 20, 2007 12:20 pm, edited 9 times in total.
User avatar
Diska
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 179
Joined: Tue Jul 04, 2006 2:05 pm

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby Diska » Tue Feb 20, 2007 10:52 am

My corrections to gems:

Code: Select all
'2755' => array
(
'name' => 'Glinting Flame Spessarite',
'txt'  => '+3 Hit Rating and +3 Agility',
'img'  => 'INV_Misc_Gem_FlameSpessarite_02',
),
'2731' => array
(
'name' => 'Solid Star of Elune',
'txt'  => '+12 Stamina',
'img'  => 'INV_Jewelcrafting_StarOfElune_03',
),
'2757' => array
(
'name' => 'Jagged Deep Peridot',
'txt'  => '+3 Critical Strike Rating and +4 Stamina',
'img'  => 'INV_Misc_Gem_DeepPeridot_02',
),
'2695' => array
(
'name' => 'Gleaming Golden Draenite',
'txt'  => '+6 Spell Critical Rating',
'img'  => 'INV_Misc_Gem_GoldenDraenite_02',
),
'2694' => array
(
'name' => 'Brilliant Golden Draenite',
'txt'  => '+6 Intellect',
'img'  => 'INV_Misc_Gem_GoldenDraenite_02',
),
'2970' => array
(
'name' => 'Swift Starfire Diamond',
'txt'  => '+12 Spell Damage and Minor Run Speed Increase',
'img'  => 'INV_Misc_Gem_Diamond_07',
),
'2761' => array
(
'name' => 'Potent Noble Topaz',
'txt'  => '+4 Spell Critical Rating and +5 Spell Damage',
'img'  => 'INV_Jewelcrafting_NobleTopaz_03',
),
'2763' => array
(
'name' => 'Radiant Talasite',
'txt'  => '+4 Spell Critical Rating and +5 Spell Penetration',
'img'  => 'INV_Jewelcrafting_Talasite_03',
),
'2924' => array
(
'name' => 'Stark Blood Garnet',
'txt'  => '+8 Spell Damage',
'img'  => 'INV_Misc_Gem_Ruby_01',
),
'2960' => array
(
'name' => 'Bright Tourmaline',
'txt'  => '+8 Attack Power',
'img'  => 'INV_Misc_Gem_Ruby_03',
),
'2961' => array
(
'name' => 'Solid Zircon',
'txt'  => '+6 Stamina',
'img'  => 'INV_Misc_Gem_Crystal_03',
),
'2957' => array
(
'name' => 'Delicate Tourmaline',
'txt'  => '+4 Agility',
'img'  => 'INV_Misc_Gem_Ruby_03',
),
'2965' => array
(
'name' => 'Smooth Amber',
'txt'  => '+4 Critical Strike Rating',
'img'  => 'INV_Misc_Gem_Topaz_03',
),
'2966' => array
(
'name' => 'Rigid Amber',
'txt'  => '+4 Hit Rating',
'img'  => 'INV_Misc_Gem_Topaz_03',
),
'2760' => array
(
'name' => 'Potent Flame Spessarite',
'txt'  => '+3 Spell Critical Rating and +4 Spell Damage ',
'img'  => 'INV_Misc_Gem_FlameSpessarite_02',
),
'2743' => array
(
'name' => 'Enduring Talasite',
'txt'  => '+4 Defense Rating and +6 Stamina',
'img'  => 'INV_Jewelcrafting_Talasite_03',
),
'2753' => array
(
'name' => 'Inscribed Noble Topaz',
'txt'  => '+4 Critical Strike Rating and +4 Strength',
'img'  => 'INV_Misc_Gem_Opal_01',
),
'2758' => array
(
'name' => 'Jagged Talasite',
'txt'  => '+4 Critical Strike Rating and +6 Stamina',
'img'  => 'INV_Jewelcrafting_Talasite_03',
),
'2754' => array
(
'name' => 'Flashing Living Ruby',
'txt'  => '+8 Parry Rating',
'img'  => 'INV_Jewelcrafting_LivingRuby_03',
),
'2696' => array
(
'name' => 'Thick Golden Draenite',
'txt'  => '+6 Defense Rating',
'img'  => 'INV_Misc_Gem_GoldenDraenite_02',
),


Additions to enchants:
Code: Select all
'2669' => '+40 Spell Damage',
'2938' => '+20 Spell Penetration',
'2979' => '+29 Healing',
'2981' => '+15 Spell Power',
'2983' => '+26 Attack Power',
'2986' => '+30 Attack Power and +10 Critical Strike Rating',
'3003' => '+34 Attack Power and +16 Hit Rating',
'3011' => '+30 Stamina and +10 Agility',
'3096' => '+17 Strength and +16 Intellect',


Corrections to enchants:
Code: Select all
'2566' => '+24 Healing',
Last edited by Diska on Tue Feb 20, 2007 1:40 pm, edited 32 times in total.
User avatar
Diska
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 179
Joined: Tue Jul 04, 2006 2:05 pm

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby aniodon » Tue Feb 20, 2007 11:36 am

Nice Job =)

I stay tuned for French localisation !
aniodon
WR.net Journeyman
WR.net Journeyman
 
Posts: 108
Joined: Mon Dec 18, 2006 8:09 pm

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby stha64 » Tue Feb 20, 2007 5:41 pm

Another missing gem:

Code: Select all
'2742' => array
(
'name' => 'Luminous Noble Topaz',
'txt'  => '+9 Healing Spells and +4 Intellect',
'img'  => 'INV_Jewelcrafting_NobleTopaz_03',
),


Nice work BTW =)
stha64
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Mon Jan 22, 2007 3:41 pm

Re: [1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby ds » Tue Feb 20, 2007 8:34 pm

Diska wrote:Looks great ds001, nice work, hope we'll see this or something alike upstream!
I found one error: You have the image url (img/) and extension (.png) hardcoded. Personally I use jpg and not png. My icons are at the default location so the hardcoded url didn't bother me.
Also, after the enchants you add a line break that isn't there normally, I removed that for myself.
I guess you already realise that you're missing a meta socket icon? Get it here: http://www.unbridled.eu/roster/img/Metasocket.png

Thanks for pointing out the hardcoded img extension. I corrected that and will release the change with v1.1.
I just forgot to add the Metasocket.png with the release :( I'll add the icon with the v1.1 also.

Diska wrote:Something weird seems to be happening to some items of this person: http://www.unbridled.eu/roster/char.php ... er=Arathor
The Chest, Pants and Boots don't seem to get parsed at all, no debugging information shows up either.

This is because the ItemID is not getting passed in the tooltip. I would have to assume the data was not collected when the profile was updated. You can confirm this by reuploading the profile or looking in your database.

Diska wrote:The socket bonus gets converted to a gem too if the text matches :)
Check it out on the legs here: http://www.unbridled.eu/roster/char.php ... er=Arathor

This char has +9 stamina on bracers enchant, but the bracers also has +9 stamina out of the box. Both get colored green: http://www.unbridled.eu/roster/char.php ... er=Arathor

I did not think about this when I coded the parser. I will have to add some logic to correct that. Thanks!

Also, thank you for you gem and enchant ID's!
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby ds » Tue Feb 20, 2007 8:45 pm

Read 1st post for v1.1 of the Mod. Fixed the Image extentions to use the Roster Default. Included the Metasocket.png Icon.

Also uploaded Rev 2 of the WoW_IDs.php file.
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby DiscoWay » Tue Feb 20, 2007 9:24 pm

Wanted to say, awesome job on the mod, works great! wanted to throw in some extra info for,

WoWRosterDF users.

So far i have run into a few problems.

1. colorsocket pngs aren't showing

How to fix?

open the file
modules/WoWRosterDF/lib/commonfunctions.lib.php

Find (Was line 486 for me)

Code: Select all
$parsedToolTip = preg_replace('/(Yellow|Blue|Red|Meta)\sSocket/i', '<img src="img/${1}socket.png" alt="">  $1 Socket', $parsedToolTip);


replace with

Code: Select all
$parsedToolTip = preg_replace('/(Yellow|Blue|Red|Meta)\sSocket/i', '<img src="modules/WoWRosterDF/img/${1}socket.png" alt="">  $1 Socket', $parsedToolTip);


2. Gem images did not show, also changed png to jpg, Im using the latest image pack 2.0.5

find (was line 496 for me)

Code: Select all
$parsedToolTip = str_replace($gem_ids[$id]['txt'], '<img width="16px" hight="16px" src="img/Interface/Icons/'.$gem_ids[$id]['img'].'.png"><span style="color:#00ff00;">  '.$gem_ids[$id]['txt'].'</span>', $parsedToolTip);


replace with

Code: Select all
$parsedToolTip = str_replace($gem_ids[$id]['txt'], '<img width="16px" hight="16px" src="images/wowrosterdf/Interface/Icons/'.$gem_ids[$id]['img'].'.jpg"><span style="color:#00ff00;">  '.$gem_ids[$id]['txt'].'</span>', $parsedToolTip);



Im sure a majority of WoWRosterDF users know how to fix this sort of thing, but for that small percentage that don't, i hope this helps. =)


Ok, now i have a question. Does this mod also supposed total up the extra enchants and gems and add them the "Bonuses For Equipped Items"? Or should i be using ambisset's modification with this (link below)? I just wanted to be sure i completely understand this mod.

http://www.wowroster.net/Forums/viewtop ... html#16252
User avatar
DiscoWay
WR.net Apprentice
WR.net Apprentice
 
Posts: 25
Joined: Mon Feb 12, 2007 11:40 pm

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby ds » Tue Feb 20, 2007 9:44 pm

discoway wrote:Ok, now i have a question. Does this mod also supposed total up the extra enchants and gems and add them the "Bonuses For Equipped Items"? Or should i be using ambisset's modification with this (link below)? I just wanted to be sure i completely understand this mod.


Not currently. This Mod only mangles the Tooltip information. Perhaps if this mod continues I could add support to the Bonuses area. I really think Calvin will find some way to provide Enchantment and Gem data through CP rather then having a Gem/Enchantment db look up.
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby Subxero » Wed Feb 21, 2007 3:00 am

Siggen problem with these mod :(

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/roster/lib/WoW_IDs.php:2371) in /home/public_html/roster/addons/siggen/siggen.php on line 332

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/roster/lib/WoW_IDs.php:2371) in /home/public_html/roster/addons/siggen/siggen.php on line 333

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/roster/lib/WoW_IDs.php:2371) in /home/public_html/roster/addons/siggen/siggen.php on line 1340
User avatar
Subxero
WR.net Artisan
WR.net Artisan
 
Posts: 234
Joined: Thu Jul 06, 2006 4:08 pm
Realm: Zul'jin (PvE) - US

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby zanix » Wed Feb 21, 2007 3:05 am

Instead of hardcoding the image url, use Roster's variables to write it

Code: Select all
$parsedToolTip = preg_replace('/(Yellow|Blue|Red|Meta)\sSocket/i', '<img src="'.$roster_conf['img_url'].'${1}socket.png" alt="">  $1 Socket', $parsedToolTip);

Code: Select all
parsedToolTip = str_replace($gem_ids[$id]['txt'], '<img width="16px" hight="16px" src="'.$roster_conf['interface_url'].'Interface/Icons/'.$gem_ids[$id]['img'].'.'.$roster_conf['img_suffix'].'"><span style="color:#00ff00;">  '.$gem_ids[$id]['txt'].'</span>', $parsedToolTip);
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby ds » Wed Feb 21, 2007 3:12 am

@Subxero : Odd.. I am running Siggen without this problem. Downloading 0.2.3 now just to make sure it is not that. I did notice I didn't put a ; at the end of the WoW_IDs.php file. Slap a ; at the end of the array... might make it happy.

@Zanix: Changed this already for v1.1 :)
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby ds » Wed Feb 21, 2007 3:22 am

@Subxero: Good catch! All fixed up. Please download Rev3 of WoW_IDs.php (or later) to fix the header problem. You can find this attached to my first post in this Thread.

Thanks!
Last edited by ds on Wed Feb 21, 2007 3:23 am, edited 1 time in total.
Image
ds
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 297
Joined: Sat Jul 08, 2006 9:58 am

[1.7.3] Roster Mod for Enchantment coloring and Sockets

Postby Subxero » Wed Feb 21, 2007 3:30 am

Yes a ; and delete the ?> works like a charm :D

Enchants on head:

"+35 Healing and 7 Mana Per 5 sec." = 3001 (revered thrallmar)

on Shoulders:

"+5 Mana Regen" = 2992 (scryer honored)
"+13 Spell Critical Strike Rating" = 2994
"+13 Critical Strike Rating" = 2996
"+13 Dodge Rating" = 2977

on Shields:

"+12 Intellect" = 2654

on Wrist:

"6 Mana per 5 Sec." = 2679

on Weapons:

"+30 Intellect" = 2666
"Scope (+10 Damage)" = 2722
"Scope (+12 Damage)" = 2723

on legs:

"+46 Healing and + 15 Stamina" = 2745
"+25 Spell Damage and +15 Stamina" = 2747
"+40 Attack Power and +10 Critical Strike Rating" = 3010

on chest:

"+6 All Stats" = 2661

on rings:

"+12 Spell Damage" = 2928

Failed to match enchant_txt from db
+20 Shadow Damage
on gloves (fire,frost.. healing? from aq)

I found losts gems :D

"+2 Mana every 5 seconds" = 2701
"+1 Mana every 5 seconds and 3 Intellect" = 2707
"+3 Agility and +4 Stamina" = 2710
"+8 Dodge Rating" = 2730
"+8 Spell Critical Rating" = 2736
"+5 Spell Damage and +6 Stamina" = 2740
"+3 Spell Critical Rating and +4 Spell Penetration" = 2762
"+10 Spell Penetration" = 2765
"+24 Attack Power and Minor Run Speed Increase" = 2829
"+8 Spell Damage" = 2896
"+3 Stamina, +4 Spell Critical Strike Rating" = 2898
"+9 Healing" = 2958
"+5 Spell Damage" = 2959
"+4 Spirit" = 2962
"+1 Mana every 5 seconds" = 2963
"+4 Intellect" = 2964
"+4 Spell Critical Rating" = 2967
"+4 Defense Rating" = 2968
"+8 Strength" = 3065
Last edited by Subxero on Wed Feb 21, 2007 4:58 am, edited 6 times in total.
User avatar
Subxero
WR.net Artisan
WR.net Artisan
 
Posts: 234
Joined: Thu Jul 06, 2006 4:08 pm
Realm: Zul'jin (PvE) - US

Next

Return to Gem Sockets and Enchants (Roster Tooltip Mod)

Who is online

Users browsing this forum: No registered users and 0 guests

cron