Quantcast how to redefine an offical <OnEnter>? - WoWInterface
Thread Tools Display Modes
10-28-05, 11:25 PM   #1
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
how to redefine an offical <OnEnter>?

what i thought is to show my tooltip when mouse moves over the default EXPBar....

i check the offical MainMenuBar.xml

and found

Code:
<OnEnter>
        TextStatusBar_UpdateTextString();
        ShowTextStatusBarText(this);
        ExhaustionTick.timer = 1;
GameTooltip_AddNewbieTip(XPBAR_LABEL, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_XPBAR, 1);
       GameTooltip.canAddRestStateLine = 1;
</OnEnter>
hmmm,,,,which function should i hook.....once i thought to hook a EXPBar_OnEnter(),but now,i was confused......



if no results.....i will define a new frame over the default EXPBar..... but ...it's not what I want.....
  Reply With Quote
10-29-05, 08:45 AM   #2
Gello
A Firelord
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 478
Try hooking GameTooltip_AddNewbieTip?

GameTooltip_AddNewbieTip(XPBAR_LABEL, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_XPBAR, 1)

Something like:

oldGameTooltip_AddNewbieTip = GameTooltip_AddNewbieTip
GameTooltip_AddNewbieTip = newGameTooltip_AddNewbieTip

function newGameTooltip_AddNewbieTip(v1,v2,v3,v4,v5,v6)
oldGameTooltip_AddNewbieTip(v1,v2,v3,v4,v5,v6)
GameTooltip:AddLine("Another line")
end

There's a way to pack/unpack arguments (the v1..v6 bit) which I've seen used but don't understand it completely.
  Reply With Quote
10-29-05, 09:47 AM   #3
mondinga
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 66
local enterFunc = MainMenuExpBar:GetScript("OnEnter");
local newFunc function ()
-- your stuff here
end

MainMenuExpBar:SetScript("OnEnter", function ()
enterFunc()
newFunc();
end);
  Reply With Quote
10-31-05, 04:25 AM   #4
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
GREAT!!!

i learned a lot!!!!!!

THX both Gello and mondinga!!!

hmmm.i will try and back with Qs(hope not)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » how to redefine an offical <OnEnter>?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off