WaterOptions.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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_WaterOptions_H__6B56E20C_582E_4132_A251_87902218852C__INCLUDED_)
  19. #define AFX_WaterOptions_H__6B56E20C_582E_4132_A251_87902218852C__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // WaterOptions.h : header file
  24. //
  25. #include "WBPopupSlider.h"
  26. #include "OptionsPanel.h"
  27. #include "Common/WellKnownKeys.h"
  28. class MapObject;
  29. class PolygonTrigger;
  30. class MovePolygonUndoable;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // WaterOptions dialog
  33. class WaterOptions : public COptionsPanel, public PopupSliderOwner
  34. {
  35. // Construction
  36. public:
  37. WaterOptions(CWnd* pParent = NULL); // standard constructor
  38. // Dialog Data
  39. //{{AFX_DATA(WaterOptions)
  40. enum { IDD = IDD_WATER_OPTIONS };
  41. // NOTE: the ClassWizard will add data members here
  42. //}}AFX_DATA
  43. // Overrides
  44. // ClassWizard generated virtual function overrides
  45. //{{AFX_VIRTUAL(WaterOptions)
  46. protected:
  47. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  48. virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
  49. virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
  50. //}}AFX_VIRTUAL
  51. // Implementation
  52. protected:
  53. // Generated message map functions
  54. //{{AFX_MSG(WaterOptions)
  55. virtual BOOL OnInitDialog();
  56. afx_msg void OnChangeWaterEdit();
  57. afx_msg void OnChangeHeightEdit();
  58. afx_msg void OnChangeSpacingEdit();
  59. afx_msg void OnWaterPolygon();
  60. afx_msg void OnMakeRiver();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. protected:
  64. static WaterOptions *m_staticThis; ///< Reference to the floating panel so SetWidth and SetFeather can be static.
  65. Bool m_updating; ///<true if the ui is updating itself.
  66. static Int m_waterHeight;
  67. WBPopupSliderButton m_waterHeightPopup;
  68. MovePolygonUndoable *m_moveUndoable;
  69. Int m_originalHeight;
  70. static Int m_waterPointSpacing;
  71. static Bool m_creatingWaterAreas; ///< True if we are creating flood fill water polygons, rather than dropping single points.
  72. protected:
  73. void updateTheUI(void);
  74. void startUpdateHeight(void);
  75. void updateHeight(void);
  76. void endUpdateHeight(void);
  77. PolygonTrigger *adjustCount(PolygonTrigger *trigger, Int firstPt, Int lastPt, Int desiredPointCount);
  78. public:
  79. static void update(void);
  80. static void setHeight(Int height);
  81. static Int getHeight(void) { return m_waterHeight;};
  82. static Int getSpacing(void) { return m_waterPointSpacing;};
  83. static Bool getCreatingWaterAreas(void) {return m_creatingWaterAreas;}
  84. public:
  85. virtual void GetPopSliderInfo(const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial);
  86. virtual void PopSliderChanged(const long sliderID, long theVal);
  87. virtual void PopSliderFinished(const long sliderID, long theVal);
  88. };
  89. //{{AFX_INSERT_LOCATION}}
  90. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  91. #endif // !defined(AFX_WaterOptions_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)