From 2eb5208c46e44a663ee18c43e729a02a3ff1728c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 27 Sep 2024 14:25:17 -0400 Subject: [PATCH] Hide the pixel icon in the Results screen when there's no matching character --- source/funkin/ui/PixelatedIcon.hx | 5 +++++ source/funkin/ui/freeplay/SongMenuItem.hx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/PixelatedIcon.hx b/source/funkin/ui/PixelatedIcon.hx index 4252c9695..71d5d74ab 100644 --- a/source/funkin/ui/PixelatedIcon.hx +++ b/source/funkin/ui/PixelatedIcon.hx @@ -50,8 +50,13 @@ class PixelatedIcon extends FlxFilteredSprite if (!openfl.utils.Assets.exists(Paths.image(charPath))) { trace('[WARN] Character ${char} has no freeplay icon.'); + this.visible = false; return; } + else + { + this.visible = true; + } var isAnimated = openfl.utils.Assets.exists(Paths.file('images/$charPath.xml')); diff --git a/source/funkin/ui/freeplay/SongMenuItem.hx b/source/funkin/ui/freeplay/SongMenuItem.hx index 11ca44d54..864fa2d1d 100644 --- a/source/funkin/ui/freeplay/SongMenuItem.hx +++ b/source/funkin/ui/freeplay/SongMenuItem.hx @@ -678,7 +678,7 @@ class SongMenuItem extends FlxSpriteGroup public function confirm():Void { if (songText != null) songText.flickerText(); - if (pixelIcon != null) + if (pixelIcon != null && pixelIcon.visible) { pixelIcon.animation.play('confirm'); }