-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ui.hpp
106 lines (74 loc) · 2.04 KB
/
Ui.hpp
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
#pragma once
#include "Entity.hpp"
#include <raylib.h>
#include <vector>
#include <string>
#include "ActiveUiState.hpp"
#include "LockContext.hpp"
class Ui {
private:
const std::string m_MoveText = "Atacar";
const std::string m_PassText = "Passar";
Vector2 m_CursorPosition;
Entity* m_SelectedEntity;
Entity* m_HoveringEntity;
Entity* m_SelectedTarget;
Font m_Font;
float m_UpperTextBoxHeightLimit;
float m_LowerTextBoxHeightLimit;
float m_TextBoxWidthLimit;
float m_DefaultFontSize;
float m_DefaultFontSpacing;
Texture2D m_HealthBarTexture2D;
Texture2D m_EmptyHealthBarTexture2D;
Vector2 m_MoveTextPos;
ActiveUiState m_ActiveUiState;
Move* m_SelectedMove;
bool m_RunningDamageAnimation;
int m_DamageDrawValue;
bool m_DamageHasModifier;
Vector2 m_DesiredDrawDamagePos;
Vector2 m_CurrentDrawDamagePos;
LockContext m_LockedBy;
bool m_PlayerWon;
bool m_PlayerLost;
Sound m_BlinkSound;
void UpdateContextMenu();
void ExecuteDrawDamageAnimation();
void DrawWinText() const;
void DrawLoseText() const;
public:
Ui();
~Ui();
const Font& GetFont();
bool IsCursorOn(Vector2 pos, Rectangle entityAreaRec);
bool IsCursorOn(Vector2 pos);
Vector2 GetCursorPosition();
void SetupDrawDamageAnimation();
void Update(Entity* entity);
void Draw();
void DrawHpBar(
Entity* entity,
Rectangle entityRectangle,
Vector2 entityInfoPos) const;
void DrawEntityInformation(Entity* entity) const;
Entity* GetSelectedTarget() const;
Entity* GetSelectedEntity() const;
const Move* GetSelectedMove() const;
void SetSelectedEntity(Entity* entity);
void SetSelectedTarget(Entity* entity);
void SetSelectedMove(Move* move);
void RemoveSelectedMove();
void RemoveSelectedTarget();
void RemoveHoveringEntity();
void RemoveSelectedEntity();
void ChangeUiState(ActiveUiState activeUiState);
void ResetUiState();
void Lock(LockContext lockContext);
void ReleaseLock();
const LockContext GetLockContext() const;
void SetPlayerWon();
void SetPlayerLost();
const float GetFontSize() const;
const float GetFontSpacing() const;
};