0ad/binaries/data/mods/public/gui/gamesetup/gamesetup_mp.xml
leper df4c07238d Change GUI tag parsing to use a FSM instead of using CParser. Refs #2589.
Parameters now have to be quoted with ".
Supports " in parameters by escaping them with \.
Tag start characters can be included in normal text by escaping them
with \.
Better error handling and a error messages to help with fixing
invalid/malformed strings.

This was SVN commit r15969.
2014-11-16 02:10:28 +00:00

115 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/common/network.js"/>
<script file="gui/common/functions_global_object.js"/>
<script file="gui/gamesetup/gamesetup_mp.js"/>
<!-- Add a translucent black background to fade out the menu page -->
<object type="image" sprite="ModernFade"/>
<object type="image" style="ModernDialog" size="50%-230 50%-120 50%+230 50%+120">
<action on="Tick">
onTick();
</action>
<object style="ModernLabelText" type="text" size="50%-128 0%-16 50%+128 16">
<translatableAttribute id="caption">Multiplayer</translatableAttribute>
</object>
<object name="pageJoin" size="0 32 100% 100%" hidden="true">
<object type="text" style="ModernLabelText" size="0 0 100% 30">
<translatableAttribute id="caption">Joining an existing game.</translatableAttribute>
</object>
<object type="text" size="20 40 50% 70" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Player name:</translatableAttribute>
</object>
<object name="joinPlayerName" type="input" size="50%+10 40 100%-20 64" style="ModernInput">
<action on="Load">
this.caption = Engine.ConfigDB_GetValue("user", "playername");
</action>
</object>
<object type="text" size="20 80 50% 110" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Server Hostname or IP:</translatableAttribute>
</object>
<object name="joinServer" type="input" size="50%+10 80 100%-20 104" style="ModernInput">
<action on="Load">
this.caption = Engine.ConfigDB_GetValue("user", "multiplayerserver")
</action>
</object>
<object hotkey="confirm" type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed">
<translatableAttribute id="caption">Continue</translatableAttribute>
<action on="Press">
var joinPlayerName = Engine.GetGUIObjectByName("joinPlayerName").caption;
var joinServer = Engine.GetGUIObjectByName("joinServer").caption;
if (startJoin(joinPlayerName, joinServer))
switchSetupPage("pageJoin", "pageConnecting");
</action>
</object>
</object>
<object name="pageHost" size="0 32 100% 100%" hidden="true">
<object type="text" style="ModernLabelText" size="0 0 100% 30">
<translatableAttribute id="caption">Set up your server to host.</translatableAttribute>
</object>
<object name="hostPlayerNameWrapper" hidden="true">
<object type="text" size="20 40 50% 70" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Player name:</translatableAttribute>
</object>
<object name="hostPlayerName" type="input" size="50%+10 40 100%-20 64" style="ModernInput">
<action on="Load">
this.caption = Engine.ConfigDB_GetValue("user", "playername");
</action>
</object>
</object>
<!-- Host server name is only used on games started through the lobby. -->
<object name="hostServerNameWrapper" hidden="true">
<object type="text" size="20 80 50% 110" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Server name:</translatableAttribute>
</object>
<object name="hostServerName" type="input" size="50%+10 80 100%-20 104" style="ModernInput">
<action on="Load">
this.caption = getDefaultGameName();
</action>
</object>
</object>
<object type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed">
<translatableAttribute id="caption">Continue</translatableAttribute>
<action on="Press">
var hostPlayerName = Engine.GetGUIObjectByName("hostPlayerName").caption;
var hostServerName = Engine.GetGUIObjectByName("hostServerName").caption;
if (startHost(hostPlayerName, hostServerName))
switchSetupPage("pageHost", "pageConnecting");
</action>
</object>
</object>
<object name="hostFeedback" type="text" style="ModernLabelText" size="50 100%-90 100%-50 100%-50" textcolor="red" />
<object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">cancelSetup();</action>
</object>
<object name="pageConnecting" hidden="true">
<object name="connectionStatus" type="text" style="ModernLabelText" size="0 100 100% 120"/>
</object>
</object>
</objects>