From 38f4387c528a6c531fb517af957f4bbe0cecff31 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Thu, 16 Feb 2023 23:09:37 +0100 Subject: [PATCH] Change console window title to server name --- src/client/component/console.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/component/console.cpp b/src/client/component/console.cpp index 3bc324fb..294d22d8 100644 --- a/src/client/component/console.cpp +++ b/src/client/component/console.cpp @@ -3,6 +3,7 @@ #include "resource.hpp" #include "game/game.hpp" +#include "scheduler.hpp" #include #include @@ -204,6 +205,14 @@ namespace console { utils::hook::set(0x14133D2FE_g, 0xEB); // Always enable ingame console } + else + { + scheduler::once([]() + { + const auto server_name = game::Dvar_FindVar("live_steam_server_name")->current.string; + SetWindowTextA(*game::s_wcd::hWnd, server_name); + }, scheduler::pipeline::main); + } utils::hook::jump(game::select(0x1423337F0, 0x1405976B0), queue_message); utils::hook::nop(game::select(0x14233380A, 0x1405976CA), 2); // Print from every thread