summaryrefslogtreecommitdiff
path: root/game/client/cstrike/radio_status.h
blob: a820ba85fbb879677c93e99f1286fb4295a9113d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef RADIO_STATUS_H
#define RADIO_STATUS_H
#pragma once

class IMaterial;

class CRadioStatus : public CAutoGameSystem
{
public:
	CRadioStatus();

	virtual bool Init();
	virtual void Shutdown();

	virtual void LevelInitPostEntity();
	virtual void LevelShutdownPreEntity();
	
public:

	// Called when a player uses the radio
	void	UpdateRadioStatus(int entindex, float duration);

	// Called when a player (bot) speaks a wav file
	void	UpdateVoiceStatus(int entindex, float duration);

	// Call from the HUD_CreateEntities function so it can add sprites above player heads.
	void	DrawHeadLabels();

private:


	float		m_radioUntil[MAX_PLAYERS];	// Who is currently talking. Indexed by client index.
	IMaterial	*m_pHeadLabelMaterial;		// For labels above players' heads.

	void		ExpireBotVoice( bool force = false );
	float		m_voiceUntil[MAX_PLAYERS];	// Who is currently talking. Indexed by client index.
};


// Get the (global) voice manager. 
CRadioStatus* RadioManager();


#endif // RADIO_STATUS_H