RoadOptions.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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_RoadOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_)
  19. #define AFX_RoadOptions_H__D3FF66C5_7107_4DAC_8A29_5EBAB5C3A24E__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // RoadOptions.h : header file
  24. //
  25. #include "TerrainSwatches.h"
  26. #include "OptionsPanel.h"
  27. #include "Common/AsciiString.h"
  28. class WorldHeightMapEdit;
  29. /////////////////////////////////////////////////////////////////////////////
  30. // RoadOptions dialog
  31. class RoadOptions : public COptionsPanel
  32. {
  33. // Construction
  34. public:
  35. RoadOptions(CWnd* pParent = NULL); ///< standard constructor
  36. ~RoadOptions(void); ///< standard destructor
  37. enum { NAME_MAX_LEN = 64 };
  38. // Dialog Data
  39. //{{AFX_DATA(RoadOptions)
  40. enum { IDD = IDD_ROAD_OPTIONS };
  41. // NOTE: the ClassWizard will add data members here
  42. //}}AFX_DATA
  43. // Overrides
  44. // ClassWizard generated virtual function overrides
  45. //{{AFX_VIRTUAL(RoadOptions)
  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. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  51. //}}AFX_VIRTUAL
  52. // Implementation
  53. protected:
  54. // Generated message map functions
  55. //{{AFX_MSG(RoadOptions)
  56. virtual BOOL OnInitDialog();
  57. afx_msg void OnTightCurve();
  58. afx_msg void OnAngled();
  59. afx_msg void OnBroadCurve();
  60. afx_msg void OnJoin();
  61. afx_msg void OnApplyRoad();
  62. //}}AFX_MSG
  63. DECLARE_MESSAGE_MAP()
  64. protected:
  65. static RoadOptions *m_staticThis;
  66. static Bool m_updating;
  67. static Int m_currentRoadIndex;
  68. static Int m_numberOfRoads;
  69. static Int m_numberOfBridges;
  70. static AsciiString m_currentRoadName;
  71. static Bool m_angleCorners;
  72. static Bool m_tightCurve;
  73. static Bool m_doJoin;
  74. CTreeCtrl m_roadTreeView;
  75. protected:
  76. void addRoad(char *pPath, Int objectNdx, HTREEITEM parent);
  77. HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel);
  78. Bool findAndSelect(HTREEITEM parent, AsciiString label);
  79. Bool setRoadTreeViewSelection(HTREEITEM parent, Int selection);
  80. void updateLabel(void);
  81. void ChangeRoadType(AsciiString newRoad);
  82. void SelectConnected(void);
  83. public:
  84. static AsciiString getCurRoadName(void) {return m_currentRoadName;}
  85. static Bool isBridge(void) {return (m_currentRoadIndex >= m_numberOfRoads);}
  86. static Bool isAngled(void) {return m_angleCorners;}
  87. static Bool isTightCurve(void) {return m_tightCurve;}
  88. static Bool isJoin(void) {return m_doJoin;}
  89. static void updateSelection(void);
  90. static Bool selectionIsRoadsOnly(void);
  91. void applyToSelection(void);
  92. };
  93. //{{AFX_INSERT_LOCATION}}
  94. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  95. #endif // !defined(AFX_RoadOptions_H__D3FF66C5_711D_4DAC_8A29_5EAAB5C3A23E__INCLUDED_)