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
728 B
C++
Raw Normal View History

2023-09-23 15:28:34 -04:00
// 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>
2023-10-12 23:44:54 -04:00
QString getGameDirectory()
{
2023-09-26 00:37:55 -04:00
KConfig config(QStringLiteral("novusrc"));
KConfigGroup game = config.group(QStringLiteral("Game"));
2023-09-26 00:37:55 -04:00
if (game.hasKey(QStringLiteral("GameDir"))) {
return game.readEntry(QStringLiteral("GameDir"));
} else {
QMessageBox msgBox;
2023-09-26 00:37:55 -04:00
msgBox.setText(QStringLiteral("The game directory has not been set. Please open the Novus SDK launcher and set it."));
msgBox.exec();
QCoreApplication::quit();
return {};
}
}