From 636bfd5e0a0eac54378f881354b552a83f0f5524 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 10 Jul 2010 15:05:17 +1200 Subject: [PATCH] Tweaks --- OpenRA.Game/Game.cs | 2 +- OpenRA.Game/GameRules/UserSettings.cs | 7 +++---- OpenRA.Game/Widgets/Delegates/ServerBrowserDelegate.cs | 6 ++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 8f93a84770..6d267ddbe8 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -597,7 +597,7 @@ namespace OpenRA ChangeMods(); - if (Settings.Replay != "") + if (Settings.Replay != null) orderManager = new OrderManager(new ReplayConnection(Settings.Replay)); else JoinLocal(); diff --git a/OpenRA.Game/GameRules/UserSettings.cs b/OpenRA.Game/GameRules/UserSettings.cs index 9dd814a01f..52408cc37c 100644 --- a/OpenRA.Game/GameRules/UserSettings.cs +++ b/OpenRA.Game/GameRules/UserSettings.cs @@ -45,11 +45,10 @@ namespace OpenRA.GameRules public readonly int SheetSize = 2048; // External game settings - public readonly string NetworkHost = ""; + public readonly string NetworkHost = null; public readonly int NetworkPort = 0; - public readonly int Player = 1; - public readonly string Replay = ""; - public readonly string PlayerName = ""; + public readonly string Replay = null; + public readonly string PlayerName = null; public readonly string[] InitialMods = { "ra" }; public readonly string GameName = "OpenRA Game"; diff --git a/OpenRA.Game/Widgets/Delegates/ServerBrowserDelegate.cs b/OpenRA.Game/Widgets/Delegates/ServerBrowserDelegate.cs index 19b16bc9e7..77a008a8a5 100644 --- a/OpenRA.Game/Widgets/Delegates/ServerBrowserDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/ServerBrowserDelegate.cs @@ -127,9 +127,11 @@ namespace OpenRA.Widgets.Delegates }; r.GetWidget("JOINSERVER_BUTTON_DIRECTCONNECT").OnMouseUp = mi => - { /* rude hack. kill this as soon as we can do a direct connect via the commandline */ + { /* rude hack. Should prompt the user once we have textfield widgets */ r.CloseWindow(); - Game.JoinServer(Game.Settings.NetworkHost, Game.Settings.NetworkPort); + if (Game.Settings.NetworkHost != null) + Game.JoinServer(Game.Settings.NetworkHost, Game.Settings.NetworkPort); + return true; }; }