📄 animcontrol.h
字号:
#ifndef ANIMCONTROL_H
#define ANIMCONTROL_H
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "model.h"
#include "wmo.h"
#include "modelcanvas.h"
#include "animdb.h"
#include "creaturedb.h"
#include "itemdb.h"
#include <string>
extern float animSpeed;
enum {
ID_ANIMFRAME = 3000,
ID_PAUSE,
ID_PLAY,
ID_STOP,
ID_CLEARANIM,
ID_LOADANIM,
ID_ADDANIM,
ID_PREVANIM,
ID_NEXTANIM,
ID_OLDSTYLE,
ID_LOOPS,
ID_ANIM,
ID_SKIN,
ID_ITEMSET,
ID_SPEED,
ID_FRAME
};
struct TextureGroup {
static const int num = 3;
int base, count;
std::string tex[num];
TextureGroup()
{
for (int i=0; i<num; i++) {
tex[i] = "";
}
}
// default copy constr
TextureGroup(const TextureGroup &grp)
{
for (int i=0; i<num; i++) {
tex[i] = grp.tex[i];
}
base = grp.base;
count = grp.count;
}
const bool operator<(const TextureGroup &grp) const
{
for (int i=0; i<num; i++) {
if (tex[i]<grp.tex[i]) return true;
}
return false;
}
};
typedef std::set<TextureGroup> TextureSet;
class AnimControl: public wxPanel
{
DECLARE_CLASS(AnimControl)
DECLARE_EVENT_TABLE()
wxComboBox *animList;
wxComboBox *skinList;
wxComboBox *wmoList;
wxComboBox *loopList;
wxStaticText *wmoLabel,*speedLabel, *frameLabel;
wxSlider *speedSlider, *frameSlider;
wxButton *btnAdd;
bool UpdateCreatureModel(Model *m);
bool UpdateItemModel(Model *m);
bool FillSkinSelector(TextureSet &skins);
public:
AnimControl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
~AnimControl();
bool Init();
void UpdateModel(Model *m);
void UpdateWMO(WMO *w, int group);
void OnButton(wxCommandEvent &event);
void OnCheck(wxCommandEvent &event);
void OnAnim(wxCommandEvent &event);
void OnSkin(wxCommandEvent &event);
void OnItemSet(wxCommandEvent &event);
void OnSliderUpdate(wxCommandEvent &event);
void OnLoop(wxCommandEvent &event);
void SetSkin(int num);
void SetAnimSpeed(float speed);
void SetAnimFrame(int frame);
static std::string makeSkinTexture(const char *texfn, const char *skin);
AnimDB animdb;
CreatureModelDB modeldb;
CreatureSkinDB skindb;
ItemDisplayDB *itemdb;
bool randomSkins;
bool defaultDoodads;
Model *model;
WMO *wmo;
std::string oldname;
ModelCanvas *canvas;
int selectedAnim;
bool bOldStyle;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -