forked from FranciscoBiaso/TileMapEditorRealmz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSceneScripts.h
69 lines (56 loc) · 1.88 KB
/
SceneScripts.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
#pragma once
#include <map>
#include <vector>
#include <string>
#include <glm/glm.hpp>
#include "GLRect.h"
#include "DrawingFunctions.h"
// The script is composed by
// GRAPHICAL AREA RECT
// GRAPHICAL NAME
// script id NAME FROM JSON script FILE
namespace Scripts {
typedef struct SceneScript{
SceneScript();
SceneScript(glm::vec2 xy, glm::vec2 dest, float floor,
glm::vec4 RectColor = glm::vec4(0.5, 1, 0.25, 0.25), glm::vec4 borderColor = glm::vec4(1, 1, 0, 0.85), float borderSize = 1.0f,
glm::vec2 offset = glm::vec2(3,3));
glm::vec2 leftTopPoint;
glm::vec2 rightBotPoint;
glm::vec4 borderColor;
glm::vec4 rectColor;
float borderSize;
float floor;
float zRect;
float zBorder;
float zText;
std::string name;
std::string scriptToLoad;
glm::vec2 offsetText;
}SceneScript;
class ContainerSceneScript
{
public:
ContainerSceneScript();
std::vector<GLRect> getQuads();
void addScript(Scripts::SceneScript);
void delScript(std::string scriptID);
std::map < std::string, Scripts::SceneScript>& getScripts();
void setShowScriptsTexts(bool value);
void setShowScriptsRects(bool value);
bool areScriptsTextsVisibles();
bool areScriptsRectsVisibles();
void cleanScriptRects();
void cleanScripts();
void updateRectColor(std::string script, glm::vec4 color);
std::string getSelectedScriptID();
void setSelectedScriptID(std::string);
private:
std::string _selectedScriptID;
bool _showScriptsTexts;
bool _showScriptsRects;
static int _coutScripts;
std::vector<GLRect> _areaQuads; // used by opengl to draw //
std::map < std::string, Scripts::SceneScript> _scripts;
};
};