From 3229067f78ee62097eb59d927fb4c552afed800c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 21 May 2024 18:53:51 +0300 Subject: [PATCH 1/5] Fix compile.bat scripts to build with MSVC6 --- cl_dll/compile.bat | 3 ++- dlls/compile.bat | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cl_dll/compile.bat b/cl_dll/compile.bat index b7085545..bb219a57 100644 --- a/cl_dll/compile.bat +++ b/cl_dll/compile.bat @@ -70,7 +70,8 @@ set SOURCES=../dlls/crossbow.cpp ^ util.cpp ^ view.cpp ^ scoreboard.cpp ^ - MOTD.cpp + MOTD.cpp ^ + ../game_shared/vcs_info.cpp set DEFINES=/DCLIENT_DLL /DCLIENT_WEAPONS /Dsnprintf=_snprintf /DNO_VOICEGAMEMGR /DGOLDSOURCE_SUPPORT /DNDEBUG set LIBS=user32.lib Winmm.lib set OUTNAME=client.dll diff --git a/dlls/compile.bat b/dlls/compile.bat index 20b7cc66..fd4a0caf 100644 --- a/dlls/compile.bat +++ b/dlls/compile.bat @@ -108,6 +108,7 @@ set SOURCES=agrunt.cpp ^ world.cpp ^ xen.cpp ^ zombie.cpp ^ + ../game_shared/vcs_info.cpp ^ ../pm_shared/pm_debug.c ../pm_shared/pm_math.c ../pm_shared/pm_shared.c set DEFINES=/DCLIENT_WEAPONS /Dsnprintf=_snprintf /DNO_VOICEGAMEMGR /DNDEBUG set LIBS=user32.lib From 951a95c5965e55ae39a948266c0fb5ba605bbb53 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 21 May 2024 18:54:35 +0300 Subject: [PATCH 2/5] game_shared: vcs_info: fix undefined branch name --- game_shared/vcs_info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game_shared/vcs_info.cpp b/game_shared/vcs_info.cpp index 0af53f33..72b39af8 100644 --- a/game_shared/vcs_info.cpp +++ b/game_shared/vcs_info.cpp @@ -9,5 +9,5 @@ const char *g_VCSInfo_Commit = "unknown-commit"; #ifdef XASH_BUILD_BRANCH const char *g_VCSInfo_Branch = XASH_BUILD_BRANCH; #else -const char *g_VCSInfo_Branch = "unknown-commit"; +const char *g_VCSInfo_Branch = "unknown-branch"; #endif From bc9019953da379a88f7080568ccf01f1fbce4e32 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 9 Jun 2024 12:53:17 +0300 Subject: [PATCH 3/5] Implement scroll in non-vgui MOTD for GoldSource (like in xash3d-fwgs) (#453) --- cl_dll/input_goldsource.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index a28ff600..a8330448 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -873,7 +873,12 @@ void GoldSourceInput::IN_MouseMove ( float frametime, usercmd_t *cmd) if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) { - viewangles[PITCH] += m_pitch->value * mouse_y; +#if !USE_VGUI || USE_NOVGUI_MOTD + if( gHUD.m_MOTD.m_bShow ) + gHUD.m_MOTD.scroll += m_pitch->value * mouse_y; + else +#endif + viewangles[PITCH] += m_pitch->value * mouse_y; if (viewangles[PITCH] > cl_pitchdown->value) viewangles[PITCH] = cl_pitchdown->value; if (viewangles[PITCH] < -cl_pitchup->value) From d774c9e0f99a71b313a51e52a176aa2742525794 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 9 Jun 2024 12:53:40 +0300 Subject: [PATCH 4/5] Fix instant camera movement after closing the VGUI menu (#455) --- cl_dll/input_goldsource.cpp | 11 +++++++++++ cl_dll/input_mouse.cpp | 7 ++++++- cl_dll/input_mouse.h | 4 ++++ cl_dll/vgui_TeamFortressViewport.cpp | 4 ++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index a8330448..80a0ab5e 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -811,6 +811,11 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) mx = my = 0; } + if (ignoreNextDelta) + { + ignoreNextDelta = false; + mx = my = 0; + } if(pOutX) *pOutX = mx; if(pOutY) *pOutY = my; } @@ -1585,6 +1590,7 @@ IN_Init */ void GoldSourceInput::IN_Init (void) { + ignoreNextDelta = false; m_filter = gEngfuncs.pfnRegisterVariable ( "m_filter","0", FCVAR_ARCHIVE ); sensitivity = gEngfuncs.pfnRegisterVariable ( "sensitivity","3", FCVAR_ARCHIVE ); // user mouse sensitivity setting. @@ -1685,4 +1691,9 @@ void GoldSourceInput::IN_Init (void) IN_StartupJoystick (); } +void GoldSourceInput::IgnoreNextMouseDelta() +{ + ignoreNextDelta = true; +} + #endif diff --git a/cl_dll/input_mouse.cpp b/cl_dll/input_mouse.cpp index e4f6c305..49a3119a 100644 --- a/cl_dll/input_mouse.cpp +++ b/cl_dll/input_mouse.cpp @@ -87,7 +87,12 @@ void IN_ResetMouse() currentInput->IN_ResetMouse(); } +void IgnoreNextMouseDelta() +{ + currentInput->IgnoreNextMouseDelta(); +} + AbstractInput* CurrentMouseInput() { - return currentInput; + return currentInput; } diff --git a/cl_dll/input_mouse.h b/cl_dll/input_mouse.h index 186bf5ba..5ca300cd 100644 --- a/cl_dll/input_mouse.h +++ b/cl_dll/input_mouse.h @@ -21,6 +21,7 @@ public: virtual void IN_Init( void ) = 0; virtual void IN_ResetMouse( void ) = 0; virtual void Joy_AdvancedUpdate( void ) = 0; + virtual void IgnoreNextMouseDelta() = 0; }; class FWGSInput : public AbstractInput @@ -39,6 +40,7 @@ public: virtual void IN_Init( void ); virtual void IN_ResetMouse( void ) {} virtual void Joy_AdvancedUpdate( void ) {} + virtual void IgnoreNextMouseDelta() {} protected: float ac_forwardmove; @@ -82,6 +84,7 @@ public: virtual void IN_Init( void ); virtual void IN_ResetMouse( void ); virtual void Joy_AdvancedUpdate( void ); + virtual void IgnoreNextMouseDelta(); protected: void IN_GetMouseDelta( int *pOutX, int *pOutY); @@ -98,6 +101,7 @@ protected: int old_mouse_x, old_mouse_y, mx_accum, my_accum; int mouseinitialized; void* sdl2Lib; + bool ignoreNextDelta; }; #endif diff --git a/cl_dll/vgui_TeamFortressViewport.cpp b/cl_dll/vgui_TeamFortressViewport.cpp index b19ae2a1..5361be76 100644 --- a/cl_dll/vgui_TeamFortressViewport.cpp +++ b/cl_dll/vgui_TeamFortressViewport.cpp @@ -58,6 +58,8 @@ #include "screenfade.h" void IN_SetVisibleMouse(bool visible); +void IgnoreNextMouseDelta(); + class CCommandMenu; // Scoreboard positions @@ -1672,6 +1674,7 @@ void TeamFortressViewport::UpdateCursorState() if( m_pSpectatorPanel->m_menuVisible || m_pCurrentMenu || m_pTeamMenu->isVisible() || GetClientVoiceMgr()->IsInSquelchMode() ) { IN_SetVisibleMouse(true); + IgnoreNextMouseDelta(); App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_arrow) ); return; } @@ -1681,6 +1684,7 @@ void TeamFortressViewport::UpdateCursorState() if( gHUD.m_pCvarStealMouse->value != 0.0f ) { IN_SetVisibleMouse(true); + IgnoreNextMouseDelta(); App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_arrow) ); return; } From a4acefb25c8143d682a6ae6c953166b6cd102398 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 9 Jun 2024 12:53:57 +0300 Subject: [PATCH 5/5] Call DeathMsg for non-VGUI scoreboard (used to highlight the killer) (#456) --- cl_dll/death.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 90024245..606b6405 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -175,9 +175,11 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu strncat( killedwith, READ_STRING(), sizeof(killedwith) - strlen(killedwith) - 1 ); killedwith[sizeof(killedwith) - 1] = '\0'; -#if USE_VGUI +#if USE_VGUI && !USE_NOVGUI_SCOREBOARD if (gViewPort) gViewPort->DeathMsg( killer, victim ); +#else + gHUD.m_Scoreboard.DeathMsg( killer, victim ); #endif gHUD.m_Spectator.DeathMessage( victim );