I have a custom Say function that's like this:
Code: ags
This function works fine. The problem is with WaitMouseKey, in that during a cutscene with lots of dialogue, I'd like the player to be able to pause the game during the cutscene (by pressing P, for example). Pressing P during a cutscene while the speech GUI is visible doesn't do anything, it just treats it like any key press. So I was wondering how I could have the WaitMouseKey in this code ignore certain keys?
In truth, I was originally trying to have the function only respond to mouse clicks and the Enter key, instead of responding to any mouse clicks/key presses. I tried to do it by modifying the loop to something like:
Code: ags
Which I suppose worked with the speech aspect, but would also cause some bugs in other areas, and not "queue" speech lines.
void Saying(this Character*, String msg) {
gSpchWindow.Visible = true;
lSpeechText.Text = msg;
lSpeakerName.Text = this.Name;
while (WaitMouseKey(40) == 0 && !Game.SkippingCutscene) { // wait until key or mouse click
/*...Irrelevant animation code...*/
}
gSpchWindow.Visible = false;
}
This function works fine. The problem is with WaitMouseKey, in that during a cutscene with lots of dialogue, I'd like the player to be able to pause the game during the cutscene (by pressing P, for example). Pressing P during a cutscene while the speech GUI is visible doesn't do anything, it just treats it like any key press. So I was wondering how I could have the WaitMouseKey in this code ignore certain keys?
In truth, I was originally trying to have the function only respond to mouse clicks and the Enter key, instead of responding to any mouse clicks/key presses. I tried to do it by modifying the loop to something like:
while (!Mouse.IsButtonDown(eMouseLeft) && !IsKeyPressed(eKeyReturn) && !Game.SkippingCutscene) {
while (WaitMouseKey(40) == 0) {
/*....*/
}
}
Which I suppose worked with the speech aspect, but would also cause some bugs in other areas, and not "queue" speech lines.