diff --git a/cl_dll/compile.bat b/cl_dll/compile.bat index f9fdc475..de5bc1cf 100644 --- a/cl_dll/compile.bat +++ b/cl_dll/compile.bat @@ -81,7 +81,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/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 ); diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index a28ff600..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; } @@ -873,7 +878,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) @@ -1580,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. @@ -1680,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; } diff --git a/dlls/compile.bat b/dlls/compile.bat index 51674fba..d565ddb3 100644 --- a/dlls/compile.bat +++ b/dlls/compile.bat @@ -154,6 +154,7 @@ set SOURCES=gearbox/blkop_apache.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 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