diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js
index fa657f75..05a3cf12 100644
--- a/Launcher/runtime/dialog/dialog.js
+++ b/Launcher/runtime/dialog/dialog.js
@@ -172,6 +172,7 @@ function goSettings(event) {
}
// Show settings overlay
+ updateOptional();
overlay.show(settingsOverlay.overlay, null);
}
diff --git a/Launcher/runtime/dialog/overlay/options/options.fxml b/Launcher/runtime/dialog/overlay/options/options.fxml
index 5eeaf696..44ea8b93 100644
--- a/Launcher/runtime/dialog/overlay/options/options.fxml
+++ b/Launcher/runtime/dialog/overlay/options/options.fxml
@@ -4,24 +4,22 @@
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/Launcher/runtime/dialog/overlay/options/options.js b/Launcher/runtime/dialog/overlay/options/options.js
index d2f770de..0d530327 100644
--- a/Launcher/runtime/dialog/overlay/options/options.js
+++ b/Launcher/runtime/dialog/overlay/options/options.js
@@ -42,9 +42,45 @@ var options = {
// Lookup autoEnter checkbox
var holder = options.overlay.lookup("#holder");
-
// Lookup apply settings button
holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
},
};
+function updateOptional()
+{
+ var holder = options.overlay.lookup("#holderpane");
+ var nodelist = new java.util.ArrayList;
+
+ holder.getChildren().forEach(function(node,i,arr) {
+ if(node instanceof javafx.scene.control.CheckBox)
+ nodelist.add(node);
+ });
+ nodelist.forEach(function(node,i,arr) {
+ holder.getChildren().remove(node);
+ });
+ var profile = profilesList[serverHolder.old].object;
+ var list = profile.getOptional();
+ var checkboxlist = new java.util.ArrayList;
+ list.forEach(function(modfile,i,arr) {
+ var testMod = new javafx.scene.control.CheckBox(modfile.string);
+ testMod.setSelected(modfile.mark);
+ //testMod.setLayoutY(2+3*i);
+ //testMod.setLayoutX(2);
+ testMod.setOnAction(function(event) {
+ var isSelected = event.getSource().isSelected();
+ if(isSelected)
+ {
+ profile.markOptional(modfile.string);
+ LogHelper.debug("Selected mod %s", modfile.string);
+ }
+ else
+ {
+ profile.unmarkOptional(modfile.string);
+ LogHelper.debug("Unselected mod %s", modfile.string);
+ }
+ });
+ checkboxlist.add(testMod);
+ });
+ holder.getChildren().addAll(checkboxlist);
+}
diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java
index f157553d..5d371457 100644
--- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java
+++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java
@@ -76,7 +76,9 @@ public String toString() {
private final IntegerConfigEntry serverPort;
public static class MarkedString {
+ @LauncherAPI
public String string;
+ @LauncherAPI
public boolean mark;
public MarkedString(String string, boolean mark) {