0ad/binaries/data/mods/public/gui/gamesetup/gamesetup_mp.xml
Yves 4b1297b328 Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
2014-01-04 10:14:53 +00:00

122 lines
3.9 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="StoneDialog" 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">
Multiplayer
</object>
<object name="pageJoin" size="0 32 100% 100%" hidden="true">
<object type="text" style="CenteredLabelText" size="0 0 400 30">
Joining an existing game.
</object>
<object type="text" size="0 40 200 70" style="RightLabelText">
Player name:
</object>
<object name="joinPlayerName" type="input" size="210 40 100%-32 64" style="StoneInput">
<action on="Load">
this.caption = Engine.ConfigDB_GetValue("user", "playername");
</action>
</object>
<object type="text" size="0 80 200 110" style="RightLabelText">
Server Hostname or IP:
</object>
<object name="joinServer" type="input" size="210 80 100%-32 104" style="StoneInput">
<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%-144 100%-60 50%-16 100%-32" style="StoneButton">
Continue
<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="CenteredLabelText" size="0 0 400 30">
Set up your server to host.
</object>
<object name="hostPlayerNameWrapper" hidden="true">
<object type="text" size="0 40 200 70" style="RightLabelText">
Player name:
</object>
<object name="hostPlayerName" type="input" size="210 40 100%-32 64" style="StoneInput">
<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="RightLabelText">
Server name:
</object>
<object name="hostServerName" type="input" size="210 80 100%-32 104" style="StoneInput">
<action on="Load">
this.caption = Engine.ConfigDB_GetValue("user", "playername") + "'s game";
</action>
</object>
</object>
<object type="button" size="50%-144 100%-60 50%-16 100%-32" style="StoneButton">
Continue
<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="CenteredLabelText" size="32 150 100%-32 180" textcolor="red" />
<object type="button" style="StoneButton" size="50%+16 100%-60 50%+144 100%-32">
Cancel
<action on="Press">cancelSetup();</action>
</object>
<object name="pageConnecting" hidden="true">
<object name="connectionStatus" type="text" style="CenteredLabelText" size="0 100 100% 120">
[Connection status]
</object>
</object>
</object>
</objects>