Skip to content

Commit

Permalink
Some fixes to Character Select
Browse files Browse the repository at this point in the history
  • Loading branch information
gamerbross authored and ninjamuffin99 committed Sep 30, 2024
1 parent 4a9ad53 commit 9324359
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions source/funkin/ui/charSelect/CharSelectSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class CharSelectSubState extends MusicBeatSubState

playerChillOut = new CharSelectPlayer(0, 0);
playerChillOut.switchChar("bf");
playerChillOut.visible = false;
add(playerChillOut);

playerChill = new CharSelectPlayer(0, 0);
Expand Down Expand Up @@ -543,6 +544,7 @@ class CharSelectSubState extends MusicBeatSubState

nametag.switchChar(char);
gfChill.switchGF(char);
gfChill.visible = true;

var icon = new PixelatedIcon(0, 0);
icon.setCharacter(char);
Expand Down Expand Up @@ -797,8 +799,6 @@ class CharSelectSubState extends MusicBeatSubState
if (allowInput && !pressedSelect && controls.ACCEPT)
{
cursorConfirmed.visible = true;
cursorConfirmed.x = cursor.x - 2;
cursorConfirmed.y = cursor.y - 4;
cursorConfirmed.animation.play("idle", true);

grpCursors.visible = false;
Expand Down Expand Up @@ -855,8 +855,6 @@ class CharSelectSubState extends MusicBeatSubState
if (allowInput && controls.ACCEPT)
{
cursorDenied.visible = true;
cursorDenied.x = cursor.x - 2;
cursorDenied.y = cursor.y - 4;

playerChill.playAnimation("cannot select Label", true);

Expand Down Expand Up @@ -892,6 +890,12 @@ class CharSelectSubState extends MusicBeatSubState

cursorDarkBlue.x = MathUtil.coolLerp(cursorDarkBlue.x, cursorLocIntended.x, lerpAmnt * 0.2);
cursorDarkBlue.y = MathUtil.coolLerp(cursorDarkBlue.y, cursorLocIntended.y, lerpAmnt * 0.2);

cursorConfirmed.x = cursor.x - 2;
cursorConfirmed.y = cursor.y - 4;

cursorDenied.x = cursor.x - 2;
cursorDenied.y = cursor.y - 4;
}

var bopTimer:Float = 0;
Expand Down Expand Up @@ -1056,18 +1060,20 @@ class CharSelectSubState extends MusicBeatSubState
staticSound.stop();

nametag.switchChar(value);
gfChill.visible = false;
playerChill.visible = false;
playerChillOut.visible = true;
playerChillOut.playAnimation("slideout");
var index = playerChillOut.anim.getFrameLabel("slideout").index;
playerChillOut.onAnimationFrame.add((_, frame:Int) -> {
if (frame == index + 1)
if (frame >= index + 1)
{
playerChill.visible = true;
playerChill.switchChar(value);
gfChill.switchGF(value);
gfChill.visible = true;
}
if (frame == index + 2)
if (frame >= index + 2)
{
playerChillOut.switchChar(value);
playerChillOut.visible = false;
Expand Down

0 comments on commit 9324359

Please sign in to comment.