WoW:API GameTooltip SetPlayerBuff: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
({{widgetmethod}})
(Updated to match the current API boilerplate.)
Line 1: Line 1:
{{widgetmethod}}
{{widgetmethod}} __NOTOC__
{{stub/api}}


MUST access it in this fasion, if you want to specify what TYPE of buff you want to set the tooltip to.


Sets a GameTooltip to a player buff of the type last used in [[API GetPlayerBuff|GetPlayerBuff]].
GameTooltip:SetPlayerBuff(buffIndex)


local buffIndex, untilCancelled = [[API GetPlayerBuff|GetPlayerBuff]](blah.index, "HARMFUL");


GameTooltip:SetPlayerBuff(buffIndex);
== Arguments ==
:; buffIndex : Number - The index of the buff to set in the game tooltip (affected by the filter used in [[API GetPlayerBuff|GetPlayerBuff]])




From what I can understand, GetPlayerBuff sets what type of buff-type that SetPlayerBuff will use.
== Returns ==
It will use whatever last type of buff you specified in GetPlayerBuff, hence the reason you should specify GetPlayerBuff right before you call SetPlayerBuff.
:nil




I also tried to have GameTooltip:SetPlayerBuff(blah.index), seeing as how blah.index and buffIndex are the same number, but it wouldn't work. You MUST have it as above.
== Example ==
local buffIndex, untilCancelled = GetPlayerBuff(1, "HARMFUL");
GameTooltip:SetPlayerBuff(buffIndex);


<big>'''Result'''</big>


Options for GetPlayerBuff are : HELPFUL|HARMFUL|PASSIVE
The GameTooltip is set to the first harmful buff.
 
 
== Details ==
: It will use whatever the last type of buff you specified in GetPlayerBuff was, hence the reason you should specify GetPlayerBuff right before you call SetPlayerBuff.
: Options for the GetPlayerBuff filter are : HELPFUL|HARMFUL|PASSIVE

Revision as of 15:24, 27 June 2007

Widget API ← GameTooltip < SetPlayerBuff


Sets a GameTooltip to a player buff of the type last used in GetPlayerBuff.

GameTooltip:SetPlayerBuff(buffIndex)


Arguments

buffIndex
Number - The index of the buff to set in the game tooltip (affected by the filter used in GetPlayerBuff)


Returns

nil


Example

local buffIndex, untilCancelled = GetPlayerBuff(1, "HARMFUL");
GameTooltip:SetPlayerBuff(buffIndex);

Result

The GameTooltip is set to the first harmful buff.


Details

It will use whatever the last type of buff you specified in GetPlayerBuff was, hence the reason you should specify GetPlayerBuff right before you call SetPlayerBuff.
Options for the GetPlayerBuff filter are : HELPFUL|HARMFUL|PASSIVE