blob: 2ca40d65562f81c161f7e1895cda4a39e1bc058d (
plain)
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
|
#pragma once
#include "StarPane.hpp"
#include "StarUuid.hpp"
#include "StarMainInterfaceTypes.hpp"
#include "StarProgressWidget.hpp"
#include "StarLabelWidget.hpp"
namespace Star {
STAR_CLASS(TeamBar);
STAR_CLASS(MainInterface);
STAR_CLASS(UniverseClient);
STAR_CLASS(Player);
STAR_CLASS(TeamInvite);
STAR_CLASS(TeamInvitation);
STAR_CLASS(TeamMemberMenu);
STAR_CLASS(TeamBar);
class TeamInvite : public Pane {
public:
TeamInvite(TeamBar* owner);
virtual void show() override;
private:
TeamBar* m_owner;
void ok();
void close();
};
class TeamInvitation : public Pane {
public:
TeamInvitation(TeamBar* owner);
void open(Uuid const& inviterUuid, String const& inviterName);
private:
TeamBar* m_owner;
Uuid m_inviterUuid;
void ok();
void close();
};
class TeamMemberMenu : public Pane {
public:
TeamMemberMenu(TeamBar* owner);
void open(Uuid memberUuid, Vec2I position);
virtual void update(float dt) override;
private:
void updateWidgets();
void close();
void beamToShip();
void makeLeader();
void removeFromTeam();
TeamBar* m_owner;
Uuid m_memberUuid;
bool m_canBeam;
};
class TeamBar : public Pane {
public:
TeamBar(MainInterface* mainInterface, UniverseClientPtr client);
bool sendEvent(InputEvent const& event) override;
void invitePlayer(String const& playerName);
void acceptInvitation(Uuid const& inviterUuid);
protected:
virtual void update(float dt) override;
private:
void updatePlayerResources();
void inviteButton();
void buildTeamBar();
void showMemberMenu(Uuid memberUuid, Vec2I position);
MainInterface* m_mainInterface;
UniverseClientPtr m_client;
GuiContext* m_guiContext;
TextStyle m_nameStyle;
Vec2F m_nameOffset;
TeamInvitePtr m_teamInvite;
TeamInvitationPtr m_teamInvitation;
TeamMemberMenuPtr m_teamMemberMenu;
ProgressWidgetPtr m_healthBar;
ProgressWidgetPtr m_energyBar;
ProgressWidgetPtr m_foodBar;
LabelWidgetPtr m_nameLabel;
Color m_energyBarColor;
Color m_energyBarRegenMixColor;
Color m_energyBarUnusableColor;
friend class TeamMemberMenu;
};
}
|