Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle more key presses in message dialog. #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/MessageBox/MessageBox.as
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ class MessageBox extends MovieClip

private function onKeyDown(): Void
{
if (Key.getCode() == 89 && _buttons[0].ButtonText.text == "Yes") {
//Select yes on the key press of 'Y' or 'E' or space key.
if (_buttons[0].ButtonText.text == "Yes" && (Key.getCode() == 89 || Key.getCode() == 69 || Key.getCode() == Key.SPACE)) {
GameDelegate.call("buttonPress", [0]);
return;
}
if (Key.getCode() == 78 && _buttons[1].ButtonText.text == "No") {
//Select no on the key press of 'N' or escape or tab key.
if (_buttons[1].ButtonText.text == "No" && (Key.getCode() == 78 || Key.getCode() == Key.ESCAPE || Key.getCode() == Key.TAB)) {
GameDelegate.call("buttonPress", [1]);
return;
}
Expand Down