Counter Strike : Global Offensive Source Code
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.

91 lines
2.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #pragma once
  14. #include "ObjectPage.h"
  15. #include "AnchorMgr.h"
  16. class GDclass;
  17. class CEditGameClass;
  18. class COP_Entity;
  19. struct CheckListItem
  20. {
  21. const char *pszItemString;
  22. int nItemBit;
  23. int state;
  24. inline bool operator==( const CheckListItem &first ) const
  25. {
  26. return ( ( first.nItemBit == nItemBit ) && ( !Q_strcmp( first.pszItemString, pszItemString ) ) );
  27. }
  28. };
  29. class COP_Flags : public CObjectPage
  30. {
  31. DECLARE_DYNCREATE(COP_Flags)
  32. // Construction
  33. public:
  34. COP_Flags();
  35. ~COP_Flags();
  36. // This needs to be set because we have to notify the entity page when the value changes.
  37. void SetEntityPage( COP_Entity *pEntityPage );
  38. virtual bool SaveData( SaveData_Reason_t reason );
  39. virtual void UpdateData( int Mode, PVOID pData, bool bCanEdit );
  40. void UpdateForClass(CEditGameClass* pObj);
  41. void MergeForClass(CEditGameClass* pObj);
  42. void CreateCheckList(void);
  43. // Called when the entity tab changes the spawnflags, which renders our data obsolete.
  44. void OnUpdateSpawnFlags( unsigned long value );
  45. GDclass *pObjClass;
  46. // Dialog Data
  47. //{{AFX_DATA(COP_Flags)
  48. enum { IDD = IDD_OBJPAGE_FLAGS };
  49. CCheckListBox m_CheckList;
  50. // NOTE - ClassWizard will add data members here.
  51. // DO NOT EDIT what you see in these blocks of generated code !
  52. //}}AFX_DATA
  53. // Overrides
  54. // ClassWizard generate virtual function overrides
  55. //{{AFX_VIRTUAL(COP_Flags)
  56. protected:
  57. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  58. //}}AFX_VIRTUAL
  59. // Implementation
  60. protected:
  61. // Generated message map functions
  62. //{{AFX_MSG(COP_Flags)
  63. virtual BOOL OnInitDialog();
  64. virtual void OnCheckListChange();
  65. afx_msg void OnSize( UINT nType, int cx, int cy );
  66. //}}AFX_MSG
  67. DECLARE_MESSAGE_MAP()
  68. CAnchorMgr m_AnchorMgr;
  69. CUtlVector <CheckListItem> m_CheckListItems;
  70. int m_nNumSelectedObjects;
  71. COP_Entity *m_pEntityPage;
  72. };