Ask a Question Using Windows Dialogue
From YoYoGames Wiki
I've seen a few people in the forum under Novice and Intermediate ask this question: "I have GM7 Pro now. How do I ask a question with Windows Dialogue?"
It is actually simple. Here is what you need to do:
wd_message_set_text([string]); switch wd_message_show([type],wd_mb_yes,wd_mb_no,wd_mb_none); case wd_mb_yes: { [expression] break; }
[string]=the text you want to use [type]=the type of message (usually wd_mk_confirmation is used) [expression]=the code you want to use if the answer is yes. Here is an example:
wd_message_set_text("Do you want to save before you exit?") switch wd_message_show(wd_mk_information,wd_mb_yes,wd_mb_no,wd_mb_cancel) case wd_mb_cancel: break; case wd_mb_yes: { game_save("save.sav") game_end() break; } case wd_mb_no: { game_end() break; }
I have added a few things to the example: [wd_mb_cancel]: this is so the user doesn't quit I have also added a few more [case]s. This is so that every button, not just the yes button, gets a code to it. It is important that you use break after you are done each case!

