add an option to only start a new demo when connect while automatically record demos

This commit is contained in:
sirius 2020-02-21 17:01:31 +08:00
parent 7691227f24
commit 50b980ea16
2 changed files with 5 additions and 1 deletions

View file

@ -23,6 +23,7 @@ MACRO_CONFIG_INT(ClLoadCountryFlags, cl_load_country_flags, 1, 0, 1, CFGFLAG_SAV
MACRO_CONFIG_STR(ClSkinFilterString, cl_skin_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Skin filtering string")
MACRO_CONFIG_INT(ClAutoDemoRecord, cl_auto_demo_record, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically record demos")
MACRO_CONFIG_INT(ClAutoDemoOnConnect, cl_auto_demo_on_connect, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Only start a new demo when connect while automatically record demos")
MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically recorded demos (0 = no limit)")
MACRO_CONFIG_INT(ClAutoScreenshot, cl_auto_screenshot, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically take game over screenshot")
MACRO_CONFIG_INT(ClAutoScreenshotMax, cl_auto_screenshot_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically created screenshots (0 = no limit)")

View file

@ -493,6 +493,9 @@ void CGameClient::OnConnected()
for(int i = 0; i < MAX_CLIENTS; i++)
m_aLastWorldCharacters[i].m_Alive = false;
LoadMapSettings();
if(Client()->State() != IClient::STATE_DEMOPLAYBACK && g_Config.m_ClAutoDemoOnConnect)
Client()->DemoRecorder_HandleAutoStart();
}
void CGameClient::OnReset()
@ -874,7 +877,7 @@ void CGameClient::OnGameOver()
void CGameClient::OnStartGame()
{
if(Client()->State() != IClient::STATE_DEMOPLAYBACK)
if(Client()->State() != IClient::STATE_DEMOPLAYBACK && !g_Config.m_ClAutoDemoOnConnect)
Client()->DemoRecorder_HandleAutoStart();
m_pStatboard->OnReset();
}