From 91bc16c037325ff4064e42d0f21632ed69fe3ad9 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 25 Nov 2014 20:46:21 +0100 Subject: [PATCH] Add an option to assume demos to be race demos --- src/engine/client/client.cpp | 3 +++ src/engine/shared/config_variables.h | 1 + src/game/client/components/menus_settings.cpp | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index fb213dd59..82ec6338a 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -839,6 +839,9 @@ void CClient::DummyInfo() void CClient::GetServerInfo(CServerInfo *pServerInfo) { mem_copy(pServerInfo, &m_CurrentServerInfo, sizeof(m_CurrentServerInfo)); + + if(m_DemoPlayer.IsPlaying() && g_Config.m_ClDemoAssumeRace) + str_copy(pServerInfo->m_aGameType, "DDraceNetwork", 14); } void CClient::ServerInfoRequest() diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index d146f9d9e..e2ec586b2 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -273,6 +273,7 @@ MACRO_CONFIG_INT(ConnTimeoutProtection, conn_timeout_protection, 1000, 5, 10000, MACRO_CONFIG_INT(ClShowIDs, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard") MACRO_CONFIG_INT(ClAutoRaceRecord, cl_auto_race_record, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save the best demo of each race") MACRO_CONFIG_INT(ClDemoName, cl_demo_name, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save the player name within the demo") +MACRO_CONFIG_INT(ClDemoAssumeRace, cl_demo_assume_race, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Assume that demos are race demos") MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable ghost") MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ghost") MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost") diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index e5e7df205..c688b2b78 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1696,7 +1696,7 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView) { CUIRect Button, Left, Right, LeftLeft, Demo, Gameplay, Miscellaneous, Label; - MainView.HSplitTop(100.0f, &Demo , &MainView); + MainView.HSplitTop(125.0f, &Demo , &MainView); Demo.HSplitTop(30.0f, &Label, &Demo); UI()->DoLabelScaled(&Label, Localize("Demo"), 20.0f, -1); @@ -1723,6 +1723,12 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView) g_Config.m_ClDemoShowSpeed ^= 1; } + Left.HSplitTop(20.0f, &Button, &Left); + if(DoButton_CheckBox(&g_Config.m_ClDemoAssumeRace, Localize("Assume race demos (time in scoreboard)"), g_Config.m_ClDemoAssumeRace, &Button)) + { + g_Config.m_ClDemoAssumeRace ^= 1; + } + Right.HSplitTop(20.0f, &Button, &Right); if(DoButton_CheckBox(&g_Config.m_ClRaceGhost, Localize("Ghost"), g_Config.m_ClRaceGhost, &Button)) {