Skip to content

Enhancement: PauseSubState.quitToMenu() and quitToChartEditor() should call onSongEnd() #4199

Closed as not planned
@Starexify

Description

Issue Checklist

  • I have read the Contributing Guide
  • I have checked the Issues/Discussions pages to see if my enhancement has already been suggested
  • I have properly titled my enhancement

What is your suggestion, and why should it be implemented?

My suggestion is that the ScriptEvent onSongEnd() should also be fired from PauseSubState.quitToMenu() and quitToChartEditor() because when leaving a song and trying to cleanup stuff and use onSongEnd() it doesnt seem to call the Event when exiting/ending the song through the pause menu

The methods in question:

/**
* Quit the game and return to the main menu.
* @param state The current PauseSubState.
*/
static function quitToMenu(state:PauseSubState):Void
{
state.allowInput = false;
PlayState.instance.deathCounter = 0;
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
if (PlayStatePlaylist.isStoryMode)
{
PlayStatePlaylist.reset();
state.openSubState(new funkin.ui.transition.StickerSubState(null, (sticker) -> new funkin.ui.story.StoryMenuState(sticker)));
}
else
{
state.openSubState(new funkin.ui.transition.StickerSubState(null, (sticker) -> FreeplayState.build(null, sticker)));
}
}
/**
* Quit the game and return to the chart editor.
* @param state The current PauseSubState.
*/
static function quitToChartEditor(state:PauseSubState):Void
{
state.close();
if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position!
PlayState.instance.close(); // This only works because PlayState is a substate!
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: rejectedIssue did not pass review or PR cannot be approved.type: enhancementInvolves an enhancement or new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions