Add a server password field and map name

This commit is contained in:
Paul Chote
2011-05-08 13:18:07 +12:00
parent 09526ee2dd
commit 1c1b89948a
2 changed files with 37 additions and 15 deletions

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Cnc.Widgets
map = Game.modData.AvailableMaps.FirstOrDefault(m => m.Value.Selectable).Value; map = Game.modData.AvailableMaps.FirstOrDefault(m => m.Value.Selectable).Value;
panel.GetWidget<MapPreviewWidget>("MAP_PREVIEW").Map = () => map; panel.GetWidget<MapPreviewWidget>("MAP_PREVIEW").Map = () => map;
panel.GetWidget<LabelWidget>("MAP_NAME").GetText = () => map.Title;
panel.GetWidget<TextFieldWidget>("SERVER_NAME").Text = settings.Server.Name ?? ""; panel.GetWidget<TextFieldWidget>("SERVER_NAME").Text = settings.Server.Name ?? "";
panel.GetWidget<TextFieldWidget>("LISTEN_PORT").Text = settings.Server.ListenPort.ToString(); panel.GetWidget<TextFieldWidget>("LISTEN_PORT").Text = settings.Server.ListenPort.ToString();

View File

@@ -2,9 +2,9 @@ Container@CREATESERVER_PANEL:
Id:CREATESERVER_PANEL Id:CREATESERVER_PANEL
Delegate:CncServerCreationLogic Delegate:CncServerCreationLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 224)/2 Y:(WINDOW_BOTTOM - 260)/2
Width:604 Width:604
Height:254 Height:295
Children: Children:
Label@TITLE: Label@TITLE:
Text:Create Server Text:Create Server
@@ -15,7 +15,7 @@ Container@CREATESERVER_PANEL:
Align:Center Align:Center
Background@bg: Background@bg:
Width:604 Width:604
Height:224 Height:260
Background:panel-black Background:panel-black
Children: Children:
Background@MAP_BG: Background@MAP_BG:
@@ -31,6 +31,14 @@ Container@CREATESERVER_PANEL:
Y:1 Y:1
Width:192 Width:192
Height:192 Height:192
Label@MAP_NAME:
Id:MAP_NAME
X:PARENT_RIGHT-WIDTH-15
Y:220
Width:194
Height:25
Align:Center
Font:Bold
Label@SERVER_NAME_LABEL: Label@SERVER_NAME_LABEL:
X:15 X:15
Y:14 Y:14
@@ -61,17 +69,31 @@ Container@CREATESERVER_PANEL:
MaxLength:50 MaxLength:50
Height:25 Height:25
Text:Describe your server here Text:Describe your server here
Label@LISTEN_PORT_LABEL: Label@SERVER_PASSWORD_LABEL:
X:15 X:15
Y:84 Y:84
Width:90 Width:90
Height:25 Height:25
Align:Right
Text:Password:
TextField@SERVER_PASSWORD:
Id:SERVER_PASSWORD
X:110
Y:85
Width:275
MaxLength:50
Height:25
Label@LISTEN_PORT_LABEL:
X:15
Y:119
Width:90
Height:25
Align: Right Align: Right
Text:Port: Text:Port:
TextField@LISTEN_PORT: TextField@LISTEN_PORT:
Id:LISTEN_PORT Id:LISTEN_PORT
X:110 X:110
Y:85 Y:120
Width:50 Width:50
MaxLength:5 MaxLength:5
Height:25 Height:25
@@ -79,20 +101,20 @@ Container@CREATESERVER_PANEL:
Checkbox@CHECKBOX_ONLINE: Checkbox@CHECKBOX_ONLINE:
Id:CHECKBOX_ONLINE Id:CHECKBOX_ONLINE
X:110 X:110
Y:120 Y:155
Width:275 Width:275
Height:20 Height:20
Text:Advertise Online* Text:Advertise Online
Label@PORT_FORWARDING: Label@PORT_FORWARDING:
X:140 X:140
Y:145 Y:180
Width:220 Width:220
WordWrap:true WordWrap:true
Font:Tiny Font:Tiny
Text:*You must forward an external port from your router to your computer before other players will be able to join your server. Text:You must forward an external port from your router to your computer before other players will be able to join your server.
Label@EXTERNAL_PORT_LABEL: Label@EXTERNAL_PORT_LABEL:
X:15 X:15
Y:183 Y:219
Width:90 Width:90
Height:25 Height:25
Align:Right Align:Right
@@ -100,7 +122,7 @@ Container@CREATESERVER_PANEL:
TextField@EXTERNAL_PORT: TextField@EXTERNAL_PORT:
Id:EXTERNAL_PORT Id:EXTERNAL_PORT
X:110 X:110
Y:184 Y:220
Width:50 Width:50
MaxLength:5 MaxLength:5
Height:25 Height:25
@@ -108,21 +130,21 @@ Container@CREATESERVER_PANEL:
CncMenuButton@BACK_BUTTON: CncMenuButton@BACK_BUTTON:
Id:BACK_BUTTON Id:BACK_BUTTON
X:0 X:0
Y:223 Y:259
Width:140 Width:140
Height:35 Height:35
Text:Back Text:Back
CncMenuButton@MAP_BUTTON: CncMenuButton@MAP_BUTTON:
Id:MAP_BUTTON Id:MAP_BUTTON
X:314 X:314
Y:223 Y:259
Width:140 Width:140
Height:35 Height:35
Text:Change Map Text:Change Map
CncMenuButton@CREATE_BUTTON: CncMenuButton@CREATE_BUTTON:
Id:CREATE_BUTTON Id:CREATE_BUTTON
X:464 X:464
Y:223 Y:259
Width:140 Width:140
Height:35 Height:35
Text:Create Text:Create