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>
This commit is contained in:
@@ -202,8 +202,8 @@ class OptionsMenu extends TreeMenu {
|
||||
Logs.warn("A radio option requires an \"id\" for option saving.");
|
||||
continue;
|
||||
}
|
||||
var v:Dynamic = Std.parseFloat(node.att.value);
|
||||
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));
|
||||
var f = Std.parseFloat(node.att.value);
|
||||
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));
|
||||
case 'slider':
|
||||
if (!node.has.id) {
|
||||
Logs.warn("A slider option requires an \"id\" for option saving.");
|
||||
@@ -223,4 +223,4 @@ class OptionsMenu extends TreeMenu {
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user