2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2004-05-09 14:57:04 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-05-09 14:57:04 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-10-31 17:10:45 +00:00
|
|
|
// Disable symbol overrides so that we can use system headers.
|
|
|
|
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
|
|
|
|
|
|
|
#include "backends/platform/wince/wince-sdl.h"
|
2004-05-09 14:57:04 +00:00
|
|
|
|
|
|
|
#include "CEActionsPocket.h"
|
|
|
|
#include "EventsBuffer.h"
|
|
|
|
#include "gui/message.h"
|
|
|
|
#include "common/config-manager.h"
|
2006-01-29 23:23:17 +00:00
|
|
|
#include "gui/KeysDialog.h"
|
|
|
|
|
2010-06-15 11:02:23 +00:00
|
|
|
#include "common/translation.h"
|
|
|
|
|
2010-10-31 17:10:45 +00:00
|
|
|
|
2005-07-05 20:51:54 +00:00
|
|
|
#ifdef _WIN32_WCE
|
2011-03-09 03:02:46 +01:00
|
|
|
#define KEY_ALL_SKIP 3457
|
2005-07-05 20:51:54 +00:00
|
|
|
#endif
|
|
|
|
|
2010-10-31 17:10:45 +00:00
|
|
|
const Common::String pocketActionNames[] = {
|
2010-06-15 11:02:23 +00:00
|
|
|
_s("Pause"),
|
|
|
|
_s("Save"),
|
|
|
|
_s("Quit"),
|
|
|
|
_s("Skip"),
|
|
|
|
_s("Hide Toolbar"),
|
|
|
|
_s("Show Keyboard"),
|
|
|
|
_s("Sound on/off"),
|
|
|
|
_s("Right click"),
|
|
|
|
_s("Show/Hide Cursor"),
|
|
|
|
_s("Free look"),
|
|
|
|
_s("Zoom up"),
|
|
|
|
_s("Zoom down"),
|
|
|
|
_s("Multi Function"),
|
|
|
|
_s("Bind Keys"),
|
|
|
|
_s("Cursor Up"),
|
|
|
|
_s("Cursor Down"),
|
|
|
|
_s("Cursor Left"),
|
|
|
|
_s("Cursor Right"),
|
|
|
|
_s("Left Click")
|
2004-05-09 14:57:04 +00:00
|
|
|
};
|
|
|
|
|
2006-06-06 19:31:49 +00:00
|
|
|
void CEActionsPocket::init() {
|
|
|
|
_instance = new CEActionsPocket(ConfMan.get("gameid"));
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-10-31 17:10:45 +00:00
|
|
|
Common::String CEActionsPocket::actionName(GUI::ActionType action) {
|
2010-06-15 11:02:23 +00:00
|
|
|
return _(pocketActionNames[action]);
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CEActionsPocket::size() {
|
|
|
|
return POCKET_ACTION_LAST;
|
|
|
|
}
|
|
|
|
|
2010-10-31 17:10:45 +00:00
|
|
|
Common::String CEActionsPocket::domain() {
|
2006-06-10 11:06:05 +00:00
|
|
|
return ConfMan.kApplicationDomain;
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CEActionsPocket::version() {
|
|
|
|
return POCKET_ACTION_VERSION;
|
|
|
|
}
|
|
|
|
|
2006-04-12 19:04:10 +00:00
|
|
|
CEActionsPocket::CEActionsPocket(const Common::String &gameid) :
|
2011-03-09 03:02:46 +01:00
|
|
|
GUI::Actions() {
|
2004-05-09 14:57:04 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
_right_click_needed = false;
|
|
|
|
_hide_toolbar_needed = false;
|
|
|
|
_zoom_needed = false;
|
|
|
|
|
2011-03-09 03:02:46 +01:00
|
|
|
for (i = 0; i < POCKET_ACTION_LAST; i++) {
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_mapping[i] = 0;
|
|
|
|
_action_enabled[i] = false;
|
|
|
|
}
|
|
|
|
|
2006-06-10 11:06:05 +00:00
|
|
|
// apply some default settings for emulated mouse
|
|
|
|
_action_enabled[POCKET_ACTION_LEFTCLICK] = true;
|
|
|
|
_action_enabled[POCKET_ACTION_UP] = true;
|
|
|
|
_action_enabled[POCKET_ACTION_DOWN] = true;
|
|
|
|
_action_enabled[POCKET_ACTION_LEFT] = true;
|
|
|
|
_action_enabled[POCKET_ACTION_RIGHT] = true;
|
2007-06-05 19:06:54 +00:00
|
|
|
_action_mapping[POCKET_ACTION_LEFTCLICK] = SDLK_F1;
|
2007-04-28 17:34:09 +00:00
|
|
|
_action_mapping[POCKET_ACTION_UP] = SDLK_UP;
|
|
|
|
_action_mapping[POCKET_ACTION_DOWN] = SDLK_DOWN;
|
|
|
|
_action_mapping[POCKET_ACTION_LEFT] = SDLK_LEFT;
|
|
|
|
_action_mapping[POCKET_ACTION_RIGHT] = SDLK_RIGHT;
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2005-07-05 20:22:56 +00:00
|
|
|
void CEActionsPocket::initInstanceMain(OSystem *mainSystem) {
|
2004-12-20 23:52:16 +00:00
|
|
|
// Nothing generic to do for Pocket PC
|
2011-03-09 03:02:46 +01:00
|
|
|
_CESystem = static_cast<OSystem_WINCE3 *>(mainSystem);
|
2005-07-05 20:22:56 +00:00
|
|
|
GUI_Actions::initInstanceMain(mainSystem);
|
2004-12-20 23:52:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEActionsPocket::initInstanceGame() {
|
2010-10-31 17:10:45 +00:00
|
|
|
Common::String gameid(ConfMan.get("gameid"));
|
2006-04-15 17:39:14 +00:00
|
|
|
bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0);
|
|
|
|
bool is_sword1 = (gameid == "sword1");
|
|
|
|
bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0);
|
|
|
|
bool is_queen = (gameid == "queen");
|
|
|
|
bool is_sky = (gameid == "sky");
|
|
|
|
bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0);
|
|
|
|
bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0);
|
2007-02-27 11:07:59 +00:00
|
|
|
bool is_saga = (gameid == "saga");
|
2011-03-09 03:02:46 +01:00
|
|
|
bool is_kyra = (strncmp(gameid.c_str(), "kyra", 4) == 0);
|
2006-07-30 09:03:10 +00:00
|
|
|
bool is_samnmax = (gameid == "samnmax");
|
2007-02-27 11:07:59 +00:00
|
|
|
bool is_cine = (gameid == "cine");
|
2007-02-24 20:50:56 +00:00
|
|
|
bool is_touche = (gameid == "touche");
|
2007-02-26 18:09:41 +00:00
|
|
|
bool is_agi = (gameid == "agi");
|
2007-06-09 10:06:05 +00:00
|
|
|
bool is_parallaction = (gameid == "parallaction");
|
2007-12-16 20:08:56 +00:00
|
|
|
bool is_lure = (gameid == "lure");
|
2008-02-23 18:55:31 +00:00
|
|
|
bool is_feeble = (gameid == "feeble");
|
2011-03-09 03:02:46 +01:00
|
|
|
bool is_drascula = (strncmp(gameid.c_str(), "drascula", 8) == 0);
|
2009-02-15 20:22:07 +00:00
|
|
|
bool is_tucker = (gameid == "tucker");
|
|
|
|
bool is_groovie = (gameid == "groovie");
|
2009-03-01 22:35:14 +00:00
|
|
|
bool is_tinsel = (gameid == "tinsel");
|
2009-08-04 12:02:07 +00:00
|
|
|
bool is_cruise = (gameid == "cruise");
|
2009-08-04 12:19:30 +00:00
|
|
|
bool is_made = (gameid == "made");
|
2011-06-27 02:00:33 +02:00
|
|
|
bool is_sci = (gameid == "sci");
|
2004-05-09 14:57:04 +00:00
|
|
|
|
2005-07-05 20:22:56 +00:00
|
|
|
GUI_Actions::initInstanceGame();
|
2004-05-09 14:57:04 +00:00
|
|
|
|
|
|
|
// See if a right click mapping could be needed
|
2009-03-01 22:35:14 +00:00
|
|
|
if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_tinsel ||
|
2011-03-09 03:02:46 +01:00
|
|
|
is_samnmax || is_cine || is_touche || is_parallaction || is_drascula || is_cruise)
|
2004-05-09 14:57:04 +00:00
|
|
|
_right_click_needed = true;
|
|
|
|
|
|
|
|
// See if a "hide toolbar" mapping could be needed
|
2009-02-15 20:22:07 +00:00
|
|
|
if (is_sword1 || is_sword2 || is_comi || is_groovie)
|
2004-05-09 14:57:04 +00:00
|
|
|
_hide_toolbar_needed = true;
|
|
|
|
|
|
|
|
// Initialize keys for different actions
|
|
|
|
// Pause
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_PAUSE].setKey(VK_SPACE);
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_enabled[POCKET_ACTION_PAUSE] = true;
|
|
|
|
// Save
|
2009-02-15 20:22:07 +00:00
|
|
|
if (is_simon || is_sword2 || is_gob || is_kyra || is_feeble || is_tucker || is_groovie)
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = false;
|
2007-03-14 19:28:29 +00:00
|
|
|
else if (is_queen) {
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F1 key for FOTAQ
|
2006-07-30 09:03:10 +00:00
|
|
|
} else if (is_sky) {
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5);
|
2009-08-04 12:02:07 +00:00
|
|
|
} else if (is_cine || is_drascula || is_cruise) {
|
2006-07-30 09:03:10 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); // F10
|
2009-08-04 12:19:30 +00:00
|
|
|
} else if (is_agi || is_made) {
|
2007-02-26 18:09:41 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE);
|
2007-06-09 10:06:05 +00:00
|
|
|
} else if (is_parallaction) {
|
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey('s', SDLK_s);
|
2009-03-01 22:35:14 +00:00
|
|
|
} else if (is_tinsel) {
|
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F1, SDLK_F1);
|
2006-07-30 09:03:10 +00:00
|
|
|
} else {
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SAVE] = true;
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F5 key
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
// Quit
|
|
|
|
_action_enabled[POCKET_ACTION_QUIT] = true;
|
|
|
|
// Skip
|
2009-08-04 12:19:30 +00:00
|
|
|
if (!is_cine && !is_parallaction && !is_groovie && !is_cruise && !is_made)
|
2006-07-30 09:03:10 +00:00
|
|
|
_action_enabled[POCKET_ACTION_SKIP] = true;
|
2009-03-01 22:35:14 +00:00
|
|
|
if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_tinsel ||
|
2011-03-09 03:02:46 +01:00
|
|
|
is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula || is_tucker)
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SKIP].setKey(VK_ESCAPE);
|
2004-05-09 14:57:04 +00:00
|
|
|
else
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_SKIP].setKey(KEY_ALL_SKIP);
|
2004-05-09 14:57:04 +00:00
|
|
|
// Hide
|
|
|
|
_action_enabled[POCKET_ACTION_HIDE] = true;
|
2005-07-30 21:11:48 +00:00
|
|
|
// Keyboard
|
2004-05-09 14:57:04 +00:00
|
|
|
_action_enabled[POCKET_ACTION_KEYBOARD] = true;
|
|
|
|
// Sound
|
|
|
|
_action_enabled[POCKET_ACTION_SOUND] = true;
|
|
|
|
// RightClick
|
|
|
|
_action_enabled[POCKET_ACTION_RIGHTCLICK] = true;
|
|
|
|
// Cursor
|
|
|
|
_action_enabled[POCKET_ACTION_CURSOR] = true;
|
|
|
|
// Freelook
|
|
|
|
_action_enabled[POCKET_ACTION_FREELOOK] = true;
|
|
|
|
// Zoom
|
2007-04-30 21:11:09 +00:00
|
|
|
if (is_sword1 || is_sword2 || is_comi || is_touche) {
|
2004-05-09 14:57:04 +00:00
|
|
|
_zoom_needed = true;
|
|
|
|
_action_enabled[POCKET_ACTION_ZOOM_UP] = true;
|
|
|
|
_action_enabled[POCKET_ACTION_ZOOM_DOWN] = true;
|
|
|
|
}
|
2007-06-08 06:09:09 +00:00
|
|
|
// Multi function key
|
2007-06-05 19:06:54 +00:00
|
|
|
_action_enabled[POCKET_ACTION_MULTI] = true;
|
|
|
|
if (is_agi)
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_MULTI].setKey(SDLK_PAUSE); // agi: show predictive dialog
|
2007-06-08 06:09:09 +00:00
|
|
|
else if (is_gob)
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_MULTI].setKey(Common::ASCII_F1, SDLK_F1); // bargon : F1 to start
|
2007-06-08 06:09:09 +00:00
|
|
|
else if (gameid == "atlantis")
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_MULTI].setKey(0, SDLK_KP0); // fate of atlantis : Ins to sucker-punch
|
2007-06-05 19:06:54 +00:00
|
|
|
else
|
2007-06-23 00:05:32 +00:00
|
|
|
_key_action[POCKET_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V
|
2006-01-29 23:23:17 +00:00
|
|
|
// Key bind method
|
|
|
|
_action_enabled[POCKET_ACTION_BINDKEYS] = true;
|
2009-08-04 12:02:07 +00:00
|
|
|
// Disable double-tap right-click for convenience
|
2011-06-27 02:00:33 +02:00
|
|
|
if (is_tinsel || is_cruise || is_sci)
|
2009-08-04 12:02:07 +00:00
|
|
|
if (!ConfMan.hasKey("no_doubletap_rightclick")) {
|
|
|
|
ConfMan.setBool("no_doubletap_rightclick", true);
|
|
|
|
ConfMan.flushToDisk();
|
|
|
|
}
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CEActionsPocket::~CEActionsPocket() {
|
|
|
|
}
|
|
|
|
|
2005-07-05 20:22:56 +00:00
|
|
|
bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
|
2008-08-13 19:32:25 +00:00
|
|
|
static bool keydialogrunning = false, quitdialog = false;
|
2006-01-29 23:23:17 +00:00
|
|
|
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager());
|
|
|
|
|
2004-12-21 00:31:58 +00:00
|
|
|
if (!pushed) {
|
2009-09-30 16:16:53 +00:00
|
|
|
switch (action) {
|
2006-06-10 11:06:05 +00:00
|
|
|
case POCKET_ACTION_RIGHTCLICK:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->add_right_click(false);
|
2006-06-10 11:06:05 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_LEFTCLICK:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->add_left_click(false);
|
2006-06-10 11:06:05 +00:00
|
|
|
return true;
|
2005-01-28 23:45:53 +00:00
|
|
|
case POCKET_ACTION_PAUSE:
|
|
|
|
case POCKET_ACTION_SAVE:
|
|
|
|
case POCKET_ACTION_SKIP:
|
2007-06-05 19:06:54 +00:00
|
|
|
case POCKET_ACTION_MULTI:
|
2005-01-28 23:45:53 +00:00
|
|
|
EventsBuffer::simulateKey(&_key_action[action], false);
|
|
|
|
return true;
|
2004-12-21 00:31:58 +00:00
|
|
|
}
|
2004-05-09 14:57:04 +00:00
|
|
|
return false;
|
2004-12-21 00:31:58 +00:00
|
|
|
}
|
2004-05-09 14:57:04 +00:00
|
|
|
|
|
|
|
switch (action) {
|
2009-09-30 16:16:53 +00:00
|
|
|
case POCKET_ACTION_PAUSE:
|
|
|
|
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
|
2010-06-15 11:02:23 +00:00
|
|
|
GUI::MessageDialog alert(_("Do you want to load or save the game?"), _("Load"), _("Save"));
|
2009-09-30 16:16:53 +00:00
|
|
|
if (alert.runModal() == GUI::kMessageOK)
|
|
|
|
_key_action[action].setKey(SDLK_l);
|
|
|
|
else
|
|
|
|
_key_action[action].setKey(SDLK_s);
|
|
|
|
}
|
|
|
|
EventsBuffer::simulateKey(&_key_action[action], true);
|
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_KEYBOARD:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->swap_panel();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_HIDE:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->swap_panel_visibility();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_SOUND:
|
|
|
|
_CESystem->swap_sound_master();
|
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_RIGHTCLICK:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->add_right_click(true);
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_CURSOR:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->swap_mouse_visibility();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_FREELOOK:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->swap_freeLook();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_ZOOM_UP:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->swap_zoom_up();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_ZOOM_DOWN:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->swap_zoom_down();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_LEFTCLICK:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->add_left_click(true);
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_UP:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->move_cursor_up();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_DOWN:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->move_cursor_down();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_LEFT:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->move_cursor_left();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_RIGHT:
|
2011-06-11 01:07:46 +02:00
|
|
|
_graphicsMan->move_cursor_right();
|
2009-09-30 16:16:53 +00:00
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_QUIT:
|
|
|
|
if (!quitdialog) {
|
|
|
|
quitdialog = true;
|
2010-06-15 11:02:23 +00:00
|
|
|
GUI::MessageDialog alert(_(" Are you sure you want to quit ? "), _("Yes"), _("No"));
|
2009-09-30 16:16:53 +00:00
|
|
|
if (alert.runModal() == GUI::kMessageOK)
|
|
|
|
_mainSystem->quit();
|
|
|
|
quitdialog = false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
case POCKET_ACTION_BINDKEYS:
|
|
|
|
if (!keydialogrunning) {
|
|
|
|
keydialogrunning = true;
|
|
|
|
GUI::KeysDialog *keysDialog = new GUI::KeysDialog();
|
|
|
|
keysDialog->runModal();
|
|
|
|
delete keysDialog;
|
|
|
|
keydialogrunning = false;
|
|
|
|
}
|
|
|
|
return true;
|
2004-05-09 14:57:04 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CEActionsPocket::needsRightClickMapping() {
|
|
|
|
if (!_right_click_needed)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return (_action_mapping[POCKET_ACTION_RIGHTCLICK] == 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CEActionsPocket::needsHideToolbarMapping() {
|
|
|
|
if (!_hide_toolbar_needed)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return (_action_mapping[POCKET_ACTION_HIDE] == 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CEActionsPocket::needsZoomMapping() {
|
|
|
|
if (!_zoom_needed)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return (_action_mapping[POCKET_ACTION_ZOOM_UP] == 0 || _action_mapping[POCKET_ACTION_ZOOM_DOWN] == 0);
|
|
|
|
}
|