Add a "Game Name" textfield to server creation

This commit is contained in:
Paul Chote
2010-07-11 00:04:42 +12:00
parent 3296cc2ec1
commit b6fc28023d
3 changed files with 28 additions and 14 deletions

View File

@@ -54,7 +54,6 @@ namespace OpenRA.GameRules
public string PlayerName = null;
public readonly string[] InitialMods = { "ra" };
public readonly string GameName = "OpenRA Game";
public readonly int ListenPort = 1234;
public readonly int ExternalPort = 1234;
public readonly bool InternetServer = true;

View File

@@ -50,8 +50,7 @@ namespace OpenRA.Widgets.Delegates
// TODO: Get this from a mod chooser
var mods = Game.Settings.InitialMods;
// TODO: Get this from a textbox
var gameName = Game.Settings.GameName;
var gameName = r.GetWidget<TextFieldWidget>("GAME_TITLE").Text;
Server.Server.ServerMain(AdvertiseServerOnline, Game.Settings.MasterServer,
gameName, Game.Settings.ListenPort,

View File

@@ -72,39 +72,55 @@ Container:
Delegate:CreateServerMenuDelegate
X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450
Height:145
Width:400
Height:180
Visible:false
Children:
Label@CREATESERVER_LABEL_TITLE:
Id:CREATESERVER_LABEL_TITLE
X:0
Y:20
Width:250
Width:400
Height:25
Text:Create Server
Align:Center
Bold:True
Label@GAME_TITLE:
Id:GAME_TITLE_LABEL
X:50
Y:59
Width:95
Height:25
Align: Right
Text:Game Title:
TextField@GAME_TITLE:
Id:GAME_TITLE
X:150
Y:60
Width:200
MaxLength:50
Height:25
Text:OpenRA Game
Checkbox@CREATESERVER_CHECKBOX_ONLINE:
Id:CREATESERVER_CHECKBOX_ONLINE
X:100
Y:60
X:150
Y:100
Width:300
Height:20
Text:Advertise game Online
Button@CREATESERVER_BUTTON_START:
Id:CREATESERVER_BUTTON_START
X:100
Y:100
Width:160
X:130
Y:PARENT_BOTTOM - 45
Width:120
Height:25
Text:Create
Bold:True
Button@CREATESERVER_BUTTON_CANCEL:
Id:CREATESERVER_BUTTON_CANCEL
X:270
Y:100
Width:160
X:260
Y:PARENT_BOTTOM - 45
Width:120
Height:25
Text:Cancel
Bold:True