mirror of
https://github.com/modelec/ihm.git
synced 2026-01-18 16:47:32 +01:00
80 lines
1.6 KiB
C++
80 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QMainWindow>
|
|
#include <QWidget>
|
|
#include <QStackedWidget>
|
|
#include <QPixmap>
|
|
#include <QSettings>
|
|
#include <atomic>
|
|
#include <QMovie>
|
|
#include <QLabel>
|
|
|
|
#include "HomePage.h"
|
|
#include "Homologation.h"
|
|
#include "InGame.h"
|
|
#include "PreparationMatch.h"
|
|
#include "TeamChooser.h"
|
|
#include "TestMode.h"
|
|
#include "WaintingForTirette.h"
|
|
#include "GCMode.h"
|
|
#include "tcp/MyTCPClient.h"
|
|
|
|
enum class DisplayMode
|
|
{
|
|
FULLSCREEN,
|
|
WINDOWED
|
|
};
|
|
|
|
class MainWindow : public QMainWindow {
|
|
Q_OBJECT
|
|
public:
|
|
explicit MainWindow(const char* address = "127.0.0.1", int port = 8080, QWidget* parent = nullptr);
|
|
|
|
void setWidgetNb(int index);
|
|
|
|
void setDisplayMode(DisplayMode mode);
|
|
|
|
void turnOnTheWindow();
|
|
|
|
protected slots:
|
|
void onHomePressed();
|
|
|
|
void onHomologationPressed();
|
|
|
|
void onTeamChooserPressed();
|
|
|
|
void onTestModePressed();
|
|
|
|
void onSpawnPointChoose(int nb);
|
|
|
|
void onWaitingForTirette();
|
|
|
|
void onStartGame();
|
|
|
|
void handleMessage(const std::string& message);
|
|
|
|
private:
|
|
QVBoxLayout* mainLayout;
|
|
QHBoxLayout* topLayout;
|
|
QPushButton* homeBtn;
|
|
QWidget* centralWidget;
|
|
QStackedWidget* stackedWidget;
|
|
QPushButton* quit;
|
|
|
|
HomePage* home;
|
|
Homologation* homologation;
|
|
TeamChooser* teamChooser;
|
|
PreparationMatch* preparationMatch;
|
|
TestMode* testMode;
|
|
WaintingForTirette* waintingForTirette;
|
|
InGame* inGame;
|
|
|
|
bool waitingForTiretteValue = false;
|
|
DisplayMode displayMode = DisplayMode::WINDOWED;
|
|
|
|
MyTCPClient* tcpClient;
|
|
QSettings* settings;
|
|
|
|
GCMode* gcMode;
|
|
};
|