@@ -464,6 +464,33 @@ private static void onLevelLoaderStartLevel(On.Celeste.LevelLoader.orig_StartLev
464464 orig ( self ) ;
465465 }
466466
467+ public static IEnumerator DisplayCollabMapEndScreenIfEnabled ( ) {
468+ // display an endscreen if enabled in mod options AND speedrun timer is enabled (or else the endscreen won't show anything anyway).
469+ if ( CollabModule . Instance . Settings . DisplayEndScreenForAllMaps && Settings . Instance . SpeedrunClock != SpeedrunType . Off ) {
470+ Engine . Scene . Add ( new AreaCompleteInfoInLevel ( ) ) ;
471+
472+ // force the player to wait a bit, so that the info shows up
473+ yield return 0.5f ;
474+
475+ // wait for an input
476+ while ( ! Input . MenuConfirm . Pressed && ! Input . MenuCancel . Pressed ) {
477+ yield return null ;
478+ }
479+ } else {
480+ // wait 1 second max
481+ float timer = 0f ;
482+ while ( ! Input . MenuConfirm . Pressed && ! Input . MenuCancel . Pressed && timer <= 1f ) {
483+ yield return null ;
484+ timer += Engine . DeltaTime ;
485+ }
486+ }
487+ }
488+
489+ public static void TriggerReturnToLobby ( ) {
490+ Level level = ( Level ) Engine . Scene ;
491+ level . DoScreenWipe ( false , ( ) => Engine . Scene = new LevelExitToLobby ( LevelExit . Mode . Completed , level . Session ) ) ;
492+ }
493+
467494 // ModInterop exports
468495
469496 [ ModExportName ( "CollabUtils2.ReturnToLobbyHelper" ) ]
@@ -526,6 +553,23 @@ public static void TeleportToMapWithReturnToLobbyAndGym(string mapSID, string ch
526553 OnSessionCreated ( ) ;
527554 }
528555 }
556+
557+ /// <summary>
558+ /// Displays the endscreen of the individual collab map if the player enabled it, pauses for up to 1 second otherwise.
559+ /// This is the same behavior as mini hearts.
560+ /// </summary>
561+ /// <returns>A coroutine that should be run through in order to show the endscreen and wait for user input</returns>
562+ public static IEnumerator DisplayCollabMapEndScreenIfEnabled ( ) {
563+ return ReturnToLobbyHelper . DisplayCollabMapEndScreenIfEnabled ( ) ;
564+ }
565+
566+ /// <summary>
567+ /// Triggers the transition that sends the player back to the lobby from an individual collab map,
568+ /// like mini hearts do.
569+ /// </summary>
570+ public static void TriggerReturnToLobby ( ) {
571+ ReturnToLobbyHelper . TriggerReturnToLobby ( ) ;
572+ }
529573 }
530574 }
531575}
0 commit comments