From 0543f6c4012dfa66c39eedd0f62da095da82e228 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sat, 16 Sep 2023 12:40:08 -0700 Subject: [PATCH] hopefully fix empty events --- .../{drag-strumline.png => strumline-drag.png} | Bin source/funkin/editors/charter/CharterEventGroup.hx | 11 ++++++++++- source/funkin/editors/charter/CharterStrumline.hx | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) rename assets/images/editors/charter/{drag-strumline.png => strumline-drag.png} (100%) diff --git a/assets/images/editors/charter/drag-strumline.png b/assets/images/editors/charter/strumline-drag.png similarity index 100% rename from assets/images/editors/charter/drag-strumline.png rename to assets/images/editors/charter/strumline-drag.png diff --git a/source/funkin/editors/charter/CharterEventGroup.hx b/source/funkin/editors/charter/CharterEventGroup.hx index 06450ddb..5022b3a4 100644 --- a/source/funkin/editors/charter/CharterEventGroup.hx +++ b/source/funkin/editors/charter/CharterEventGroup.hx @@ -8,6 +8,7 @@ class CharterEventGroup extends FlxTypedGroup { var __lastSort:Int = 0; public override function update(elapsed:Float) { + filterEvents(); if (length != __lastSort) sortEvents(); @@ -22,10 +23,18 @@ class CharterEventGroup extends FlxTypedGroup { super.draw(); } - public function sortEvents() { + public inline function sortEvents() { __lastSort = length; this.sort(function(i, e1, e2) { return FlxSort.byValues(FlxSort.ASCENDING, e1.step, e2.step); }); } + + public inline function filterEvents() { + for (event in members) + if (event.events.length == 0) { + remove(event, true); + event.kill(); + } + } } \ No newline at end of file diff --git a/source/funkin/editors/charter/CharterStrumline.hx b/source/funkin/editors/charter/CharterStrumline.hx index 8e34ee46..0319bf7b 100644 --- a/source/funkin/editors/charter/CharterStrumline.hx +++ b/source/funkin/editors/charter/CharterStrumline.hx @@ -40,7 +40,7 @@ class CharterStrumline extends UISprite { members.push(healthIcon); draggingSprite = new UISprite(); - draggingSprite.loadGraphic(Paths.image("editors/charter/drag-strumline")); + draggingSprite.loadGraphic(Paths.image("editors/charter/strumline-drag")); draggingSprite.alpha = 0.4; draggingSprite.y = 9; draggingSprite.antialiasing = true; @@ -98,7 +98,7 @@ class CharterStrumline extends UISprite { class CharterStrumlineButton extends UITopMenuButton { var strLine:CharterStrumline; public function new(parent:CharterStrumline) { - super(0, 95, null, "Options", []); + super(0, 95, null, "Options ↓", []); strLine = parent; bWidth = 40 * 4; this.label.fieldWidth = bWidth;