mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
Merge 7e24e936ce
into d31ef12363
This commit is contained in:
commit
a1925c5286
3 changed files with 31 additions and 6 deletions
source/funkin/ui/charSelect
|
@ -154,8 +154,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;
|
||||
|
||||
|
@ -183,6 +184,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();
|
||||
|
|
|
@ -6,6 +6,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"));
|
||||
|
@ -16,10 +18,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":
|
||||
|
@ -63,7 +77,7 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
}
|
||||
}
|
||||
|
||||
public function switchChar(str:String)
|
||||
public function switchChar(str:String, pressedSelect:Bool = false)
|
||||
{
|
||||
switch str
|
||||
{
|
||||
|
@ -73,6 +87,8 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
|
||||
playAnimation("slidein", true, false, false);
|
||||
|
||||
this.pressedSelect = pressedSelect;
|
||||
|
||||
updateHitbox();
|
||||
|
||||
updatePosition(str);
|
||||
|
|
|
@ -1038,10 +1038,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');
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1084,8 +1090,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