HUGO: Add CTRL-l and CTRL-s keys used in Win versions.

CTRL-n has been added too, but is currently only a STUB

svn-id: r55081
This commit is contained in:
Arnaud Boutonné 2010-12-31 22:44:16 +00:00
parent 11d4742520
commit 3358001c39
2 changed files with 116 additions and 1 deletions

View File

@ -360,7 +360,12 @@ void Parser_v1d::keyHandler(Common::Event event) {
gameStatus.viewState = V_PLAY;
break;
case Common::KEYCODE_F6: // Inventory
showDosInventory();
if (gameStatus.viewState == V_PLAY) {
if (gameStatus.gameOverFl)
Utils::gameOverMsg();
else
showDosInventory();
}
break;
case Common::KEYCODE_F8: // Turbo mode
_config.turboFl = !_config.turboFl;
@ -368,6 +373,61 @@ void Parser_v1d::keyHandler(Common::Event event) {
case Common::KEYCODE_F9: // Boss button
warning("STUB: F9 (DOS) - BossKey");
break;
case Common::KEYCODE_l:
if (event.kbd.hasFlags(Common::KBD_CTRL)) {
_vm->_file->restoreGame(-1);
_vm->_scheduler->restoreScreen(*_vm->_screen_p);
gameStatus.viewState = V_PLAY;
} else {
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
if (bnext != _getIndex) {
_ringBuffer[_putIndex] = event.kbd.ascii;
_putIndex = bnext;
}
}
}
break;
case Common::KEYCODE_n:
if (event.kbd.hasFlags(Common::KBD_CTRL)) {
warning("STUB: CTRL-N (WIN) - New Game");
} else {
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
if (bnext != _getIndex) {
_ringBuffer[_putIndex] = event.kbd.ascii;
_putIndex = bnext;
}
}
}
break;
case Common::KEYCODE_s:
if (event.kbd.hasFlags(Common::KBD_CTRL)) {
if (gameStatus.viewState == V_PLAY) {
if (gameStatus.gameOverFl)
Utils::gameOverMsg();
else
_vm->_file->saveGame(-1, Common::String());
}
} else {
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
if (bnext != _getIndex) {
_ringBuffer[_putIndex] = event.kbd.ascii;
_putIndex = bnext;
}
}
}
break;
default: // Any other key
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer

View File

@ -128,6 +128,61 @@ void Parser_v1w::keyHandler(Common::Event event) {
case Common::KEYCODE_F9: // Boss button
warning("STUB: F9 (DOS) - BossKey");
break;
case Common::KEYCODE_l:
if (event.kbd.hasFlags(Common::KBD_CTRL)) {
_vm->_file->restoreGame(-1);
_vm->_scheduler->restoreScreen(*_vm->_screen_p);
gameStatus.viewState = V_PLAY;
} else {
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
if (bnext != _getIndex) {
_ringBuffer[_putIndex] = event.kbd.ascii;
_putIndex = bnext;
}
}
}
break;
case Common::KEYCODE_n:
if (event.kbd.hasFlags(Common::KBD_CTRL)) {
warning("STUB: CTRL-N (WIN) - New Game");
} else {
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
if (bnext != _getIndex) {
_ringBuffer[_putIndex] = event.kbd.ascii;
_putIndex = bnext;
}
}
}
break;
case Common::KEYCODE_s:
if (event.kbd.hasFlags(Common::KBD_CTRL)) {
if (gameStatus.viewState == V_PLAY) {
if (gameStatus.gameOverFl)
Utils::gameOverMsg();
else
_vm->_file->saveGame(-1, Common::String());
}
} else {
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
if (bnext != _getIndex) {
_ringBuffer[_putIndex] = event.kbd.ascii;
_putIndex = bnext;
}
}
}
break;
default: // Any other key
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer