From a8e39d90e8df855d90b9b384b51ab4d746b71e5f Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 11 Aug 2023 05:20:25 -0400 Subject: [PATCH] temp rank stuff in progress --- assets | 2 +- hmm.json | 8 ++++---- source/funkin/freeplayStuff/SongMenuItem.hx | 21 +++++++++++++++++++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/assets b/assets index 37fa62d8e..abbbc89a8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 37fa62d8e88b7a7023e689ef52d8a5c527cd4618 +Subproject commit abbbc89a83f48317568b5b25eaf831ae16f88a8c diff --git a/hmm.json b/hmm.json index aa032fb75..85c83ea6d 100644 --- a/hmm.json +++ b/hmm.json @@ -4,14 +4,14 @@ "name": "discord_rpc", "type": "git", "dir": null, - "ref": "2d83fa863ef0c1eace5f1cf67c3ac315d1a3a8a5", + "ref": "2d83fa8", "url": "https://github.com/Aidan63/linc_discord-rpc" }, { "name": "flixel", "type": "git", "dir": null, - "ref": "32cee07a0e5f21e590a4b21234603b2cd5898b10", + "ref": "32cee07a", "url": "https://github.com/EliteMasterEric/flixel" }, { @@ -32,7 +32,7 @@ "name": "flxanimate", "type": "git", "dir": null, - "ref": "a9136359271cae6ea3016b7fd9023c5c42562933", + "ref": "a913635", "url": "https://github.com/ninjamuffin99/flxanimate" }, { @@ -75,7 +75,7 @@ "name": "hxCodec", "type": "git", "dir": null, - "ref": "c8c47e706ad82a423783006ed901b6d93c89a421", + "ref": "c8c47e7", "url": "https://github.com/polybiusproxy/hxCodec" }, { diff --git a/source/funkin/freeplayStuff/SongMenuItem.hx b/source/funkin/freeplayStuff/SongMenuItem.hx index 3a1dfacbf..184846805 100644 --- a/source/funkin/freeplayStuff/SongMenuItem.hx +++ b/source/funkin/freeplayStuff/SongMenuItem.hx @@ -20,6 +20,9 @@ class SongMenuItem extends FlxSpriteGroup public var songText:FlxText; public var favIcon:FlxSprite; + public var ranking:FlxSprite; + + var ranks:Array = ["fail", "average", "great", "excellent", "perfect"]; public var targetPos:FlxPoint = new FlxPoint(); public var doLerp:Bool = false; @@ -42,6 +45,20 @@ class SongMenuItem extends FlxSpriteGroup // capsule.animation add(capsule); + var rank:String = FlxG.random.getObject(ranks); + + ranking = new FlxSprite(capsule.width * 0.78, 30); + ranking.loadGraphic(Paths.image("freeplay/ranks/" + rank)); + ranking.scale.x = ranking.scale.y = realScaled; + ranking.alpha = 0.75; + add(ranking); + + switch (rank) + { + case "perfect": + ranking.x -= 10; + } + songText = new FlxText(capsule.width * 0.23, 40, 0, songTitle, Std.int(40 * realScaled)); songText.font = "5by7"; songText.color = 0xFF43C1EA; @@ -218,12 +235,12 @@ class SongMenuItem extends FlxSpriteGroup function set_selected(value:Bool):Bool { - // trace(value); - // cute one liners, lol! songText.alpha = value ? 1 : 0.6; capsule.offset.x = value ? 0 : -5; capsule.animation.play(value ? "selected" : "unselected"); + ranking.alpha = value ? 1 : 0.7; + ranking.color = value ? 0xFFFFFFFF : 0xFFAAAAAA; return value; } }