-
Notifications
You must be signed in to change notification settings - Fork 27
/
creatureui.h
68 lines (56 loc) · 2.24 KB
/
creatureui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//////////////////////////////////////////////////////////////////////
// Yet Another Tibia Client
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#ifndef __CREATUREUI_H
#define __CREATUREUI_H
#include "thingui.h"
#include "objects.h"
#include "defines.h"
class CreatureUI : virtual public ThingUI {
public:
CreatureUI();
~CreatureUI();
virtual void Blit(int x, int y, float scale = 1., int map_x = 0, int map_y = 0) const;
void loadOutfit();
void drawInfo(int x, int y, float scale, bool visible) const;
void drawName(int x, int y, float scale, bool visible) const;
void drawSkullsShields(int x, int y, float scale) const;
void startWalk() { m_preWalk = true; m_walkState = 0.f; }
void cancelWalk() { m_preWalk = false; m_walkState = 1.f; }
void confirmWalk() { m_preWalk = false; }
void advanceWalk(int groundspeed);
void getWalkOffset(float &walkoffx, float &walkoffy, float scale=1.f) const;
bool isPreWalking() const {return m_preWalk;}
float getWalkState() const {return m_walkState;}
bool isLoaded() const;
void resetSelf();
void unloadGfx();
static oRGBA getHealthColor(int hp);
int getSize() const { return (m_obj != NULL)?(MAX(m_obj->width, m_obj->height)):(1); }
protected:
void setupObject();
private:
ObjectType *m_obj;
std::vector<Sprite*> m_gfx;
bool m_preWalk;
float m_walkState;
// for invisible, constant animations, etc
uint32_t m_startTime;
};
#endif