From 8c4f8eaf275d8ab974e106d625a305440d16e1ee Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Tue, 30 Nov 2004 23:05:20 +0000 Subject: * PTRC (post timeout restoration code) system --- src/ui/ui_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/ui') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 48de3dde..4eca5373 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -4208,6 +4208,27 @@ static void UI_RunMenuScript(char **args) { if( cmd = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } + else if( Q_stricmp( name, "PTRCRestore" ) == 0 ) + { + int len; + char text[ 16 ]; + fileHandle_t f; + char command[ 32 ]; + + // load the file + len = trap_FS_FOpenFile( "ptrc.txt", &f, FS_READ ); + + if( len > 0 && ( len < sizeof( text ) - 1 ) ) + { + trap_FS_Read( text, len, f ); + text[ len ] = 0; + trap_FS_FCloseFile( f ); + + Com_sprintf( command, 32, "ptrcrestore %s", text ); + + trap_Cmd_ExecuteText( EXEC_APPEND, command ); + } + } //TA: tremulous menus else if (Q_stricmp(name, "playMovie") == 0) { -- cgit