blank input field = use default server ip

This commit is contained in:
JohnCorby 2022-01-24 11:10:19 -08:00
parent 78803d6c81
commit 616370fa24
3 changed files with 6 additions and 1 deletions

View File

@ -347,6 +347,10 @@ namespace QSB.Menus
private void Connect()
{
var address = ((PopupInputMenu)IPPopup).GetInputText();
if (address == string.Empty)
{
address = QSBCore.DefaultServerIP;
}
if (QSBSceneManager.CurrentScene == OWScene.TitleScreen)
{

View File

@ -44,7 +44,7 @@ namespace QSB
{
public static IModHelper Helper { get; private set; }
public static IModUnityEvents UnityEvents => Helper.Events.Unity;
public static string DefaultServerIP { get; private set; }
public static string DefaultServerIP;
public static bool UseKcpTransport => DebugSettings.UseKcpTransport;
public static int OverrideAppId => DebugSettings.OverrideAppId;
public static bool DebugMode => DebugSettings.DebugMode;

View File

@ -204,6 +204,7 @@ namespace QSB
public override void OnStartClient()
{
QSBCore.DefaultServerIP = networkAddress;
var config = QSBCore.Helper.Config;
config.SetSettingsValue("defaultServerIP", networkAddress);
QSBCore.Helper.Storage.Save(config, Constants.ModConfigFileName);