blob: c7523b331fbe6d86cf342656883a27b09efcc77c (
plain) (
blame)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
#pragma once
#include "openvic-simulation/interface/LoadBase.hpp"
namespace OpenVic {
class UIManager;
}
namespace OpenVic::GFX {
struct Font : HasIdentifierAndColour {
friend class OpenVic::UIManager;
private:
const std::string PROPERTY(fontname);
// TODO - colorcodes, effect
Font(std::string_view new_identifier, colour_t new_colour, std::string_view new_fontname);
public:
Font(Font&&) = default;
};
using frame_t = int32_t; /* Keep this as int32_t to simplify interfacing with Godot */
static constexpr frame_t NO_FRAMES = 0;
class Sprite : public Named<> {
protected:
Sprite() = default;
public:
Sprite(Sprite&&) = default;
virtual ~Sprite() = default;
OV_DETAIL_GET_BASE_TYPE(Sprite)
OV_DETAIL_GET_TYPE
static NodeTools::node_callback_t expect_sprite(NodeTools::callback_t<std::unique_ptr<Sprite>&&> callback);
};
class TextureSprite final : public Sprite {
friend std::unique_ptr<TextureSprite> std::make_unique<TextureSprite>();
std::string PROPERTY(texture_file);
frame_t PROPERTY(no_of_frames);
// TODO - effectFile, allwaystransparent
protected:
TextureSprite();
bool _fill_key_map(NodeTools::key_map_t& key_map) override;
public:
TextureSprite(TextureSprite&&) = default;
virtual ~TextureSprite() = default;
OV_DETAIL_GET_TYPE
};
class TileTextureSprite final : public Sprite {
friend std::unique_ptr<TileTextureSprite> std::make_unique<TileTextureSprite>();
std::string PROPERTY(texture_file);
ivec2_t PROPERTY(size);
protected:
TileTextureSprite();
bool _fill_key_map(NodeTools::key_map_t& key_map) override;
public:
TileTextureSprite(TileTextureSprite&&) = default;
virtual ~TileTextureSprite() = default;
OV_DETAIL_GET_TYPE
};
class ProgressBar final : public Sprite {
friend std::unique_ptr<ProgressBar> std::make_unique<ProgressBar>();
colour_t PROPERTY(back_colour);
std::string PROPERTY(back_texture_file);
colour_t PROPERTY(progress_colour);
std::string PROPERTY(progress_texture_file);
ivec2_t PROPERTY(size);
// TODO - effectFile
protected:
ProgressBar();
bool _fill_key_map(NodeTools::key_map_t& key_map) override;
public:
ProgressBar(ProgressBar&&) = default;
virtual ~ProgressBar() = default;
OV_DETAIL_GET_TYPE
};
class PieChart final : public Sprite {
friend std::unique_ptr<PieChart> std::make_unique<PieChart>();
uint32_t PROPERTY(size);
protected:
PieChart();
bool _fill_key_map(NodeTools::key_map_t& key_map) override;
public:
PieChart(PieChart&&) = default;
virtual ~PieChart() = default;
OV_DETAIL_GET_TYPE
};
class LineChart final : public Sprite {
friend std::unique_ptr<LineChart> std::make_unique<LineChart>();
ivec2_t PROPERTY(size);
uint32_t PROPERTY(linewidth);
protected:
LineChart();
bool _fill_key_map(NodeTools::key_map_t& key_map) override;
public:
LineChart(LineChart&&) = default;
virtual ~LineChart() = default;
OV_DETAIL_GET_TYPE
};
class MaskedFlag final : public Sprite {
friend std::unique_ptr<MaskedFlag> std::make_unique<MaskedFlag>();
std::string PROPERTY(overlay_file)
std::string PROPERTY(mask_file);
protected:
MaskedFlag();
bool _fill_key_map(NodeTools::key_map_t& key_map) override;
public:
MaskedFlag(MaskedFlag&&) = default;
virtual ~MaskedFlag() = default;
OV_DETAIL_GET_TYPE
};
}
|