1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-12-08 04:58:48 +00:00
This commit is contained in:
Zyflx 2025-12-07 20:38:00 +01:00 committed by GitHub
commit deac4c00cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View file

@ -9,12 +9,18 @@ import funkin.graphics.FlxFilteredSprite;
@:nullSafety
class PixelatedIcon extends FlxFilteredSprite
{
/**
* Name which represents the character this icon is for.
*/
public var characterId(default, set):String;
public function new(x:Float, y:Float)
{
super(x, y);
this.makeGraphic(32, 32, 0x00000000);
this.antialiasing = false;
this.active = false;
this.characterId = '';
}
public function setCharacter(char:String):Void
@ -85,4 +91,19 @@ class PixelatedIcon extends FlxFilteredSprite
this.animation.play('idle');
}
}
function set_characterId(id:String):String
{
if (id == '')
{
return characterId;
}
if (characterId != id)
{
this.setCharacter(id);
}
return characterId = id;
}
}

View file

@ -431,7 +431,7 @@ class SongMenuItem extends FlxSpriteGroup
else
{
songText.text = freeplayData.fullSongName;
if (freeplayData.songCharacter != null) pixelIcon.setCharacter(freeplayData.songCharacter);
if (freeplayData.songCharacter != null) pixelIcon.characterId = freeplayData.songCharacter;
pixelIcon.visible = true;
updateBPM(Std.int(freeplayData.songStartingBpm) ?? 0);
updateDifficultyRating(freeplayData.difficultyRating ?? 0);