fix bug using same string and code to warn and to reject phonies.

This commit is contained in:
ehouse 2007-12-14 03:21:46 +00:00
parent d6a161b939
commit 872ae90c94
2 changed files with 10 additions and 7 deletions

View file

@ -96,7 +96,7 @@
{ "STRS_NEW_TILES", "New tiles: %s\n" },
{ "STRSS_TRADED_FOR", "Traded %s for %s." },
{ "STR_PASS", "pass\n" },
{ "STR_PHONY_REJECTED", "Illegal word in move; turn lost!\n" },
{ "STR_PHONY_REJECTED", "Turn lost: illegal word in move." },
{ "STR_ROBOT_MOVED", "The robot made this move:\n" },
{ "STR_REMOTE_MOVED", "Remote player made this move:\n" },

View file

@ -4040,16 +4040,19 @@ palm_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
{
XP_Bool result = XP_TRUE;
PalmAppGlobals* globals = (PalmAppGlobals*)uc->closure;
XP_UCHAR buf[200];
char wordsBuf[150];
const XP_UCHAR* format = getResString( globals, STR_ILLEGAL_WORD );
formatBadWords( bwi, wordsBuf );
StrPrintF( (char*)buf, (const char*)format, wordsBuf );
const XP_UCHAR* resStr = getResString( globals,
turnLost? STR_PHONY_REJECTED : STR_ILLEGAL_WORD );
if ( turnLost ) {
keySafeCustomAlert( globals, buf );
keySafeCustomAlert( globals, resStr );
} else {
char wordsBuf[150];
XP_UCHAR buf[200];
formatBadWords( bwi, wordsBuf );
StrPrintF( (char*)buf, (const char*)resStr, wordsBuf );
result = palmask( globals, buf, NULL, -1 );
}
return result;
} /* palm_util_warnIllegalWord */