Skip to content

Commit 4e477d4

Browse files
committed
Remove the game version field from settings
1 parent b851568 commit 4e477d4

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

launcher/src/main/java/net/modtale/launcher/ui/settings/LauncherSettingsController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,12 @@ private Node libraryDefaultsSection() {
265265
VBox defaults = settingsSection("settings.library.section", "settings.library.description",
266266
LauncherIcons.Glyph.BOX);
267267
GridPane grid = settingsGrid();
268-
addField(grid, 0, I18N.binding("settings.library.gameVersion"), form.gameVersionField());
269268
VBox toggles = new VBox(10,
270269
toggleCard(form.includeDependenciesCheck()),
271270
toggleCard(form.includeOptionalCheck()),
272271
toggleCard(form.autoUpdatesCheck()));
273272
toggles.getStyleClass().add("settings-toggle-row");
274-
addField(grid, 1, I18N.binding("settings.library.projectDefaults"), toggles);
273+
addField(grid, 0, I18N.binding("settings.library.projectDefaults"), toggles);
275274
defaults.getChildren().add(grid);
276275
return defaults;
277276
}

launcher/src/main/java/net/modtale/launcher/ui/settings/LauncherSettingsForm.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
public final class LauncherSettingsForm {
2525

2626
private final TextField modsPathField = new TextField();
27-
private final TextField gameVersionField = new TextField();
2827
private final TextField hytaleGamePathField = new TextField();
2928
private final TextField hytaleUserDataPathField = new TextField();
3029
private final TextField hytaleJavaPathField = new TextField();
@@ -60,7 +59,7 @@ public String fromString(String value) {
6059
}
6160
});
6261
hytaleBranchCombo.setOnAction(event -> hytaleVersionCombo.getItems().clear());
63-
styleInput(modsPathField, gameVersionField, hytaleGamePathField, hytaleUserDataPathField, hytaleJavaPathField,
62+
styleInput(modsPathField, hytaleGamePathField, hytaleUserDataPathField, hytaleJavaPathField,
6463
playHytaleGamePathField, playHytaleUserDataPathField, playHytaleJavaPathField);
6564
launcherChannelCombo.setItems(FXCollections.observableArrayList("stable", "develop"));
6665
styleCombo(localeCombo, hytaleBranchCombo, hytaleVersionCombo, launcherChannelCombo);
@@ -74,10 +73,6 @@ public TextField modsPathField() {
7473
return modsPathField;
7574
}
7675

77-
public TextField gameVersionField() {
78-
return gameVersionField;
79-
}
80-
8176
public TextField hytaleGamePathField() {
8277
return hytaleGamePathField;
8378
}
@@ -143,7 +138,6 @@ public CheckBox launcherAutoUpdatesCheck() {
143138

144139
public void applyTo(LauncherSettings settings, LauncherView currentView, ModtaleApiClient apiClient) {
145140
settings.setHytaleModsPath(modsPathField.getText());
146-
settings.setGameVersion(gameVersionField.getText());
147141
boolean playView = currentView == LauncherView.PLAY;
148142
settings.setHytaleGamePath(playView ? playHytaleGamePathField.getText() : hytaleGamePathField.getText());
149143
settings.setHytaleUserDataPath(playView ? playHytaleUserDataPathField.getText() : hytaleUserDataPathField.getText());
@@ -168,7 +162,6 @@ public void applyTo(LauncherSettings settings, LauncherView currentView, Modtale
168162

169163
public void reloadFrom(LauncherSettings settings) {
170164
modsPathField.setText(settings.getHytaleModsPath());
171-
gameVersionField.setText(settings.getGameVersion());
172165
hytaleGamePathField.setText(settings.getHytaleGamePath());
173166
hytaleUserDataPathField.setText(settings.getHytaleUserDataPath());
174167
hytaleJavaPathField.setText(settings.getHytaleJavaPath());

launcher/src/test/java/net/modtale/launcher/ui/settings/LauncherSettingsControllerPersistenceTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ void categoryNavigationRetainsUnsavedEditsAndAlwaysKeepsOneSelection() throws Ex
4040
var buttons = view.lookupAll(".settings-category").stream()
4141
.map(node -> (javafx.scene.control.ToggleButton) node).toList();
4242
assertEquals(4, buttons.size());
43-
controller.form().gameVersionField().setText("0.6.0");
43+
controller.form().includeOptionalCheck().setSelected(true);
4444
buttons.forEach(button -> { button.fire(); button.fire(); });
4545
assertEquals(1, buttons.stream().filter(javafx.scene.control.ToggleButton::isSelected).count());
46-
assertEquals("0.6.0", controller.form().gameVersionField().getText());
46+
assertEquals(true, controller.form().includeOptionalCheck().isSelected());
4747
controller.saveFromFields(false);
48-
assertEquals("0.6.0", controller.settings().getGameVersion());
48+
assertEquals(true, controller.settings().isIncludeOptionalDependencies());
4949
});
5050
}
5151

@@ -56,13 +56,15 @@ void earlySavePreservesExplicitPathsBeforeViewsReloadControls() throws Exception
5656
LauncherSettings settings = new LauncherSettings();
5757
String userData = root.resolve("custom/UserData").toString();
5858
String mods = root.resolve("separate/Mods").toString();
59+
settings.setGameVersion("0.6.0");
5960
settings.setHytaleUserDataPath(userData);
6061
settings.setHytaleModsPath(mods);
6162
store.save(settings);
6263
for (LauncherView view : List.of(LauncherView.PLAY, LauncherView.SETTINGS)) {
6364
var controller = new LauncherSettingsController(store,
6465
new ModtaleApiClient("http://localhost"), () -> null, () -> view);
6566
controller.saveFromFields(false);
67+
assertEquals("0.6.0", store.load().getGameVersion());
6668
assertEquals(userData, store.load().getHytaleUserDataPath());
6769
assertEquals(mods, store.load().getHytaleModsPath());
6870
}

0 commit comments

Comments
 (0)