From 80432ef36a514065a190290a7bacc456996cc486 Mon Sep 17 00:00:00 2001 From: Kostas Nakos Date: Sat, 9 Jun 2007 10:06:05 +0000 Subject: add nippon support svn-id: r27244 --- backends/platform/wince/CEActionsPocket.cpp | 17 +++++++++++++++-- backends/platform/wince/CEActionsSmartphone.cpp | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index cfc029536e..81de8e779c 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -127,11 +127,12 @@ void CEActionsPocket::initInstanceGame() { bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); bool is_agi = (gameid == "agi"); + bool is_parallaction = (gameid == "parallaction"); GUI_Actions::initInstanceGame(); // See if a right click mapping could be needed - if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche) + if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche || is_parallaction) _right_click_needed = true; // See if a "hide toolbar" mapping could be needed @@ -157,6 +158,9 @@ void CEActionsPocket::initInstanceGame() { } else if (is_agi) { _action_enabled[POCKET_ACTION_SAVE] = true; _key_action[POCKET_ACTION_SAVE].setAscii(SDLK_ESCAPE); + } else if (is_parallaction) { + _action_enabled[POCKET_ACTION_SAVE] = true; + _key_action[POCKET_ACTION_SAVE].setAscii(SDLK_s); } else { _action_enabled[POCKET_ACTION_SAVE] = true; _key_action[POCKET_ACTION_SAVE].setAscii(319); // F5 key @@ -164,7 +168,7 @@ void CEActionsPocket::initInstanceGame() { // Quit _action_enabled[POCKET_ACTION_QUIT] = true; // Skip - if (!is_cine) + if (!is_cine && !is_parallaction) _action_enabled[POCKET_ACTION_SKIP] = true; if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_saga || is_kyra || is_touche) _key_action[POCKET_ACTION_SKIP].setAscii(VK_ESCAPE); @@ -233,6 +237,15 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { case POCKET_ACTION_SAVE: case POCKET_ACTION_SKIP: case POCKET_ACTION_MULTI: + if (action == POCKET_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { + // FIXME: This is a temporary solution. The engine should handle its own menus. + // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience + GUI::MessageDialog alert("Do you want to load or save the game?", "Load", "Save"); + if (alert.runModal() == GUI::kMessageOK) + _key_action[action].setAscii(SDLK_l); + else + _key_action[action].setAscii(SDLK_s); + } EventsBuffer::simulateKey(&_key_action[action], true); return true; case POCKET_ACTION_KEYBOARD: diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index 309aefd95d..e65af8fc53 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -117,11 +117,12 @@ void CEActionsSmartphone::initInstanceGame() { bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); bool is_agi = (gameid == "agi"); + bool is_parallaction = (gameid == "parallaction"); GUI_Actions::initInstanceGame(); // See if a right click mapping could be needed - if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche) + if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche || is_parallaction) _right_click_needed = true; // Initialize keys for different actions @@ -140,6 +141,9 @@ void CEActionsSmartphone::initInstanceGame() { } else if (is_agi) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; _key_action[SMARTPHONE_ACTION_SAVE].setAscii(SDLK_ESCAPE); + } else if (is_parallaction) { + _action_enabled[SMARTPHONE_ACTION_SAVE] = true; + _key_action[SMARTPHONE_ACTION_SAVE].setAscii(SDLK_s); } else { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; _key_action[SMARTPHONE_ACTION_SAVE].setAscii(319); // F5 key @@ -194,6 +198,15 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { case SMARTPHONE_ACTION_SAVE: case SMARTPHONE_ACTION_SKIP: case SMARTPHONE_ACTION_MULTI: + if (action == SMARTPHONE_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { + // FIXME: This is a temporary solution. The engine should handle its own menus. + // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience + GUI::MessageDialog alert("Do you want to load or save the game?", "Load", "Save"); + if (alert.runModal() == GUI::kMessageOK) + _key_action[action].setAscii(SDLK_l); + else + _key_action[action].setAscii(SDLK_s); + } EventsBuffer::simulateKey(&_key_action[action], true); return true; case SMARTPHONE_ACTION_RIGHTCLICK: -- cgit v1.2.3