Delayed Closing of a Dialog Box

Started by Splyth, May 17, 2019, 11:32:18 PM

Previous topic - Next topic
The situation:
Currently when a player selects an answer to a question the dialog box instantly closes:

What I want:
I'd like to delay closing the dialog box for half a second or so. I really I should be able to configure however much time I want.

Why is this needed:
I'd like to do things like play a sound or change the cursor to a new image. (e.g. display a thumbs up or play a small animation)

Anyone have any thoughts on how to tackle this?

Im a bit drunk but are you after something like

if answer == 1 then -- Yes
sol.timer.start(map, 500, function() -- (1000 = 1 second)
sol.audio.play_sound("Blah_blah")
end)
else -- no
sol.timer.start(map, 100000000000, function()
end)


-- this might not be accurate, also dont use this as you'd be waiting 100,000,000 seconds for it to close on a no situation....again, drunk.

I was drinking last night too so no worries.  I'm swamped today but I think I'll have a few hours tomorrow.

I think the thing I was missing was  placing the timer on the game object. I'll try it and get back to you.

Thanks!