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

Reread game version once profile game directory changed

This commit is contained in:
redstrate 2021-11-09 13:11:21 -05:00
parent dfb4afb12e
commit e1d4be7aff
3 changed files with 11 additions and 5 deletions

View file

@ -70,8 +70,7 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window
this->reloadControls();
this->window.saveSettings();
// TODO: replace this call with a dedicated "read version information" call or something similar
//this->window.readInitialInformation();
this->window.readGameVersion();
});
gameBoxLayout->addWidget(selectDirectoryButton);

View file

@ -184,9 +184,6 @@ void LauncherWindow::readInitialInformation() {
#endif
}
profile.bootVersion = readVersion(profile.gamePath + "/boot/ffxivboot.ver");
profile.gameVersion = readVersion(profile.gamePath + "/game/ffxivgame.ver");
profile.isSapphire = settings.value("isSapphire", false).toBool();
profile.lobbyURL = settings.value("lobbyURL", "").toString();
profile.rememberUsername = settings.value("rememberUsername", false).toBool();
@ -202,6 +199,15 @@ void LauncherWindow::readInitialInformation() {
profileSettings.append(profile);
}
readGameVersion();
}
void LauncherWindow::readGameVersion() {
for(auto& profile : profileSettings) {
profile.bootVersion = readVersion(profile.gamePath + "/boot/ffxivboot.ver");
profile.gameVersion = readVersion(profile.gamePath + "/game/ffxivgame.ver");
}
}
LauncherWindow::LauncherWindow(QWidget* parent) :

View file

@ -70,6 +70,7 @@ public:
void setSSL(QNetworkRequest& request);
QString readVersion(QString path);
void readInitialInformation();
void readGameVersion();
void saveSettings();
QSettings settings;