Skip to content

Commit 9cc051e

Browse files
committed
dev1
0 parents  commit 9cc051e

29 files changed

+1471
-0
lines changed

game_window.ui

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<ui version="4.0" >
2+
<class>Dialog</class>
3+
<widget class="QDialog" name="Dialog" >
4+
<property name="geometry" >
5+
<rect>
6+
<x>0</x>
7+
<y>0</y>
8+
<width>400</width>
9+
<height>300</height>
10+
</rect>
11+
</property>
12+
<property name="windowTitle" >
13+
<string>Dialog</string>
14+
</property>
15+
</widget>
16+
<resources/>
17+
<connections/>
18+
</ui>
19+

gamewindow.cpp

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include "gamewindow.h"
2+
#include "ui_gamewindow.h"
3+
#include <QPixmap>
4+
#include <windows.h>
5+
gamewindow::gamewindow(QWidget *parent) :
6+
QDialog(parent),
7+
ui(new Ui::gamewindow)
8+
{
9+
ui->setupUi(this);
10+
this->setWindowFlags(Qt::FramelessWindowHint );
11+
this->setAttribute(Qt::WA_TranslucentBackground);
12+
this->show();
13+
}
14+
15+
gamewindow::~gamewindow()
16+
{
17+
delete ui;
18+
}
19+
20+
void gamewindow::SetLoadingLine(double precent) {
21+
ui->loading_line->setStyleSheet("background:white;border-radius:7px;border:3.3px solid white;background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(145, 102, 206, 255), stop:"+QString::number(precent-0.01)+" rgba(145, 102, 206, 255), stop:"+QString::number(precent)+" rgba(255, 255, 255, 255), stop:1 rgba(255, 255, 255, 255));");
22+
}
23+
24+
void gamewindow::SetSelectedSkin(int id) {
25+
ui->selected_skin->setStyleSheet("background: url(:/resources/img/"+QString::number(id)+".png) center/top;border-radius:20px;border:6px solid white;");
26+
}
27+
28+
void gamewindow::SetSelectedNick(std::string nick) {
29+
ui->selected_nick->setText("<html><head/><body><p align=\"center\">"+QString::fromStdString(nick)+"</p></body></html>");
30+
}
31+
32+
void gamewindow::on_start_game_clicked()
33+
{
34+
double procent = 1;
35+
SetLoadingLine(procent/100);
36+
SetSelectedSkin(188);
37+
SetSelectedNick("ivan_Pivan");
38+
}
39+
40+
41+
42+
void gamewindow::on_close_btn_clicked()
43+
{
44+
exit(0);
45+
}
46+

gamewindow.h

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef GAMEWINDOW_H
2+
#define GAMEWINDOW_H
3+
4+
#include <QDialog>
5+
6+
namespace Ui {
7+
class gamewindow;
8+
}
9+
10+
class gamewindow : public QDialog
11+
{
12+
Q_OBJECT
13+
public:
14+
explicit gamewindow(QWidget *parent = nullptr);
15+
~gamewindow();
16+
void SetLoadingLine(double proc);
17+
void SetSelectedSkin(int id);
18+
void SetSelectedNick(std::string nick);
19+
private slots:
20+
void on_start_game_clicked();
21+
22+
void on_close_btn_clicked();
23+
24+
private:
25+
Ui::gamewindow *ui;
26+
};
27+
28+
#endif // GAMEWINDOW_H

0 commit comments

Comments
 (0)