Small fix to dropdowns

This commit is contained in:
Ne_Eo
2024-10-28 23:11:18 +01:00
parent 2f63f8ac41
commit 9d1a27d404
@@ -162,7 +162,11 @@ class CharterEventScreen extends UISubstateWindow {
colorWheel;
case TDropDown(options):
addLabel();
var dropdown = new UIDropDown(eventName.x, y, 320, 32, options, Std.int(Math.abs(options.indexOf(cast value))));
var optionIndex = options.indexOf(cast value);
if(optionIndex < 0) {
optionIndex = 0;
}
var dropdown = new UIDropDown(eventName.x, y, 320, 32, options, optionIndex);
paramsPanel.add(dropdown); paramsFields.push(dropdown);
dropdown;
case TCharacter: