afxTSCtrl.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  2. // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  3. // Copyright (C) 2015 Faust Logic, Inc.
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to
  7. // deal in the Software without restriction, including without limitation the
  8. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9. // sell copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. // IN THE SOFTWARE.
  22. //
  23. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  24. #ifndef _AFX_TS_CTRL_H_
  25. #define _AFX_TS_CTRL_H_
  26. #include "app/game.h"
  27. #include "gui/3d/guiTSControl.h"
  28. #include "core/iTickable.h"
  29. class GameBase;
  30. class afxSpellBook;
  31. //----------------------------------------------------------------------------
  32. class afxTSCtrl : public GuiTSCtrl, public virtual ITickable
  33. {
  34. private:
  35. struct Targeting
  36. {
  37. U8 mode;
  38. U8 check;
  39. };
  40. typedef GuiTSCtrl Parent;
  41. Point3F mMouse3DVec;
  42. Point3F mMouse3DPos;
  43. U32 mouse_dn_timestamp;
  44. afxSpellBook* spellbook;
  45. Vector<Targeting> targeting_mode;
  46. public:
  47. /*C*/ afxTSCtrl();
  48. virtual bool processCameraQuery(CameraQuery *query);
  49. virtual void renderWorld(const RectI &updateRect);
  50. virtual void onRender(Point2I offset, const RectI &updateRect);
  51. virtual void getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent);
  52. virtual void onMouseDown(const GuiEvent&);
  53. virtual void onMouseMove(const GuiEvent&);
  54. virtual void onMouseDragged(const GuiEvent&);
  55. virtual void onMouseEnter(const GuiEvent&);
  56. virtual void onMouseLeave(const GuiEvent&);
  57. virtual bool onMouseWheelUp(const GuiEvent&);
  58. virtual bool onMouseWheelDown(const GuiEvent&);
  59. virtual void onRightMouseDown(const GuiEvent&);
  60. Point3F getMouse3DVec() {return mMouse3DVec;};
  61. Point3F getMouse3DPos() {return mMouse3DPos;};
  62. void setSpellBook(afxSpellBook* book);
  63. void clearTargetingMode();
  64. void pushTargetingMode(U8 mode, U8 check);
  65. void popTargetingMode();
  66. U8 getTargetingMode();
  67. U8 getTargetingCheckMethod();
  68. void performTargeting(const Point2I& mousePoint, U8 mode);
  69. virtual void interpolateTick( F32 delta ) {};
  70. virtual void processTick() {};
  71. virtual void advanceTime( F32 timeDelta );
  72. DECLARE_CONOBJECT(afxTSCtrl);
  73. DECLARE_CATEGORY("AFX");
  74. };
  75. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  76. #endif // _AFX_TS_CTRL_H_