WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Delay part of code (https://www.wowinterface.com/forums/showthread.php?t=40023)

frohanss 05-06-11 02:50 AM

Delay part of code
 
I am making a simple addon to display Arena rating as Text on screen with a tooltip that shows detail info.

The addon works nicely. But on login it generates a error on the part where i set the text to display due to addon loading before it have gotten arena team information. A normal /rl does not trigger any errors.

Is there anyway i can add a delay to text so it doesn't generate errors?

Code:

local Text  = LBottom:CreateFontString(nil, "OVERLAY")
Text:SetText("Sometext")


Rilgamon 05-06-11 03:25 AM

Wait for the startup-events like PLAYER_ENTERING_WORLD

http://www.wowpedia.org/Handling_events#Lua-specific


All times are GMT -6. The time now is 11:08 AM.

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