From 85388e97c1f6c3311c8e6dd6a7a7d857bbf9979d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 20 Dec 2024 01:46:52 +0300 Subject: [PATCH] engine: client: add command cl_list_messages to print all registered user messages --- engine/client/cl_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index d2a99091..8847b77e 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -3326,6 +3326,22 @@ static void CL_Escape_f( void ) else UI_SetActiveMenu( true ); } +static void CL_ListMessages_f( void ) +{ + int i; + + Con_Printf( "num size name\n" ); + for( i = 0; i < MAX_USER_MESSAGES; i++ ) + { + if( !COM_CheckStringEmpty( clgame.msg[i].name )) + break; + + Con_Printf( "%3d\t%3d\t%s\n", clgame.msg[i].number, clgame.msg[i].size, clgame.msg[i].name ); + } + + Con_Printf( "Total %i messages\n", i ); +} + /* ================= CL_InitLocal @@ -3483,6 +3499,7 @@ static void CL_InitLocal( void ) Cmd_AddCommand( "richpresence_gamemode", Cmd_Null_f, "compatibility command, does nothing" ); Cmd_AddCommand( "richpresence_update", Cmd_Null_f, "compatibility command, does nothing" ); + Cmd_AddCommand( "cl_list_messages", CL_ListMessages_f, "list registered user messages" ); } //============================================================================