Skip to content

Commit

Permalink
add pausing animations to results page
Browse files Browse the repository at this point in the history
  • Loading branch information
KoloInDaCrib committed Nov 27, 2024
1 parent 6495373 commit 6dabf5e
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion source/funkin/ui/debug/char/pages/CharCreatorResultsPage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,15 @@ class CharCreatorResultsPage extends CharCreatorDefaultPage

if (FlxG.keys.justPressed.SPACE)
{
playAnimation();
if (FlxG.keys.pressed.SHIFT)
{
setStatusOfEverything();
playAnimation();
}
else
{
setStatusOfEverything(!activityStatus);
}
}
}

Expand Down Expand Up @@ -310,6 +318,29 @@ class CharCreatorResultsPage extends CharCreatorDefaultPage
}
}

var activityStatus:Bool = true;

function setStatusOfEverything(value:Bool = true)
{
activityStatus = value;
for (timer in animTimers)
timer.active = value;

for (tween in animTweens)
tween.active = value;

var animDialog:ResultsAnimDialog = cast dialogMap[RankAnims];
var rank = animDialog.currentRank;

for (onething in members)
{
onething.active = value;
}

// genuine witchcraft
(value ? rankMusicMap[rank].resume : rankMusicMap[rank].pause)();
}

function stopTweensAndTimers():Void
{
while (animTimers.length > 0)
Expand Down Expand Up @@ -475,6 +506,18 @@ private class ResultsMusic
introMusic?.stop();
music?.stop();
}

public function pause():Void
{
introMusic?.pause();
music?.pause();
}

public function resume():Void
{
introMusic?.resume();
music?.resume();
}
}

enum ResultsDialogType
Expand Down

0 comments on commit 6dabf5e

Please sign in to comment.