mapobjectprops.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_)
  19. #define AFX_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // mapobjectprops.h : header file
  24. //
  25. #include "OptionsPanel.h"
  26. #include "Common/Dict.h"
  27. #include "WBPopupSlider.h"
  28. class MapObject;
  29. class ModifyObjectUndoable;
  30. class MultipleUndoable;
  31. class CWorldBuilderDoc;
  32. class MapObject;
  33. /////////////////////////////////////////////////////////////////////////////
  34. // External Defines
  35. extern const char* NEUTRAL_TEAM_UI_STR;
  36. extern const char* NEUTRAL_TEAM_INTERNAL_STR;
  37. /////////////////////////////////////////////////////////////////////////////
  38. // MapObjectProps dialog
  39. class MapObjectProps : public COptionsPanel, public PopupSliderOwner
  40. {
  41. // Construction
  42. public:
  43. MapObjectProps(Dict* dictToEdit = NULL, const char* title = NULL, CWnd* pParent = NULL); // standard constructor
  44. ~MapObjectProps();
  45. void makeMain();
  46. // Dialog Data
  47. //{{AFX_DATA(MapObjectProps)
  48. enum { IDD = IDD_MAPOBJECT_PROPS };
  49. //}}AFX_DATA
  50. // Overrides
  51. // ClassWizard generated virtual function overrides
  52. //{{AFX_VIRTUAL(MapObjectProps)
  53. protected:
  54. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  55. //}}AFX_VIRTUAL
  56. // Implementation
  57. protected:
  58. void getAllSelectedDicts(void);
  59. static MapObjectProps *TheMapObjectProps;
  60. // Data common to all property pages
  61. Dict* m_dictToEdit;
  62. std::vector<Dict*> m_allSelectedDicts;
  63. const char* m_title;
  64. MapObject *m_selectedObject;
  65. MapObject *m_dictSource; // Source object for m_dictToEdit. m_selectedObject is not always the current source
  66. // of m_dictToEdit, and I don't understand why, so I'm making another MapObject pointer
  67. // which is always kept in sync.
  68. Real m_angle;
  69. Real m_height;
  70. Real m_scale;
  71. WBPopupSliderButton m_heightSlider;
  72. WBPopupSliderButton m_angleSlider;
  73. WBPopupSliderButton m_scaleSlider;
  74. Int m_defaultEntryIndex; //< Index in the sound combobox of the entry labelled "default"
  75. Bool m_defaultIsNone; //< The default for this object is no sound
  76. AsciiString m_defaultEntryName; //< The original name of the default entry
  77. ModifyObjectUndoable *m_posUndoable;
  78. Coord3D m_position;
  79. void deletePages();
  80. void updateTheUI(void);
  81. void enableButtons();
  82. int getSel();
  83. // Generated message map functions
  84. //{{AFX_MSG(MapObjectProps)
  85. virtual BOOL OnInitDialog();
  86. virtual void OnOK();
  87. virtual void OnCancel();
  88. afx_msg void OnSelchangeProperties();
  89. afx_msg void OnEditprop();
  90. afx_msg void OnNewprop();
  91. afx_msg void OnRemoveprop();
  92. afx_msg void OnDblclkProperties();
  93. afx_msg void _TeamToDict(void);
  94. afx_msg void _NameToDict(void);
  95. afx_msg void _ScriptToDict(void);
  96. afx_msg void _WeatherToDict(void);
  97. afx_msg void _TimeToDict(void);
  98. afx_msg void _ScaleToDict(void);
  99. afx_msg void SetZOffset(void);
  100. afx_msg void SetAngle(void);
  101. afx_msg void SetPosition(void);
  102. afx_msg void OnScaleOn();
  103. afx_msg void OnScaleOff();
  104. afx_msg void OnKillfocusMAPOBJECTXYPosition();
  105. afx_msg void _PrebuiltUpgradesToDict(void);
  106. afx_msg void _HealthToDict(void);
  107. afx_msg void _EnabledToDict(void);
  108. afx_msg void _IndestructibleToDict(void);
  109. afx_msg void _UnsellableToDict(void);
  110. afx_msg void _TargetableToDict();
  111. afx_msg void _PoweredToDict(void);
  112. afx_msg void _AggressivenessToDict(void);
  113. afx_msg void _VisibilityToDict(void);
  114. afx_msg void _VeterancyToDict(void);
  115. afx_msg void _ShroudClearingDistanceToDict(void);
  116. afx_msg void _RecruitableAIToDict(void);
  117. afx_msg void _SelectableToDict(void);
  118. afx_msg void _HPsToDict();
  119. afx_msg void _StoppingDistanceToDict(void);
  120. afx_msg void attachedSoundToDict(void);
  121. afx_msg void customizeToDict(void);
  122. afx_msg void enabledToDict(void);
  123. afx_msg void loopingToDict(void);
  124. afx_msg void loopCountToDict(void);
  125. afx_msg void minVolumeToDict(void);
  126. afx_msg void volumeToDict(void);
  127. afx_msg void minRangeToDict(void);
  128. afx_msg void maxRangeToDict(void);
  129. afx_msg void priorityToDict(void);
  130. //}}AFX_MSG
  131. DECLARE_MESSAGE_MAP()
  132. void _DictToName(void);
  133. void _DictToTeam(void);
  134. void _DictToScript(void);
  135. void _DictToScale(void);
  136. void _DictToWeather(void);
  137. void _DictToTime(void);
  138. void _DictToPrebuiltUpgrades(void);
  139. void _DictToHealth(void);
  140. void _DictToHPs(void);
  141. void _DictToEnabled(void);
  142. void _DictToDestructible(void);
  143. void _DictToUnsellable(void);
  144. void _DictToTargetable(void);
  145. void _DictToPowered(void);
  146. void _DictToAggressiveness(void);
  147. void _DictToVisibilityRange(void);
  148. void _DictToVeterancy(void);
  149. void _DictToShroudClearingDistance(void);
  150. void _DictToRecruitableAI();
  151. void _DictToSelectable(void);
  152. void _DictToStoppingDistance(void);
  153. void ShowZOffset(MapObject* pMapObj);
  154. void ShowAngle(MapObject* pMapObj);
  155. void ShowPosition(MapObject* pMapObj);
  156. void dictToAttachedSound(void);
  157. void dictToCustomize(void);
  158. void dictToEnabled(void);
  159. void dictToLooping(void);
  160. void dictToLoopCount(void);
  161. void dictToMinVolume(void);
  162. void dictToVolume(void);
  163. void dictToMinRange(void);
  164. void dictToMaxRange(void);
  165. void dictToPriority(void);
  166. void clearCustomizeFlag( CWorldBuilderDoc* pDoc, MultipleUndoable * ownerUndoable );
  167. // Implementation of PopupSliderOwner callbacks
  168. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  169. virtual void PopSliderChanged(const long sliderID, long theVal);
  170. virtual void PopSliderFinished(const long sliderID, long theVal);
  171. public:
  172. static MapObject *getSingleSelectedMapObject(void);
  173. static void update(void);
  174. private:
  175. /// Disallow copying: Object is not set up to be copied
  176. MapObjectProps( const MapObjectProps & other ); // Deliberately undefined
  177. MapObjectProps & operator=( const MapObjectProps & other ); // Deliberately undefined
  178. void updateTheUI(MapObject *pMapObj);
  179. void InitSound(void);
  180. };
  181. //{{AFX_INSERT_LOCATION}}
  182. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  183. #endif // !defined(AFX_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_)