-
Notifications
You must be signed in to change notification settings - Fork 1
/
InvShow.h
46 lines (33 loc) · 995 Bytes
/
InvShow.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
#pragma once
#include "EngineX/EngineX.h"
#define DEFAULT_INV_LOC_X -2e6
#define DEFAULT_INV_LOC_Y 2e6
#define INV_CELL_SIZE_X 69
#define INV_CELL_SIZE_Y 63
class InvShow
{
public:
InvShow();
~InvShow();
void loadRes();
void Init(Engine* game);
void update();
void draw(sf::RenderWindow* app);
inline void activate(const std::string str) { iconActive[str] = true; }
inline void deActivate(const std::string str) { iconActive[str] = false; }
void setProgress(const std::string str, float prog);
static inline Point getDefaultLoc() { return { DEFAULT_INV_LOC_X, DEFAULT_INV_LOC_Y }; }
private:
sf::Texture backTex;
sf::Sprite back;
sf::Font font;
sf::Texture keyT;
sf::Sprite key;
std::map <std::string, sf::Texture> iconTex;
std::map <std::string, sf::Sprite> icon;
std::map <std::string, sf::Text> iconNum;
std::map <std::string, sf::Text> iconKey;
std::map <std::string, bool> iconActive;
std::map <std::string, sf::RectangleShape> iconRect;
Engine* game;
};