ModeManager

From Valve Developer Community
Revision as of 03:45, 6 August 2009 by TomEdwards (talk | contribs) (Created page with ''''ModeManager''' is a required global object that manages ClientModes. Since no Valve game has more than one ClientMode any more, it is almost entirely vestigial. There is n…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ModeManager is a required global object that manages ClientModes. Since no Valve game has more than one ClientMode any more, it is almost entirely vestigial. There is no base implementation.

Minimum implementation

#include "ivmodemanager.h"

class CSkeletonModeManager : public IVModeManager
{
	void	Init() {}
	void	SwitchMode( bool commander, bool force ) {}
	void	LevelInit( const char* newmap ) {}
	void	LevelShutdown() { g_pClientMode->LevelShutdown(); }
};

IVModeManager* modemanager = (IVModeManager*)new CSkeletonModeManager;

SwitchMode() and LevelInit() are both called when a new map is loaded.

See also