Skip to content

Commit 47a3526

Browse files
Allow string values for radio buttons in options menu (#896)
* Allow string values for radio buttons in options menu :D NOT sure why this wasn't already a thing.... But it's here now * Fix NaN check --------- Co-authored-by: Ralty <78720179+Raltyro@users.noreply.github.com>
1 parent bbb16f4 commit 47a3526

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/funkin/options/OptionsMenu.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ class OptionsMenu extends TreeMenu {
202202
Logs.warn("A radio option requires an \"id\" for option saving.");
203203
continue;
204204
}
205-
var v:Dynamic = Std.parseFloat(node.att.value);
206-
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));
205+
var f = Std.parseFloat(node.att.value);
206+
options.push(new RadioButton(screen, name, desc, node.att.id, f == Math.NaN ? node.att.value : f, null, FlxG.save.data, node.has.forId ? node.att.forId : null));
207207
case 'slider':
208208
if (!node.has.id) {
209209
Logs.warn("A slider option requires an \"id\" for option saving.");
@@ -223,4 +223,4 @@ class OptionsMenu extends TreeMenu {
223223

224224
return options;
225225
}
226-
}
226+
}

0 commit comments

Comments
 (0)