-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem_entries.h
More file actions
94 lines (75 loc) · 1.88 KB
/
system_entries.h
File metadata and controls
94 lines (75 loc) · 1.88 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* system_entries.h
* Stepilicious
*
* Created by Magnus Selin on 5/3/13.
* Copyright 2013 __MyCompanyName__. All rights reserved.
*
*/
#include <iostream>
#include <SFML/Graphics.hpp>
#include <vector>
#define INF 1000000000
class Base_System_Entry{
private:
static int items;
static std::vector<Base_System_Entry*> adress_list;
protected:
int pos[2];
int size[2];
int active_col[4];
int nonactive_col[4];
int text_col[3];
bool multi_active;
bool is_down;
bool activated;
public:
Base_System_Entry();
static bool no_target(int x, int y, bool l_mouse_key);
static void deactivate_all();
void set_pos(int x, int y);
void set_size(int x, int y);
void set_active_col(int r, int g, int b);
void set_active_col(int r, int g, int b, int a);
void set_nonactive_col(int r, int g, int b);
void set_nonactive_col(int r, int g, int b, int a);
void set_text_col(int r, int g, int b);
void switch_state(){activated = !activated;}
void activate(){activated = true;}
void deactivate(){activated = false;};
bool has_focus(){return activated;}
bool check(int x, int y, bool l_mouse_key);
};
class Button : public Base_System_Entry{
private:
static sf::Image button_img;
bool m_is_down;
public:
static bool init();
Button();
void text_append(char c);
void text_remove(bool r);
bool check(int x, int y, bool l_mouse_key);
bool poll();
void draw(sf::RenderWindow * window);
};
class Text_Field : public Base_System_Entry{
private:
std::string text;
public:
void text_append(char c);
void text_remove(bool r);
void draw(sf::RenderWindow * window);
};
class Choice_Field : public Base_System_Entry{
private:
std::vector<std::string> files;
int active_field;
int is_down;
public:
Choice_Field();
void init(std::vector<std::string> f_list);
void draw(sf::RenderWindow * window);
int check(int x, int y, bool l_mouse_key);
std::string get_file_name(int n);
};