diff --git a/README.md b/README.md index f170f3a..2d5f573 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Client-Mod -* **Client-Mod** is a small modification of the **Half-Life** client part for **Xash3D FWGS and GoldSource** +* **Client-Mod** is a modification of the **Half-Life** client part for **Xash3D FWGS and GoldSource** Added server name to no vgui scoreboard, player model name (included in vgui), curent map name and number of current players. @@ -9,7 +9,7 @@ Added commands: ``` cl_autojump [0/1] - Will jump automatically as soon as you touch the ground while +jump is held. Taken from OpenAG. ``` -* **When this command is enabled the jump button may not work**, solved by command **cl_lw 1**. +* When **cl_autojump** is enabled, the jump button may not work, solved by command **cl_lw 1**. ``` +ducktap — Performs a duck tap automatically as soon as you touch the ground (presses +duck for 1 frame). Taken from OpenAG. diff --git a/cl_dll/ui/hud/hud.cpp b/cl_dll/ui/hud/hud.cpp index dfdc1e9..9d0667f 100644 --- a/cl_dll/ui/hud/hud.cpp +++ b/cl_dll/ui/hud/hud.cpp @@ -503,6 +503,7 @@ void CHud::Init( void ) // OpenAG m_pCvarColor = CVAR_CREATE( "hud_color", "", FCVAR_ARCHIVE ); CVAR_CREATE( "hud_weapon", "0", FCVAR_ARCHIVE ); + m_pCvarAutostop = CVAR_CREATE("cl_autostop", "0", FCVAR_ARCHIVE); m_pCvarDrawDeathNoticesAlways = CVAR_CREATE( "cl_draw_deathnotices_always", "0", FCVAR_ARCHIVE ); m_pCvarDrawMessagesAlways = CVAR_CREATE( "cl_draw_messages_always", "0", FCVAR_ARCHIVE ); // diff --git a/cl_dll/ui/hud/hud.h b/cl_dll/ui/hud/hud.h index c39571d..57a6310 100644 --- a/cl_dll/ui/hud/hud.h +++ b/cl_dll/ui/hud/hud.h @@ -588,6 +588,7 @@ class CHud cvar_t *m_pCvarDraw; cvar_t *m_pCvarDrawDeathNoticesAlways; cvar_t *m_pCvarDrawMessagesAlways; + cvar_t *m_pCvarAutostop; // OpenAg cvar_t* m_pCvarColor; diff --git a/cl_dll/ui/hud/hud_redraw.cpp b/cl_dll/ui/hud/hud_redraw.cpp index 3db9b77..3cf1852 100644 --- a/cl_dll/ui/hud/hud_redraw.cpp +++ b/cl_dll/ui/hud/hud_redraw.cpp @@ -102,6 +102,7 @@ int CHud::Redraw( float flTime, int intermission ) m_flTime = flTime; m_flTimeDelta = (double)( m_flTime - m_fOldTime ); static float m_flShotTime = 0; + static float m_flStopTime = 0; // Clock was reset, reset delta if( m_flTimeDelta < 0 ) @@ -131,6 +132,9 @@ int CHud::Redraw( float flTime, int intermission ) // Take a screenshot if the client's got the cvar set if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) m_flShotTime = flTime + 1.0; // Take a screenshot in a second + + if ( m_pCvarAutostop->value > 0.0f ) + m_flStopTime = flTime + 3.0; // Stop demo recording in three seconds } } #else @@ -139,6 +143,9 @@ int CHud::Redraw( float flTime, int intermission ) // Take a screenshot if the client's got the cvar set if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) m_flShotTime = flTime + 1.0f; // Take a screenshot in a second + + if ( m_pCvarAutostop->value > 0.0f ) + m_flStopTime = flTime + 3.0; // Stop demo recording in three seconds } #endif if( m_flShotTime && m_flShotTime < flTime ) @@ -147,6 +154,13 @@ int CHud::Redraw( float flTime, int intermission ) m_flShotTime = 0; } + if (m_flStopTime && m_flStopTime < flTime) + { + gEngfuncs.pfnClientCmd("stop"); + m_flStopTime = 0; + } + + m_iIntermission = intermission; // if no redrawing is necessary