0ad/binaries/data/mods/public/gui/lobby/prelobby.xml

121 lines
5.4 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/lobby/prelobby.js"/>
<script file="gui/common/functions_global_object.js"/>
<script file="gui/common/functions_utility.js"/>
<!-- Add a translucent black background to fade out the menu page -->
<object type="image" z="0" sprite="ModernFade"/>
<object name="dialog" 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 Lobby</translatableAttribute>
</object>
<object name="pageWelcome" size="0 32 100% 100%">
<object type="button" size="50 12 100%-50 68" style="ModernButtonRed">
<translatableAttribute id="caption">Create a new account</translatableAttribute>
<action on="Press">switchPage("register");</action>
</object>
<object type="button" size="50 80 100%-50 136" style="ModernButtonRed">
<translatableAttribute id="caption">Login to an existing account</translatableAttribute>
<action on="Press">switchPage("connect");</action>
</object>
</object>
<object name="pageConnect" size="0 32 100% 100%" hidden="true">
<object type="text" size="0 0 100% 30" style="ModernLabelText" text_align="center">
<translatableAttribute id="caption">Connect to the game lobby</translatableAttribute>
</object>
<object name="connectUsernameLabel" type="text" size="20 40 50% 70" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Login:</translatableAttribute>
</object>
<object name="connectUsername" type="input" size="50%+10 40 100%-20 64" style="ModernInput">
<action on="Load">
this.caption = Engine.ConfigDB_GetValue("user", "lobby.login");
</action>
</object>
<object name="connectPasswordLabel" type="text" size="20 80 50% 110" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Password:</translatableAttribute>
</object>
<object name="connectPassword" type="input" size="50%+10 80 100%-20 104" style="ModernInput" mask="true" mask_char="*">
<action on="Load">
// We only show 10 characters to make it look decent.
this.caption = Engine.ConfigDB_GetValue("user", "lobby.password").substring(0, 10);
</action>
<action on="Press">
lobbyStartConnect();
</action>
</object>
</object>
<object name="pageRegister" size="0 32 100% 100%" hidden="true">
<object type="text" style="ModernLabelText" size="0 0 100% 30" text_align="center">
<translatableAttribute id="caption">Registration</translatableAttribute>
</object>
<object name="registerUsernameLabel" type="text" size="10 40 50% 70" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Login:</translatableAttribute>
</object>
<object name="registerUsername" type="input" size="50%+10 40 100%-20 64" style="ModernInput"/>
<object name="registerPasswordLabel" type="text" size="10 80 50% 110" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Password:</translatableAttribute>
</object>
<object name="registerPassword" type="input" size="50%+10 80 100%-20 104" style="ModernInput" mask="true" mask_char="*"/>
<object name="registerPasswordAgainLabel" type="text" size="10 120 50% 150" style="ModernLabelText" text_align="right">
<translatableAttribute id="caption">Password again:</translatableAttribute>
</object>
<object name="registerPasswordAgain" type="input" size="50%+10 120 100%-20 144" style="ModernInput" mask="true" mask_char="*"/>
<object type="button" size="20 160 100%-20 188" style="ModernButtonRed">
<translatableAttribute id="caption">Terms of Service</translatableAttribute>
<action on="Press">openTermsOfService();</action>
</object>
<object type="button" size="20 200 100%-20 228" style="ModernButtonRed">
<translatableAttribute id="caption">Terms of Use</translatableAttribute>
<action on="Press">openTermsOfUse();</action>
</object>
<object name="registerAgreeTermsLabel" type="text" size="20 240 100%-80 270" style="ModernLabelText">
<translatableAttribute id="caption">I have read and agree to the Terms of Service and Terms of Use:</translatableAttribute>
</object>
<object name="registerAgreeTerms" type="checkbox" size="100%-60 245 100%-20 270" style="ModernTickBox" enabled="false">
<action on="Tick"><![CDATA[this.enabled = g_TermsOfServiceRead && g_TermsOfUseRead;]]></action>
</object>
</object>
<object name="feedback" type="text" size="50 100%-90 100%-50 100%-50" style="ModernLabelText" textcolor="red" text_align="center"/>
<object name="cancel" type="button" size="18 100%-45 50%-5 100%-17" style="ModernButtonRed">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">
if (Engine.GetGUIObjectByName("pageWelcome").hidden)
switchPage("welcome");
else
{
lobbyStop();
Engine.PopGuiPage();
}
</action>
</object>
<object name="continue" type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed" enabled="false" hidden="true">
<translatableAttribute id="caption">Connect</translatableAttribute>
<action on="Press">
if (!Engine.GetGUIObjectByName("pageConnect").hidden)
lobbyStartConnect();
else if (!Engine.GetGUIObjectByName("pageRegister").hidden)
lobbyStartRegister();
</action>
</object>
</object>
</objects>