mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
add synonyms to tile counts/values summary
This commit is contained in:
parent
9e67dda5a9
commit
b58fe30ecc
2 changed files with 14 additions and 4 deletions
|
@ -110,7 +110,7 @@ dict_getNextTileString( const DictionaryCtxt* dict, Tile tile,
|
|||
} else {
|
||||
cur += XP_STRLEN( cur ) + 1;
|
||||
XP_Bool isSpecial = dict_faceIsBitmap( dict, tile );
|
||||
if ( isSpecial ) {
|
||||
if ( isSpecial || tile == dict->blankTile ) {
|
||||
const XP_UCHAR* facep = dict_getTileStringRaw( dict, tile );
|
||||
if ( cur < dict->charEnds[(XP_U16)*facep] ) {
|
||||
result = cur;
|
||||
|
|
|
@ -2856,17 +2856,27 @@ server_formatDictCounts( ServerCtxt* server, XWStreamCtxt* stream,
|
|||
nChars = dict_numTileFaces( dict );
|
||||
|
||||
for ( tile = 0, nPrinted = 0; ; ) {
|
||||
XP_UCHAR buf[24];
|
||||
XP_UCHAR buf[128];
|
||||
XP_U16 count, value;
|
||||
|
||||
count = dict_numTiles( dict, tile );
|
||||
|
||||
if ( count > 0 ) {
|
||||
const XP_UCHAR* face = dict_getTileString( dict, tile );
|
||||
const XP_UCHAR* face = NULL;
|
||||
XP_UCHAR faces[48] = {0};
|
||||
XP_U16 len = 0;
|
||||
for ( ; ; ) {
|
||||
face = dict_getNextTileString( dict, tile, face );
|
||||
if ( !face ) {
|
||||
break;
|
||||
}
|
||||
const XP_UCHAR* fmt = len == 0? "%s" : ",%s";
|
||||
len += XP_SNPRINTF( faces + len, sizeof(faces) - len, fmt, face );
|
||||
}
|
||||
value = dict_getTileValue( dict, tile );
|
||||
|
||||
XP_SNPRINTF( buf, sizeof(buf), (XP_UCHAR*)"%s: %d/%d",
|
||||
face, count, value );
|
||||
faces, count, value );
|
||||
stream_catString( stream, buf );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue