1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-26 13:47:46 +00:00
novus/common/src/settings.cpp

25 lines
No EOL
728 B
C++

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "settings.h"
#include <KConfig>
#include <KConfigGroup>
#include <QCoreApplication>
#include <QMessageBox>
QString getGameDirectory()
{
KConfig config(QStringLiteral("novusrc"));
KConfigGroup game = config.group(QStringLiteral("Game"));
if (game.hasKey(QStringLiteral("GameDir"))) {
return game.readEntry(QStringLiteral("GameDir"));
} else {
QMessageBox msgBox;
msgBox.setText(QStringLiteral("The game directory has not been set. Please open the Novus SDK launcher and set it."));
msgBox.exec();
QCoreApplication::quit();
return {};
}
}