From 4b1af216d4a86e354ec8c33c6a0139bcdc3397f7 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 19 Sep 2023 19:10:30 -0400 Subject: [PATCH] capsule alpha stuff in progress --- source/funkin/FreeplayState.hx | 7 +++---- source/funkin/freeplayStuff/SongMenuItem.hx | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 9447488ff..6d8c24bbf 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -585,11 +585,10 @@ class FreeplayState extends MusicBeatSubState funnyMenu.y = funnyMenu.intendedY(i + 1) + 10; funnyMenu.targetPos.x = funnyMenu.x; funnyMenu.ID = i; - funnyMenu.alpha = 0.5; + funnyMenu.capsule.alpha = 0.5; funnyMenu.songText.visible = false; funnyMenu.favIcon.visible = tempSongs[i].isFav; funnyMenu.hsvShader = hsvShader; - // fp.updateScore(0); if (i < 8) funnyMenu.initJumpIn(Math.min(i, 4), force); @@ -943,7 +942,7 @@ class FreeplayState extends MusicBeatSubState function capsuleOnConfirmDefault():Void { - var poop:String = songs[curSelected].songName.toLowerCase(); + // var poop:String = songs[curSelected].songName.toLowerCase(); // does not work properly, always just accidentally sets it to normal anyways! /* if (!Assets.exists(Paths.json(songs[curSelected].songName + '/' + poop))) @@ -1035,7 +1034,7 @@ class FreeplayState extends MusicBeatSubState { index += 1; - capsule.selected = false; + capsule.selected = true; capsule.targetPos.y = capsule.intendedY(index - curSelected); capsule.targetPos.x = 270 + (60 * (Math.sin(index - curSelected))); diff --git a/source/funkin/freeplayStuff/SongMenuItem.hx b/source/funkin/freeplayStuff/SongMenuItem.hx index 60af8d0f2..6301f14c4 100644 --- a/source/funkin/freeplayStuff/SongMenuItem.hx +++ b/source/funkin/freeplayStuff/SongMenuItem.hx @@ -15,10 +15,11 @@ import funkin.shaderslmfao.Grayscale; class SongMenuItem extends FlxSpriteGroup { - var capsule:FlxSprite; + public var capsule:FlxSprite; + var pixelIcon:FlxSprite; - public var selected(default, set):Bool = false; + public var selected(default, set):Bool; public var songTitle:String = "Test"; @@ -108,8 +109,6 @@ class SongMenuItem extends FlxSpriteGroup // grpHide.add(favIcon); setVisibleGrp(false); - - selected = selected; // just to kickstart the set_selected } function set_hsvShader(value:HSVShader):HSVShader @@ -144,6 +143,8 @@ class SongMenuItem extends FlxSpriteGroup } if (value) textAppear(); + + selectedAlpha(); } public function init(x:Float, y:Float, song:String, ?character:String) @@ -210,14 +211,16 @@ class SongMenuItem extends FlxSpriteGroup if (force) { - alpha = 1; + visible = true; + capsule.alpha = 1; setVisibleGrp(true); } else { new FlxTimer().start((xFrames.length / 24) * 2.5, function(_) { + visible = true; + capsule.alpha = 1; setVisibleGrp(true); - alpha = 1; }); } } @@ -226,7 +229,9 @@ class SongMenuItem extends FlxSpriteGroup public function forcePosition() { - alpha = 1; + visible = true; + capsule.alpha = 1; + selectedAlpha(); doLerp = true; doJumpIn = false; doJumpOut = false; @@ -303,6 +308,7 @@ class SongMenuItem extends FlxSpriteGroup function set_selected(value:Bool):Bool { + trace("set_selected: " + value); // cute one liners, lol! diffGrayscale.setAmount(value ? 0 : 0.8); songText.alpha = value ? 1 : 0.6;