From afa452f55ac33ae374cc5a2c673612f14408fefc Mon Sep 17 00:00:00 2001 From: CharlesCatYT <62410083+CharlesCatYT@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:58:44 -0400 Subject: [PATCH] Revert "Looping of character sing and strumline confirm animations on hold notes" This reverts commit 3b69379ee6e7466534ef7cc4fdd0fb3e53df566b. --- source/funkin/play/character/BaseCharacter.hx | 49 +++---------------- source/funkin/play/notes/Strumline.hx | 8 +-- source/funkin/play/notes/StrumlineNote.hx | 14 ------ 3 files changed, 9 insertions(+), 62 deletions(-) diff --git a/source/funkin/play/character/BaseCharacter.hx b/source/funkin/play/character/BaseCharacter.hx index 98fc08eb7a..4ef86c6a9f 100644 --- a/source/funkin/play/character/BaseCharacter.hx +++ b/source/funkin/play/character/BaseCharacter.hx @@ -346,16 +346,6 @@ class BaseCharacter extends Bopper } } - /** - * Stored the direction of the last note that was hit by this player. - */ - var lastNoteDirection:Null = null; - - /** - * Stores the time at which the player should stop looping the sing animation when pressing a hold note. - */ - var lastHoldFinish:Null = null; - public override function onUpdate(event:UpdateScriptEvent):Void { super.onUpdate(event); @@ -398,17 +388,6 @@ class BaseCharacter extends Bopper // Without this check here, the player character would only play the `sing` animation // for one beat, as opposed to holding it as long as the player is holding the button. - - // Repeat the sing animation when pressing a hold note just like in the old input system. - if ((this.characterType != BF || isHoldingNote()) - && this.animation.curAnim.curFrame >= 3 - && lastNoteDirection != null - && (lastHoldFinish != null && lastHoldFinish >= Conductor.instance.songPosition)) - { - this.playSingAnimation(lastNoteDirection, false); - holdTimer = 0; - } - var shouldStopSinging:Bool = (this.characterType == BF) ? !isHoldingNote() : true; FlxG.watch.addQuick('singTimeSec-${characterId}', singTimeSec); @@ -500,15 +479,6 @@ class BaseCharacter extends Bopper return false; } - /** - * Resets the hold data values to stop the animation from looping - */ - function stopHolding() - { - lastNoteDirection = null; - lastHoldFinish = null; - } - /** * Every time a note is hit, check if the note is from the same strumline. * If it is, then play the sing animation. @@ -517,16 +487,17 @@ class BaseCharacter extends Bopper { super.onNoteHit(event); - var noteDirection:NoteDirection = event.note.noteData.getDirection(); - - if ((event.note.noteData.getMustHitNote() && characterType == BF) || (!event.note.noteData.getMustHitNote() && characterType == DAD)) + if (event.note.noteData.getMustHitNote() && characterType == BF) { // If the note is from the same strumline, play the sing animation. - this.playSingAnimation(noteDirection, false); + this.playSingAnimation(event.note.noteData.getDirection(), false); + holdTimer = 0; + } + else if (!event.note.noteData.getMustHitNote() && characterType == DAD) + { + // If the note is from the same strumline, play the sing animation. + this.playSingAnimation(event.note.noteData.getDirection(), false); holdTimer = 0; - - lastNoteDirection = noteDirection; - if (event.note.noteData.isHoldNote) lastHoldFinish = event.note.strumTime + event.note.noteData.length; } } @@ -569,8 +540,6 @@ class BaseCharacter extends Bopper this.playAnimation(dropAnim, true, true); } } - - stopHolding(); } /** @@ -592,8 +561,6 @@ class BaseCharacter extends Bopper // trace('Playing ghost miss animation...'); this.playSingAnimation(event.dir, true); } - - stopHolding(); } public override function onDestroy(event:ScriptEvent):Void diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 0d5cf7cc46..189636612c 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -446,8 +446,7 @@ class Strumline extends FlxSpriteGroup else if (conductorInUse.songPosition > holdNote.strumTime && holdNote.hitNote) { // Hold note is currently being hit, clip it off. - /* holdConfirm(holdNote.noteDirection); */ - playConfirmHold(holdNote.noteDirection); + holdConfirm(holdNote.noteDirection); holdNote.visible = true; holdNote.sustainLength = (holdNote.strumTime + holdNote.fullSustainLength) - conductorInUse.songPosition; @@ -645,11 +644,6 @@ class Strumline extends FlxSpriteGroup getByDirection(direction).playConfirm(); } - public function playConfirmHold(direction:NoteDirection):Void - { - getByDirection(direction).playConfirmHold(); - } - public function holdConfirm(direction:NoteDirection):Void { getByDirection(direction).holdConfirm(); diff --git a/source/funkin/play/notes/StrumlineNote.hx b/source/funkin/play/notes/StrumlineNote.hx index c17d34d2a3..40d893255e 100644 --- a/source/funkin/play/notes/StrumlineNote.hx +++ b/source/funkin/play/notes/StrumlineNote.hx @@ -111,15 +111,6 @@ class StrumlineNote extends FlxSprite this.playAnimation('confirm', true); } - public function playConfirmHold():Void - { - if (getCurrentAnimationFrame() >= 3) - { - this.active = true; - this.playAnimation('confirm', true); - } - } - public function isConfirm():Bool { return getCurrentAnimation().startsWith('confirm'); @@ -147,11 +138,6 @@ class StrumlineNote extends FlxSprite } } - public function getCurrentAnimationFrame():Int - { - return this.animation.curAnim.curFrame; - } - /** * Returns the name of the animation that is currently playing. * If no animation is playing (usually this means the sprite is BROKEN!),