mapobjectprops.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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_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. /////////////////////////////////////////////////////////////////////////////
  31. // External Defines
  32. extern const char* NEUTRAL_TEAM_UI_STR;
  33. extern const char* NEUTRAL_TEAM_INTERNAL_STR;
  34. /////////////////////////////////////////////////////////////////////////////
  35. // MapObjectProps dialog
  36. class MapObjectProps : public COptionsPanel, public PopupSliderOwner
  37. {
  38. // Construction
  39. public:
  40. MapObjectProps(Dict* dictToEdit = NULL, const char* title = NULL, CWnd* pParent = NULL); // standard constructor
  41. ~MapObjectProps();
  42. void makeMain();
  43. // Dialog Data
  44. //{{AFX_DATA(MapObjectProps)
  45. enum { IDD = IDD_MAPOBJECT_PROPS };
  46. //}}AFX_DATA
  47. // Overrides
  48. // ClassWizard generated virtual function overrides
  49. //{{AFX_VIRTUAL(MapObjectProps)
  50. protected:
  51. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. protected:
  55. void getAllSelectedDicts(void);
  56. static MapObjectProps *TheMapObjectProps;
  57. Dict* m_dictToEdit;
  58. std::vector<Dict*> m_allSelectedDicts;
  59. const char* m_title;
  60. MapObject *m_selectedObject;
  61. void updateTheUI(void);
  62. void enableButtons();
  63. int getSel();
  64. WBPopupSliderButton m_heightSlider;
  65. WBPopupSliderButton m_angleSlider;
  66. Real m_angle;
  67. Real m_height;
  68. ModifyObjectUndoable *m_posUndoable;
  69. // Generated message map functions
  70. //{{AFX_MSG(MapObjectProps)
  71. afx_msg void OnSelchangeProperties();
  72. virtual BOOL OnInitDialog();
  73. afx_msg void OnEditprop();
  74. afx_msg void OnNewprop();
  75. afx_msg void OnRemoveprop();
  76. afx_msg void OnDblclkProperties();
  77. virtual void OnOK();
  78. virtual void OnCancel();
  79. afx_msg void _TeamToDict(void);
  80. afx_msg void _NameToDict(void);
  81. afx_msg void _HealthToDict(void);
  82. afx_msg void _EnabledToDict(void);
  83. afx_msg void _ScriptToDict(void);
  84. afx_msg void _IndestructibleToDict(void);
  85. afx_msg void _UnsellableToDict(void);
  86. afx_msg void _TargetableToDict();
  87. afx_msg void _PoweredToDict(void);
  88. afx_msg void _AggressivenessToDict(void);
  89. afx_msg void _VisibilityToDict(void);
  90. afx_msg void _VeterancyToDict(void);
  91. afx_msg void _ShroudClearingDistanceToDict(void);
  92. afx_msg void _RecruitableAIToDict(void);
  93. afx_msg void _SelectableToDict(void);
  94. afx_msg void _WeatherToDict(void);
  95. afx_msg void _TimeToDict(void);
  96. afx_msg void _PrebuiltUpgradesToDict(void);
  97. afx_msg void SetZOffset(void);
  98. afx_msg void SetAngle(void);
  99. afx_msg void _HPsToDict();
  100. afx_msg void _StoppingDistanceToDict(void);
  101. //}}AFX_MSG
  102. DECLARE_MESSAGE_MAP()
  103. void _DictToTeam(void);
  104. void _DictToName(void);
  105. void _DictToHealth(void);
  106. void _DictToHPs(void);
  107. void _DictToEnabled(void);
  108. void _DictToScript(void);
  109. void _DictToDestructible(void);
  110. void _DictToUnsellable(void);
  111. void _DictToTargetable(void);
  112. void _DictToPowered(void);
  113. void _DictToAggressiveness(void);
  114. void _DictToVisibilityRange(void);
  115. void _DictToVeterancy(void);
  116. void _DictToShroudClearingDistance(void);
  117. void _DictToRecruitableAI();
  118. void _DictToSelectable(void);
  119. void _DictToWeather(void);
  120. void _DictToTime(void);
  121. void ShowZOffset(MapObject* pMapObj);
  122. void ShowAngle(MapObject* pMapObj);
  123. void _DictToStoppingDistance(void);
  124. void _DictToPrebuiltUpgrades(void);
  125. public:
  126. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  127. virtual void PopSliderChanged(const long sliderID, long theVal);
  128. virtual void PopSliderFinished(const long sliderID, long theVal);
  129. static MapObject *getSingleSelectedMapObject(void);
  130. static void update(void);
  131. };
  132. //{{AFX_INSERT_LOCATION}}
  133. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  134. #endif // !defined(AFX_MAPOBJECTPROPS_H__44517B9E_12AB_4E2C_B49B_D6BB65C59649__INCLUDED_)