WoW:API GameTooltip SetHyperlink: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
({{widgetmethod}})
(Added enchant info, moved disconnect info to remarks, and changed the wording.)
Line 3: Line 3:
== Syntax ==
== Syntax ==


  SetHyperlink( itemID );
  SetHyperlink( link );




Line 11: Line 11:
=== Arguments ===
=== Arguments ===


:; itemID : string - a string representing an ingame item, i.e. "item:16846:0:0:0" is the link id for the Giantstalker's Helm
:; link : string - a string representing an ingame item or enchant. For instance:
::: "item:16846:0:0:0" is the link id for the "Giantstalker's Helm".
::: "enchant:23804" is the link id for "Enchant Weapon - Mighty Intellect".


=== Returns ===
=== Returns ===
Line 17: Line 19:
: unknown, probably nil
: unknown, probably nil


: If you attempt to reference an item that is not in your local cache, i.e. you've never seen it before, or you attempt to reference a nonexistent item the game will disconnect you. Guessing at this, untested. - Edit: You will not be disconnected, it will read the data from the server cache, but the requests seems to be limited to certain number per time.
== Remarks ==


== Remarks ==
: Calling this function with the same link which is currently shown, will close the Tooltip.
 
: If you attempt to reference an item that is not in your local cache, i.e. you've never seen it before, the client will query the server for information about that item. If that particular item has not been seen since last server restart, the server will disconnect the client.


: Calling this function with the same item which is currently shown, will close the Tooltip.
: Calling this function with an enchant id that does not exist, will give the error message "Unknown link type".


== Example ==
== Example ==

Revision as of 22:38, 13 July 2006

Widget API ← GameTooltip < SetHyperlink

Syntax

SetHyperlink( link );


Parameters

Arguments

link
string - a string representing an ingame item or enchant. For instance:
"item:16846:0:0:0" is the link id for the "Giantstalker's Helm".
"enchant:23804" is the link id for "Enchant Weapon - Mighty Intellect".

Returns

unknown, probably nil

Remarks

Calling this function with the same link which is currently shown, will close the Tooltip.
If you attempt to reference an item that is not in your local cache, i.e. you've never seen it before, the client will query the server for information about that item. If that particular item has not been seen since last server restart, the server will disconnect the client.
Calling this function with an enchant id that does not exist, will give the error message "Unknown link type".

Example

GameTooltip:SetHyperlink("item:16846:0:0:0");

Result

this will replace the currently showing tooltip with one containing the information for the Giantstalker Helm