From 54be65687158c413ae457682ee2ff6f47cf1acfd Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 26 Jan 2023 18:24:34 +0200 Subject: [PATCH] Initial design for Launcher Welcome screen --- launcher/CMakeLists.txt | 37 +- launcher/firstLaunch/firstlaunch_moc.cpp | 47 ++ launcher/firstLaunch/firstlaunch_moc.h | 41 ++ launcher/firstLaunch/firstlaunch_moc.ui | 836 +++++++++++++++++++++++ launcher/mainwindow_moc.cpp | 7 + launcher/mainwindow_moc.h | 6 +- launcher/mainwindow_moc.ui | 57 +- 7 files changed, 1003 insertions(+), 28 deletions(-) create mode 100644 launcher/firstLaunch/firstlaunch_moc.cpp create mode 100644 launcher/firstLaunch/firstlaunch_moc.h create mode 100644 launcher/firstLaunch/firstlaunch_moc.ui diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 5eaef18a6..24d7e356a 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1,33 +1,13 @@ -set(launcher_modmanager_SRCS +set(launcher_SRCS + StdInc.cpp modManager/cdownloadmanager_moc.cpp modManager/cmodlist.cpp modManager/cmodlistmodel_moc.cpp modManager/cmodlistview_moc.cpp modManager/cmodmanager.cpp modManager/imageviewer_moc.cpp -) - -set(launcher_modmanager_HEADERS - modManager/cdownloadmanager_moc.h - modManager/cmodlist.h - modManager/cmodlistmodel_moc.h - modManager/cmodlistview_moc.h - modManager/cmodmanager.h - modManager/imageviewer_moc.h -) - -set(launcher_settingsview_SRCS settingsView/csettingsview_moc.cpp -) - -set(launcher_settingsview_HEADERS - settingsView/csettingsview_moc.h -) - -set(launcher_SRCS - StdInc.cpp - ${launcher_modmanager_SRCS} - ${launcher_settingsview_SRCS} + firstLaunch/firstlaunch_moc.cpp main.cpp mainwindow_moc.cpp launcherdirs.cpp @@ -40,8 +20,14 @@ set(launcher_SRCS set(launcher_HEADERS StdInc.h - ${launcher_modmanager_HEADERS} - ${launcher_settingsview_HEADERS} + modManager/cdownloadmanager_moc.h + modManager/cmodlist.h + modManager/cmodlistmodel_moc.h + modManager/cmodlistview_moc.h + modManager/cmodmanager.h + modManager/imageviewer_moc.h + settingsView/csettingsview_moc.h + firstLaunch/firstlaunch_moc.h mainwindow_moc.h launcherdirs.h jsonutils.h @@ -56,6 +42,7 @@ set(launcher_FORMS modManager/cmodlistview_moc.ui modManager/imageviewer_moc.ui settingsView/csettingsview_moc.ui + firstLaunch/firstlaunch_moc.ui mainwindow_moc.ui updatedialog_moc.ui lobby/lobby_moc.ui diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp new file mode 100644 index 000000000..9119e0202 --- /dev/null +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -0,0 +1,47 @@ +/* + * firstlaunch_moc.cpp, part of VCMI engine + * + * Authors: listed in file AUTHORS in main folder + * + * License: GNU General Public License v2.0 or later + * Full text of license available in license.txt file, in main folder + * + */ +#include "StdInc.h" +#include "firstlaunch_moc.h" +#include "ui_firstlaunch_moc.h" + +FirstLaunchView::FirstLaunchView(QWidget * parent) + : QWidget(parent), ui(new Ui::FirstLaunchView) +{ + ui->setupUi(this); +} + +FirstLaunchView::~FirstLaunchView() +{ + +} + +void FirstLaunchView::on_buttonTabLanguage_clicked() +{ + ui->installerTabs->setCurrentIndex(0); +} + + +void FirstLaunchView::on_buttonTabHeroesData_clicked() +{ + ui->installerTabs->setCurrentIndex(1); +} + + +void FirstLaunchView::on_buttonTabModPreset_clicked() +{ + ui->installerTabs->setCurrentIndex(2); +} + + +void FirstLaunchView::on_buttonTabFinish_clicked() +{ + ui->installerTabs->setCurrentIndex(3); +} + diff --git a/launcher/firstLaunch/firstlaunch_moc.h b/launcher/firstLaunch/firstlaunch_moc.h new file mode 100644 index 000000000..159d1e48e --- /dev/null +++ b/launcher/firstLaunch/firstlaunch_moc.h @@ -0,0 +1,41 @@ +/* + * firstlaunch_moc.h, part of VCMI engine + * + * Authors: listed in file AUTHORS in main folder + * + * License: GNU General Public License v2.0 or later + * Full text of license available in license.txt file, in main folder + * + */ +#pragma once +#include "../StdInc.h" + +namespace Ui +{ +class FirstLaunchView; +} + +class FirstLaunchView : public QWidget +{ + Q_OBJECT + +public: + explicit FirstLaunchView(QWidget * parent = 0); + ~FirstLaunchView(); + +public slots: + +private slots: + + void on_buttonTabLanguage_clicked(); + + void on_buttonTabHeroesData_clicked(); + + void on_buttonTabModPreset_clicked(); + + void on_buttonTabFinish_clicked(); + +private: + Ui::FirstLaunchView * ui; + +}; diff --git a/launcher/firstLaunch/firstlaunch_moc.ui b/launcher/firstLaunch/firstlaunch_moc.ui new file mode 100644 index 000000000..1889bd881 --- /dev/null +++ b/launcher/firstLaunch/firstlaunch_moc.ui @@ -0,0 +1,836 @@ + + + FirstLaunchView + + + + 0 + 0 + 650 + 409 + + + + + + + + + + + + + 0 + 0 + + + + Language + + + true + + + true + + + Qt::ToolButtonTextOnly + + + true + + + + + + + + 0 + 0 + + + + Heroes III Data + + + true + + + true + + + Qt::ToolButtonTextOnly + + + true + + + + + + + + 0 + 0 + + + + Mods Preset + + + true + + + true + + + Qt::ToolButtonTextOnly + + + true + + + + + + + + 0 + 0 + + + + Finish + + + true + + + true + + + Qt::ToolButtonTextOnly + + + true + + + + + + + + + 0 + + + 4 + + + 0 + + + true + + + Step %v out of %m + + + + + + + 3 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + true + + + + Choose your language + + + + + + + Next + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 5 + + + + English + + + + + German + + + + + Polish + + + + + Russian + + + + + Ukrainian + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + true + + + + Find Heroes III data files + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + 6 + + + + + + 25 + 0 + + + + Open help in browser + + + + + + + + 25 + 0 + + + + Search again + + + + + + + + 50 + 0 + + + + + + + + + 50 + 0 + + + + + + + + + 100 + 0 + + + + If you don't have installed Heroes III copy, it is possible to use our automatic installation tool 'vcmibuilder' to extract data from GoG.com installer. Visit our wiki for detailed instructions. + + + true + + + + + + + + 100 + 0 + + + + VCMI requires Heroes III data files in one of the locations listed above. Please copy Heroes III data in one of these directories. + + + true + + + + + + + + 50 + 0 + + + + + 75 + true + + + + Heroes III data files + + + + + + + + 100 + 0 + + + + Alternatively, you can select directory with installed Heroes III data and VCMI will copy exisiting data automatically. + + + true + + + + + + + + 25 + 0 + + + + Copy existing data + + + + + + + + 100 + 0 + + + + Your Heroes III data files have been succesfully found. + + + true + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + 6 + + + + + You Heroes III language was succesfully detected automatically. + + + true + + + + + + + Automatic detection of language failed. Please select language of your Heroes III copy + + + true + + + + + + + + + + + 75 + true + + + + Heroes III language + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 20 + 20 + + + + + + + + Back + + + + + + + Next + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + true + + + + Install VCMI Mod Preset + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 100 + 0 + + + + VCMI provides its own version of Horn of the Abyss fan-made addon. If you wish you can install it right now. For more information about mod visit hota website + + + true + + + + + + + + 0 + 0 + + + + Localization to (language) + + + Qt::ToolButtonTextOnly + + + + + + + + 100 + 0 + + + + Install VCMI-compatible version of the "In The Wake of Gods" fan-made addon + + + true + + + + + + + + 0 + 0 + + + + Heroes III + HotA + + + Qt::ToolButtonTextOnly + + + + + + + + 0 + 0 + + + + Heroes III + WoG + + + Qt::ToolButtonTextOnly + + + + + + + + 100 + 0 + + + + VCMI provides support for playing Heroes III in resolutions other than 800x600. If you wish, you can install this support + + + true + + + + + + + + 100 + 0 + + + + VCMI provides translations of Heroes III into a different languages. If you wish, you can install translation to (your language) + + + true + + + + + + + + 0 + 0 + + + + HD support + + + Qt::ToolButtonTextOnly + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Back + + + + + + + Skip + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + true + + + + Join community / get help + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Back + + + + + + + Finish + + + + + + + + + + + + + + diff --git a/launcher/mainwindow_moc.cpp b/launcher/mainwindow_moc.cpp index f76798404..98eb62019 100644 --- a/launcher/mainwindow_moc.cpp +++ b/launcher/mainwindow_moc.cpp @@ -197,3 +197,10 @@ void MainWindow::updateTranslation() #endif } + +void MainWindow::on_setupButton_clicked() +{ + ui->startGameButton->setEnabled(false); + ui->tabListWidget->setCurrentIndex(TabRows::SETUP); +} + diff --git a/launcher/mainwindow_moc.h b/launcher/mainwindow_moc.h index b7505635d..26835e30f 100644 --- a/launcher/mainwindow_moc.h +++ b/launcher/mainwindow_moc.h @@ -36,7 +36,10 @@ private: enum TabRows { - MODS = 0, SETTINGS = 1, LOBBY = 2 + MODS = 0, + SETTINGS = 1, + LOBBY = 2, + SETUP = 3 }; void changeEvent(QEvent *event) override; @@ -57,4 +60,5 @@ private slots: void on_settingsButton_clicked(); void on_lobbyButton_clicked(); void on_startEditorButton_clicked(); + void on_setupButton_clicked(); }; diff --git a/launcher/mainwindow_moc.ui b/launcher/mainwindow_moc.ui index 9665d131f..2ad42744b 100644 --- a/launcher/mainwindow_moc.ui +++ b/launcher/mainwindow_moc.ui @@ -7,7 +7,7 @@ 0 0 800 - 410 + 490 @@ -183,6 +183,52 @@ + + + + + 1 + 1 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Setup + + + + 60 + 60 + + + + true + + + false + + + true + + + Qt::ToolButtonTextOnly + + + true + + + @@ -316,11 +362,12 @@ - 0 + 3 + @@ -346,6 +393,12 @@
lobby/lobby_moc.h
1 + + FirstLaunchView + QWidget +
firstLaunch/firstlaunch_moc.h
+ 1 +