Add demo_speed command (fixes #354)

This commit is contained in:
def 2016-04-27 17:21:40 +02:00
parent 0f5611c2f0
commit ccbdf1d073
2 changed files with 8 additions and 0 deletions

View file

@ -3100,6 +3100,12 @@ void CClient::Con_DemoPlay(IConsole::IResult *pResult, void *pUserData)
}
}
void CClient::Con_DemoSpeed(IConsole::IResult *pResult, void *pUserData)
{
CClient *pSelf = (CClient *)pUserData;
pSelf->m_DemoPlayer.SetSpeed(pResult->GetFloat(0));
}
void CClient::DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder)
{
if(State() != IClient::STATE_ONLINE)
@ -3221,6 +3227,7 @@ void CClient::RegisterCommands()
m_pConsole->Register("demo_slice_start", "", CFGFLAG_CLIENT, Con_DemoSliceBegin, this, "");
m_pConsole->Register("demo_slice_end", "", CFGFLAG_CLIENT, Con_DemoSliceEnd, this, "");
m_pConsole->Register("demo_play", "", CFGFLAG_CLIENT, Con_DemoPlay, this, "Play demo");
m_pConsole->Register("demo_speed", "i[speed]", CFGFLAG_CLIENT, Con_DemoSpeed, this, "Set demo speed");
// used for server browser update
m_pConsole->Chain("br_filter_string", ConchainServerBrowserUpdate, this);

View file

@ -320,6 +320,7 @@ public:
static void Con_Quit(IConsole::IResult *pResult, void *pUserData);
static void Con_DemoPlay(IConsole::IResult *pResult, void *pUserData);
static void Con_DemoSpeed(IConsole::IResult *pResult, void *pUserData);
static void Con_Minimize(IConsole::IResult *pResult, void *pUserData);
static void Con_Ping(IConsole::IResult *pResult, void *pUserData);
static void Con_Screenshot(IConsole::IResult *pResult, void *pUserData);