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

Add a dedicated free trial setting, which makes more sense

Previously I had this listed as another "license type" which makes no
sense, considering that Steam free trial accounts can exist.
This commit is contained in:
Joshua Goins 2022-05-09 16:02:07 -04:00
parent e8d1485256
commit f6e56e4b15
5 changed files with 17 additions and 3 deletions

View file

@ -17,8 +17,7 @@ class Watchdog;
enum class GameLicense {
WindowsStandalone,
WindowsSteam,
macOS,
FreeTrial
macOS
};
enum class WineType {
@ -86,6 +85,7 @@ struct ProfileSettings {
bool useOneTimePassword = false;
GameLicense license = GameLicense::WindowsStandalone;
bool isFreeTrial = false;
};
struct AppSettings {

View file

@ -54,6 +54,7 @@ private:
QLineEdit* lobbyServerURL = nullptr;
QCheckBox* rememberUsernameBox = nullptr, *rememberPasswordBox = nullptr;
QComboBox* gameLicenseBox = nullptr;
QCheckBox* freeTrialBox = nullptr;
QCheckBox* useOneTimePassword = nullptr;
// dalamud

View file

@ -414,6 +414,7 @@ void LauncherCore::readInitialInformation() {
profile.rememberPassword = settings.value("rememberPassword", defaultSettings.rememberPassword).toBool();
profile.useOneTimePassword = settings.value("useOneTimePassword", defaultSettings.useOneTimePassword).toBool();
profile.license = (GameLicense)settings.value("license", (int)defaultSettings.license).toInt();
profile.isFreeTrial = settings.value("isFreeTrial", defaultSettings.isFreeTrial).toBool();
profile.useDX9 = settings.value("useDX9", defaultSettings.useDX9).toBool();
@ -655,6 +656,7 @@ void LauncherCore::saveSettings() {
settings.setValue("rememberPassword", profile.rememberPassword);
settings.setValue("useOneTimePassword", profile.useOneTimePassword);
settings.setValue("license", (int)profile.license);
settings.setValue("isFreeTrial", profile.isFreeTrial);
settings.setValue("enableDalamud", profile.dalamud.enabled);
settings.setValue("dalamudOptOut", profile.dalamud.optOutOfMbCollection);

View file

@ -221,6 +221,15 @@ SettingsWindow::SettingsWindow(int defaultTab, LauncherWindow& window, LauncherC
loginBoxLayout->addRow("Game License", gameLicenseBox);
freeTrialBox = new QCheckBox();
connect(freeTrialBox, &QCheckBox::stateChanged, [=](int) {
getCurrentProfile().isFreeTrial =
freeTrialBox->isChecked();
this->core.saveSettings();
});
loginBoxLayout->addRow("Is Free Trial", freeTrialBox);
rememberUsernameBox = new QCheckBox();
connect(rememberUsernameBox, &QCheckBox::stateChanged, [=](int) {
getCurrentProfile().rememberUsername =
@ -555,6 +564,8 @@ void SettingsWindow::reloadControls() {
gameLicenseBox->setToolTip("");
}
freeTrialBox->setChecked(profile.isFreeTrial);
// dalamud
enableDalamudBox->setChecked(profile.dalamud.enabled);
if(core.dalamudVersion.isEmpty()) {

View file

@ -37,7 +37,7 @@ void SquareLauncher::getStored(const LoginInformation& info) {
query.addQueryItem("lng", "en");
// for some reason, we always use region 3. the actual region is acquired later
query.addQueryItem("rgn", "3");
query.addQueryItem("isft", info.settings->license == GameLicense::FreeTrial ? "1" : "0");
query.addQueryItem("isft", info.settings->isFreeTrial ? "1" : "0");
query.addQueryItem("cssmode", "1");
query.addQueryItem("isnew", "1");
query.addQueryItem("launchver", "3");