From 9d1a27d4046e6de0bd46f9a82469d3dc60cd4d32 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Mon, 28 Oct 2024 23:11:18 +0100 Subject: [PATCH] Small fix to dropdowns --- source/funkin/editors/charter/CharterEventScreen.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/funkin/editors/charter/CharterEventScreen.hx b/source/funkin/editors/charter/CharterEventScreen.hx index 20d84715..f3df422a 100644 --- a/source/funkin/editors/charter/CharterEventScreen.hx +++ b/source/funkin/editors/charter/CharterEventScreen.hx @@ -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: