summaryrefslogtreecommitdiff
path: root/tools/gameevents/gameeventeditpanel.h
blob: ba11733ae2d3933ed323839f1d3bd6d34e484b4b (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//===========================================================================//

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

#include "vgui_controls/editablepanel.h"
#include "tier1/utlstring.h"
#include "datamodel/dmehandle.h"
#include "igameevents.h"

//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CGameEventEditDoc;

namespace vgui
{
	class ComboBox;
	class Button;
	class TextEntry;
	class ListPanel;
	class CheckButton;
	class RadioButton;
}

#define MAX_GAME_EVENT_PARAMS 20

extern IGameEventManager2 *gameeventmanager;

//-----------------------------------------------------------------------------
// Panel that shows all entities in the level
//-----------------------------------------------------------------------------
class CGameEventEditPanel : public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CGameEventEditPanel, vgui::EditablePanel );

public:
	CGameEventEditPanel( CGameEventEditDoc *pDoc, vgui::Panel* pParent );   // standard constructor
	~CGameEventEditPanel();

	// Inherited from Panel
	virtual void OnCommand( const char *pCommand );

private:
	// Text to attribute...
	//void TextEntryToAttribute( vgui::TextEntry *pEntry, const char *pAttributeName );
	//void TextEntriesToVector( vgui::TextEntry *pEntry[3], const char *pAttributeName );

	// Messages handled
	/*
	MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv );
	MESSAGE_FUNC_PARAMS( OnSoundSelected, "SoundSelected", kv );
	MESSAGE_FUNC_PARAMS( OnPicked, "Picked", kv );
	MESSAGE_FUNC_PARAMS( OnFileSelected, "FileSelected", kv );
	MESSAGE_FUNC_PARAMS( OnSoundRecorded, "SoundRecorded", kv );*/

	//MESSAGE_FUNC( OnEventSend, "SendEvent" );

	MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv );

	void LoadEventsFromFile( const char *filename );

	CGameEventEditDoc *m_pDoc;

	// drop down of available events

	vgui::ComboBox *m_pEventCombo;

	vgui::Label *m_pParamLabels[MAX_GAME_EVENT_PARAMS];
	vgui::TextEntry *m_pParams[MAX_GAME_EVENT_PARAMS];

	vgui::Button *m_pSendEventButton;

	CUtlSymbolTable	m_EventFiles;	// list of all loaded event files
	CUtlVector<CUtlSymbol>	m_EventFileNames; 

	KeyValues *m_pEvents;

	vgui::TextEntry *m_pFilterBox;
};


#endif // GAMEEVENTEDITPANEL_H