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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//===========================================================================//
#ifndef GAMEEVENTEDITDOC_H
#define GAMEEVENTEDITDOC_H
#ifdef _WIN32
#pragma once
#endif
#include "dme_controls/inotifyui.h"
#include "datamodel/dmehandle.h"
#include "datamodel/dmelement.h"
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class ICommEditDocCallback;
class CCommEditDoc;
class CDmeCommentaryNodeEntity;
typedef CDmrElementArray<CDmeCommentaryNodeEntity> CDmrCommentaryNodeEntityList;
//-----------------------------------------------------------------------------
// Contains all editable state
//-----------------------------------------------------------------------------
class CGameEventEditDoc : public IDmNotify
{
public:
CGameEventEditDoc();
~CGameEventEditDoc();
// Inherited from INotifyUI
virtual void NotifyDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags );
// Sets/Gets the file name
const char *GetTXTFileName();
void SetTXTFileName( const char *pFileName );
// Dirty bits (has it changed since the last time it was saved?)
void SetDirty( bool bDirty );
bool IsDirty() const;
// Saves/loads from file
bool LoadFromFile( const char *pFileName );
void SaveToFile( );
/*
// Returns the root object
CDmElement *GetRootObject();
// Called when data changes (see INotifyUI for flags)
void OnDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags );
// Returns the entity list
CDmAttribute *GetEntityList();
// Adds a new info_target
void AddNewInfoTarget( void );
void AddNewInfoTarget( const Vector &vecOrigin, const QAngle &angAngles );
// Adds a new commentary node
void AddNewCommentaryNode( void );
void AddNewCommentaryNode( const Vector &vecOrigin, const QAngle &angAngles );
// Deletes a commentary node
void DeleteCommentaryNode( CDmElement *pNode );
// Returns the commentary node at the specified location
CDmeCommentaryNodeEntity *GetCommentaryNodeForLocation( Vector &vecOrigin, QAngle &angAbsAngles );
// For element choice lists. Return false if it's an unknown choice list type
virtual bool GetStringChoiceList( const char *pChoiceListType, CDmElement *pElement,
const char *pAttributeName, bool bArrayElement, StringChoiceList_t &list );
virtual bool GetElementChoiceList( const char *pChoiceListType, CDmElement *pElement,
const char *pAttributeName, bool bArrayElement, ElementChoiceList_t &list );*/
private:
//ICommEditDocCallback *m_pCallback;
CDmeHandle< CDmElement > m_hRoot;
char m_pTXTFileName[512];
bool m_bDirty;
};
#endif // GAMEEVENTEDITDOC_H
|