mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
Character Select fixes
Pixelated icons hold only plays once Characters do not play confirm animation if selected mid transition Also removes buggy debug keys in CharSelectGF
This commit is contained in:
parent
edb270d15e
commit
7e24e936ce
3 changed files with 31 additions and 20 deletions
source/funkin/ui/charSelect
|
@ -57,20 +57,6 @@ class CharSelectGF extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
doFade(animInInfo);
|
||||
default:
|
||||
}
|
||||
|
||||
#if FEATURE_DEBUG_FUNCTIONS
|
||||
if (FlxG.keys.justPressed.J)
|
||||
{
|
||||
alpha = 1;
|
||||
x = y = 0;
|
||||
fadingStatus = FADE_OUT;
|
||||
}
|
||||
if (FlxG.keys.justPressed.K)
|
||||
{
|
||||
alpha = 0;
|
||||
fadingStatus = FADE_IN;
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
public function onStepHit(event:SongTimeScriptEvent):Void {}
|
||||
|
@ -171,8 +157,9 @@ class CharSelectGF extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
/**
|
||||
* For switching between "GFs" such as gf, nene, etc
|
||||
* @param bf Which BF we are selecting, so that we know the accompyaning GF
|
||||
* @param pressedSelect If select was pressed while switching character, play the confirm animation instead
|
||||
*/
|
||||
public function switchGF(bf:String):Void
|
||||
public function switchGF(bf:String, pressedSelect:Bool = false):Void
|
||||
{
|
||||
var previousGFPath = currentGFPath;
|
||||
|
||||
|
@ -200,6 +187,8 @@ class CharSelectGF extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
animOutInfo = FramesJSFLParser.parse(animInfoPath + '/Out.txt');
|
||||
}
|
||||
|
||||
if (pressedSelect) playAnimation("confirm", true, false, true);
|
||||
else
|
||||
playAnimation("idle", true, false, false);
|
||||
|
||||
updateHitbox();
|
||||
|
|
|
@ -8,6 +8,8 @@ import funkin.modding.events.ScriptEvent;
|
|||
|
||||
class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
||||
{
|
||||
var pressedSelect:Bool = false;
|
||||
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super(x, y, Paths.animateAtlas("charSelect/bfChill"));
|
||||
|
@ -18,10 +20,22 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
case "slidein":
|
||||
if (hasAnimation("slidein idle point"))
|
||||
{
|
||||
if (pressedSelect)
|
||||
{
|
||||
playAnimation("select");
|
||||
pressedSelect = false;
|
||||
}
|
||||
else
|
||||
playAnimation("slidein idle point", true, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pressedSelect)
|
||||
{
|
||||
playAnimation("select");
|
||||
pressedSelect = false;
|
||||
}
|
||||
else
|
||||
playAnimation("idle", true, false, false);
|
||||
}
|
||||
case "deselect":
|
||||
|
@ -65,7 +79,7 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
}
|
||||
}
|
||||
|
||||
public function switchChar(str:String)
|
||||
public function switchChar(str:String, pressedSelect:Bool = false)
|
||||
{
|
||||
switch str
|
||||
{
|
||||
|
@ -75,6 +89,8 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
|
||||
playAnimation("slidein", true, false, false);
|
||||
|
||||
this.pressedSelect = pressedSelect;
|
||||
|
||||
updateHitbox();
|
||||
|
||||
updatePosition(str);
|
||||
|
|
|
@ -1030,10 +1030,16 @@ class CharSelectSubState extends MusicBeatSubState
|
|||
if (pressedSelect && memb.animation.curAnim.name == "idle") memb.animation.play("confirm");
|
||||
if (autoFollow && !pressedSelect && memb.animation.curAnim.name != "idle")
|
||||
{
|
||||
// Play the confirm animation in reverse
|
||||
memb.animation.play("confirm", false, true);
|
||||
member.animation.finishCallback = (_) -> {
|
||||
member.animation.finishCallback = function(name:String):Void {
|
||||
trace('Finish pixel animation: ${name}');
|
||||
member.animation.play("idle");
|
||||
member.animation.finishCallback = null;
|
||||
// Reset the finish callback to what it was before
|
||||
member.animation.finishCallback = function(name:String):Void {
|
||||
trace('Finish pixel animation: ${name}');
|
||||
if (name == 'confirm') member.animation.play('confirm-hold');
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1076,8 +1082,8 @@ class CharSelectSubState extends MusicBeatSubState
|
|||
if (frame >= index + 1)
|
||||
{
|
||||
playerChill.visible = true;
|
||||
playerChill.switchChar(value);
|
||||
gfChill.switchGF(value);
|
||||
playerChill.switchChar(value, pressedSelect);
|
||||
gfChill.switchGF(value, pressedSelect);
|
||||
gfChill.visible = true;
|
||||
}
|
||||
if (frame >= index + 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue