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:
parent
930b3fcbdc
commit
763a524766
5 changed files with 27 additions and 8 deletions
|
@ -33,6 +33,10 @@ struct ProfileSettings {
|
||||||
QList<QString> expansionVersions;
|
QList<QString> expansionVersions;
|
||||||
bool enableWatchdog = false;
|
bool enableWatchdog = false;
|
||||||
|
|
||||||
|
bool isGameInstalled() const {
|
||||||
|
return !gameVersion.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
// wine
|
// wine
|
||||||
// 0 = system, 1 = custom, 2 = built-in (mac only)
|
// 0 = system, 1 = custom, 2 = built-in (mac only)
|
||||||
// TODO: yes, i know this should be an enum
|
// TODO: yes, i know this should be an enum
|
||||||
|
|
|
@ -32,6 +32,11 @@ private:
|
||||||
QLabel* bannerImageView;
|
QLabel* bannerImageView;
|
||||||
QTreeWidget* newsListView;
|
QTreeWidget* newsListView;
|
||||||
|
|
||||||
|
QAction* launchOfficial;
|
||||||
|
QAction* launchSysInfo;
|
||||||
|
QAction* launchCfgBackup;
|
||||||
|
QAction* openGameDir;
|
||||||
|
|
||||||
QComboBox* profileSelect;
|
QComboBox* profileSelect;
|
||||||
QLineEdit* usernameEdit, *passwordEdit;
|
QLineEdit* usernameEdit, *passwordEdit;
|
||||||
QLineEdit* otpEdit;
|
QLineEdit* otpEdit;
|
||||||
|
|
|
@ -33,6 +33,7 @@ private:
|
||||||
QComboBox* directXCombo = nullptr;
|
QComboBox* directXCombo = nullptr;
|
||||||
QLineEdit* currentGameDirectory = nullptr;
|
QLineEdit* currentGameDirectory = nullptr;
|
||||||
QLabel* expansionVersionLabel = nullptr;
|
QLabel* expansionVersionLabel = nullptr;
|
||||||
|
QPushButton* gameDirectoryButton = nullptr;
|
||||||
|
|
||||||
// wine
|
// wine
|
||||||
QComboBox* wineVersionCombo;
|
QComboBox* wineVersionCombo;
|
||||||
|
|
|
@ -24,19 +24,19 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo
|
||||||
|
|
||||||
QMenu* toolsMenu = menuBar()->addMenu("Tools");
|
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"));
|
launchOfficial->setIcon(QIcon::fromTheme("application-x-executable"));
|
||||||
connect(launchOfficial, &QAction::triggered, [=] {
|
connect(launchOfficial, &QAction::triggered, [=] {
|
||||||
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivboot.exe"});
|
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"));
|
launchSysInfo->setIcon(QIcon::fromTheme("application-x-executable"));
|
||||||
connect(launchSysInfo, &QAction::triggered, [=] {
|
connect(launchSysInfo, &QAction::triggered, [=] {
|
||||||
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivsysinfo64.exe"});
|
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"));
|
launchCfgBackup->setIcon(QIcon::fromTheme("application-x-executable"));
|
||||||
connect(launchCfgBackup, &QAction::triggered, [=] {
|
connect(launchCfgBackup, &QAction::triggered, [=] {
|
||||||
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivconfig64.exe"});
|
this->core.launchExecutable(currentProfile(), {currentProfile().gamePath + "/boot/ffxivconfig64.exe"});
|
||||||
|
@ -44,7 +44,7 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo
|
||||||
|
|
||||||
toolsMenu->addSeparator();
|
toolsMenu->addSeparator();
|
||||||
|
|
||||||
QAction* openGameDir = toolsMenu->addAction("Open Game Directory...");
|
openGameDir = toolsMenu->addAction("Open Game Directory...");
|
||||||
openGameDir->setIcon(QIcon::fromTheme("document-open"));
|
openGameDir->setIcon(QIcon::fromTheme("document-open"));
|
||||||
connect(openGameDir, &QAction::triggered, [=] {
|
connect(openGameDir, &QAction::triggered, [=] {
|
||||||
openPath(currentProfile().gamePath);
|
openPath(currentProfile().gamePath);
|
||||||
|
@ -312,18 +312,25 @@ void LauncherWindow::reloadControls() {
|
||||||
}
|
}
|
||||||
#endif
|
#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) {
|
if(canLogin) {
|
||||||
loginButton->setText("Login");
|
loginButton->setText("Login");
|
||||||
} else {
|
} else if(!core.squareLauncher->isGateOpen) {
|
||||||
loginButton->setText("Login (Maintenance is in progress)");
|
loginButton->setText("Login (Maintenance is in progress)");
|
||||||
|
} else {
|
||||||
|
loginButton->setText("Login (Game is not installed)");
|
||||||
}
|
}
|
||||||
|
|
||||||
loginButton->setEnabled(canLogin);
|
loginButton->setEnabled(canLogin);
|
||||||
registerButton->setEnabled(currentProfile().isSapphire);
|
registerButton->setEnabled(currentProfile().isSapphire);
|
||||||
otpEdit->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;
|
currentlyReloadingControls = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC
|
||||||
});
|
});
|
||||||
gameDirButtonLayout->addWidget(selectDirectoryButton);
|
gameDirButtonLayout->addWidget(selectDirectoryButton);
|
||||||
|
|
||||||
auto gameDirectoryButton = new QPushButton("Open Game Directory");
|
gameDirectoryButton = new QPushButton("Open Game Directory");
|
||||||
connect(gameDirectoryButton, &QPushButton::pressed,
|
connect(gameDirectoryButton, &QPushButton::pressed,
|
||||||
[&window, this] { window.openPath(getCurrentProfile().gamePath); });
|
[&window, this] { window.openPath(getCurrentProfile().gamePath); });
|
||||||
gameDirButtonLayout->addWidget(gameDirectoryButton);
|
gameDirButtonLayout->addWidget(gameDirectoryButton);
|
||||||
|
@ -143,6 +143,8 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gameDirectoryButton->setEnabled(getCurrentProfile().isGameInstalled());
|
||||||
|
|
||||||
expansionVersionLabel = new QLabel();
|
expansionVersionLabel = new QLabel();
|
||||||
gameBoxLayout->addRow("Game Version", expansionVersionLabel);
|
gameBoxLayout->addRow("Game Version", expansionVersionLabel);
|
||||||
|
|
||||||
|
@ -410,7 +412,7 @@ void SettingsWindow::reloadControls() {
|
||||||
directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0);
|
directXCombo->setCurrentIndex(profile.useDX9 ? 1 : 0);
|
||||||
currentGameDirectory->setText(profile.gamePath);
|
currentGameDirectory->setText(profile.gamePath);
|
||||||
|
|
||||||
if(profile.gameVersion.isEmpty()) {
|
if(!profile.isGameInstalled()) {
|
||||||
expansionVersionLabel->setText("No game installed.");
|
expansionVersionLabel->setText("No game installed.");
|
||||||
} else {
|
} else {
|
||||||
QString expacString;
|
QString expacString;
|
||||||
|
|
Loading…
Add table
Reference in a new issue