forked from 0ad/0ad
122 lines
4.5 KiB
XML
122 lines
4.5 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" z="0" sprite="bkTranslucent"/>
|
|
|
|
<object type="image" style="ModernDialog" size="50%-190 50%-120 50%+190 50%+120">
|
|
|
|
<action on="Tick">
|
|
onTick();
|
|
</action>
|
|
|
|
<object style="TitleText" 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 400 30">
|
|
<translatableAttribute id="caption">Joining an existing game.</translatableAttribute>
|
|
</object>
|
|
|
|
<object type="text" size="0 40 200 70" style="ModernRightLabelText">
|
|
<translatableAttribute id="caption">Player name:</translatableAttribute>
|
|
</object>
|
|
|
|
<object name="joinPlayerName" type="input" size="210 40 100%-32 64" style="ModernInput">
|
|
<action on="Load">
|
|
this.caption = Engine.ConfigDB_GetValue("user", "playername");
|
|
</action>
|
|
</object>
|
|
|
|
<object type="text" size="0 80 200 110" style="ModernRightLabelText">
|
|
<translatableAttribute id="caption">Server Hostname or IP:</translatableAttribute>
|
|
</object>
|
|
|
|
<object name="joinServer" type="input" size="210 80 100%-32 104" style="ModernInput">
|
|
<action on="Load">
|
|
this.caption = Engine.ConfigDB_GetValue("user", "multiplayerserver")
|
|
</action>
|
|
</object>3 100%-33 103 100%-3
|
|
|
|
<object hotkey="confirm" type="button" size="50%+16 100%-60 50%+144 100%-32" style="StoneButton">
|
|
<translatableAttribute id="caption">Continue</translatableAttribute>
|
|
<action on="Press">
|
|
var joinPlayerName = Engine.GetGUIObjectByName("joinPlayerName").caption;
|
|
var joinServer = Engine.GetGUIObjectByName("joinServer").caption;
|
|
Engine.ConfigDB_CreateValue("user", "playername", joinPlayerName);
|
|
Engine.ConfigDB_CreateValue("user", "multiplayerserver", joinServer);
|
|
Engine.ConfigDB_WriteFile("user", "config/user.cfg");
|
|
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 400 30">
|
|
<translatableAttribute id="caption">Set up your server to host.</translatableAttribute>
|
|
</object>
|
|
|
|
<object name="hostPlayerNameWrapper" hidden="true">
|
|
<object type="text" size="0 40 200 70" style="ModernRightLabelText">
|
|
<translatableAttribute id="caption">Player name:</translatableAttribute>
|
|
</object>
|
|
|
|
<object name="hostPlayerName" type="input" size="210 40 100%-32 64" style="ModernInput">
|
|
<action on="Load">
|
|
this.caption = Engine.ConfigDB_GetValue("user", "playername");
|
|
</action>
|
|
</object>
|
|
</object>
|
|
|
|
<object name="hostServerNameWrapper" hidden="true">
|
|
<object type="text" size="0 80 200 110" style="ModernRightLabelText">
|
|
<translatableAttribute id="caption">Server name:</translatableAttribute>
|
|
</object>
|
|
|
|
<object name="hostServerName" type="input" size="210 80 100%-32 104" style="ModernInput">
|
|
<action on="Load">
|
|
this.caption = getDefaultGameName();
|
|
</action>
|
|
</object>
|
|
</object>
|
|
|
|
<object type="button" size="50%+16 100%-60 50%+144 100%-32" style="StoneButton">
|
|
<translatableAttribute id="caption">Continue</translatableAttribute>
|
|
<action on="Press">
|
|
var hostPlayerName = Engine.GetGUIObjectByName("hostPlayerName").caption;
|
|
Engine.ConfigDB_CreateValue("user", "playername", hostPlayerName);
|
|
Engine.ConfigDB_WriteFile("user", "config/user.cfg");
|
|
if (startHost(hostPlayerName, Engine.GetGUIObjectByName("hostServerName").caption))
|
|
switchSetupPage("pageHost", "pageConnecting");
|
|
</action>
|
|
</object>
|
|
</object>
|
|
|
|
<object name="hostFeedback" type="text" style="ModernLabelText" size="32 150 100%-32 180" textcolor="red" />
|
|
|
|
<object type="button" style="StoneButton" size="50%-144 100%-60 50%-16 100%-32">
|
|
<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">
|
|
<translatableAttribute id="caption">[Connection status]</translatableAttribute>
|
|
</object>
|
|
</object>
|
|
|
|
</object>
|
|
|
|
</objects>
|