implement wasm_util_remSelected

This commit is contained in:
Eric House 2021-02-16 17:22:50 -08:00
parent be1042559a
commit b80f3fdf06
4 changed files with 16 additions and 4 deletions

View file

@ -493,6 +493,16 @@ main_playerScoreHeld( Globals* globals, XP_U16 player )
}
}
void
main_showRemaining( Globals* globals )
{
XWStreamCtxt* stream = mem_stream_make_raw( MPPARM(globals->mpool)
globals->vtMgr );
board_formatRemainingTiles( globals->game.board, NULL, stream );
stream_putU8( stream, 0 );
call_alert( (const XP_UCHAR*)stream_getPtr( stream ) );
stream_destroy( stream, NULL );
}
void
main_showGameOver( Globals* globals )

View file

@ -75,5 +75,6 @@ void main_onGameMessage( Globals* globals, XP_U32 gameID,
void main_sendOnClose( XWStreamCtxt* stream, XWEnv env, void* closure );
void main_playerScoreHeld( Globals* globals, XP_U16 player );
void main_showGameOver( Globals* globals );
void main_showRemaining( Globals* globals );
#endif

View file

@ -126,8 +126,7 @@ static const XP_UCHAR*
wasm_dutil_getUserQuantityString( XW_DUtilCtxt* duc, XWEnv xwe, XP_U16 code,
XP_U16 quantity )
{
LOG_FUNC();
return NULL;
return wasm_dutil_getUserString( duc, xwe, code );
}
static void

View file

@ -1,4 +1,4 @@
/* -*- compile-command: "cd ../wasm && make main.html -j3"; -*- */
/* -*- compile-command: "cd ../wasm && make MEMDEBUG=TRUE install -j3"; -*- */
/*
* Copyright 2021 by Eric House (xwords@eehouse.org). All rights reserved.
*
@ -438,7 +438,9 @@ wasm_util_notifyIllegalWords( XW_UtilCtxt* uc, XWEnv xwe, BadWordInfo* bwi,
static void
wasm_util_remSelected( XW_UtilCtxt* uc, XWEnv xwe )
{
LOG_FUNC();
WasmUtilCtx* wuctxt = (WasmUtilCtx*)uc;
Globals* globals = (Globals*)wuctxt->closure;
main_showRemaining( globals );
}
static void