mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-12-08 04:58:48 +00:00
Merge 5aea8ff99e into 758f712eb5
This commit is contained in:
commit
deac4c00cf
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue