Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef GAMEEVENTEDITDOC_H
  9. #define GAMEEVENTEDITDOC_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "dme_controls/inotifyui.h"
  14. #include "datamodel/dmehandle.h"
  15. #include "datamodel/dmelement.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. class ICommEditDocCallback;
  20. class CCommEditDoc;
  21. class CDmeCommentaryNodeEntity;
  22. typedef CDmrElementArray<CDmeCommentaryNodeEntity> CDmrCommentaryNodeEntityList;
  23. //-----------------------------------------------------------------------------
  24. // Contains all editable state
  25. //-----------------------------------------------------------------------------
  26. class CGameEventEditDoc : public IDmNotify
  27. {
  28. public:
  29. CGameEventEditDoc();
  30. ~CGameEventEditDoc();
  31. // Inherited from INotifyUI
  32. virtual void NotifyDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags );
  33. // Sets/Gets the file name
  34. const char *GetTXTFileName();
  35. void SetTXTFileName( const char *pFileName );
  36. // Dirty bits (has it changed since the last time it was saved?)
  37. void SetDirty( bool bDirty );
  38. bool IsDirty() const;
  39. // Saves/loads from file
  40. bool LoadFromFile( const char *pFileName );
  41. void SaveToFile( );
  42. /*
  43. // Returns the root object
  44. CDmElement *GetRootObject();
  45. // Called when data changes (see INotifyUI for flags)
  46. void OnDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags );
  47. // Returns the entity list
  48. CDmAttribute *GetEntityList();
  49. // Adds a new info_target
  50. void AddNewInfoTarget( void );
  51. void AddNewInfoTarget( const Vector &vecOrigin, const QAngle &angAngles );
  52. // Adds a new commentary node
  53. void AddNewCommentaryNode( void );
  54. void AddNewCommentaryNode( const Vector &vecOrigin, const QAngle &angAngles );
  55. // Deletes a commentary node
  56. void DeleteCommentaryNode( CDmElement *pNode );
  57. // Returns the commentary node at the specified location
  58. CDmeCommentaryNodeEntity *GetCommentaryNodeForLocation( Vector &vecOrigin, QAngle &angAbsAngles );
  59. // For element choice lists. Return false if it's an unknown choice list type
  60. virtual bool GetStringChoiceList( const char *pChoiceListType, CDmElement *pElement,
  61. const char *pAttributeName, bool bArrayElement, StringChoiceList_t &list );
  62. virtual bool GetElementChoiceList( const char *pChoiceListType, CDmElement *pElement,
  63. const char *pAttributeName, bool bArrayElement, ElementChoiceList_t &list );*/
  64. private:
  65. //ICommEditDocCallback *m_pCallback;
  66. CDmeHandle< CDmElement > m_hRoot;
  67. char m_pTXTFileName[512];
  68. bool m_bDirty;
  69. };
  70. #endif // GAMEEVENTEDITDOC_H