I’ve got a problem where i’m passing a message and loading a gui from the loader script in the same function resulting in both things being executed in the same frame. This has resulted in the gui being messaged before the gui has been enabled/loaded. Does anyone know how i can message the gui after it has been loaded.
This code below both recieves the message which will be passed to the gui and also passes a message to the loader script to call for the gui to be loaded:
if message_id == hash("game_complete") then
self.timer = message[timer]
unload_game(self)
load_level_complete(self)
end
At the moment this function both loads and sends the message to the gui
local function load_level_complete(self)
msg.post("go#level_complete", "load")
msg.post("go#level_complete", "enable")
msg.post("level_completed:/level_completed#level_completed", "time", {timer = self.timer})
end
How can i split the message from the line that gets the gui to load so that the gui can recieve the message after it has loaded