From 5f5a6a84fece5a66aeb175747a12b9e2f6cc0dff Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Mon, 22 May 2023 15:00:19 -0700 Subject: [PATCH] Backwards compat on old events --- source/funkin/backend/chart/Chart.hx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/funkin/backend/chart/Chart.hx b/source/funkin/backend/chart/Chart.hx index 8253a7a8..e950fa9e 100644 --- a/source/funkin/backend/chart/Chart.hx +++ b/source/funkin/backend/chart/Chart.hx @@ -108,6 +108,22 @@ class Chart { */ #if REGION if (Reflect.hasField(data, "codenameChart") && Reflect.field(data, "codenameChart") == true) { + // backward compat on events since its caused problems + var eventTypesToString:Map = [ + -1 => "HScript Call", + 0 => "Unknown", + 1 => "Camera Movement", + 2 => "BPM Change", + 3 => "Alt Animation Toggle", + ]; + + for (event in cast(data.events, Array)) { + if (Reflect.hasField(event, "type")) { + event.name = eventTypesToString[event.type]; + event.type = null; + } + } + // codename chart base = data; } else {