Skip to content

Commit

Permalink
Remove use of old Launcher Settings (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzats authored Nov 7, 2023
1 parent 51f03da commit 2791df3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import org.terasology.launcher.settings.LauncherSettings;
import org.terasology.launcher.settings.Settings;
import org.terasology.launcher.util.I18N;
import org.terasology.launcher.util.JavaHeapSize;
Expand Down Expand Up @@ -149,13 +148,15 @@ protected void saveSettingsAction(ActionEvent event) {

//save userParameters (java & game), if textfield is empty then set to defaults
if (userJavaParametersField.getText().isEmpty()) {
launcherSettings.userJavaParameters.setAll(asParameterList(LauncherSettings.USER_JAVA_PARAMETERS_DEFAULT));
logger.debug("Reapplying default Java parameters: {}", Settings.getDefault().userJavaParameters);
launcherSettings.userJavaParameters.setAll(Settings.getDefault().userJavaParameters);
} else {
logger.debug("User defined Java parameters: {}", userJavaParametersField.getText());
launcherSettings.userJavaParameters.setAll(asParameterList(userJavaParametersField.getText()));
}
if (userGameParametersField.getText().isEmpty()) {
launcherSettings.userGameParameters.setAll(asParameterList(LauncherSettings.USER_GAME_PARAMETERS_DEFAULT));
logger.debug("Reapplying default game parameters: {}", Settings.getDefault().userGameParameters);
launcherSettings.userGameParameters.setAll(Settings.getDefault().userGameParameters);
} else {
logger.debug("User defined game parameters: {}", userGameParametersField.getText());
launcherSettings.userGameParameters.setAll(asParameterList(userGameParametersField.getText()));
Expand Down Expand Up @@ -353,7 +354,7 @@ private void updateLogLevelSelection() {

private void initUserParameterFields() {
//if the VM parameters are left default do not display, the prompt message will show
List<String> defaultParams = asParameterList(LauncherSettings.USER_JAVA_PARAMETERS_DEFAULT);
List<String> defaultParams = Settings.getDefault().userJavaParameters;
List<String> userJavaParams = launcherSettings.userJavaParameters.get();
if (!(defaultParams.containsAll(userJavaParams) && userJavaParams.containsAll(defaultParams))) {
userJavaParametersField.setText(String.join(" ", launcherSettings.userJavaParameters.get()));
Expand Down

0 comments on commit 2791df3

Please sign in to comment.