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