mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-13 20:48:02 +01:00
change signature to fit API changes (but don't use new params yet);
add new strings; fix formatting.
This commit is contained in:
parent
5a5fa2c1aa
commit
b2bec00da3
1 changed files with 282 additions and 267 deletions
|
@ -89,7 +89,7 @@ CMenuBar MainMenuBar( MENUBAR_WINDOW_ID, 23 );
|
||||||
static VTableMgr* frank_util_getVTManager( XW_UtilCtxt* uc );
|
static VTableMgr* frank_util_getVTManager( XW_UtilCtxt* uc );
|
||||||
static DictionaryCtxt* frank_util_makeEmptyDict( XW_UtilCtxt* uc );
|
static DictionaryCtxt* frank_util_makeEmptyDict( XW_UtilCtxt* uc );
|
||||||
static void frank_util_userError( XW_UtilCtxt* uc, UtilErrID id );
|
static void frank_util_userError( XW_UtilCtxt* uc, UtilErrID id );
|
||||||
static XP_U16 frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id,
|
static XP_Bool frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id,
|
||||||
XWStreamCtxt* stream );
|
XWStreamCtxt* stream );
|
||||||
static XP_S16 frank_util_userPickTile( XW_UtilCtxt* uc, PickInfo* pi,
|
static XP_S16 frank_util_userPickTile( XW_UtilCtxt* uc, PickInfo* pi,
|
||||||
XP_U16 playerNum,
|
XP_U16 playerNum,
|
||||||
|
@ -150,6 +150,7 @@ class CXWordsWindow : public CWindow {
|
||||||
BOOL drawInProgress;
|
BOOL drawInProgress;
|
||||||
BOOL userEventPending;
|
BOOL userEventPending;
|
||||||
XP_Bool fRobotHalted;
|
XP_Bool fRobotHalted;
|
||||||
|
XP_Bool fAskTrayLimits;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CXWordsWindow( MPFORMAL FrankDictList* dlist );
|
CXWordsWindow( MPFORMAL FrankDictList* dlist );
|
||||||
|
@ -283,6 +284,8 @@ CXWordsWindow::CXWordsWindow(MPFORMAL FrankDictList* dlist )
|
||||||
fGame.server = (ServerCtxt*)NULL;
|
fGame.server = (ServerCtxt*)NULL;
|
||||||
fGame.board = (BoardCtxt*)NULL;
|
fGame.board = (BoardCtxt*)NULL;
|
||||||
|
|
||||||
|
fAskTrayLimits = XP_FALSE;
|
||||||
|
|
||||||
gi_initPlayerInfo( MEMPOOL(this) &fGameInfo, (XP_UCHAR*)"Player %d" );
|
gi_initPlayerInfo( MEMPOOL(this) &fGameInfo, (XP_UCHAR*)"Player %d" );
|
||||||
|
|
||||||
U16 nRecords = gamesDB->countRecords();
|
U16 nRecords = gamesDB->countRecords();
|
||||||
|
@ -461,6 +464,7 @@ CXWordsWindow::MsgHandler( MSG_TYPE type, CViewable *from, S32 data )
|
||||||
S16 drag_x;
|
S16 drag_x;
|
||||||
S16 drag_y;
|
S16 drag_y;
|
||||||
XWTimerReason reason;
|
XWTimerReason reason;
|
||||||
|
XP_Bool handled;
|
||||||
|
|
||||||
drag_x = (S16) (data >> 16);
|
drag_x = (S16) (data >> 16);
|
||||||
drag_y = (S16) data;
|
drag_y = (S16) data;
|
||||||
|
@ -490,7 +494,7 @@ CXWordsWindow::MsgHandler( MSG_TYPE type, CViewable *from, S32 data )
|
||||||
|
|
||||||
case MSG_PEN_DOWN:
|
case MSG_PEN_DOWN:
|
||||||
this->penDown = TRUE;
|
this->penDown = TRUE;
|
||||||
if ( board_handlePenDown( fGame.board, drag_x, drag_y, 0 ) ) {
|
if ( board_handlePenDown( fGame.board, drag_x, drag_y, 0, &handled ) ) {
|
||||||
GUI_NeedUpdate();
|
GUI_NeedUpdate();
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
@ -979,7 +983,8 @@ CXWordsWindow::doHint( XP_Bool reset )
|
||||||
if ( reset ) {
|
if ( reset ) {
|
||||||
board_resetEngine( fGame.board );
|
board_resetEngine( fGame.board );
|
||||||
}
|
}
|
||||||
done = board_requestHint( fGame.board, &workRemains );
|
done = board_requestHint( fGame.board,
|
||||||
|
fAskTrayLimits, &workRemains );
|
||||||
if ( done ) {
|
if ( done ) {
|
||||||
GUI_NeedUpdate();
|
GUI_NeedUpdate();
|
||||||
}
|
}
|
||||||
|
@ -1085,8 +1090,8 @@ CXWordsWindow::doAbout()
|
||||||
XWStreamCtxt* stream;
|
XWStreamCtxt* stream;
|
||||||
|
|
||||||
stream = makeMemStream();
|
stream = makeMemStream();
|
||||||
char* txt = "Crosswords" VERSION_STRING "\n"
|
char* txt = "Crosswords " VERSION_STRING "\n"
|
||||||
"Copyright 2000-2002 by Eric House (fixin@peak.org).\n"
|
"Copyright 2000-2004 by Eric House (fixin@peak.org).\n"
|
||||||
"All rights reserved.\n"
|
"All rights reserved.\n"
|
||||||
"For further information see www.peak.org/~fixin/xwords/ebm.html.";
|
"For further information see www.peak.org/~fixin/xwords/ebm.html.";
|
||||||
stream_putBytes( stream, txt, strlen(txt) );
|
stream_putBytes( stream, txt, strlen(txt) );
|
||||||
|
@ -1367,7 +1372,7 @@ frank_util_userError( XW_UtilCtxt* uc, UtilErrID id )
|
||||||
GUI_NeedUpdate();
|
GUI_NeedUpdate();
|
||||||
} /* frank_util_userError */
|
} /* frank_util_userError */
|
||||||
|
|
||||||
static XP_U16
|
static XP_Bool
|
||||||
frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream )
|
frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream )
|
||||||
{
|
{
|
||||||
char* question;
|
char* question;
|
||||||
|
@ -1397,7 +1402,7 @@ frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream )
|
||||||
askResult = GUI_Alert( ALERT_OK, question );
|
askResult = GUI_Alert( ALERT_OK, question );
|
||||||
board_invalAll( self->fGame.board );
|
board_invalAll( self->fGame.board );
|
||||||
GUI_NeedUpdate();
|
GUI_NeedUpdate();
|
||||||
return askResult;
|
return askResult != 0;
|
||||||
} /* frank_util_userQuery */
|
} /* frank_util_userQuery */
|
||||||
|
|
||||||
static XP_S16
|
static XP_S16
|
||||||
|
@ -1505,8 +1510,7 @@ frank_util_getSquareBonus( XW_UtilCtxt* uc, ModelCtxt* model,
|
||||||
XP_U16 col, XP_U16 row )
|
XP_U16 col, XP_U16 row )
|
||||||
{
|
{
|
||||||
XP_U16 index;
|
XP_U16 index;
|
||||||
/* This must be static or won't compile under multilink (for Palm).
|
|
||||||
Fix! */
|
|
||||||
const char scrabbleBoard[8*8] = {
|
const char scrabbleBoard[8*8] = {
|
||||||
TW,EM,EM,DL,EM,EM,EM,TW,
|
TW,EM,EM,DL,EM,EM,EM,TW,
|
||||||
EM,DW,EM,EM,EM,TL,EM,EM,
|
EM,DW,EM,EM,EM,TL,EM,EM,
|
||||||
|
@ -1547,6 +1551,8 @@ frank_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode )
|
||||||
return (XP_UCHAR*)"Commit the current move?\n";
|
return (XP_UCHAR*)"Commit the current move?\n";
|
||||||
case STR_NONLOCAL_NAME:
|
case STR_NONLOCAL_NAME:
|
||||||
return (XP_UCHAR*)"%s (remote)";
|
return (XP_UCHAR*)"%s (remote)";
|
||||||
|
case STR_LOCAL_NAME:
|
||||||
|
return (XP_UCHAR*)"%s";
|
||||||
case STRD_TIME_PENALTY_SUB:
|
case STRD_TIME_PENALTY_SUB:
|
||||||
return (XP_UCHAR*)" - %d [time]";
|
return (XP_UCHAR*)" - %d [time]";
|
||||||
|
|
||||||
|
@ -1572,6 +1578,15 @@ frank_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode )
|
||||||
case STR_ROBOT_MOVED:
|
case STR_ROBOT_MOVED:
|
||||||
return (XP_UCHAR*)"The robot made this move:\n";
|
return (XP_UCHAR*)"The robot made this move:\n";
|
||||||
|
|
||||||
|
case STR_PASSED:
|
||||||
|
return (XP_UCHAR*)"Passed";
|
||||||
|
case STRSD_SUMMARYSCORED:
|
||||||
|
return (XP_UCHAR*)"%s:%d";
|
||||||
|
case STRD_TRADED:
|
||||||
|
return (XP_UCHAR*)"Traded %d";
|
||||||
|
case STR_LOSTTURN:
|
||||||
|
return (XP_UCHAR*)"Lost turn";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return (XP_UCHAR*)"unknown code ";
|
return (XP_UCHAR*)"unknown code ";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue