summaryrefslogtreecommitdiff
path: root/utils/hlfaceposer/eventproperties.h
blob: 24974ab5920ab80b70b3f92dc61867664cbec508 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef EVENTPROPERTIES_H
#define EVENTPROPERTIES_H
#ifdef _WIN32
#pragma once
#endif

#include "basedialogparams.h"

class CChoreoScene;
class CChoreoEvent;

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
class CEventParams : public CBaseDialogParams
{
public:
	// e.g. CChoreoEvent::GESTURE
	int				m_nType;

	// Event descriptive name
	char			m_szName[ 256 ];

	// Expression name/wav name/gesture name/look at name
	char			m_szParameters[ 256 ];
	char			m_szParameters2[ 256 ];
	char			m_szParameters3[ 256 ];

	CChoreoScene	*m_pScene;

	float			m_flStartTime;
	float			m_flEndTime;
	bool			m_bHasEndTime;

	CChoreoEvent	*m_pEvent;

	bool			m_bDisabled;
	bool			m_bFixedLength;

	bool			m_bResumeCondition;

	bool			m_bLockBodyFacing;
	float			m_flDistanceToTarget;

	bool			m_bForceShortMovement;

	bool			m_bSyncToFollowingGesture;

	bool			m_bPlayOverScript;

	bool			m_bUsesTag;
	char			m_szTagName[ 256 ];
	char			m_szTagWav[ 256 ];

	// For Lookat events
	int				pitch;
	int				yaw;
	bool			usepitchyaw;

	// For speak
	bool			m_bCloseCaptionNoAttenuate;

};

int EventProperties( CEventParams *params );

class CBaseEventPropertiesDialog
{
public:
	virtual void		InitDialog( HWND hwndDlg ) = 0;
	virtual BOOL		HandleMessage( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;
	virtual void		SetTitle() = 0;

	HWND		GetControl( int id ) { return GetDlgItem( m_hDialog, id ); }

	virtual void ShowControlsForEventType( CEventParams *params );
	virtual void		InitControlData( CEventParams *params );

protected:
	virtual BOOL InternalHandleMessage( CEventParams *params, HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, bool& handled );

	void		SetDialogTitle( CEventParams *params, char const *eventname, char const *desc );

	void		UpdateTagRadioButtons( CEventParams *params );
	void		PopulateTagList( CEventParams *params );
	void		ParseTags( CEventParams *params );

	void		PopulateNamedActorList( HWND wnd, CEventParams *params );

	void		GetSplineRect( HWND placeholder, RECT& rcOut );
	void		DrawSpline( HDC hdc, HWND placeholder, CChoreoEvent *e );

protected:

	HWND		m_hDialog;
};

#endif // EVENTPROPERTIES_H