From fbcc73dceebdcfcba2b14922c6b7c38adae0b086 Mon Sep 17 00:00:00 2001 From: lemz Date: Mon, 17 Jun 2024 17:21:52 +0200 Subject: [PATCH] unhardcode notestyledropdown --- .../ui/debug/charting/util/ChartEditorDropdowns.hx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/funkin/ui/debug/charting/util/ChartEditorDropdowns.hx b/source/funkin/ui/debug/charting/util/ChartEditorDropdowns.hx index 65ec2a0c3..6a426c391 100644 --- a/source/funkin/ui/debug/charting/util/ChartEditorDropdowns.hx +++ b/source/funkin/ui/debug/charting/util/ChartEditorDropdowns.hx @@ -126,10 +126,7 @@ class ChartEditorDropdowns { dropDown.dataSource.clear(); - // hardcoding this because i dont want note kind styles to be shown as well - // there is probably a better solution - // var noteStyleIds:Array = NoteStyleRegistry.instance.listEntryIds(); - var noteStyleIds:Array = ['funkin', 'pixel']; + var noteStyleIds:Array = NoteStyleRegistry.instance.listEntryIds(); var returnValue:DropDownEntry = {id: "funkin", text: "Funkin'"}; @@ -138,6 +135,14 @@ class ChartEditorDropdowns var noteStyle:Null = NoteStyleRegistry.instance.fetchEntry(noteStyleId); if (noteStyle == null) continue; + // check if the note style has all necessary assets (strums, notes, holdNotes) + if (noteStyle._data?.assets?.noteStrumline == null + || noteStyle._data?.assets?.note == null + || noteStyle._data?.assets?.holdNote == null) + { + continue; + } + var value = {id: noteStyleId, text: noteStyle.getName()}; if (startingStyleId == noteStyleId) returnValue = value;