Preparation for connection dialogs in yaml

This commit is contained in:
Paul Chote
2010-03-17 22:31:45 +13:00
parent 48370612a0
commit 3aa9b17685
3 changed files with 123 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA. * This file is part of OpenRA.
@@ -59,7 +59,8 @@ namespace OpenRA.FileFormats
var colon = t.IndexOf(':'); var colon = t.IndexOf(':');
var d = new Dictionary<string, MiniYaml>(); var d = new Dictionary<string, MiniYaml>();
try
{
if (colon == -1) if (colon == -1)
levels[level].Add(t.Trim(), new MiniYaml(null, d)); levels[level].Add(t.Trim(), new MiniYaml(null, d));
else else
@@ -69,6 +70,9 @@ namespace OpenRA.FileFormats
value = null; value = null;
levels[level].Add(t.Substring(0, colon).Trim(), new MiniYaml(value, d)); levels[level].Add(t.Substring(0, colon).Trim(), new MiniYaml(value, d));
} }
}
catch (ArgumentException) { throw new InvalidDataException("Duplicate Identifier:`{0}`".F(t)); }
levels.Add(d); levels.Add(d);
} }
return levels[0]; return levels[0];

View File

@@ -2,8 +2,8 @@ Container:
Children: Children:
Background@MAINMENU_BG: Background@MAINMENU_BG:
Id:MAINMENU_BG Id:MAINMENU_BG
X:WINDOW_RIGHT/2 - 125 X:(WINDOW_RIGHT - WIDTH)/2
Y:WINDOW_BOTTOM/2 - 100 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:250 Width:250
Height:200 Height:200
Children: Children:
@@ -41,8 +41,8 @@ Container:
Delegate:MainMenuButtonsDelegate Delegate:MainMenuButtonsDelegate
Background@CREATESERVER_BG: Background@CREATESERVER_BG:
Id:CREATESERVER_BG Id:CREATESERVER_BG
X:WINDOW_RIGHT/2 - 225 X:(WINDOW_RIGHT - WIDTH)/2
Y:WINDOW_BOTTOM/2 - 72 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450
Height:145 Height:145
Visible:false Visible:false
@@ -87,8 +87,8 @@ Container:
Delegate:CreateServerMenuDelegate Delegate:CreateServerMenuDelegate
Background@JOINSERVER_BG: Background@JOINSERVER_BG:
Id:JOINSERVER_BG Id:JOINSERVER_BG
X:WINDOW_RIGHT/2 - 225 X:(WINDOW_RIGHT - WIDTH)/2
Y:WINDOW_BOTTOM/2 - 200 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450
Height:400 Height:400
Visible:false Visible:false
@@ -117,3 +117,51 @@ Container:
Height:25 Height:25
Text:Cancel Text:Cancel
Delegate:ServerBrowserDelegate Delegate:ServerBrowserDelegate
Background@CONNECTION_BG:
Id:CONNECTION_BG
X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450
Height:400
Visible:false
Children:
Label@CONNECTION_LABEL_TITLE:
Id:CONNECTION_LABEL_TITLE
X:0
Y:20
Width:450
Height:25
Text:Connecting
Align:Center
Container@CONNECTION_GROUP_CONNECTING:
Id:CONNECTION_GROUP_CONNECTING
Visible:false
Children:
Button@CONNECTION_BUTTON_ABORT:
Id:CONNECTION_BUTTON_ABORT
X:PARENT_RIGHT - 180
Y:PARENT_BOTTOM - 45
Width:160
Height:25
Text:Abort
Delegate:ServerBrowserDelegate
Container@CONNECTION_GROUP_FAILED:
Id:CONNECTION_GROUP_FAILED
Visible:false
Children:
Button@CONNECTION_BUTTON_RETRY:
Id:CONNECTION_BUTTON_RETRY
X:PARENT_RIGHT - 360
Y:PARENT_BOTTOM - 45
Width:160
Height:25
Text:Retry
Delegate:ServerBrowserDelegate
Button@CONNECTION_BUTTON_CANCEL:
Id:CONNECTION_BUTTON_CANCEL
X:PARENT_RIGHT - 180
Y:PARENT_BOTTOM - 45
Width:160
Height:25
Text:Cancel
Delegate:ServerBrowserDelegate

View File

@@ -2,8 +2,8 @@ Container:
Children: Children:
Background@MAINMENU_BG: Background@MAINMENU_BG:
Id:MAINMENU_BG Id:MAINMENU_BG
X:WINDOW_RIGHT/2 - 125 X:(WINDOW_RIGHT - WIDTH)/2
Y:WINDOW_BOTTOM/2 - 100 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:250 Width:250
Height:200 Height:200
Children: Children:
@@ -41,8 +41,8 @@ Container:
Delegate:MainMenuButtonsDelegate Delegate:MainMenuButtonsDelegate
Background@CREATESERVER_BG: Background@CREATESERVER_BG:
Id:CREATESERVER_BG Id:CREATESERVER_BG
X:WINDOW_RIGHT/2 - 225 X:(WINDOW_RIGHT - WIDTH)/2
Y:WINDOW_BOTTOM/2 - 72 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450
Height:145 Height:145
Visible:false Visible:false
@@ -87,8 +87,8 @@ Container:
Delegate:CreateServerMenuDelegate Delegate:CreateServerMenuDelegate
Background@JOINSERVER_BG: Background@JOINSERVER_BG:
Id:JOINSERVER_BG Id:JOINSERVER_BG
X:WINDOW_RIGHT/2 - 225 X:(WINDOW_RIGHT - WIDTH)/2
Y:WINDOW_BOTTOM/2 - 200 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450
Height:400 Height:400
Visible:false Visible:false
@@ -117,3 +117,51 @@ Container:
Height:25 Height:25
Text:Cancel Text:Cancel
Delegate:ServerBrowserDelegate Delegate:ServerBrowserDelegate
Background@CONNECTION_BG:
Id:CONNECTION_BG
X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450
Height:400
Visible:false
Children:
Label@CONNECTION_LABEL_TITLE:
Id:CONNECTION_LABEL_TITLE
X:0
Y:20
Width:450
Height:25
Text:Connecting
Align:Center
Container:
Id:CONNECTION_GROUP_CONNECTING
Visible:false
Children:
Button@CONNECTION_BUTTON_ABORT:
Id:CONNECTION_BUTTON_ABORT
X:PARENT_RIGHT - 180
Y:PARENT_BOTTOM - 45
Width:160
Height:25
Text:Abort
Delegate:ServerBrowserDelegate
Container:
Id:CONNECTION_GROUP_FAILED
Visible:false
Children:
Button@CONNECTION_BUTTON_RETRY:
Id:CONNECTION_BUTTON_RETRY
X:PARENT_RIGHT - 360
Y:PARENT_BOTTOM - 45
Width:160
Height:25
Text:Retry
Delegate:ServerBrowserDelegate
Button@CONNECTION_BUTTON_CANCEL:
Id:CONNECTION_BUTTON_CANCEL
X:PARENT_RIGHT - 180
Y:PARENT_BOTTOM - 45
Width:160
Height:25
Text:Cancel
Delegate:ServerBrowserDelegate