Add an option to assume demos to be race demos

This commit is contained in:
def 2014-11-25 20:46:21 +01:00
parent 93d0f43a6a
commit 91bc16c037
3 changed files with 11 additions and 1 deletions

View file

@ -839,6 +839,9 @@ void CClient::DummyInfo()
void CClient::GetServerInfo(CServerInfo *pServerInfo) void CClient::GetServerInfo(CServerInfo *pServerInfo)
{ {
mem_copy(pServerInfo, &m_CurrentServerInfo, sizeof(m_CurrentServerInfo)); 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() void CClient::ServerInfoRequest()

View file

@ -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(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(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(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(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(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") MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost")

View file

@ -1696,7 +1696,7 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
{ {
CUIRect Button, Left, Right, LeftLeft, Demo, Gameplay, Miscellaneous, Label; 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); Demo.HSplitTop(30.0f, &Label, &Demo);
UI()->DoLabelScaled(&Label, Localize("Demo"), 20.0f, -1); UI()->DoLabelScaled(&Label, Localize("Demo"), 20.0f, -1);
@ -1723,6 +1723,12 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
g_Config.m_ClDemoShowSpeed ^= 1; 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); Right.HSplitTop(20.0f, &Button, &Right);
if(DoButton_CheckBox(&g_Config.m_ClRaceGhost, Localize("Ghost"), g_Config.m_ClRaceGhost, &Button)) if(DoButton_CheckBox(&g_Config.m_ClRaceGhost, Localize("Ghost"), g_Config.m_ClRaceGhost, &Button))
{ {