feat: added "menu" panic button

This avoids restarting the game when encountering an unknown issue.
This commit is contained in:
anavoi 2025-07-14 00:14:11 +02:00
commit 34d9e9261e
4 changed files with 46 additions and 3 deletions

View file

@ -1,4 +1,5 @@
using GB.Core;
using GB.Networking.Utils;
using GB.Platform.Lobby;
using UnityEngine;
@ -21,4 +22,11 @@ public class GBSUClient : MonoBehaviour
GBSUGui.PushError("You are currently hosting a game! Please stop your server before attempting to join.");
}
}
// this method should be used when something has went wrong
// because players can just use the escape menu to exit
public static void DisconnectFromServer()
{
GBNetUtils.DisconnectSelf(false);
}
}