BuildListTool.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. // BuildListTool.h
  19. // Build list tool for worldbuilder.
  20. // Author: John Ahlquist, Nov 2001
  21. #pragma once
  22. #ifndef BUILDLISTTOOL_H
  23. #define BUILDLISTTOOL_H
  24. #include "Tool.h"
  25. #include "Common/AsciiString.h"
  26. #include "PickUnitDialog.h"
  27. class WorldHeightMapEdit;
  28. class BuildListInfo;
  29. /*************************************************************************/
  30. /** BuildListTool
  31. Does the add item to build list tool operation.
  32. ***************************************************************************/
  33. class BuildListTool : public Tool
  34. {
  35. protected:
  36. CPoint m_downPt2d;
  37. Coord3D m_downPt3d;
  38. Coord3D m_prevPt3d;
  39. BuildListInfo *m_curObject;
  40. Bool m_moving; ///< True if we are drag moving an object.
  41. Bool m_rotating; ///< True if we are rotating an object.
  42. Bool m_mouseUpRotate;///< True if we are over the "rotate" hotspot.
  43. HCURSOR m_rotateCursor;
  44. Bool m_mouseUpMove;///< True if we are over the "move" hotspot.
  45. HCURSOR m_moveCursor;
  46. HCURSOR m_pointerCursor;
  47. PickUnitDialog m_pickBuildingDlg;
  48. Bool m_created;
  49. static PickUnitDialog *m_static_pickBuildingDlg;
  50. static Bool m_isActive;
  51. public:
  52. BuildListTool(void);
  53. ~BuildListTool(void);
  54. private:
  55. void createWindow(void);
  56. Bool isDoingAdd(void);
  57. public:
  58. static void addBuilding(void);
  59. static Bool isActive(void) {return m_isActive;};
  60. public:
  61. /// Perform tool on mouse down.
  62. virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  63. virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  64. virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  65. virtual void setCursor(void);
  66. virtual void activate(); ///< Become the current tool.
  67. virtual void deactivate(); ///< Become not the current tool.
  68. };
  69. #endif //TOOL_H