From 71ed154b81abbd002d78c09c2dada8a2ad3fa73e Mon Sep 17 00:00:00 2001 From: Kolo <67389779+JustKolosaki@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:24:49 +0100 Subject: [PATCH] fix that one annoying ass bug for events --- .../charting/toolboxes/ChartEditorEventDataToolbox.hx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx index 70580300ea..27d5f21c92 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx @@ -74,6 +74,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox return; } + chartEditorState.eventDataToPlace = {}; buildEventDataFormFromSchema(toolboxEventsDataGrid, schema, chartEditorState.eventKindToPlace); if (!_initializing && chartEditorState.currentEventSelection.length > 0) @@ -98,6 +99,8 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox { super.refresh(); + toolboxEventsEventKind.pauseEvent(UIEvent.CHANGE, true); + var newDropdownElement = ChartEditorDropdowns.findDropdownElement(chartEditorState.eventKindToPlace, toolboxEventsEventKind); if (newDropdownElement == null) @@ -156,6 +159,8 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox } } } + + toolboxEventsEventKind.resumeEvent(UIEvent.CHANGE, true, true); } var lastEventKind:String = 'unknown'; @@ -170,8 +175,6 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox // Clear the frame. target.removeAllComponents(); - chartEditorState.eventDataToPlace = {}; - for (field in schema) { if (field == null) continue; @@ -264,7 +267,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox var value = event.target.value; if (field.type == ENUM) { - value = event.target.value.value; + value = event.target.value?.value; } else if (field.type == BOOL) {