From 4f3f3d2a616715aa68b4d348a4a02c2f33762c90 Mon Sep 17 00:00:00 2001 From: sirius Date: Wed, 2 Oct 2019 13:33:55 +0800 Subject: [PATCH] add two video settings: showhookcollother and showdirection --- README.md | 3 +++ src/game/client/components/players.cpp | 8 ++++++++ src/game/variables.h | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 704a43a64..4b58d3e24 100644 --- a/README.md +++ b/README.md @@ -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. - `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). +- `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. \ No newline at end of file diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index c0619e1f7..21fabac56 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -280,7 +280,11 @@ void CPlayers::RenderPlayer( // 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))))) +#endif { vec2 ExDirection = Direction; @@ -521,7 +525,11 @@ void CPlayers::RenderPlayer( Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha); 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())) +#endif { if(Player.m_Direction == -1) { diff --git a/src/game/variables.h b/src/game/variables.h index feeb771a4..0d6f02561 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -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(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 #ifdef CONF_DEBUG // this one can crash the server if not used correctly