From 5afe5d83e5f74d7ee7e8fb7285cb87cc9577df94 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 15 Mar 2010 22:21:50 +1300 Subject: [PATCH] Direct Connect --- OpenRA.Game/Chrome/DefaultWidgetDelegates.cs | 21 +++++++++++++------- mods/cnc/menus.yaml | 10 +++++++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/OpenRA.Game/Chrome/DefaultWidgetDelegates.cs b/OpenRA.Game/Chrome/DefaultWidgetDelegates.cs index 218f37dd07..599c0be5b9 100644 --- a/OpenRA.Game/Chrome/DefaultWidgetDelegates.cs +++ b/OpenRA.Game/Chrome/DefaultWidgetDelegates.cs @@ -40,13 +40,7 @@ namespace OpenRA.Widgets.Delegates Game.CreateServer(); return true; } - - if (w.Id == "JOINSERVER_BUTTON_CANCEL") - { - WidgetLoader.rootWidget.GetWidget("JOINSERVER_BG").Visible = false; - WidgetLoader.rootWidget.GetWidget("MAINMENU_BG").Visible = true; - return true; - } + return false; } } @@ -86,6 +80,12 @@ namespace OpenRA.Widgets.Delegates return true; } + if (w.Id == "JOINSERVER_BUTTON_DIRECTCONNECT") + { + Game.JoinServer(Game.Settings.NetworkHost, Game.Settings.NetworkPort); + return true; + } + if (w.Id.Substring(0,10) == "JOIN_GAME_") { int index = int.Parse(w.Id.Substring(10)); @@ -94,6 +94,13 @@ namespace OpenRA.Widgets.Delegates Game.JoinServer(game.Address.Split(':')[0], int.Parse(game.Address.Split(':')[1])); return true; } + + if (w.Id == "JOINSERVER_BUTTON_CANCEL") + { + WidgetLoader.rootWidget.GetWidget("JOINSERVER_BG").Visible = false; + WidgetLoader.rootWidget.GetWidget("MAINMENU_BG").Visible = true; + return true; + } return false; } diff --git a/mods/cnc/menus.yaml b/mods/cnc/menus.yaml index abf9b41b9d..5994cc9767 100644 --- a/mods/cnc/menus.yaml +++ b/mods/cnc/menus.yaml @@ -100,6 +100,14 @@ Container: Height:25 Text:Quick'n'dirty Server Browser Align:Center + Button@JOINSERVER_BUTTON_DIRECTCONNECT: + Id:JOINSERVER_BUTTON_DIRECTCONNECT + X:PARENT_RIGHT - 360 + Y:PARENT_BOTTOM - 45 + Width:160 + Height:25 + Text:Direct Connect + Delegate:ServerBrowserDelegate Button@JOINSERVER_BUTTON_CANCEL: Id:JOINSERVER_BUTTON_CANCEL X:PARENT_RIGHT - 180 @@ -107,4 +115,4 @@ Container: Width:160 Height:25 Text:Cancel - Delegate:MainMenuButtonsDelegate \ No newline at end of file + Delegate:ServerBrowserDelegate \ No newline at end of file