diff --git a/xwords4/common/game.c b/xwords4/common/game.c index 70074ee1e..6507ba204 100644 --- a/xwords4/common/game.c +++ b/xwords4/common/game.c @@ -44,8 +44,9 @@ assertUtilOK( XW_UtilCtxt* util ) # define assertUtilOK(u) #endif +#ifdef XWFEATURE_CHANGEDICT static void gi_setDict( MPFORMAL CurGameInfo* gi, const DictionaryCtxt* dict ); - +#endif static void checkServerRole( CurGameInfo* gi, XP_U16* nPlayersHere, XP_U16* nPlayersTotal ) @@ -186,6 +187,7 @@ game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, board_prefsChanged( game->board, cp ); } /* game_reset */ +#ifdef XWFEATURE_CHANGEDICT void game_changeDict( MPFORMAL XWGame* game, CurGameInfo* gi, DictionaryCtxt* dict ) { @@ -194,6 +196,7 @@ game_changeDict( MPFORMAL XWGame* game, CurGameInfo* gi, DictionaryCtxt* dict ) gi_setDict( MPPARM(mpool) gi, dict ); server_resetEngines( game->server ); } +#endif XP_Bool game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game, @@ -572,6 +575,7 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi ) } } /* gi_writeToStream */ +#ifdef XWFEATURE_CHANGEDICT static void gi_setDict( MPFORMAL CurGameInfo* gi, const DictionaryCtxt* dict ) { @@ -583,6 +587,7 @@ gi_setDict( MPFORMAL CurGameInfo* gi, const DictionaryCtxt* dict ) XP_FREEP( mpool, &pl->dictName ); } } +#endif XP_Bool player_hasPasswd( LocalPlayer* player ) diff --git a/xwords4/common/server.c b/xwords4/common/server.c index ec537368e..abc5b5852 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -1581,6 +1581,7 @@ server_getEngineFor( ServerCtxt* server, XP_U16 playerNum ) return engine; } /* server_getEngineFor */ +#ifdef XWFEATURE_CHANGEDICT void server_resetEngines( ServerCtxt* server ) { @@ -1589,6 +1590,7 @@ server_resetEngines( ServerCtxt* server ) server_resetEngine( server, nPlayers ); } } +#endif void server_resetEngine( ServerCtxt* server, XP_U16 playerNum ) diff --git a/xwords4/linux/Makefile b/xwords4/linux/Makefile index ee44da715..1459e6580 100644 --- a/xwords4/linux/Makefile +++ b/xwords4/linux/Makefile @@ -108,6 +108,8 @@ DEFINES += -DXWFEATURE_TRAYUNDO_ONE DEFINES += -DXWFEATURE_BONUSALL # DEFINES += -DXWFEATURE_BONUSALLHINT DEFINES += -DXWFEATURE_HILITECELL +# allow change dict inside running game +DEFINES += -DXWFEATURE_CHANGEDICT # MAX_ROWS controls STREAM_VERS_BIGBOARD and with it move hashing DEFINES += -DMAX_ROWS=32 diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 74ee145a2..f42ce4afd 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -861,6 +861,7 @@ save_game( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* XP_UNUSED(globals) ) { } /* save_game */ +#ifdef XWFEATURE_CHANGEDICT static void change_dictionary( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) { @@ -877,6 +878,7 @@ change_dictionary( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) } g_slist_free( dicts ); } /* change_dictionary */ +#endif static void handle_undo( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* XP_UNUSED(globals) ) @@ -1020,10 +1022,10 @@ makeMenus( GtkAppGlobals* globals, int XP_UNUSED(argc), GTK_SIGNAL_FUNC(load_game), globals ); (void)createAddItem( fileMenu, "Save game", GTK_SIGNAL_FUNC(save_game), globals ); - +#ifdef XWFEATURE_CHANGEDICT (void)createAddItem( fileMenu, "Change dictionary", GTK_SIGNAL_FUNC(change_dictionary), globals ); - +#endif (void)createAddItem( fileMenu, "Cancel trade", GTK_SIGNAL_FUNC(handle_trade_cancel), globals );