ObjectOptions.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #if !defined(AFX_ObjectOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
  19. #define AFX_ObjectOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // ObjectOptions.h : header file
  24. //
  25. #include "ObjectPreview.h"
  26. #include "OptionsPanel.h"
  27. #include "Common/AsciiString.h"
  28. class WorldHeightMapEdit;
  29. class MapObject;
  30. /////////////////////////////////////////////////////////////////////////////
  31. // ObjectOptions dialog
  32. class ObjectOptions : public COptionsPanel
  33. {
  34. // Construction
  35. public:
  36. ObjectOptions(CWnd* pParent = NULL); ///< standard constructor
  37. ~ObjectOptions(void); ///< standard destructor
  38. enum { NAME_MAX_LEN = 64 };
  39. // Dialog Data
  40. //{{AFX_DATA(ObjectOptions)
  41. enum { IDD = IDD_OBJECT_OPTIONS };
  42. // NOTE: the ClassWizard will add data members here
  43. //}}AFX_DATA
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(ObjectOptions)
  47. protected:
  48. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  49. virtual void OnOK(){return;}; ///< Modeless dialogs don't OK, so eat this for modeless.
  50. virtual void OnCancel(){return;}; ///< Modeless dialogs don't close on ESC, so eat this for modeless.
  51. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. protected:
  55. // Generated message map functions
  56. //{{AFX_MSG(ObjectOptions)
  57. virtual BOOL OnInitDialog();
  58. afx_msg void OnEditchangeOwningteam();
  59. afx_msg void OnCloseupOwningteam();
  60. afx_msg void OnSelchangeOwningteam();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. protected:
  64. static ObjectOptions *m_staticThis;
  65. static Bool m_updating;
  66. static Int m_currentObjectIndex;
  67. static char m_currentObjectName[NAME_MAX_LEN];
  68. static AsciiString m_curOwnerName;
  69. CTreeCtrl m_objectTreeView;
  70. MapObject *m_objectsList;
  71. ObjectPreview m_objectPreview;
  72. protected:
  73. void addObject( MapObject *mapObject, const char *pPath,
  74. Int objectNdx, HTREEITEM parent );
  75. HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel);
  76. HTREEITEM findOrDont(const char *pLabel);
  77. HTREEITEM _FindOrDont(const char* pLabel, HTREEITEM startPoint);
  78. Bool setObjectTreeViewSelection(HTREEITEM parent, Int selection);
  79. void updateLabel();
  80. static MapObject *getCurMapObject(void);
  81. public:
  82. static const char * getCurObjectName(void) {return m_currentObjectName;};
  83. static MapObject *duplicateCurMapObjectForPlace(const Coord3D* loc, Real angle, Bool checkPlayers = true);
  84. static MapObject *getObjectNamed(AsciiString name);
  85. static Int getObjectNamedIndex(const AsciiString& name);
  86. static void selectObject(const MapObject* pObj);
  87. static Real getCurObjectHeight(void);
  88. static void update();
  89. static AsciiString getCurGdfName(void);
  90. };
  91. //{{AFX_INSERT_LOCATION}}
  92. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  93. #endif // !defined(AFX_ObjectOptions_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)