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

Make it much more clear when the game is not installed

Now the "open game directory" buttons in settings is turned off, and
buttons that could possibly result in a broken launch is now disabled
too.
This commit is contained in:
Joshua Goins 2022-04-09 16:56:17 -04:00
parent 930b3fcbdc
commit 763a524766
5 changed files with 27 additions and 8 deletions

View file

@ -33,6 +33,10 @@ struct ProfileSettings {
QList<QString> expansionVersions;
bool enableWatchdog = false;
bool isGameInstalled() const {
return !gameVersion.isEmpty();
}
// wine
// 0 = system, 1 = custom, 2 = built-in (mac only)
// TODO: yes, i know this should be an enum

View file

@ -32,6 +32,11 @@ private:
QLabel* bannerImageView;
QTreeWidget* newsListView;
QAction* launchOfficial;
QAction* launchSysInfo;
QAction* launchCfgBackup;
QAction* openGameDir;
QComboBox* profileSelect;
QLineEdit* usernameEdit, *passwordEdit;
QLineEdit* otpEdit;

View file

@ -33,6 +33,7 @@ private:
QComboBox* directXCombo = nullptr;
QLineEdit* currentGameDirectory = nullptr;
QLabel* expansionVersionLabel = nullptr;
QPushButton* gameDirectoryButton = nullptr;
// wine
QComboBox* wineVersionCombo;

View file

@ -24,19 +24,19 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo
QMenu* toolsMenu = menuBar()->addMenu("Tools");
QAction* launchOfficial = toolsMenu->addAction("Open Official Client...");
launchOfficial = toolsMenu->addAction("Open Official Client...");
launchOfficial->setIcon(QIcon::fromTheme("application-x-executable"));
connect(launchOfficial, &QAction::triggered, [=] {
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivboot.exe"});
});
QAction* launchSysInfo = toolsMenu->addAction("Open System Info...");
launchSysInfo = toolsMenu->addAction("Open System Info...");
launchSysInfo->setIcon(QIcon::fromTheme("application-x-executable"));
connect(launchSysInfo, &QAction::triggered, [=] {
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivsysinfo64.exe"});
});
QAction* launchCfgBackup = toolsMenu->addAction("Open Config Backup...");
launchCfgBackup = toolsMenu->addAction("Open Config Backup...");
launchCfgBackup->setIcon(QIcon::fromTheme("application-x-executable"));
connect(launchCfgBackup, &QAction::triggered, [=] {
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivconfig64.exe"});
@ -44,7 +44,7 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo
toolsMenu->addSeparator();
QAction* openGameDir = toolsMenu->addAction("Open Game Directory...");
openGameDir = toolsMenu->addAction("Open Game Directory...");
openGameDir->setIcon(QIcon::fromTheme("document-open"));
connect(openGameDir, &QAction::triggered, [=] {
openPath(currentProfile().gamePath);
@ -312,18 +312,25 @@ void LauncherWindow::reloadControls() {
}
#endif
const bool canLogin = currentProfile().isSapphire || (!currentProfile().isSapphire && core.squareLauncher->isGateOpen);
const bool canLogin = currentProfile().isSapphire || (!currentProfile().isSapphire && core.squareLauncher->isGateOpen) && currentProfile().isGameInstalled();
if(canLogin) {
loginButton->setText("Login");
} else {
} else if(!core.squareLauncher->isGateOpen) {
loginButton->setText("Login (Maintenance is in progress)");
} else {
loginButton->setText("Login (Game is not installed)");
}
loginButton->setEnabled(canLogin);
registerButton->setEnabled(currentProfile().isSapphire);
otpEdit->setEnabled(!currentProfile().isSapphire);
launchOfficial->setEnabled(currentProfile().isGameInstalled());
launchSysInfo->setEnabled(currentProfile().isGameInstalled());
launchCfgBackup->setEnabled(currentProfile().isGameInstalled());
openGameDir->setEnabled(currentProfile().isGameInstalled());
currentlyReloadingControls = false;
}

View file

@ -127,7 +127,7 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC
});
gameDirButtonLayout->addWidget(selectDirectoryButton);
auto gameDirectoryButton = new QPushButton("Open Game Directory");
gameDirectoryButton = new QPushButton("Open Game Directory");
connect(gameDirectoryButton, &QPushButton::pressed,
[&window, this] { window.openPath(getCurrentProfile().gamePath); });
gameDirButtonLayout->addWidget(gameDirectoryButton);
@ -143,6 +143,8 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC
});
#endif
gameDirectoryButton->setEnabled(getCurrentProfile().isGameInstalled());
expansionVersionLabel = new QLabel();
gameBoxLayout->addRow("Game Version", expansionVersionLabel);
@ -410,7 +412,7 @@ void SettingsWindow::reloadControls() {
directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0);
currentGameDirectory->setText(profile.gamePath);
if(profile.gameVersion.isEmpty()) {
if(!profile.isGameInstalled()) {
expansionVersionLabel->setText("No game installed.");
} else {
QString expacString;