📄 gametsctrl.h
字号:
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
#ifndef _GAMETSCTRL_H_
#define _GAMETSCTRL_H_
#ifndef _DGL_H_
#include "dgl/dgl.h"
#endif
#ifndef _GAME_H_
#include "game/game.h"
#endif
#ifndef _GUITSCONTROL_H_
#include "gui/core/guiTSControl.h"
#endif
#ifndef _MOVEMANAGER_H_
#include "game/moveManager.h"
#endif
class ProjectileData;
class GameBase;
#ifdef TGE_RPG
namespace RPG
{
class GNpc;
};
using namespace RPG;
#endif
//----------------------------------------------------------------------------
class GameTSCtrl : public GuiTSCtrl
{
private:
typedef GuiTSCtrl Parent;
/// TGE_RPG
Point3F mMouse3DVec;
Point3F mMouse3DPos;
U32 m_uMouseDownTimer;
U32 m_uUpdateTimer;
#ifdef TGE_RPG
enum GameMouseStates
{
GMS_NONE,
GMS_MOVE,
GMS_RELEASE,
GMS_PRESS,
GMS_DRAG
};
enum GameTSCursors
{
TSC_NORMAL,
TSC_NPC,
TSC_ITEM,
TSC_AMOUNT
};
GuiCursor* m_arCursors[TSC_AMOUNT];
GameTSCursors m_cursorState;
public:
static F32 ms_fTalkDistance;
static F32 ms_fRangeRadiusSqt;
static Point3F ms_posMainRole;
//static char ms_sMainRolePos[64];
//static Point2I ms_posMainRoleGrid;
static Vector<GameBase*> ms_arGameBases;
static Vector<GameBase*> ms_arNormals;
static Vector<GameBase*> ms_arTaskNpcs;
static Vector<GameBase*> ms_arTaskLocks;
#endif
public:
GameTSCtrl();
#ifdef TGE_RPG
static void initPersistFields();
void getCursor(GuiCursor *&cursor, bool &visible, const GuiEvent &event);
bool onWake();
#endif
bool processCameraQuery(CameraQuery *query);
void renderWorld(const RectI &updateRect);
void onMouseMove(const GuiEvent &evt);
void onMouseDragged(const GuiEvent & event);
void onMouseDown(const GuiEvent &evt);
void onMouseUp(const GuiEvent &evt);
void onRightMouseDown(const GuiEvent & event);
void onRightMouseUp(const GuiEvent & event);
#ifdef TGE_RPG
void onPreRender();
#endif
void onRender(Point2I offset, const RectI &updateRect);
bool onInputEvent(const InputEvent & event);
/// TGE_Move
#ifdef TGE_RPG
Point3F getMouse3DVec() {return mMouse3DVec;};
Point3F getMouse3DPos() {return mMouse3DPos;};
/// TGE_Move
//计算鼠标在地面上点击的位置
static U32 ms_uDownLength; //鼠标按着指定秒数后,将自动发送点击事件
static U32 ms_uUpdateCycle; //更新周期
void processMouseMove(S32 x, S32 y,GameMouseStates state);
void ProcessClickOnGround(GameMouseStates state);
//void ProcessNpcTalk(GNpc* pNpc);
static void consoleInit();
#endif
DECLARE_CONOBJECT(GameTSCtrl);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -