From 5f4d594150976e9624ca0c93e92d1bb07970876f Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sun, 17 Nov 2002 15:15:26 +0000 Subject: implemented quit_if_user_presses_y() svn-id: r5589 --- simon/items.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'simon') diff --git a/simon/items.cpp b/simon/items.cpp index 321b558016..36c064aec4 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -775,7 +775,7 @@ int SimonState::runScript() break; case 135:{ - warning("Quit if user presses Y unimplemented"); + o_quit_if_user_presses_y(); } break; @@ -1479,6 +1479,20 @@ void SimonState::o_177() } } +void SimonState::o_quit_if_user_presses_y() +{ + OSystem::Event event; + + for (;;) { + _system->poll_event(&event); + if (event.event_code == OSystem::EVENT_KEYDOWN) + if (event.kbd.keycode == 'y') + _system->quit(); + else if (event.kbd.keycode == 'n') + break; + delay(10); + } +} void SimonState::o_unk_137(uint fcs_index) { -- cgit v1.2.3