MessageBox style function

Started by
9 comments, last by Programmer16 16 years, 2 months ago
Quote:Original post by Endurion
But there's your problem.

Coroutines don't support yielding while the lua code is calling into C code again.

You really have to let the script set some gamestate variables and call yield. On every frame you call resume on your coroutine and pass in any changed states of the message box. Once that happened the script can continue on its merry way.

You can mask that yield loop in a script function but you won't be able to have a Message Box style function call from C code.


Lol, one of us is misunderstanding the other (I'm not sure if its you me, or me you.) Forgetting the script part all together, I want to have a C++ function that works exactly like MessageBox (displays a message, handles messages, and returns the choice with a single function call.)

I guess the best solution would be to redesign my system to incorporate a more message based system, but I've restarted enough, it's time to finish a project.

This topic is closed to new replies.

Advertisement