1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-20 11:47:45 +00:00

Add a new game launcher program

This is simplistic for now, but I want to expand it for quick offline
testing.
This commit is contained in:
Joshua Goins 2024-05-18 15:14:22 -04:00
parent 5fd94fc70c
commit 2720e5fd7a
15 changed files with 146 additions and 5 deletions

View file

@ -3,11 +3,11 @@ Upstream-Name: Novus
Upstream-Contact: Joshua Goins <josh@redstrate.com> Upstream-Contact: Joshua Goins <josh@redstrate.com>
Source: https://git.sr.ht/~redstrate/novus Source: https://git.sr.ht/~redstrate/novus
Files: .gitmodules scripts/* README.md BUILDING.md CONTRIBUTING.md apps/argcracker/README.md apps/armoury/README.md apps/karuku/README.md apps/sagasu/README.md apps/mdlviewer/README.md renderer/README.md apps/launcher/README.md .clang-format .build.yml misc/* renderer/shaders/*.spv apps/mapeditor/README.md .github/* apps/mateditor/README.md Files: .gitmodules scripts/* README.md BUILDING.md CONTRIBUTING.md apps/argcracker/README.md apps/armoury/README.md apps/gamelauncher/README.md apps/karuku/README.md apps/sagasu/README.md apps/mdlviewer/README.md renderer/README.md apps/sdklauncher/README.md .clang-format .build.yml misc/* renderer/shaders/*.spv apps/mapeditor/README.md .github/* apps/mateditor/README.md
Copyright: Joshua Goins <josh@redstrate.com> Copyright: Joshua Goins <josh@redstrate.com>
License: CC0-1.0 License: CC0-1.0
Files: apps/armoury/zone.xiv.armoury.svg apps/karuku/zone.xiv.karaku.svg apps/launcher/zone.xiv.novus.svg apps/mapeditor/zone.xiv.mapeditor.svg apps/mdlviewer/zone.xiv.mdlviewer.svg apps/sagasu/zone.xiv.sagasu.svg resources/* Files: apps/armoury/zone.xiv.armoury.svg apps/karuku/zone.xiv.karaku.svg apps/sdklauncher/zone.xiv.novus.svg apps/mapeditor/zone.xiv.mapeditor.svg apps/mdlviewer/zone.xiv.mdlviewer.svg apps/sagasu/zone.xiv.sagasu.svg resources/*
Copyright: Joshua Goins <josh@redstrate.com> Copyright: Joshua Goins <josh@redstrate.com>
License: CC-BY-SA-4.0 License: CC-BY-SA-4.0

View file

@ -15,6 +15,7 @@ Here is an exhaustive list of tooling available here:
* [Model Viewer](apps/mdlviewer), a graphical model viewer for MDL files. * [Model Viewer](apps/mdlviewer), a graphical model viewer for MDL files.
* [Data Viewer](apps/sagasu), a graphical interface to explore FFXIV data archive files. * [Data Viewer](apps/sagasu), a graphical interface to explore FFXIV data archive files.
* [Material Editor](apps/mateditor), a program to view material files. * [Material Editor](apps/mateditor), a program to view material files.
* [Game Launcher](apps/gamelauncher), a program to quickly launch the game for testing.
## Usage ## Usage

View file

@ -7,5 +7,6 @@ add_subdirectory(argcracker)
add_subdirectory(sagasu) add_subdirectory(sagasu)
add_subdirectory(mapeditor) add_subdirectory(mapeditor)
add_subdirectory(mdlviewer) add_subdirectory(mdlviewer)
add_subdirectory(launcher) add_subdirectory(sdklauncher)
add_subdirectory(mateditor) add_subdirectory(mateditor)
add_subdirectory(gamelauncher)

View file

@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
# SPDX-License-Identifier: CC0-1.0
add_executable(novus-gamelauncher)
target_sources(novus-gamelauncher
PRIVATE
include/mainwindow.h
src/main.cpp
src/mainwindow.cpp)
target_include_directories(novus-gamelauncher
PUBLIC
include)
target_link_libraries(novus-gamelauncher
PRIVATE
Novus::Common
Physis::Physis
Physis::Logger
KF6::I18n
Qt6::Core
Qt6::Widgets)
install(TARGETS novus-gamelauncher ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
if (WIN32)
set_target_properties(novus-gamelauncher PROPERTIES
WIN32_EXECUTABLE TRUE
OUTPUT_NAME "GameLauncher")
install(FILES $<TARGET_RUNTIME_DLLS:novus-gamelauncher> DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

View file

@ -0,0 +1,7 @@
# Game Launcher
This tool can display and preview game materials.
## Note
Vulkan 1.3 or higher is currently required. This requirement is planned to be lifted in the future.

View file

@ -0,0 +1,21 @@
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QProcess>
#include "novusmainwindow.h"
struct GameData;
class MainWindow : public NovusMainWindow
{
Q_OBJECT
public:
explicit MainWindow();
private:
QProcess *process = nullptr;
};

View file

@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <KLocalizedString>
#include <QApplication>
#include <physis.hpp>
#include <physis_logger.h>
#include "aboutdata.h"
#include "mainwindow.h"
#include "settings.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
KLocalizedString::setApplicationDomain(QByteArrayLiteral("novus"));
customizeAboutData(QStringLiteral("gamelauncher"),
QStringLiteral("zone.xiv.gamelauncher"),
QStringLiteral("Game Launcher"),
i18n("Program to launch the game for debug purposes."));
// Default to a sensible message pattern
if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) {
qputenv("QT_MESSAGE_PATTERN", "[%{time yyyy-MM-dd h:mm:ss.zzz}] %{if-category}[%{category}] %{endif}[%{type}] %{message}");
}
setup_physis_logging();
MainWindow w;
w.show();
return app.exec();
}

View file

@ -0,0 +1,43 @@
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "mainwindow.h"
#include "settings.h"
#include <KLocalizedString>
#include <QApplication>
#include <QListWidget>
#include <QMenuBar>
#include <QFormLayout>
#include <QPushButton>
#include <QProcess>
#include <QLineEdit>
MainWindow::MainWindow() : NovusMainWindow()
{
setMinimumSize(1280, 720);
setupMenubar();
process = new QProcess();
process->setWorkingDirectory(getGameDirectory());
process->setProgram(QStringLiteral("ffxiv_dx11.exe"));
auto dummyWidget = new QWidget();
setCentralWidget(dummyWidget);
auto layout = new QFormLayout();
dummyWidget->setLayout(layout);
auto argsBox = new QLineEdit();
layout->addRow(i18n("Arguments"), argsBox);
auto launchGameButton = new QPushButton(i18n("Launch Game"));
connect(launchGameButton, &QPushButton::clicked, this, [this, argsBox] {
process->setArguments(argsBox->text().split(QLatin1Char(' ')));
qInfo() << "Launching" << process->program() << process->arguments();
process->start();
});
layout->addWidget(launchGameButton);
}
#include "moc_mainwindow.cpp"

View file

@ -13,6 +13,7 @@ file (GENERATE
#define MATEDITOR_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mateditor>\")\n\ #define MATEDITOR_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mateditor>\")\n\
#define MDLVIEWER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mdlviewer>\")\n\ #define MDLVIEWER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mdlviewer>\")\n\
#define DATAEXPLORER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-sagasu>\")\n\ #define DATAEXPLORER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-sagasu>\")\n\
#define GAMELAUNCHER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-gamelauncher>\")\n\
" "
) )

View file

@ -23,7 +23,8 @@ static QMap<QString, QPair<QString, QString>> applications = {
{QStringLiteral("Material Editor"), {QStringLiteral("zone.xiv.mateditor"), MATEDITOR_EXECUTABLE}}, {QStringLiteral("Material Editor"), {QStringLiteral("zone.xiv.mateditor"), MATEDITOR_EXECUTABLE}},
{QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), EXCELEDITOR_EXECUTABLE}}, {QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), EXCELEDITOR_EXECUTABLE}},
{QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), DATAEXPLORER_EXECUTABLE}}, {QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), DATAEXPLORER_EXECUTABLE}},
{QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), MDLVIEWER_EXECUTABLE}}}; {QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), MDLVIEWER_EXECUTABLE}},
{QStringLiteral("Game Launcher"), {QStringLiteral("zone.xiv.gamelauncher"), GAMELAUNCHER_EXECUTABLE}}};
static QMap<QString, QString> links = {{QStringLiteral("XIV Dev Wiki"), QStringLiteral("https://xiv.dev")}, static QMap<QString, QString> links = {{QStringLiteral("XIV Dev Wiki"), QStringLiteral("https://xiv.dev")},
{QStringLiteral("XIV Docs"), QStringLiteral("https://docs.xiv.zone")}}; {QStringLiteral("XIV Docs"), QStringLiteral("https://docs.xiv.zone")}};

View file

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB