1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/main.cpp

57 lines
1.5 KiB
C++
Raw Normal View History

#include "launchercore.h"
2021-11-01 09:54:58 -04:00
#include <QApplication>
#include <QCommandLineParser>
#include "config.h"
#include "desktopinterface.h"
#include "gameinstaller.h"
#include "sapphirelauncher.h"
#include "squareboot.h"
2021-11-01 09:54:58 -04:00
int main(int argc, char* argv[]) {
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
2021-11-01 09:54:58 -04:00
QApplication app(argc, argv);
2022-02-23 19:00:17 -05:00
QCoreApplication::setApplicationName("astra");
QCoreApplication::setApplicationVersion(version);
// we want to decide which interface to use. this is decided by the
// -cli, -desktop, or -tablet
// the default is -desktop
// cli is a special case where it's always "enabled"
QCommandLineParser parser;
parser.setApplicationDescription("Cross-platform FFXIV Launcher");
auto helpOption = parser.addHelpOption();
auto versionOption = parser.addVersionOption();
2021-11-23 15:37:02 -05:00
QCommandLineOption steamOption("steam", "Simulate booting the launcher via Steam.");
#ifdef ENABLE_STEAM
parser.addOption(steamOption);
#endif
parser.process(app);
2022-08-15 11:14:37 -04:00
if (parser.isSet(versionOption)) {
parser.showVersion();
}
2022-08-15 11:14:37 -04:00
if (parser.isSet(helpOption)) {
parser.showHelp();
}
#ifdef ENABLE_STEAM
2022-09-06 10:54:34 -04:00
LauncherCore c(parser.isSet(steamOption));
#else
LauncherCore c(false);
#endif
std::unique_ptr<DesktopInterface> desktopInterface = std::make_unique<DesktopInterface>(c);
2021-11-01 09:54:58 -04:00
2022-10-13 13:20:09 -04:00
return QApplication::exec();
2021-11-01 09:54:58 -04:00
}