WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   how to redefine an offical <OnEnter>? (https://www.wowinterface.com/forums/showthread.php?t=2254)

xmlover 10-28-05 11:25 PM

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..... :confused:

Gello 10-29-05 08:45 AM

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.

mondinga 10-29-05 09:47 AM

local enterFunc = MainMenuExpBar:GetScript("OnEnter");
local newFunc function ()
-- your stuff here
end

MainMenuExpBar:SetScript("OnEnter", function ()
enterFunc()
newFunc();
end);

xmlover 10-31-05 04:25 AM

:eek: GREAT!!!

i learned a lot!!!!!!

THX both Gello and mondinga!!!

hmmm.i will try and back with Qs(hope not) :) :o


All times are GMT -6. The time now is 07:20 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI