source-sdk-2013-mapbase/sp/src/game/client/clientmode_shared.h
Blixibon 87cd9b24bb Mapbase v6.1
- Added postprocess_controller entity from later versions of Source
- Added env_dof_controller entity from later versions of Source
- Added SDK_Engine_Post and DepthOfField shaders from the Momentum repo/Alien Swarm SDK
- Fixed auto-breaking game_text/choreo text not null terminating
- Fixed console groups showing up at the wrong developer levels
- Added more mesages to console groups, including a new "NPC AI" console group
- Fixed typos and added elaboration in various cvars, console messages, etc.
- Fixed npc_metropolice not using frag grenades correctly when allowed to use them
- Fixed npc_metropolice not registering stitching squad slots in AI
- Fixed SetModel input late precache warning
- Fixed env_global_light angles resetting upon loading a save
- Fixed an issue with ScriptKeyValuesRead using the wrong name and having a memory leak
- Allowed VScript functions which return null strings to actually return null instead of empty strings
- Added VScript member variable documentation
- Fixed VScript documentation lines sometimes mixing together
- Fixed VScript singletons having a ! at the beginning of descriptions
- Added Color struct to VScript and allowed color-related inputs to use it
- Added more VScript functions for weapons, ammo, ragdolling, and response contexts
- Added GameRules singleton for VScript
- Exposed AI interaction system to VScript
- Recovered some lost documentation from older revisions of the Mapbase wiki
- Added a way to get the current game's load type in VScript
- Fixed Precache/SpawnEntityFromTable not accounting for a few important field types
- Added VScript functions for getting a player's eye vectors
- Fixed a crash caused by removing the active weapon of a Combine soldier while it's firing
- Changed the way metrocops deploy their manhacks so they could use their manhack death response properly
- Fixed "Use Server" keyvalue on game_convar_mod not working
- Adjusted CAI_Expresser in VScript
2020-12-17 03:38:23 +00:00

178 lines
5.6 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#if !defined( CLIENTMODE_NORMAL_H )
#define CLIENTMODE_NORMAL_H
#ifdef _WIN32
#pragma once
#endif
#include "iclientmode.h"
#include "GameEventListener.h"
#include <baseviewport.h>
class CBaseHudChat;
class CBaseHudWeaponSelection;
class CViewSetup;
class C_BaseEntity;
class C_BasePlayer;
namespace vgui
{
class Panel;
}
//=============================================================================
// HPE_BEGIN:
// [tj] Moved this from the .cpp file so derived classes could access it
//=============================================================================
#define ACHIEVEMENT_ANNOUNCEMENT_MIN_TIME 10
//=============================================================================
// HPE_END
//=============================================================================
class CReplayReminderPanel;
#define USERID2PLAYER(i) ToBasePlayer( ClientEntityList().GetEnt( engine->GetPlayerForUserID( i ) ) )
#ifdef MAPBASE
#define DEMO_AUTORECORD 1
#endif
extern IClientMode *GetClientModeNormal(); // must be implemented
// This class implements client mode functionality common to HL2 and TF2.
class ClientModeShared : public IClientMode, public CGameEventListener
{
// IClientMode overrides.
public:
DECLARE_CLASS_NOBASE( ClientModeShared );
ClientModeShared();
virtual ~ClientModeShared();
virtual void Init();
virtual void InitViewport();
virtual void VGui_Shutdown();
virtual void Shutdown();
virtual void LevelInit( const char *newmap );
virtual void LevelShutdown( void );
#ifdef DEMO_AUTORECORD
virtual void AutoRecord( const char *map );
#endif
virtual void Enable();
virtual void Disable();
virtual void Layout();
virtual void ReloadScheme( void );
virtual void OverrideView( CViewSetup *pSetup );
virtual bool ShouldDrawDetailObjects( );
virtual bool ShouldDrawEntity(C_BaseEntity *pEnt);
virtual bool ShouldDrawLocalPlayer( C_BasePlayer *pPlayer );
virtual bool ShouldDrawViewModel();
virtual bool ShouldDrawParticles( );
virtual bool ShouldDrawCrosshair( void );
virtual bool ShouldBlackoutAroundHUD() OVERRIDE;
virtual HeadtrackMovementMode_t ShouldOverrideHeadtrackControl() OVERRIDE;
virtual void AdjustEngineViewport( int& x, int& y, int& width, int& height );
virtual void PreRender(CViewSetup *pSetup);
virtual void PostRender();
virtual void PostRenderVGui();
virtual void ProcessInput(bool bActive);
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd );
virtual void Update();
// Input
virtual int KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
virtual int HudElementKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
virtual void OverrideMouseInput( float *x, float *y );
virtual void StartMessageMode( int iMessageModeType );
virtual vgui::Panel *GetMessagePanel();
virtual void ActivateInGameVGuiContext( vgui::Panel *pPanel );
virtual void DeactivateInGameVGuiContext();
// The mode can choose to not draw fog
virtual bool ShouldDrawFog( void );
virtual float GetViewModelFOV( void );
virtual vgui::Panel* GetViewport() { return m_pViewport; }
// Gets at the viewports vgui panel animation controller, if there is one...
virtual vgui::AnimationController *GetViewportAnimationController()
{ return m_pViewport->GetAnimationController(); }
virtual void FireGameEvent( IGameEvent *event );
virtual bool CanRecordDemo( char *errorMsg, int length ) const { return true; }
virtual int HandleSpectatorKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
virtual void ComputeVguiResConditions( KeyValues *pkvConditions ) OVERRIDE;
//=============================================================================
// HPE_BEGIN:
// [menglish] Save server information shown to the client in a persistent place
//=============================================================================
virtual wchar_t* GetServerName() { return NULL; }
virtual void SetServerName(wchar_t* name) {};
virtual wchar_t* GetMapName() { return NULL; }
virtual void SetMapName(wchar_t* name) {};
//=============================================================================
// HPE_END
//=============================================================================
virtual bool DoPostScreenSpaceEffects( const CViewSetup *pSetup );
virtual void DisplayReplayMessage( const char *pLocalizeName, float flDuration, bool bUrgent,
const char *pSound, bool bDlg );
virtual bool IsInfoPanelAllowed() OVERRIDE { return true; }
virtual void InfoPanelDisplayed() OVERRIDE { }
virtual bool IsHTMLInfoPanelAllowed() OVERRIDE { return true; }
protected:
CBaseViewport *m_pViewport;
void DisplayReplayReminder();
private:
virtual void UpdateReplayMessages();
void ClearReplayMessageList();
#if defined( REPLAY_ENABLED )
float m_flReplayStartRecordTime;
float m_flReplayStopRecordTime;
CReplayReminderPanel *m_pReplayReminderPanel;
#endif
// Message mode handling
// All modes share a common chat interface
CBaseHudChat *m_pChatElement;
vgui::HCursor m_CursorNone;
CBaseHudWeaponSelection *m_pWeaponSelection;
int m_nRootSize[2];
void UpdatePostProcessingEffects();
const C_PostProcessController* m_pCurrentPostProcessController;
PostProcessParameters_t m_CurrentPostProcessParameters;
PostProcessParameters_t m_LerpStartPostProcessParameters, m_LerpEndPostProcessParameters;
CountdownTimer m_PostProcessLerpTimer;
};
#endif // CLIENTMODE_NORMAL_H