diff --git a/Homepage.jpg b/Homepage.jpg new file mode 100644 index 0000000..8347b46 Binary files /dev/null and b/Homepage.jpg differ diff --git a/Resources.qrc b/Resources.qrc new file mode 100644 index 0000000..1e9365f --- /dev/null +++ b/Resources.qrc @@ -0,0 +1,2 @@ + + diff --git a/USTlord.pro b/USTlord.pro new file mode 100644 index 0000000..2191d88 --- /dev/null +++ b/USTlord.pro @@ -0,0 +1,29 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + gamewindow.cpp \ + maininterface.cpp + +HEADERS += \ + gamewindow.h \ + maininterface.h + +FORMS += \ + gamewindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + img.qrc diff --git a/USTlord.pro.user b/USTlord.pro.user new file mode 100644 index 0000000..8c1f78c --- /dev/null +++ b/USTlord.pro.user @@ -0,0 +1,357 @@ + + + + + + EnvironmentId + {96b5b842-7dfd-449c-bf0a-8f1af8889643} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + true + true + true + true + + + 0 + true + + -fno-delayed-template-parsing + + true + Builtin.Questionable + + true + Builtin.DefaultTidyAndClazy + 8 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 5.15.0 MinGW 64-bit + Desktop Qt 5.15.0 MinGW 64-bit + qt.qt5.5150.win64_mingw81_kit + 0 + 0 + 0 + + true + 0 + C:\Users\16413\Documents\Qtprojects\build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Debug + C:/Users/16413/Documents/Qtprojects/build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + 2 + 2 + + + true + 2 + C:\Users\16413\Documents\Qtprojects\build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Release + C:/Users/16413/Documents/Qtprojects/build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 2 + + + true + 0 + C:\Users\16413\Documents\Qtprojects\build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Profile + C:/Users/16413/Documents/Qtprojects/build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:C:/Users/16413/Documents/Qtprojects/USTlord/USTlord.pro + C:/Users/16413/Documents/Qtprojects/USTlord/USTlord.pro + + false + + false + true + true + false + false + true + + C:/Users/16413/Documents/Qtprojects/build-USTlord-Desktop_Qt_5_15_0_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/assets.qrc b/assets.qrc new file mode 100644 index 0000000..6b3619a --- /dev/null +++ b/assets.qrc @@ -0,0 +1,5 @@ + + + images/background.jpg + + diff --git a/gamewindow.cpp b/gamewindow.cpp new file mode 100644 index 0000000..5aa45a1 --- /dev/null +++ b/gamewindow.cpp @@ -0,0 +1,113 @@ +#include "gamewindow.h" +#include "ui_gamewindow.h" +#include +#include +#include + +GameWindow::GameWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::GameWindow) +{ + initiate_window(); + initiate_game_title(); + initiate_offline_button(); + initiate_online_button(); + initiate_exit_button(); + + ui->setupUi(this); +} + +GameWindow::~GameWindow() +{ + delete ui; +} + +void GameWindow::initiate_window() { setFixedSize(800, 600); } + +void GameWindow::paintEvent(QPaintEvent* event) { + static QPixmap backpic(":/Backgrounds/images/Homepage.jpg"); + QPainter painter(this); + painter.drawPixmap(this->rect(),backpic); +} + +void GameWindow::initiate_offline_button() { + offline_button = new QPushButton(this); + offline_button->setGeometry(75, 165, 200, 50); + /*QFont font; + font.setPointSize(15); + font.setFamily("Arial Rounded MT Bold"); + font.setBold(true); + offline_button->setFont(font);*/ + offline_button->setStyleSheet( + "QPushButton{" + "background-color:white;"//color + "border-style:outset;" //inset/outset + "border-width:4px;" + "border-radius:10px;" + "border-color:black;" //border color + "font:bold 25px;" //character and size + "color:black;" //character color + "padding:6px;" //padding + "}"); + offline_button->setCursor(Qt::PointingHandCursor); + offline_button->setText("Single Player"); + offline_button->installEventFilter(this); + offline_clickable = true; +} + +void GameWindow::initiate_online_button() { + online_button = new QPushButton(this); + online_button->setGeometry(75, 240, 200, 50); + QFont font; + font.setPointSize(15); + font.setFamily("Arial Rounded MT Bold"); + font.setBold(true); + online_button->setFont(font); + online_button->setStyleSheet("QPushButton{" + "background-color:white;"//color + "border-style:outset;" //inset/outset + "border-width:4px;" + "border-radius:10px;" + "border-color:black;" //border color + "font:bold 25px;" //character and size + "color:black;" //character color + "padding:6px;" //padding + "}"); + online_button->setCursor(Qt::PointingHandCursor); + online_button->setText("Multi-Players"); + online_button->installEventFilter(this); + online_clickable = true; +} + +void GameWindow::initiate_exit_button() { + exit_button = new QPushButton(this); + exit_button->setGeometry(75, 315, 200, 50); + exit_button->setStyleSheet("QPushButton{" + "background-color:white;"//color + "border-style:outset;" //inset/outset + "border-width:4px;" + "border-radius:10px;" + "border-color:black;" //border color + "font:bold 25px;" //character and size + "color:black;" //character color + "padding:6px;" //padding + "}"); + exit_button->setCursor(Qt::PointingHandCursor); + exit_button->setText("Exit"); + exit_button->installEventFilter(this); +} + +void GameWindow::initiate_game_title() { + game_title = new QPushButton(this); + game_title->setGeometry(50, 50, 300, 100); + QFont font; + font.setItalic(true); + font.setStyle(QFont::StyleItalic); + font.setPointSize(40); + font.setFamily("Arial Rounded MT Bold"); + font.setBold(true); + game_title->setFont(font); + game_title->setStyleSheet("color:Black"); + game_title->setText("USTlord"); + game_title->setFlat(true); +} diff --git a/gamewindow.h b/gamewindow.h new file mode 100644 index 0000000..cefe236 --- /dev/null +++ b/gamewindow.h @@ -0,0 +1,36 @@ +#ifndef GAMEWINDOW_H +#define GAMEWINDOW_H + +#include +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class GameWindow; } +QT_END_NAMESPACE + +class GameWindow : public QMainWindow +{ + Q_OBJECT + +public: + GameWindow(QWidget *parent = nullptr); + ~GameWindow(); + void initiate_window(); + void paintEvent(QPaintEvent * event); + void initiate_offline_button(); + void initiate_online_button(); + void initiate_exit_button(); + void initiate_game_title(); + +private: + Ui::GameWindow *ui; + + QPushButton* offline_button; + QPushButton* online_button; + QPushButton* exit_button; + QPushButton* game_title; + //non-UI data member + bool offline_clickable{false};//Bool variable used to prevent button repeatly pressed + bool online_clickable{false}; +}; +#endif // GAMEWINDOW_H diff --git a/gamewindow.ui b/gamewindow.ui new file mode 100644 index 0000000..abd53e0 --- /dev/null +++ b/gamewindow.ui @@ -0,0 +1,22 @@ + + + GameWindow + + + + 0 + 0 + 800 + 600 + + + + GameWindow + + + + + + + + diff --git a/images/Homepage.jpg b/images/Homepage.jpg new file mode 100644 index 0000000..8347b46 Binary files /dev/null and b/images/Homepage.jpg differ diff --git a/img.qrc b/img.qrc new file mode 100644 index 0000000..ce56e57 --- /dev/null +++ b/img.qrc @@ -0,0 +1,5 @@ + + + images/Homepage.jpg + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..539bc04 --- /dev/null +++ b/main.cpp @@ -0,0 +1,12 @@ +#include "gamewindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + GameWindow w; + w.setWindowTitle("Homepage"); + w.show(); + return a.exec(); +} diff --git a/maininterface.cpp b/maininterface.cpp new file mode 100644 index 0000000..5c3a086 --- /dev/null +++ b/maininterface.cpp @@ -0,0 +1,6 @@ +#include "maininterface.h" + +MainInterface::MainInterface(QWidget *parent) : QWidget(parent) +{ + +} diff --git a/maininterface.h b/maininterface.h new file mode 100644 index 0000000..df5e9b9 --- /dev/null +++ b/maininterface.h @@ -0,0 +1,16 @@ +#ifndef MAININTERFACE_H +#define MAININTERFACE_H + +#include + +class MainInterface : public QWidget +{ + Q_OBJECT +public: + explicit MainInterface(QWidget *parent = nullptr); + +signals: + +}; + +#endif // MAININTERFACE_H