2007-11-01 14:08:55 +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 .
*
* 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
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
*
*/
# include "common/system.h"
2008-07-24 09:24:32 +00:00
# include "common/hashmap.h"
2011-04-24 08:34:27 +00:00
# include "common/textconsole.h"
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
# include "parallaction/gui.h"
2008-05-14 14:34:01 +00:00
# include "parallaction/input.h"
2007-11-01 14:08:55 +00:00
# include "parallaction/parallaction.h"
2008-08-31 06:14:45 +00:00
# include "parallaction/saveload.h"
2007-11-01 14:08:55 +00:00
# include "parallaction/sound.h"
namespace Parallaction {
2008-07-25 06:35:02 +00:00
class SplashInputState_NS : public MenuInputState {
2008-07-24 09:24:32 +00:00
protected :
Common : : String _slideName ;
uint32 _timeOut ;
Common : : String _nextState ;
uint32 _startTime ;
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
SplashInputState_NS ( Parallaction * vm , const Common : : String & name , MenuInputHelper * helper ) : MenuInputState ( name , helper ) , _vm ( vm ) {
2008-07-24 09:24:32 +00:00
}
virtual MenuInputState * run ( ) {
2008-08-30 15:49:54 +00:00
uint32 curTime = _vm - > _system - > getMillis ( ) ;
2008-07-24 09:24:32 +00:00
if ( curTime - _startTime > _timeOut ) {
return _helper - > getState ( _nextState ) ;
2007-11-01 14:47:33 +00:00
}
2008-07-24 09:24:32 +00:00
return this ;
2007-11-01 14:47:33 +00:00
}
2008-07-24 09:24:32 +00:00
virtual void enter ( ) {
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_DISABLED ) ;
2008-07-24 09:24:32 +00:00
_vm - > showSlide ( _slideName . c_str ( ) ) ;
2008-08-30 15:49:54 +00:00
_startTime = _vm - > _system - > getMillis ( ) ;
2008-07-24 09:24:32 +00:00
}
} ;
2007-11-01 14:47:33 +00:00
2008-07-25 06:35:02 +00:00
class SplashInputState0_NS : public SplashInputState_NS {
2007-11-01 14:47:33 +00:00
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
SplashInputState0_NS ( Parallaction * vm , MenuInputHelper * helper ) : SplashInputState_NS ( vm , " intro0 " , helper ) {
2008-07-24 09:24:32 +00:00
_slideName = " intro " ;
_timeOut = 2000 ;
_nextState = " intro1 " ;
}
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
class SplashInputState1_NS : public SplashInputState_NS {
2007-11-01 14:47:33 +00:00
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
SplashInputState1_NS ( Parallaction * vm , MenuInputHelper * helper ) : SplashInputState_NS ( vm , " intro1 " , helper ) {
2008-07-24 09:24:32 +00:00
_slideName = " minintro " ;
_timeOut = 2000 ;
_nextState = " chooselanguage " ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
class ChooseLanguageInputState_NS : public MenuInputState {
2008-07-24 09:24:32 +00:00
# define BLOCK_WIDTH 16
# define BLOCK_HEIGHT 24
2008-06-24 13:21:22 +00:00
2008-07-24 09:24:32 +00:00
# define BLOCK_X 112
# define BLOCK_Y 130
2007-11-01 14:47:33 +00:00
2008-07-24 09:24:32 +00:00
# define BLOCK_SELECTION_X (BLOCK_X-1)
# define BLOCK_SELECTION_Y (BLOCK_Y-1)
2007-11-01 14:47:33 +00:00
2008-07-24 09:24:32 +00:00
# define BLOCK_X_OFFSET (BLOCK_WIDTH+1)
# define BLOCK_Y_OFFSET 9
2007-11-01 14:47:33 +00:00
2008-07-24 09:24:32 +00:00
// destination slots for code blocks
//
# define SLOT_X 61
# define SLOT_Y 64
# define SLOT_WIDTH (BLOCK_WIDTH+2)
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
int _language ;
bool _allowChoice ;
Common : : String _nextState ;
2007-11-01 14:08:55 +00:00
2010-04-27 08:59:13 +00:00
GfxObj * _label ;
2010-05-12 09:28:29 +00:00
Common : : Rect _dosLanguageSelectBlocks [ 4 ] ;
Common : : Rect _amigaLanguageSelectBlocks [ 4 ] ;
2008-07-24 09:24:32 +00:00
const Common : : Rect * _blocks ;
2007-11-01 14:08:55 +00:00
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
ChooseLanguageInputState_NS ( Parallaction * vm , MenuInputHelper * helper ) : MenuInputState ( " chooselanguage " , helper ) , _vm ( vm ) {
2008-07-24 09:24:32 +00:00
_allowChoice = false ;
_nextState = " selectgame " ;
2010-10-22 14:19:37 +00:00
_label = 0 ;
2008-07-24 09:24:32 +00:00
2010-05-12 09:28:29 +00:00
_dosLanguageSelectBlocks [ 0 ] = Common : : Rect ( 80 , 110 , 128 , 180 ) ; // Italian
_dosLanguageSelectBlocks [ 1 ] = Common : : Rect ( 129 , 85 , 177 , 155 ) ; // French
_dosLanguageSelectBlocks [ 2 ] = Common : : Rect ( 178 , 60 , 226 , 130 ) ; // English
_dosLanguageSelectBlocks [ 3 ] = Common : : Rect ( 227 , 35 , 275 , 105 ) ; // German
2011-06-19 22:59:48 +00:00
2010-05-12 09:28:29 +00:00
_amigaLanguageSelectBlocks [ 0 ] = Common : : Rect ( - 1 , - 1 , - 1 , - 1 ) ; // Italian: not supported by Amiga multi-lingual version
_amigaLanguageSelectBlocks [ 1 ] = Common : : Rect ( 129 , 85 , 177 , 155 ) ; // French
_amigaLanguageSelectBlocks [ 2 ] = Common : : Rect ( 178 , 60 , 226 , 130 ) ; // English
_amigaLanguageSelectBlocks [ 3 ] = Common : : Rect ( 227 , 35 , 275 , 105 ) ; // German
2008-07-24 09:24:32 +00:00
if ( _vm - > getPlatform ( ) = = Common : : kPlatformAmiga ) {
if ( ! ( _vm - > getFeatures ( ) & GF_LANG_MULT ) ) {
if ( _vm - > getFeatures ( ) & GF_DEMO ) {
_language = 1 ; // Amiga Demo supports English
_nextState = " startdemo " ;
return ;
} else {
_language = 0 ; // The only other non multi-lingual version just supports Italian
return ;
}
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
_blocks = _amigaLanguageSelectBlocks ;
} else {
_blocks = _dosLanguageSelectBlocks ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
_language = - 1 ;
_allowChoice = true ;
}
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
~ ChooseLanguageInputState_NS ( ) {
destroyLabels ( ) ;
}
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _label ) ;
delete _label ;
_label = 0 ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
virtual MenuInputState * run ( ) {
if ( ! _allowChoice ) {
_vm - > setInternLanguage ( _language ) ;
return _helper - > getState ( _nextState ) ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
int event = _vm - > _input - > getLastButtonEvent ( ) ;
if ( event ! = kMouseLeftUp ) {
return this ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
Common : : Point p ;
_vm - > _input - > getCursorPos ( p ) ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
for ( uint16 i = 0 ; i < 4 ; i + + ) {
if ( _blocks [ i ] . contains ( p ) ) {
_vm - > setInternLanguage ( i ) ;
_vm - > beep ( ) ;
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2008-07-24 09:24:32 +00:00
return _helper - > getState ( _nextState ) ;
}
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
return this ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
virtual void enter ( ) {
if ( ! _allowChoice ) {
return ;
}
2008-05-15 01:18:26 +00:00
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_ENABLED_SHOW ) ;
2008-07-24 09:24:32 +00:00
// user can choose language in this version
_vm - > showSlide ( " lingua " ) ;
2007-11-01 14:08:55 +00:00
2010-04-27 08:59:13 +00:00
_label = _vm - > _gfx - > createLabel ( _vm - > _introFont , " SELECT LANGUAGE " , 1 ) ;
_vm - > _gfx - > showLabel ( _label , 60 , 30 ) ;
2008-01-09 21:46:57 +00:00
2008-08-30 10:27:20 +00:00
_vm - > _input - > setArrowCursor ( ) ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
class SelectGameInputState_NS : public MenuInputState {
2008-07-24 09:24:32 +00:00
int _choice , _oldChoice ;
Common : : String _nextState [ 2 ] ;
2010-04-27 08:59:13 +00:00
GfxObj * _labels [ 2 ] ;
2008-07-24 09:24:32 +00:00
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-07-24 09:24:32 +00:00
static const char * newGameMsg [ 4 ] ;
static const char * loadGameMsg [ 4 ] ;
public :
2008-08-31 05:18:25 +00:00
SelectGameInputState_NS ( Parallaction * vm , MenuInputHelper * helper ) : MenuInputState ( " selectgame " , helper ) , _vm ( vm ) {
2008-07-24 09:24:32 +00:00
_choice = 0 ;
_oldChoice = - 1 ;
_nextState [ 0 ] = " newgame " ;
_nextState [ 1 ] = " loadgame " ;
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
}
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
~ SelectGameInputState_NS ( ) {
destroyLabels ( ) ;
}
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _labels [ 0 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 1 ] ) ;
delete _labels [ 0 ] ;
delete _labels [ 1 ] ;
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
2008-07-24 09:24:32 +00:00
}
virtual MenuInputState * run ( ) {
int event = _vm - > _input - > getLastButtonEvent ( ) ;
if ( event = = kMouseLeftUp ) {
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2008-07-24 09:24:32 +00:00
return _helper - > getState ( _nextState [ _choice ] ) ;
}
Common : : Point p ;
_vm - > _input - > getCursorPos ( p ) ;
_choice = ( p . x > 160 ) ? 1 : 0 ;
if ( _choice ! = _oldChoice ) {
if ( _oldChoice ! = - 1 )
_vm - > _gfx - > hideLabel ( _labels [ _oldChoice ] ) ;
if ( _choice ! = - 1 )
_vm - > _gfx - > showLabel ( _labels [ _choice ] , 60 , 30 ) ;
_oldChoice = _choice ;
}
return this ;
}
virtual void enter ( ) {
_vm - > showSlide ( " restore " ) ;
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_ENABLED_SHOW ) ;
2008-07-24 09:24:32 +00:00
_labels [ 0 ] = _vm - > _gfx - > createLabel ( _vm - > _introFont , newGameMsg [ _vm - > getInternLanguage ( ) ] , 1 ) ;
_labels [ 1 ] = _vm - > _gfx - > createLabel ( _vm - > _introFont , loadGameMsg [ _vm - > getInternLanguage ( ) ] , 1 ) ;
}
} ;
2008-07-25 06:35:02 +00:00
const char * SelectGameInputState_NS : : newGameMsg [ 4 ] = {
2008-07-24 09:24:32 +00:00
" NUOVO GIOCO " ,
" NEUF JEU " ,
" NEW GAME " ,
" NEUES SPIEL "
} ;
2008-07-25 06:35:02 +00:00
const char * SelectGameInputState_NS : : loadGameMsg [ 4 ] = {
2008-07-24 09:24:32 +00:00
" GIOCO SALVATO " ,
" JEU SAUVE' " ,
" SAVED GAME " ,
" SPIEL GESPEICHERT "
} ;
2008-07-25 06:35:02 +00:00
class LoadGameInputState_NS : public MenuInputState {
2008-07-24 09:24:32 +00:00
bool _result ;
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
LoadGameInputState_NS ( Parallaction * vm , MenuInputHelper * helper ) : MenuInputState ( " loadgame " , helper ) , _vm ( vm ) { }
2008-07-24 09:24:32 +00:00
virtual MenuInputState * run ( ) {
if ( ! _result ) {
_vm - > scheduleLocationSwitch ( " fogne.dough " ) ;
}
return 0 ;
}
virtual void enter ( ) {
2008-08-31 06:14:45 +00:00
_result = _vm - > _saveLoad - > loadGame ( ) ;
2008-07-24 09:24:32 +00:00
}
} ;
2007-11-16 22:03:39 +00:00
2008-07-25 06:35:02 +00:00
class NewGameInputState_NS : public MenuInputState {
2009-04-03 16:32:47 +00:00
Parallaction_ns * _vm ;
2007-11-01 14:08:55 +00:00
2010-04-27 08:59:13 +00:00
GfxObj * _labels [ 4 ] ;
2008-07-24 09:24:32 +00:00
static const char * introMsg3 [ 4 ] ;
2007-11-16 22:03:39 +00:00
2008-07-24 09:24:32 +00:00
public :
2009-04-03 16:32:47 +00:00
NewGameInputState_NS ( Parallaction_ns * vm , MenuInputHelper * helper ) : MenuInputState ( " newgame " , helper ) , _vm ( vm ) {
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
_labels [ 2 ] = 0 ;
_labels [ 3 ] = 0 ;
}
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
~ NewGameInputState_NS ( ) {
destroyLabels ( ) ;
2008-07-24 09:24:32 +00:00
}
virtual MenuInputState * run ( ) {
int event = _vm - > _input - > getLastButtonEvent ( ) ;
if ( event = = kMouseLeftUp | | event = = kMouseRightUp ) {
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_ENABLED_SHOW ) ;
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2008-07-24 09:24:32 +00:00
if ( event = = kMouseLeftUp ) {
_vm - > scheduleLocationSwitch ( " fogne.dough " ) ;
return 0 ;
2007-11-16 22:03:39 +00:00
}
2008-07-24 09:24:32 +00:00
return _helper - > getState ( " selectcharacter " ) ;
2007-11-01 14:08:55 +00:00
}
2007-11-16 22:03:39 +00:00
2008-07-24 09:24:32 +00:00
return this ;
}
2010-04-27 08:59:13 +00:00
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _labels [ 0 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 1 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 2 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 3 ] ) ;
delete _labels [ 0 ] ;
delete _labels [ 1 ] ;
delete _labels [ 2 ] ;
delete _labels [ 3 ] ;
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
_labels [ 2 ] = 0 ;
_labels [ 3 ] = 0 ;
}
2008-07-24 09:24:32 +00:00
virtual void enter ( ) {
2009-04-03 16:32:47 +00:00
_vm - > changeBackground ( " test " ) ;
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_ENABLED_HIDE ) ;
2008-07-24 09:24:32 +00:00
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , introMsg3 [ 0 ] , 1 ) ;
_labels [ 1 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , introMsg3 [ 1 ] , 1 ) ;
_labels [ 2 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , introMsg3 [ 2 ] , 1 ) ;
_labels [ 3 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , introMsg3 [ 3 ] , 1 ) ;
_vm - > _gfx - > showLabel ( _labels [ 0 ] , CENTER_LABEL_HORIZONTAL , 50 ) ;
_vm - > _gfx - > showLabel ( _labels [ 1 ] , CENTER_LABEL_HORIZONTAL , 70 ) ;
_vm - > _gfx - > showLabel ( _labels [ 2 ] , CENTER_LABEL_HORIZONTAL , 100 ) ;
_vm - > _gfx - > showLabel ( _labels [ 3 ] , CENTER_LABEL_HORIZONTAL , 120 ) ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
const char * NewGameInputState_NS : : introMsg3 [ 4 ] = {
2008-07-24 09:24:32 +00:00
" PRESS LEFT MOUSE BUTTON " ,
" TO SEE INTRO " ,
" PRESS RIGHT MOUSE BUTTON " ,
" TO START "
} ;
2008-01-09 21:46:57 +00:00
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
class StartDemoInputState_NS : public MenuInputState {
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-05-14 14:34:01 +00:00
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
StartDemoInputState_NS ( Parallaction * vm , MenuInputHelper * helper ) : MenuInputState ( " startdemo " , helper ) , _vm ( vm ) {
2008-07-24 09:24:32 +00:00
}
2008-07-23 07:52:43 +00:00
2008-07-24 09:24:32 +00:00
virtual MenuInputState * run ( ) {
_vm - > scheduleLocationSwitch ( " fognedemo.dough " ) ;
2008-08-25 09:35:22 +00:00
_vm - > _input - > setMouseState ( MOUSE_ENABLED_SHOW ) ;
2008-07-24 09:24:32 +00:00
return 0 ;
}
2008-07-25 02:37:55 +00:00
virtual void enter ( ) {
_vm - > _input - > setMouseState ( MOUSE_DISABLED ) ;
}
2008-07-24 09:24:32 +00:00
} ;
2008-07-25 06:35:02 +00:00
class SelectCharacterInputState_NS : public MenuInputState {
2008-07-24 09:24:32 +00:00
# define PASSWORD_LEN 6
# define CHAR_DINO 0
# define CHAR_DONNA 1
# define CHAR_DOUGH 2
2010-05-12 09:28:29 +00:00
Common : : Rect _codeSelectBlocks [ 9 ] ;
Common : : Rect _codeTrueBlocks [ 9 ] ;
2008-07-24 09:24:32 +00:00
2009-03-14 15:09:31 +00:00
Parallaction_ns * _vm ;
2008-07-24 09:24:32 +00:00
int guiGetSelectedBlock ( const Common : : Point & p ) {
int selection = - 1 ;
for ( uint16 i = 0 ; i < 9 ; i + + ) {
2010-05-12 09:28:29 +00:00
if ( _codeSelectBlocks [ i ] . contains ( p ) ) {
2008-07-24 09:24:32 +00:00
selection = i ;
break ;
2007-11-01 14:08:55 +00:00
}
}
2008-07-23 07:52:43 +00:00
2008-07-24 09:24:32 +00:00
if ( ( selection ! = - 1 ) & & ( _vm - > getPlatform ( ) = = Common : : kPlatformAmiga ) ) {
2010-05-12 09:28:29 +00:00
_vm - > _gfx - > invertBackground ( _codeTrueBlocks [ selection ] ) ;
2008-07-24 09:24:32 +00:00
_vm - > _gfx - > updateScreen ( ) ;
_vm - > beep ( ) ;
2008-08-30 15:49:54 +00:00
_vm - > _system - > delayMillis ( 100 ) ;
2010-05-12 09:28:29 +00:00
_vm - > _gfx - > invertBackground ( _codeTrueBlocks [ selection ] ) ;
2008-07-24 09:24:32 +00:00
_vm - > _gfx - > updateScreen ( ) ;
}
return selection ;
2007-11-16 22:03:39 +00:00
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
byte _points [ 3 ] ;
2009-03-07 19:24:31 +00:00
bool _fail ;
2008-07-24 09:24:32 +00:00
const uint16 ( * _keys ) [ PASSWORD_LEN ] ;
Graphics : : Surface _block ;
Graphics : : Surface _emptySlots ;
2007-11-01 14:08:55 +00:00
2010-04-27 08:59:13 +00:00
GfxObj * _labels [ 2 ] ;
2008-07-24 09:24:32 +00:00
uint _len ;
uint32 _startTime ;
2008-01-09 21:46:57 +00:00
2008-07-24 09:24:32 +00:00
enum {
CHOICE ,
FAIL ,
SUCCESS ,
DELAY
} ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
uint _state ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
static const char * introMsg1 [ 4 ] ;
static const char * introMsg2 [ 4 ] ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
static const uint16 _amigaKeys [ 3 ] [ PASSWORD_LEN ] ;
static const uint16 _pcKeys [ 3 ] [ PASSWORD_LEN ] ;
static const char * _charStartLocation [ 3 ] ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
public :
2009-03-14 15:09:31 +00:00
SelectCharacterInputState_NS ( Parallaction_ns * vm , MenuInputHelper * helper ) : MenuInputState ( " selectcharacter " , helper ) , _vm ( vm ) {
2008-07-24 09:24:32 +00:00
_keys = ( _vm - > getPlatform ( ) = = Common : : kPlatformAmiga & & ( _vm - > getFeatures ( ) & GF_LANG_MULT ) ) ? _amigaKeys : _pcKeys ;
2011-04-17 14:30:12 +00:00
_block . create ( BLOCK_WIDTH , BLOCK_HEIGHT , Graphics : : PixelFormat : : createFormatCLUT8 ( ) ) ;
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
2011-06-19 22:59:48 +00:00
2010-05-12 09:28:29 +00:00
_codeSelectBlocks [ 0 ] = Common : : Rect ( 111 , 129 , 127 , 153 ) ; // na
_codeSelectBlocks [ 1 ] = Common : : Rect ( 128 , 120 , 144 , 144 ) ; // wa
_codeSelectBlocks [ 2 ] = Common : : Rect ( 145 , 111 , 161 , 135 ) ; // ra
_codeSelectBlocks [ 3 ] = Common : : Rect ( 162 , 102 , 178 , 126 ) ; // ri
_codeSelectBlocks [ 4 ] = Common : : Rect ( 179 , 93 , 195 , 117 ) ; // i
_codeSelectBlocks [ 5 ] = Common : : Rect ( 196 , 84 , 212 , 108 ) ; // ne
_codeSelectBlocks [ 6 ] = Common : : Rect ( 213 , 75 , 229 , 99 ) ; // ho
_codeSelectBlocks [ 7 ] = Common : : Rect ( 230 , 66 , 246 , 90 ) ; // ki
_codeSelectBlocks [ 8 ] = Common : : Rect ( 247 , 57 , 263 , 81 ) ; // ka
_codeTrueBlocks [ 0 ] = Common : : Rect ( 112 , 130 , 128 , 154 ) ;
_codeTrueBlocks [ 1 ] = Common : : Rect ( 129 , 121 , 145 , 145 ) ;
_codeTrueBlocks [ 2 ] = Common : : Rect ( 146 , 112 , 162 , 136 ) ;
_codeTrueBlocks [ 3 ] = Common : : Rect ( 163 , 103 , 179 , 127 ) ;
_codeTrueBlocks [ 4 ] = Common : : Rect ( 180 , 94 , 196 , 118 ) ;
_codeTrueBlocks [ 5 ] = Common : : Rect ( 197 , 85 , 213 , 109 ) ;
_codeTrueBlocks [ 6 ] = Common : : Rect ( 214 , 76 , 230 , 100 ) ;
_codeTrueBlocks [ 7 ] = Common : : Rect ( 231 , 67 , 247 , 91 ) ;
_codeTrueBlocks [ 8 ] = Common : : Rect ( 248 , 58 , 264 , 82 ) ;
2008-07-24 09:24:32 +00:00
}
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
~ SelectCharacterInputState_NS ( ) {
2008-07-24 09:42:44 +00:00
_block . free ( ) ;
_emptySlots . free ( ) ;
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
}
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _labels [ 0 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 1 ] ) ;
delete _labels [ 0 ] ;
delete _labels [ 1 ] ;
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
2008-07-25 02:37:55 +00:00
}
2008-07-24 09:42:44 +00:00
2008-07-24 09:24:32 +00:00
void cleanup ( ) {
_points [ 0 ] = _points [ 1 ] = _points [ 2 ] = 0 ;
_vm - > _gfx - > hideLabel ( _labels [ 1 ] ) ;
_vm - > _gfx - > showLabel ( _labels [ 0 ] , 60 , 30 ) ;
_fail = false ;
_len = 0 ;
}
2008-01-09 21:46:57 +00:00
2008-07-24 09:24:32 +00:00
void delay ( ) {
2008-08-30 15:49:54 +00:00
if ( _vm - > _system - > getMillis ( ) - _startTime < 2000 ) {
2008-07-24 09:24:32 +00:00
return ;
}
cleanup ( ) ;
_state = CHOICE ;
}
2008-05-14 14:34:01 +00:00
2008-07-24 09:24:32 +00:00
void choice ( ) {
int event = _vm - > _input - > getLastButtonEvent ( ) ;
if ( event ! = kMouseLeftUp ) {
return ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
Common : : Point p ;
_vm - > _input - > getCursorPos ( p ) ;
int _si = guiGetSelectedBlock ( p ) ;
2008-05-14 14:34:01 +00:00
2008-07-24 09:24:32 +00:00
if ( _si ! = - 1 ) {
2010-05-12 09:28:29 +00:00
_vm - > _gfx - > grabBackground ( _codeTrueBlocks [ _si ] , _block ) ;
2008-07-24 09:24:32 +00:00
_vm - > _gfx - > patchBackground ( _block , _len * SLOT_WIDTH + SLOT_X , SLOT_Y , false ) ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
if ( _keys [ 0 ] [ _len ] ! = _si & & _keys [ 1 ] [ _len ] ! = _si & & _keys [ 2 ] [ _len ] ! = _si ) {
_fail = true ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
// build user preference
_points [ 0 ] + = ( _keys [ 0 ] [ _len ] = = _si ) ;
_points [ 1 ] + = ( _keys [ 1 ] [ _len ] = = _si ) ;
_points [ 2 ] + = ( _keys [ 2 ] [ _len ] = = _si ) ;
_len + + ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
if ( _len = = PASSWORD_LEN ) {
_state = _fail ? FAIL : SUCCESS ;
}
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
void fail ( ) {
_vm - > _gfx - > patchBackground ( _emptySlots , SLOT_X , SLOT_Y , false ) ;
_vm - > _gfx - > hideLabel ( _labels [ 0 ] ) ;
_vm - > _gfx - > showLabel ( _labels [ 1 ] , 60 , 30 ) ;
2008-08-30 15:49:54 +00:00
_startTime = _vm - > _system - > getMillis ( ) ;
2008-07-24 09:24:32 +00:00
_state = DELAY ;
}
2008-01-09 21:46:57 +00:00
2008-07-24 09:24:32 +00:00
void success ( ) {
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2008-07-24 09:24:32 +00:00
_vm - > _gfx - > setBlackPalette ( ) ;
_emptySlots . free ( ) ;
// actually select character
int character = - 1 ;
if ( _points [ 0 ] > = _points [ 1 ] & & _points [ 0 ] > = _points [ 2 ] ) {
character = CHAR_DINO ;
} else
if ( _points [ 1 ] > = _points [ 0 ] & & _points [ 1 ] > = _points [ 2 ] ) {
character = CHAR_DONNA ;
} else
if ( _points [ 2 ] > = _points [ 0 ] & & _points [ 2 ] > = _points [ 1 ] ) {
character = CHAR_DOUGH ;
} else {
2010-09-18 10:55:16 +00:00
error ( " If you read this, either your CPU or transivity is broken (we believe the former) " ) ;
2008-07-24 09:24:32 +00:00
}
_vm - > cleanupGame ( ) ;
_vm - > scheduleLocationSwitch ( _charStartLocation [ character ] ) ;
}
virtual MenuInputState * run ( ) {
MenuInputState * nextState = this ;
switch ( _state ) {
case DELAY :
delay ( ) ;
break ;
case CHOICE :
choice ( ) ;
break ;
case FAIL :
fail ( ) ;
break ;
case SUCCESS :
success ( ) ;
nextState = 0 ;
break ;
default :
error ( " unknown state in SelectCharacterInputState " ) ;
}
return nextState ;
}
virtual void enter ( ) {
2009-03-14 15:09:31 +00:00
_vm - > _soundManI - > stopMusic ( ) ;
2008-07-24 09:24:32 +00:00
_vm - > showSlide ( " password " ) ;
2011-04-17 14:30:12 +00:00
_emptySlots . create ( BLOCK_WIDTH * 8 , BLOCK_HEIGHT , Graphics : : PixelFormat : : createFormatCLUT8 ( ) ) ;
2008-07-24 09:24:32 +00:00
Common : : Rect rect ( SLOT_X , SLOT_Y , SLOT_X + BLOCK_WIDTH * 8 , SLOT_Y + BLOCK_HEIGHT ) ;
_vm - > _gfx - > grabBackground ( rect , _emptySlots ) ;
_labels [ 0 ] = _vm - > _gfx - > createLabel ( _vm - > _introFont , introMsg1 [ _vm - > getInternLanguage ( ) ] , 1 ) ;
_labels [ 1 ] = _vm - > _gfx - > createLabel ( _vm - > _introFont , introMsg2 [ _vm - > getInternLanguage ( ) ] , 1 ) ;
cleanup ( ) ;
2008-07-25 02:37:55 +00:00
2008-08-30 10:27:20 +00:00
_vm - > _input - > setArrowCursor ( ) ;
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_ENABLED_SHOW ) ;
2008-07-24 09:24:32 +00:00
_state = CHOICE ;
}
} ;
2008-07-25 06:35:02 +00:00
const char * SelectCharacterInputState_NS : : introMsg1 [ 4 ] = {
2008-07-24 09:24:32 +00:00
" INSERISCI IL CODICE " ,
" ENTREZ CODE " ,
" ENTER CODE " ,
" GIB DEN KODE EIN "
} ;
2008-07-25 06:35:02 +00:00
const char * SelectCharacterInputState_NS : : introMsg2 [ 4 ] = {
2008-07-24 09:24:32 +00:00
" CODICE ERRATO " ,
" CODE ERRONE " ,
" WRONG CODE " ,
" GIB DEN KODE EIN "
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
const uint16 SelectCharacterInputState_NS : : _amigaKeys [ ] [ PASSWORD_LEN ] = {
2008-07-24 09:24:32 +00:00
{ 5 , 3 , 6 , 2 , 2 , 7 } , // dino
{ 0 , 3 , 6 , 2 , 2 , 6 } , // donna
{ 1 , 3 , 7 , 2 , 4 , 6 } // dough
} ;
2008-07-25 06:35:02 +00:00
const uint16 SelectCharacterInputState_NS : : _pcKeys [ ] [ PASSWORD_LEN ] = {
2008-07-24 09:24:32 +00:00
{ 5 , 3 , 6 , 1 , 4 , 7 } , // dino
{ 0 , 2 , 8 , 5 , 5 , 1 } , // donna
{ 1 , 7 , 7 , 2 , 2 , 6 } // dough
} ;
2008-07-25 06:35:02 +00:00
const char * SelectCharacterInputState_NS : : _charStartLocation [ ] = {
2008-07-24 09:24:32 +00:00
" test.dino " ,
" test.donna " ,
" test.dough "
} ;
2008-07-25 06:35:02 +00:00
class ShowCreditsInputState_NS : public MenuInputState {
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-07-24 09:24:32 +00:00
int _current ;
uint32 _startTime ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
struct Credit {
const char * _role ;
const char * _name ;
} ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
static const Credit _credits [ 6 ] ;
2010-04-27 08:59:13 +00:00
GfxObj * _labels [ 2 ] ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
ShowCreditsInputState_NS ( Parallaction * vm , MenuInputHelper * helper ) : MenuInputState ( " showcredits " , helper ) , _vm ( vm ) {
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
}
~ ShowCreditsInputState_NS ( ) {
destroyLabels ( ) ;
}
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _labels [ 0 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 1 ] ) ;
delete _labels [ 0 ] ;
2011-06-19 22:59:48 +00:00
delete _labels [ 1 ] ;
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
void drawCurrentLabel ( ) {
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
_labels [ 0 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , _credits [ _current ] . _role , 1 ) ;
_labels [ 1 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , _credits [ _current ] . _name , 1 ) ;
_vm - > _gfx - > showLabel ( _labels [ 0 ] , CENTER_LABEL_HORIZONTAL , 80 ) ;
_vm - > _gfx - > showLabel ( _labels [ 1 ] , CENTER_LABEL_HORIZONTAL , 100 ) ;
2008-07-24 09:24:32 +00:00
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
virtual MenuInputState * run ( ) {
if ( _current = = - 1 ) {
2008-08-30 15:49:54 +00:00
_startTime = _vm - > _system - > getMillis ( ) ;
2008-07-24 09:24:32 +00:00
_current = 0 ;
drawCurrentLabel ( ) ;
return this ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
int event = _vm - > _input - > getLastButtonEvent ( ) ;
2008-08-30 15:49:54 +00:00
uint32 curTime = _vm - > _system - > getMillis ( ) ;
2008-07-24 09:24:32 +00:00
if ( ( event = = kMouseLeftUp ) | | ( curTime - _startTime > 5500 ) ) {
_current + + ;
_startTime = curTime ;
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
if ( _current = = 6 ) {
return _helper - > getState ( " endintro " ) ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
drawCurrentLabel ( ) ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
return this ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
virtual void enter ( ) {
_current = - 1 ;
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_DISABLED ) ;
2008-07-24 09:24:32 +00:00
}
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
const ShowCreditsInputState_NS : : Credit ShowCreditsInputState_NS : : _credits [ 6 ] = {
2008-07-24 09:24:32 +00:00
{ " Music and Sound Effects " , " MARCO CAPRELLI " } ,
{ " PC Version " , " RICCARDO BALLARINO " } ,
{ " Project Manager " , " LOVRANO CANEPA " } ,
{ " Production " , " BRUNO BOZ " } ,
{ " Special Thanks to " , " LUIGI BENEDICENTI - GILDA and DANILO " } ,
{ " Copyright 1992 Euclidea s.r.l ITALY " , " All rights reserved " }
} ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
class EndIntroInputState_NS : public MenuInputState {
2009-03-14 15:09:31 +00:00
Parallaction_ns * _vm ;
2008-07-24 09:24:32 +00:00
bool _isDemo ;
2010-04-27 08:59:13 +00:00
GfxObj * _label ;
2008-01-09 21:46:57 +00:00
2008-07-24 09:24:32 +00:00
public :
2009-03-14 15:09:31 +00:00
EndIntroInputState_NS ( Parallaction_ns * vm , MenuInputHelper * helper ) : MenuInputState ( " endintro " , helper ) , _vm ( vm ) {
2008-07-24 09:24:32 +00:00
_isDemo = ( _vm - > getFeatures ( ) & GF_DEMO ) ! = 0 ;
2010-04-27 08:59:13 +00:00
_label = 0 ;
}
~ EndIntroInputState_NS ( ) {
destroyLabels ( ) ;
}
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _label ) ;
delete _label ;
_label = 0 ;
2008-07-24 09:24:32 +00:00
}
2008-01-28 17:36:08 +00:00
2008-07-24 09:24:32 +00:00
virtual MenuInputState * run ( ) {
2008-01-28 17:36:08 +00:00
2008-07-24 09:24:32 +00:00
int event = _vm - > _input - > getLastButtonEvent ( ) ;
if ( event ! = kMouseLeftUp ) {
return this ;
}
2008-05-14 14:34:01 +00:00
2008-07-24 09:24:32 +00:00
if ( _isDemo ) {
2008-08-05 02:11:00 +00:00
_vm - > quitGame ( ) ;
2008-07-24 09:24:32 +00:00
return 0 ;
}
2007-11-01 14:08:55 +00:00
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2010-04-02 12:51:42 +00:00
_engineFlags & = ~ kEngineBlockInput ;
2008-07-24 09:24:32 +00:00
return _helper - > getState ( " selectcharacter " ) ;
}
2007-12-09 17:31:36 +00:00
2008-07-24 09:24:32 +00:00
virtual void enter ( ) {
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_DISABLED ) ;
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
if ( ! _isDemo ) {
2009-03-14 15:09:31 +00:00
_vm - > _soundManI - > stopMusic ( ) ;
2010-04-27 08:59:13 +00:00
_label = _vm - > _gfx - > createLabel ( _vm - > _menuFont , " CLICK MOUSE BUTTON TO START " , 1 ) ;
_vm - > _gfx - > showLabel ( _label , CENTER_LABEL_HORIZONTAL , 80 ) ;
2008-07-24 09:24:32 +00:00
}
}
} ;
2008-07-23 07:52:43 +00:00
2008-07-25 06:35:02 +00:00
class EndPartInputState_NS : public MenuInputState {
2008-08-31 05:18:25 +00:00
Parallaction * _vm ;
2008-07-24 09:24:32 +00:00
bool _allPartsComplete ;
2008-07-23 07:52:43 +00:00
2008-07-24 09:24:32 +00:00
// part completion messages
static const char * endMsg0 [ 4 ] ;
static const char * endMsg1 [ 4 ] ;
static const char * endMsg2 [ 4 ] ;
static const char * endMsg3 [ 4 ] ;
// game completion messages
static const char * endMsg4 [ 4 ] ;
static const char * endMsg5 [ 4 ] ;
static const char * endMsg6 [ 4 ] ;
static const char * endMsg7 [ 4 ] ;
2008-07-23 07:52:43 +00:00
2010-04-27 08:59:13 +00:00
GfxObj * _labels [ 4 ] ;
2008-07-23 07:52:43 +00:00
2008-07-24 09:24:32 +00:00
public :
2008-08-31 05:18:25 +00:00
EndPartInputState_NS ( Parallaction * vm , MenuInputHelper * helper ) : MenuInputState ( " endpart " , helper ) , _vm ( vm ) {
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
_labels [ 2 ] = 0 ;
_labels [ 3 ] = 0 ;
}
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
void destroyLabels ( ) {
_vm - > _gfx - > unregisterLabel ( _labels [ 0 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 1 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 2 ] ) ;
_vm - > _gfx - > unregisterLabel ( _labels [ 3 ] ) ;
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
delete _labels [ 0 ] ;
delete _labels [ 1 ] ;
delete _labels [ 2 ] ;
delete _labels [ 3 ] ;
2011-06-19 22:59:48 +00:00
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = 0 ;
_labels [ 1 ] = 0 ;
_labels [ 2 ] = 0 ;
_labels [ 3 ] = 0 ;
2008-07-24 09:24:32 +00:00
}
2008-07-23 07:52:43 +00:00
2008-07-24 09:24:32 +00:00
virtual MenuInputState * run ( ) {
int event = _vm - > _input - > getLastButtonEvent ( ) ;
if ( event ! = kMouseLeftUp ) {
return this ;
2007-11-01 14:08:55 +00:00
}
2010-04-27 08:59:13 +00:00
destroyLabels ( ) ;
2008-07-24 09:24:32 +00:00
if ( _allPartsComplete ) {
_vm - > scheduleLocationSwitch ( " estgrotta.drki " ) ;
return 0 ;
2008-01-06 20:42:28 +00:00
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
return _helper - > getState ( " selectcharacter " ) ;
}
2008-01-09 21:46:57 +00:00
2008-07-24 09:24:32 +00:00
virtual void enter ( ) {
2008-08-31 05:18:25 +00:00
bool completed [ 3 ] ;
2008-08-31 06:14:45 +00:00
_vm - > _saveLoad - > getGamePartProgress ( completed , 3 ) ;
2008-08-31 05:18:25 +00:00
_allPartsComplete = ( completed [ 0 ] & & completed [ 1 ] & & completed [ 2 ] ) ;
2008-07-25 02:37:55 +00:00
_vm - > _input - > setMouseState ( MOUSE_DISABLED ) ;
2008-01-09 21:46:57 +00:00
2008-08-31 10:24:32 +00:00
uint16 language = _vm - > getInternLanguage ( ) ;
2008-07-24 09:24:32 +00:00
if ( _allPartsComplete ) {
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg4 [ language ] , 1 ) ;
_labels [ 1 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg5 [ language ] , 1 ) ;
_labels [ 2 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg6 [ language ] , 1 ) ;
_labels [ 3 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg7 [ language ] , 1 ) ;
2008-07-24 09:24:32 +00:00
} else {
2010-04-27 08:59:13 +00:00
_labels [ 0 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg0 [ language ] , 1 ) ;
_labels [ 1 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg1 [ language ] , 1 ) ;
_labels [ 2 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg2 [ language ] , 1 ) ;
_labels [ 3 ] = _vm - > _gfx - > createLabel ( _vm - > _menuFont , endMsg3 [ language ] , 1 ) ;
2008-07-24 09:24:32 +00:00
}
2007-11-01 14:08:55 +00:00
2010-04-27 08:59:13 +00:00
_vm - > _gfx - > showLabel ( _labels [ 0 ] , CENTER_LABEL_HORIZONTAL , 70 ) ;
_vm - > _gfx - > showLabel ( _labels [ 1 ] , CENTER_LABEL_HORIZONTAL , 100 ) ;
_vm - > _gfx - > showLabel ( _labels [ 2 ] , CENTER_LABEL_HORIZONTAL , 130 ) ;
_vm - > _gfx - > showLabel ( _labels [ 3 ] , CENTER_LABEL_HORIZONTAL , 160 ) ;
2007-11-01 14:08:55 +00:00
}
2008-07-24 09:24:32 +00:00
} ;
// part completion messages
2008-07-25 06:35:02 +00:00
const char * EndPartInputState_NS : : endMsg0 [ ] = { " COMPLIMENTI! " , " BRAVO! " , " CONGRATULATIONS! " , " PRIMA! " } ;
const char * EndPartInputState_NS : : endMsg1 [ ] = { " HAI FINITO QUESTA PARTE " , " TU AS COMPLETE' CETTE AVENTURE " , " YOU HAVE COMPLETED THIS PART " , " DU HAST EIN ABENTEUER ERFOLGREICH " } ;
const char * EndPartInputState_NS : : endMsg2 [ ] = { " ORA COMPLETA IL RESTO " , " AVEC SUCCES. " , " NOW GO ON WITH THE REST OF " , " ZU ENDE GEFUHRT " } ;
const char * EndPartInputState_NS : : endMsg3 [ ] = { " DELL' AVVENTURA " , " CONTINUE AVEC LES AUTRES " , " THIS ADVENTURE " , " MACH' MIT DEN ANDEREN WEITER " } ;
2008-07-24 09:24:32 +00:00
// game completion messages
2008-07-25 06:35:02 +00:00
const char * EndPartInputState_NS : : endMsg4 [ ] = { " COMPLIMENTI! " , " BRAVO! " , " CONGRATULATIONS! " , " PRIMA! " } ;
const char * EndPartInputState_NS : : endMsg5 [ ] = { " HAI FINITO LE TRE PARTI " , " TU AS COMPLETE' LES TROIS PARTIES " , " YOU HAVE COMPLETED THE THREE PARTS " , " DU HAST DREI ABENTEURE ERFOLGREICH " } ;
const char * EndPartInputState_NS : : endMsg6 [ ] = { " DELL' AVVENTURA " , " DE L'AVENTURE " , " OF THIS ADVENTURE " , " ZU ENDE GEFUHRT " } ;
const char * EndPartInputState_NS : : endMsg7 [ ] = { " ED ORA IL GRAN FINALE " , " ET MAINTENANT LE GRAND FINAL " , " NOW THE GREAT FINAL " , " UND YETZT DER GROSSE SCHLUSS! " } ;
2008-07-24 09:24:32 +00:00
void Parallaction_ns : : startGui ( ) {
_menuHelper = new MenuInputHelper ;
assert ( _menuHelper ) ;
2008-07-25 06:35:02 +00:00
new SelectGameInputState_NS ( this , _menuHelper ) ;
new LoadGameInputState_NS ( this , _menuHelper ) ;
new NewGameInputState_NS ( this , _menuHelper ) ;
new StartDemoInputState_NS ( this , _menuHelper ) ;
new SelectCharacterInputState_NS ( this , _menuHelper ) ;
new ChooseLanguageInputState_NS ( this , _menuHelper ) ;
new SplashInputState1_NS ( this , _menuHelper ) ;
new SplashInputState0_NS ( this , _menuHelper ) ;
2008-07-24 09:24:32 +00:00
_menuHelper - > setState ( " intro0 " ) ;
_input - > _inputMode = Input : : kInputModeMenu ;
}
void Parallaction_ns : : startCreditSequence ( ) {
_menuHelper = new MenuInputHelper ;
assert ( _menuHelper ) ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
new ShowCreditsInputState_NS ( this , _menuHelper ) ;
new EndIntroInputState_NS ( this , _menuHelper ) ;
new SelectCharacterInputState_NS ( this , _menuHelper ) ;
2008-07-24 09:24:32 +00:00
_menuHelper - > setState ( " showcredits " ) ;
2008-01-09 21:46:57 +00:00
2008-07-24 09:24:32 +00:00
_input - > _inputMode = Input : : kInputModeMenu ;
}
2007-11-01 14:08:55 +00:00
2008-07-24 09:24:32 +00:00
void Parallaction_ns : : startEndPartSequence ( ) {
_menuHelper = new MenuInputHelper ;
assert ( _menuHelper ) ;
2007-11-01 14:08:55 +00:00
2008-07-25 06:35:02 +00:00
new EndPartInputState_NS ( this , _menuHelper ) ;
new SelectCharacterInputState_NS ( this , _menuHelper ) ;
2008-07-24 09:24:32 +00:00
_menuHelper - > setState ( " endpart " ) ;
_input - > _inputMode = Input : : kInputModeMenu ;
}
2007-11-01 14:08:55 +00:00
2007-12-09 17:31:36 +00:00
2007-11-01 14:08:55 +00:00
} // namespace Parallaction