From 4dd927f1cf5cc9572f41a2e3d40d8f8aab8d1333 Mon Sep 17 00:00:00 2001 From: Robert Göffringmann Date: Sat, 12 Jul 2003 02:07:37 +0000 Subject: added dialog skipping by pressing '.' svn-id: r8920 --- sky/mouse.h | 1 + sky/sky.cpp | 58 +++++++++++++++++++++++----------------------------------- sky/sky.h | 2 +- 3 files changed, 25 insertions(+), 36 deletions(-) (limited to 'sky') diff --git a/sky/mouse.h b/sky/mouse.h index 0fad0cf0d4..c333c9ec76 100644 --- a/sky/mouse.h +++ b/sky/mouse.h @@ -54,6 +54,7 @@ public: uint16 giveMouseY(void) { return _mouseY; }; uint16 giveCurrentMouseType(void) { return _currentCursor; }; bool wasClicked(void) { return _logicClick; }; + void logicClick(void) { _logicClick = true; }; protected: diff --git a/sky/sky.cpp b/sky/sky.cpp index c0307782a2..0cfdb9e404 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -134,6 +134,27 @@ void SkyState::doCheat(uint8 num) { } } +void SkyState::handleKey(void) { + + if (_key_pressed == 63) + _skyControl->doControlPanel(); + + if ((_key_pressed == 27) && (!_systemVars.pastIntro)) + _skyControl->restartGame(); +#ifdef WITH_DEBUG_CHEATS + if ((_key_pressed >= '0') && (_key_pressed <= '9')) + doCheat(_key_pressed - '0'); + + if (_key_pressed == 'r') { + warning("loading grid"); + _skyLogic->_skyGrid->loadGrids(); + } +#endif + if (_key_pressed == '.') + _skyMouse->logicClick(); + _key_pressed = 0; +} + void SkyState::go() { if (!_dump_file) @@ -150,8 +171,6 @@ void SkyState::go() { loadBase0(); - _paintGrid = false; - if (introSkipped) _skyControl->restartGame(); @@ -164,46 +183,15 @@ void SkyState::go() { _lastSaveTime = _system->get_msecs(); _skyControl->doAutoSave(); } - - if (_key_pressed == 63) { - _key_pressed = 0; - _skyControl->doControlPanel(); - } - if ((_key_pressed == 27) && (!_systemVars.pastIntro)) { - _skyControl->restartGame(); - _key_pressed = 0; - } -#ifdef WITH_DEBUG_CHEATS - if ((_key_pressed >= '0') && (_key_pressed <= '9')) { - doCheat(_key_pressed - '0'); - _key_pressed = 0; - } - if (_key_pressed == 'r') { - warning("loading grid"); - _skyLogic->_skyGrid->loadGrids(); - _key_pressed = 0; - } - if (_key_pressed == 'g') { - _paintGrid = !_paintGrid; - warning("Grid paint: %s",(_paintGrid)?("ON"):("OFF")); - if (!_paintGrid) - _skyScreen->forceRefresh(); - _key_pressed = 0; - } -#endif _skySound->checkFxQueue(); _skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y); + if (_key_pressed) + handleKey(); _skyLogic->engine(); if (!_skyLogic->checkProtection()) { // don't let copy prot. screen flash up - if (_paintGrid) - _skyScreen->forceRefresh(); _skyScreen->recreate(); _skyScreen->spriteEngine(); _skyScreen->flip(); - if (_paintGrid) { - _skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(SkyLogic::_scriptVariables[SCREEN])); - _system->update_screen(); - } } } } diff --git a/sky/sky.h b/sky/sky.h index 46ef0b28e9..4d5700ae85 100644 --- a/sky/sky.h +++ b/sky/sky.h @@ -71,7 +71,6 @@ protected: uint16 _debugMode; uint16 _debugLevel; - bool _paintGrid; int _numScreenUpdates; @@ -120,6 +119,7 @@ protected: void delay(uint amount); void go(); void doCheat(uint8 num); + void handleKey(void); //intro related static uint8 fosterImg[297 * 143]; -- cgit v1.2.3