Change console window title to server name

This commit is contained in:
BrentVL-1952840 2023-02-16 23:09:37 +01:00
parent 09a60ffba4
commit 38f4387c52

View File

@ -3,6 +3,7 @@
#include "resource.hpp" #include "resource.hpp"
#include "game/game.hpp" #include "game/game.hpp"
#include "scheduler.hpp"
#include <utils/thread.hpp> #include <utils/thread.hpp>
#include <utils/hook.hpp> #include <utils/hook.hpp>
@ -204,6 +205,14 @@ namespace console
{ {
utils::hook::set<uint8_t>(0x14133D2FE_g, 0xEB); // Always enable ingame console utils::hook::set<uint8_t>(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::jump(game::select(0x1423337F0, 0x1405976B0), queue_message);
utils::hook::nop(game::select(0x14233380A, 0x1405976CA), 2); // Print from every thread utils::hook::nop(game::select(0x14233380A, 0x1405976CA), 2); // Print from every thread