add two video settings: showhookcollother and showdirection

This commit is contained in:
sirius 2019-10-02 13:33:55 +08:00
parent 9467bef192
commit 4f3f3d2a61
3 changed files with 16 additions and 1 deletions

View file

@ -17,3 +17,6 @@ For ddnet origin client, please visit https://github.com/ddnet/ddnet
- And then you can use command `start_video` and `stop_video` to start and stop conversion from demo to mp4. - And then you can use command `start_video` and `stop_video` to start and stop conversion from demo to mp4.
- `cl_video_recorder_fps` to change video fps. - `cl_video_recorder_fps` to change video fps.
- or you can use `Record` button in demo menu, it will render the whole demo (you can stop recording by disconnect). - or you can use `Record` button in demo menu, it will render the whole demo (you can stop recording by disconnect).
- `cl_video_showhud`is for whether show ingame HUD when rendering video, default is 0.
- `cl_video_showhookcollother`is for whether show other players' hook collision lines when rendering video, default is 0.
- `cl_video_showdirection`is for whether show other players' key presses when rendering video, default is 0.

View file

@ -280,7 +280,11 @@ void CPlayers::RenderPlayer(
// draw gun // draw gun
{ {
#if defined(CONF_VIDEORECORDER)
if(ClientID >= 0 && ((GameClient()->m_GameInfo.m_AllowHookColl && g_Config.m_ClShowHookCollAlways) || (Player.m_PlayerFlags&PLAYERFLAG_AIM && ((!Local && ((!IVideo::Current()&&g_Config.m_ClShowHookCollOther)||(IVideo::Current()&&g_Config.m_ClVideoShowHookCollOther))) || (Local && g_Config.m_ClShowHookCollOwn)))))
#else
if(ClientID >= 0 && ((GameClient()->m_GameInfo.m_AllowHookColl && g_Config.m_ClShowHookCollAlways) || (Player.m_PlayerFlags&PLAYERFLAG_AIM && ((!Local && g_Config.m_ClShowHookCollOther) || (Local && g_Config.m_ClShowHookCollOwn))))) if(ClientID >= 0 && ((GameClient()->m_GameInfo.m_AllowHookColl && g_Config.m_ClShowHookCollAlways) || (Player.m_PlayerFlags&PLAYERFLAG_AIM && ((!Local && g_Config.m_ClShowHookCollOther) || (Local && g_Config.m_ClShowHookCollOwn)))))
#endif
{ {
vec2 ExDirection = Direction; vec2 ExDirection = Direction;
@ -521,7 +525,11 @@ void CPlayers::RenderPlayer(
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha); Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
Graphics()->QuadsSetRotation(0); Graphics()->QuadsSetRotation(0);
#if defined(CONF_VIDEORECORDER)
if(((!IVideo::Current()&&g_Config.m_ClShowDirection)||(IVideo::Current()&&g_Config.m_ClVideoShowDirection)) && ClientID >= 0 && (!Local || DemoPlayer()->IsPlaying()))
#else
if(g_Config.m_ClShowDirection && ClientID >= 0 && (!Local || DemoPlayer()->IsPlaying())) if(g_Config.m_ClShowDirection && ClientID >= 0 && (!Local || DemoPlayer()->IsPlaying()))
#endif
{ {
if(Player.m_Direction == -1) if(Player.m_Direction == -1)
{ {

View file

@ -163,7 +163,11 @@ MACRO_CONFIG_INT(SvSendVotesPerTick, sv_send_votes_per_tick, 5, 1, 15, CFGFLAG_S
MACRO_CONFIG_INT(SvRescue, sv_rescue, 0, 0, 1, CFGFLAG_SERVER, "Allow /rescue command so players can teleport themselves out of freeze") MACRO_CONFIG_INT(SvRescue, sv_rescue, 0, 0, 1, CFGFLAG_SERVER, "Allow /rescue command so players can teleport themselves out of freeze")
MACRO_CONFIG_INT(SvRescueDelay, sv_rescue_delay, 5, 0, 1000, CFGFLAG_SERVER, "Number of seconds between two rescues") MACRO_CONFIG_INT(SvRescueDelay, sv_rescue_delay, 5, 0, 1000, CFGFLAG_SERVER, "Number of seconds between two rescues")
MACRO_CONFIG_INT(ClVideoShowhud, cl_video_showhud, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD when rendering video") #if defined(CONF_VIDEORECORDER)
MACRO_CONFIG_INT(ClVideoShowhud, cl_video_showhud, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD when rendering video")
MACRO_CONFIG_INT(ClVideoShowHookCollOther, cl_video_showhookcollother, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show other players' hook collision lines when rendering video")
MACRO_CONFIG_INT(ClVideoShowDirection, cl_video_showdirection, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show other players' key presses when rendering video")
#endif
// debug // debug
#ifdef CONF_DEBUG // this one can crash the server if not used correctly #ifdef CONF_DEBUG // this one can crash the server if not used correctly