mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
make -q option take number of seconds to pause before quitting
This commit is contained in:
parent
a59c2456d5
commit
e30c72c829
4 changed files with 10 additions and 7 deletions
|
@ -334,11 +334,13 @@ curses_util_notifyGameOver( XW_UtilCtxt* uc )
|
|||
catGameHistory( &globals->cGlobals );
|
||||
}
|
||||
|
||||
if ( globals->cGlobals.params->quitAfter ) {
|
||||
if ( globals->cGlobals.params->quitAfter >= 0 ) {
|
||||
sleep( globals->cGlobals.params->quitAfter );
|
||||
globals->timeToExit = XP_TRUE;
|
||||
} else if ( globals->cGlobals.params->undoWhenDone ) {
|
||||
server_handleUndo( globals->cGlobals.game.server );
|
||||
} else {
|
||||
/* This is modal. Don't show if quitting */
|
||||
cursesShowFinalScores( globals );
|
||||
}
|
||||
} /* curses_util_notifyGameOver */
|
||||
|
|
|
@ -1119,7 +1119,8 @@ gtk_util_notifyGameOver( XW_UtilCtxt* uc )
|
|||
|
||||
printFinalScores( globals );
|
||||
|
||||
if ( globals->cGlobals.params->quitAfter ) {
|
||||
if ( globals->cGlobals.params->quitAfter >= 0 ) {
|
||||
sleep( globals->cGlobals.params->quitAfter );
|
||||
quit( NULL, globals );
|
||||
} else if ( globals->cGlobals.params->undoWhenDone ) {
|
||||
server_handleUndo( globals->cGlobals.game.server );
|
||||
|
|
|
@ -180,7 +180,7 @@ usage( char* appName, char* msg )
|
|||
# endif
|
||||
#endif
|
||||
"\t [-f file] # use this file to save/load game\n"
|
||||
"\t [-q] # quit when game over (useful for robot-only)\n"
|
||||
"\t [-q nSecs] # quit with pause when game over (useful for robot-only)\n"
|
||||
"\t [-S] # slow robot down \n"
|
||||
"\t [-i] # print game history when game over\n"
|
||||
"\t [-U] # call 'Undo' after game ends\n"
|
||||
|
@ -674,7 +674,7 @@ main( int argc, char** argv )
|
|||
mainParams.connInfo.ip.hostName = "localhost";
|
||||
#endif
|
||||
mainParams.gi.boardSize = 15;
|
||||
mainParams.quitAfter = XP_FALSE;
|
||||
mainParams.quitAfter = -1;
|
||||
mainParams.sleepOnAnchor = XP_FALSE;
|
||||
mainParams.printHistory = XP_FALSE;
|
||||
mainParams.undoWhenDone = XP_FALSE;
|
||||
|
@ -707,7 +707,7 @@ main( int argc, char** argv )
|
|||
#if defined PLATFORM_GTK
|
||||
"h:I"
|
||||
#endif
|
||||
"kKf:ln:Nsd:e:r:b:qw:Sit:Umvc"
|
||||
"kKf:ln:Nsd:e:r:b:q:w:Sit:Umvc"
|
||||
#ifdef XWFEATURE_RELAY
|
||||
"a:p:C:H"
|
||||
#endif
|
||||
|
@ -823,7 +823,7 @@ main( int argc, char** argv )
|
|||
hostName = optarg;
|
||||
break;
|
||||
case 'q':
|
||||
mainParams.quitAfter = XP_TRUE;
|
||||
mainParams.quitAfter = atoi(optarg);
|
||||
break;
|
||||
case 'b':
|
||||
mainParams.gi.boardSize = atoi(optarg);
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef struct LaunchParams {
|
|||
XP_U16 nLocalPlayers;
|
||||
XP_U16 nHidden;
|
||||
XP_Bool askNewGame;
|
||||
XP_Bool quitAfter;
|
||||
XP_S16 quitAfter;
|
||||
XP_Bool sleepOnAnchor;
|
||||
XP_Bool printHistory;
|
||||
XP_Bool undoWhenDone;
|
||||
|
|
Loading…
Reference in a new issue