From 89165e554041bc31dc609a23991bcb277a7e6556 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 2 May 2022 16:44:59 +0300 Subject: [PATCH] net: add 'announce' command --- src/game/g_console.pas | 1 + src/game/g_game.pas | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/game/g_console.pas b/src/game/g_console.pas index 87a1fba..983b63b 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -1109,6 +1109,7 @@ begin AddCommand('bot_removeall', GameCommands); AddCommand('chat', GameCommands); AddCommand('teamchat', GameCommands); + AddCommand('announce', GameCommands); AddCommand('game', GameCommands); AddCommand('host', GameCommands); AddCommand('map', GameCommands); diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 4ac5ec7..6049b90 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -6976,6 +6976,34 @@ begin end else g_Console_Add(_lc[I_MSG_GM_UNAVAIL]); end + else if cmd = 'announce' then + begin + if g_Game_IsNet then + begin + if Length(P) > 1 then + begin + for a := 1 to High(P) do + chstr := chstr + P[a] + ' '; + + if Length(chstr) > 200 then SetLength(chstr, 200); + + if Length(chstr) < 1 then + begin + g_Console_Add('announce '); + Exit; + end; + + chstr := 'centerprint 100 ' + b_Text_Format(chstr); + if g_Game_IsClient then + MC_SEND_RCONCommand(chstr) + else + g_Console_Process(chstr, True); + end + else + g_Console_Add('announce '); + end else + g_Console_Add(_lc[I_MSG_GM_UNAVAIL]); + end else if cmd = 'game' then begin if gGameSettings.GameType <> GT_NONE then @@ -7775,7 +7803,7 @@ begin name := e_CatPath(dir, Filename + '.png'); s := createDiskFile(name); try - e_MakeScreenshot(s, gWinSizeX, gWinSizeY); + e_MakeScreenshot(s, gWinSizeX, gWinSizeX); s.Free; g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [name])) except -- 2.29.2