WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   PetWindow Problem (https://www.wowinterface.com/forums/showthread.php?t=183)

Leandred 01-27-05 01:55 AM

PetWindow Problem
 
1 Attachment(s)
I'm making a conversion of vert EQ UI to WoW.


I have a problem with it. When i summon the pet the window doesn't
appear. I have to ReloadUI() to make it show. And when i dispand
pet the window doesnt disappear.

Could someone look at my attached files and point out what i did wrong?
I'm new to lua so please bare with me.

Ciao Leandred

Goatus 01-30-05 07:39 PM

hmm don't know if found your bug already but i will try answering

From what i can see you call PetWindow_Update (which is responsible for showing hidding your frame) only OnLoad for your frame.

Code:

function PetWindow_OnLoad()
       
        [cut]
       
        this.attackModeCounter = 0;
        this.attackModeSign = -1;
        --this.flashState = 1;
        --this.flashTimer = 0;
        PetWindow_Update();
        CombatFeedback_Initialize(PetHitIndicator, 30);
       
        [cut]
end

But OnLoad happens much earlier then UnitExist("pet") returns true so it won't show... You should call PetWindow_Update at least on event: "PLAYER_PET_CHANGED"

here:

Code:

function PetWindow_OnEvent()
        PeW_OnEvent(event);
        if ( event == "PLAYER_PET_CHANGED" ) then
                PeW_Update();
                PetWindow_Update();
                return;
        end
        if ( event == "PLAYER_ENTERING_WORLD" ) then
                PeW_Update();
                return;
        end

end

that should fix it :)

Leandred 02-01-05 04:08 AM

Thanks, i found it. Did some changes further up in the code. Forgot to edit this post though ><

But thank you for taking your time :)

Ciao


All times are GMT -6. The time now is 06:41 AM.

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