2021-11-23 15:34:23 -05:00
|
|
|
#include "launchercore.h"
|
|
|
|
|
2021-11-01 09:54:58 -04:00
|
|
|
#include <QApplication>
|
2021-11-23 15:34:23 -05:00
|
|
|
#include <QCommandLineParser>
|
2021-11-23 16:02:02 -05:00
|
|
|
|
2022-04-09 17:44:00 -04:00
|
|
|
#include "config.h"
|
2022-06-08 11:52:07 -04:00
|
|
|
#include "desktopinterface.h"
|
2022-07-21 20:53:19 -04:00
|
|
|
#include "gameinstaller.h"
|
|
|
|
#include "sapphirelauncher.h"
|
|
|
|
#include "squareboot.h"
|
2021-11-01 09:54:58 -04:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
2022-04-09 17:02:25 -04:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
2022-10-24 13:03:29 -04:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
|
2022-04-09 17:02:25 -04:00
|
|
|
|
2021-11-01 09:54:58 -04:00
|
|
|
QApplication app(argc, argv);
|
2021-11-01 14:52:34 -04:00
|
|
|
|
2022-02-23 19:00:17 -05:00
|
|
|
QCoreApplication::setApplicationName("astra");
|
2022-04-09 17:44:00 -04:00
|
|
|
QCoreApplication::setApplicationVersion(version);
|
2021-11-23 15:34:23 -05:00
|
|
|
|
2022-06-08 11:52:07 -04:00
|
|
|
// 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"
|
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
QCommandLineParser parser;
|
|
|
|
parser.setApplicationDescription("Cross-platform FFXIV Launcher");
|
2022-04-09 17:44:00 -04:00
|
|
|
|
|
|
|
auto helpOption = parser.addHelpOption();
|
|
|
|
auto versionOption = parser.addVersionOption();
|
2021-11-23 15:37:02 -05:00
|
|
|
|
2022-09-05 18:06:36 -04:00
|
|
|
QCommandLineOption steamOption("steam", "Simulate booting the launcher via Steam.");
|
|
|
|
#ifdef ENABLE_STEAM
|
|
|
|
parser.addOption(steamOption);
|
|
|
|
#endif
|
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
parser.process(app);
|
|
|
|
|
2022-08-15 11:14:37 -04:00
|
|
|
if (parser.isSet(versionOption)) {
|
2022-04-09 17:44:00 -04:00
|
|
|
parser.showVersion();
|
|
|
|
}
|
|
|
|
|
2022-08-15 11:14:37 -04:00
|
|
|
if (parser.isSet(helpOption)) {
|
2022-04-09 17:44:00 -04:00
|
|
|
parser.showHelp();
|
|
|
|
}
|
|
|
|
|
2022-09-07 23:45:33 -04:00
|
|
|
#ifdef ENABLE_STEAM
|
2022-09-06 10:54:34 -04:00
|
|
|
LauncherCore c(parser.isSet(steamOption));
|
2022-09-07 23:45:33 -04:00
|
|
|
#else
|
|
|
|
LauncherCore c(false);
|
|
|
|
#endif
|
2022-10-24 13:03:29 -04:00
|
|
|
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
|
|
|
}
|