robot turn reports should also be scrollable

This commit is contained in:
ehouse 2004-02-17 05:00:13 +00:00
parent 354bd96db4
commit 47a812e9b9

View file

@ -66,8 +66,8 @@ typedef struct FileWriteState {
/* forward util function decls */ /* forward util function decls */
static VTableMgr* ce_util_getVTManager( XW_UtilCtxt* uc ); static VTableMgr* ce_util_getVTManager( XW_UtilCtxt* uc );
static void ce_util_userError( XW_UtilCtxt* uc, UtilErrID id ); static void ce_util_userError( XW_UtilCtxt* uc, UtilErrID id );
static XP_U16 ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, static XP_Bool ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id,
XWStreamCtxt* stream ); XWStreamCtxt* stream );
static XWBonusType ce_util_getSquareBonus( XW_UtilCtxt* uc, static XWBonusType ce_util_getSquareBonus( XW_UtilCtxt* uc,
ModelCtxt* model, ModelCtxt* model,
XP_U16 col, XP_U16 row ); XP_U16 col, XP_U16 row );
@ -104,9 +104,9 @@ static void messageBoxChar( CEAppGlobals* globals, XP_UCHAR* str,
wchar_t* title ); wchar_t* title );
static XP_Bool queryBoxChar( CEAppGlobals* globals, XP_UCHAR* msg ); static XP_Bool queryBoxChar( CEAppGlobals* globals, XP_UCHAR* msg );
static XP_U16 ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream, static XP_Bool ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream,
wchar_t* title, XP_Bool isQuery, wchar_t* title, XP_Bool isQuery,
XP_Bool destroy ); XP_Bool destroy );
static void RECTtoXPR( XP_Rect* dest, RECT* src ); static void RECTtoXPR( XP_Rect* dest, RECT* src );
static XP_Bool doNewGame( CEAppGlobals* globals, XP_Bool silent ); static XP_Bool doNewGame( CEAppGlobals* globals, XP_Bool silent );
static XP_Bool ceSaveCurGame( CEAppGlobals* globals, XP_Bool autoSave ); static XP_Bool ceSaveCurGame( CEAppGlobals* globals, XP_Bool autoSave );
@ -795,8 +795,8 @@ ceCountsAndValues( CEAppGlobals* globals )
server_formatPoolCounts( globals->game.server, stream, server_formatPoolCounts( globals->game.server, stream,
2 ); /* 2: ncols */ 2 ); /* 2: ncols */
ceMsgFromStream( globals, stream, L"Tile Counts and Values", (void)ceMsgFromStream( globals, stream, L"Tile Counts and Values",
XP_FALSE, XP_TRUE ); XP_FALSE, XP_TRUE );
} }
} /* ceCountsAndValues */ } /* ceCountsAndValues */
@ -813,7 +813,8 @@ ceDoHistory( CEAppGlobals* globals )
model_writeGameHistory( globals->game.model, stream, model_writeGameHistory( globals->game.model, stream,
globals->game.server, gameOver ); globals->game.server, gameOver );
ceMsgFromStream( globals, stream, L"Game history", XP_FALSE, XP_TRUE ); (void)ceMsgFromStream( globals, stream, L"Game history",
XP_FALSE, XP_TRUE );
} /* ceDoHistory */ } /* ceDoHistory */
static void static void
@ -844,7 +845,8 @@ ceDisplayFinalScores( CEAppGlobals* globals )
server_writeFinalScores( globals->game.server, stream ); server_writeFinalScores( globals->game.server, stream );
stream_putU8( stream, '\0' ); stream_putU8( stream, '\0' );
ceMsgFromStream( globals, stream, L"Final scores", XP_FALSE, XP_TRUE ); (void)ceMsgFromStream( globals, stream, L"Final scores",
XP_FALSE, XP_TRUE );
} /* ceDisplayFinalScores */ } /* ceDisplayFinalScores */
static XP_Bool static XP_Bool
@ -1369,7 +1371,7 @@ notImpl( CEAppGlobals* globals )
messageBoxChar( globals, "feature not implemented", NULL ); messageBoxChar( globals, "feature not implemented", NULL );
} /* notImpl */ } /* notImpl */
static XP_U16 static XP_Bool
ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream, ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream,
wchar_t* title, XP_Bool isQuery, XP_Bool destroy ) wchar_t* title, XP_Bool isQuery, XP_Bool destroy )
{ {
@ -1387,7 +1389,7 @@ ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream,
stream_destroy( stream ); stream_destroy( stream );
} }
return init.result; return init.result == IDOK;
} /* ceMsgFromStream */ } /* ceMsgFromStream */
static void static void
@ -1613,41 +1615,36 @@ ce_util_userError( XW_UtilCtxt* uc, UtilErrID id )
} /* ce_util_userError */ } /* ce_util_userError */
static XP_U16 static XP_Bool
ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream ) ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream )
{ {
char* query = NULL; char* query = NULL;
char* info = NULL; char* info = NULL;
CEAppGlobals* globals = (CEAppGlobals*)uc->closure; CEAppGlobals* globals = (CEAppGlobals*)uc->closure;
XP_U16 answer = 0; XP_Bool answer = XP_FALSE;
XP_Bool queryWithStream = XP_FALSE; XP_Bool queryWithStream = XP_FALSE;
switch( id ) { switch( id ) {
case QUERY_COMMIT_TURN: case QUERY_COMMIT_TURN:
queryWithStream = XP_TRUE; return ceQueryFromStream( globals, stream );
break;
case QUERY_COMMIT_TRADE: case QUERY_COMMIT_TRADE:
query = "Are you sure you want to spend this move trading tiles?"; query = "Are you sure you want to spend this move trading tiles?";
break; return queryBoxChar( globals, query );
case QUERY_ROBOT_MOVE:
return ceMsgFromStream( globals, stream, L"FYI", XP_FALSE,
XP_FALSE );
case QUERY_ROBOT_TRADE: case QUERY_ROBOT_TRADE:
case QUERY_ROBOT_MOVE: messageBoxStream( globals, stream, L"FYI" );
info = "Robot foo";
break; break;
default: default:
XP_ASSERT(0); XP_ASSERT(0);
} }
if ( queryWithStream ) { return XP_FALSE;
answer = ceQueryFromStream( globals, stream );
} else if ( !!query ) {
answer = queryBoxChar( globals, query );
} else if ( !!info ) {
messageBoxStream( globals, stream, L"FYI" );
}
return answer == IDOK || answer == IDYES;
} /* ce_util_userQuery */ } /* ce_util_userQuery */
static XWBonusType static XWBonusType