Skip to content

Commit 3de652c

Browse files
committed
Merge Options XML crash fix PR
1 parent 8303e7e commit 3de652c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

source/funkin/options/OptionsMenu.hx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ class OptionsMenu extends TreeMenu {
151151
var options:Array<FlxSprite> = [];
152152

153153
for(node in xml.elements) {
154+
switch(node.name) {
155+
case "separator":
156+
options.push(new Separator(node.has.height ? Std.parseFloat(node.att.height) : null));
157+
}
158+
154159
if (!node.has.name) {
155160
Logs.warn("An option node requires a name attribute.");
156161
continue;
@@ -165,7 +170,6 @@ class OptionsMenu extends TreeMenu {
165170
continue;
166171
}
167172
options.push(new Checkbox(name, desc, node.att.id, null, FlxG.save.data));
168-
169173
case "number":
170174
if (!node.has.id) {
171175
Logs.warn("A number option requires an \"id\" for option saving.");
@@ -195,7 +199,7 @@ class OptionsMenu extends TreeMenu {
195199
continue;
196200
}
197201
var v:Dynamic = Std.parseFloat(node.att.value);
198-
options.push(new RadioButton(screen, name, desc, node.att.id, v != null ? v : node.att.value, null, FlxG.save.data, node.att.forId));
202+
options.push(new RadioButton(screen, name, desc, node.att.id, v != null ? v : node.att.value, null, FlxG.save.data, node.has.forId ? node.att.forId : null));
199203
case 'slider':
200204
if (!node.has.id) {
201205
Logs.warn("A slider option requires an \"id\" for option saving.");
@@ -204,10 +208,6 @@ class OptionsMenu extends TreeMenu {
204208
var step = node.has.change ? Std.parseFloat(node.att.change) : (node.has.step ? Std.parseFloat(node.att.step) : null);
205209
var segments = node.has.segments ? Std.parseInt(node.att.segments) : 5;
206210
options.push(new SliderOption(name, desc, Std.parseFloat(node.att.min), Std.parseFloat(node.att.max), step, segments, node.att.id, Std.parseInt(node.att.barWidth), null, FlxG.save.data));
207-
208-
case 'separator':
209-
options.push(new Separator(Std.parseInt(node.att.height)));
210-
211211
case "menu":
212212
options.push(new TextOption(name, desc, ' >', () -> {
213213
var screen = new TreeMenuScreen(name, desc);

source/funkin/options/type/Separator.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import flixel.FlxBasic;
66

77
class Separator extends FlxSprite {
88
var separatorHeight:Float;
9-
public function new(height = 67) {
9+
public function new(height = 67.0) {
1010
super();
1111
separatorHeight = height;
1212
}

0 commit comments

Comments
 (0)