p2sr / SourceAutoRecord

Speedrun plugin for Source engine games.
https://sar.portal2.sr/
MIT License
93 stars 29 forks source link

Skip to next workshop level command #138

Closed ThisAMJ closed 5 months ago

ThisAMJ commented 1 year ago

It would be nice to have a command that shortcuts the "Skip to next level" menu option in SAR. Even if not allowed in runs, it would be useful for resetting MRCC runs, or in casual play.

For reference, this is how the game handles the menu option:

static void SkipToNextLevelOkCallback()
{
    InGameMainMenu *pSelf = 
        static_cast< InGameMainMenu* >( BASEMODPANEL_SINGLETON.GetWindow( WT_INGAMEMAINMENU ) );

    Assert( pSelf );
    if ( pSelf )
    {
        pSelf->PostMessage( pSelf, new KeyValues( "MsgPreSkipToNextLevel" ), 0.0f );
    }
}