From 2af38af129d2fab1fdc0b0ffc402b830c64b2be8 Mon Sep 17 00:00:00 2001 From: Frakist <90983918+Frakist@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:15:34 +0300 Subject: [PATCH] missing event icon check --- source/funkin/editors/charter/CharterEvent.hx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/funkin/editors/charter/CharterEvent.hx b/source/funkin/editors/charter/CharterEvent.hx index 1e6cab0c..442021a3 100644 --- a/source/funkin/editors/charter/CharterEvent.hx +++ b/source/funkin/editors/charter/CharterEvent.hx @@ -47,11 +47,10 @@ class CharterEvent extends UISliceSprite implements ICharterSelectable { private static function generateDefaultIcon(name:String) { var isBase64:Bool = false; var path:String = Paths.image('editors/charter/event-icons/$name'); - if (!Assets.exists(path) && Assets.exists(Paths.pack('events/$name'))) { + if (!Assets.exists(path)) path = Paths.image('editors/charter/event-icons/Unknown'); + var packimg = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; + if (isBase64 = (packimg != null)) path = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; - isBase64 = true; - } - else if (!Assets.exists(path)) path = Paths.image('editors/charter/event-icons/Unknown'); var spr = new FlxSprite().loadGraphic(isBase64 ? openfl.display.BitmapData.fromBase64(path.trim(), 'UTF8') : path); return spr;