-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathingameui.cpp
More file actions
69 lines (49 loc) · 1.52 KB
/
ingameui.cpp
File metadata and controls
69 lines (49 loc) · 1.52 KB
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
#include "ingameui.h"
InGameUI::InGameUI(){}
InGameUI::InGameUI(QPoint pos, QSize size,QWidget* parent) :QWidget(parent)
{
mainLayout = new QVBoxLayout();
menu = new QHBoxLayout();
statContainer = new QVBoxLayout();
statContainer2 = new QVBoxLayout();
pause = new QPushButton("Pause");
reload = new QPushButton("Retry Level");
menu->addWidget(pause);
menu->addWidget(reload);
//Definition du widget stat
Mort = new QLabel(QString("Mort : 0"));
Score = new QLabel(QString("Score : 0"));
time = new QLabel(QString("Time : 00:00:00"));
totaltime = new QLabel(QString("Best Time : 00:00:00"));
// statContainer->addWidget(Score);
statContainer->addWidget(Mort);
statContainer->addWidget(time);
statContainer2->addWidget(totaltime);
//Ajout du tableau de stat au menu
menu->addLayout(statContainer);
menu->addLayout(statContainer2);
mainLayout->addLayout(menu);
setLayout(mainLayout);
// move(pos);
setMaximumSize(size);
}
void InGameUI::updateMort(int scr){
QString tmpS("Morts : ");
tmpS += QString::number(scr);
Mort->setText(tmpS);
}
void InGameUI::updateScore(int scr){
QString tmpS("Score : ");
tmpS += QString::number(scr);
Score->setText(tmpS);
}
void InGameUI::updateTime(envTime scr){
QString tmpS("Time : ");
tmpS += timeToString(scr);
time->setText(tmpS);
}
void InGameUI::updateTotalTime(envTime scr){
QString tmpS("Best Time : ");
tmpS += timeToString(scr);
totaltime->setText(tmpS);
}