-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwarperInterface.h
82 lines (71 loc) · 2.59 KB
/
warperInterface.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef WARPERINTERFACE_H_INCLUDED
#define WARPERINTERFACE_H_INCLUDED
#include "warper.h"
#include "battleSystem.h"
#define CURSOR_NORMAL 0
#define CURSOR_ALLY 1
#define CURSOR_NEUTRAL 2
#define CURSOR_ENEMY 3
#define CURSOR_HOVER 4
#define CURSOR_SELECT 5
#define CURSOR_A 6
#define CURSOR_B 7
#define CURSOR_NORMAL_BLOCKED 8
#define CURSOR_ALLY_BLOCKED 9
#define CURSOR_GRAY_BLOCKED 10
#define CURSOR_ENEMY_OK 11
typedef struct _warperTextBox
{
cDoubleRect rect;
SDL_Color outlineColor;
SDL_Color bgColor;
SDL_Color highlightColor;
cText* texts;
bool* isOption;
int textsSize;
bool isMenu;
int selection;
int storedSelection;
} warperTextBox;
typedef struct _warperPath
{
node* path;
int pathLength;
SDL_Color pathColor;
int pathfinderWidth;
int pathfinderHeight;
double distance;
} warperPath;
typedef struct _warperCircle
{
int deltaDegrees;
double radius;
cDoublePt center;
SDL_Color circleColor;
bool filled;
} warperCircle;
//functions:
//CoSprite helper functs:
void initWarperTextBox(warperTextBox* textBox, cDoubleRect rect, SDL_Color outlineColor, SDL_Color bgColor, SDL_Color highlightColor, cText* texts, bool* isOption, int textsSize, bool isMenu);
void drawWarperTextBox(void* textBoxSubclass, cCamera camera);
void destroyWarperTextBox(void* textBoxSubclass);
void drawWarperPath(void* path, cCamera camera);
void destroyWarperPath(void* path);
void drawWarperCircle(void* circle, cCamera camera);
void destroyWarperCircle(void* circle);
void drawCursor(void* cursor, cCamera camera);
void destroyCursor(void* cursor);
//text box helper functs:
void createBattleTextBox(warperTextBox* textBox, cDoubleRect dimensions, cDoublePt margins, double verticalSpacing, bool justify, char** strings, bool* isOptions, int stringsLength, int tileSize);
void createMenuTextBox(warperTextBox* textBox, cDoubleRect dimensions, cDoublePt margins, double verticalSpacing, bool justify, Uint8 bgOpacity, char** strings, bool* isOptions, int stringsLength, cFont* font);
void checkWarperTextBoxHover(warperTextBox* textBox, SDL_MouseMotionEvent motion);
void checkWarperTextBoxSelection(warperTextBox* textBox, int xClick, int yClick);
void importWarperTextBox(warperTextBox* textBox, char* data);
char* exportWarperTextBox(warperTextBox textBox, int* exportedLen);
//cursor
void updateCursorPos(SDL_MouseMotionEvent motion, bool debugPrint);
void updateCursorIcon(int id);
//Other UI/UX
void loadGridModel(warperTilemap tilemap, c2DModel* gridModel, Uint8 opacity);
extern cSprite cursorSprite; //global cursor sprite
#endif // WARPERINTERFACE_H_INCLUDED