Ticket #2312: lobby.diff

File lobby.diff, 8.3 KB (added by sanderd17, 10 years ago)
  • binaries/data/mods/public/gui/lobby/prelobby.js

     
    6161        feedback.caption = translate("Passwords do not match");
    6262        Engine.GetGUIObjectByName("connectPassword").caption = "";
    6363        Engine.GetGUIObjectByName("registerPasswordAgain").caption = "";
    64         switchRegister();
    6564        return;
    6665    }
    6766
     
    7978        lobbyStop();
    8079        Engine.GetGUIObjectByName("pageRegister").hidden = false;
    8180        Engine.GetGUIObjectByName("pageConnect").hidden = true;
    82         Engine.GetGUIObjectByName("connect").enabled = false;
    8381    }
    8482    else
    8583    {
    8684        Engine.GetGUIObjectByName("pageRegister").hidden = true;
    8785        Engine.GetGUIObjectByName("pageConnect").hidden = false;
    88         Engine.GetGUIObjectByName("connect").enabled = true;
    8986    }
    9087}
    9188
     
    125122        connectButton.enabled = true;
    126123        registerButton.enabled = true;
    127124    }
     125
     126    if (connectButton.enabled)
     127        connectButton.tooltip = translate("Connect to the lobby");
     128    else
     129        connectButton.tooltip = translate("You need to enter a valid username and password to enter the lobby");
     130    if (registerButton.enabled)
     131        registerButton.tooltip = translate("Register a new accout and connect to the lobby");
     132    else
     133        registerButton.tooltip = translate("You need to enter a valid username, password and password verification to register a lobby account");
     134
    128135    // If the password hasn't been entered again, we can't complete registation.
    129136    if (!pageRegisterHidden && !passwordAgain)
    130137        registerButton.enabled = false;
  • binaries/data/mods/public/gui/lobby/prelobby.xml

     
    88    <!-- Add a translucent black background to fade out the menu page -->
    99    <object type="image" z="0" sprite="ModernFade"/>
    1010
    11     <object name="dialog" type="image" style="ModernDialog" size="50%-190 50%-120 50%+190 50%+120">
     11    <object name="dialog" type="image" style="ModernDialog" size="50%-210 50%-150 50%+210 50%+150">
    1212
    1313        <action on="Tick">
    1414            onTick();
     
    2424            <translatableAttribute id="caption">Multiplayer Lobby</translatableAttribute>
    2525        </object>
    2626
    27         <object name="pageConnect" size="0 32 100% 100%">
    28             <object type="text" size="0 0 400 30" style="ModernLabelText" text_align="center">
    29                 <translatableAttribute id="caption">Connect to the game lobby</translatableAttribute>
    30             </object>
    31             <object name="connectUsernameLabel" type="text" size="50 40 125 70" style="ModernLabelText" text_align="right">
     27        <object name="userName" size="0 100 100% 130">
     28            <object name="connectUsernameLabel" type="text" size="10 0 50%-10 30" style="ModernLabelText" text_align="right">
    3229                <translatableAttribute id="caption">Login:</translatableAttribute>
    3330            </object>
    34             <object name="connectUsername" type="input" size="135 40 100%-50 64" style="ModernInput">
     31            <object name="connectUsername" type="input" size="50% 0 100%-50 24" style="ModernInput">
    3532                <action on="Load">
    3633                    this.caption = Engine.ConfigDB_GetValue("user", "lobby.login");
    3734                </action>
    3835            </object>
    39             <object name="connectPasswordLabel" type="text" size="50 80 125 110" style="ModernLabelText" text_align="right">
     36        </object>
     37        <object name="password" size="0 130 100% 160">
     38            <object name="connectPasswordLabel" type="text" size="10 0 50%-10 30" style="ModernLabelText" text_align="right">
    4039                <translatableAttribute id="caption">Password:</translatableAttribute>
    4140            </object>
    42             <object name="connectPassword" type="input" size="135 80 100%-50 104" style="ModernInput" mask="true" mask_char="*">
     41            <object name="connectPassword" type="input" size="50% 0 100%-50 24" style="ModernInput" mask="true" mask_char="*">
    4342                <action on="Load">
    4443                    // We only show 10 characters to make it look decent.
    4544                    this.caption = Engine.ConfigDB_GetValue("user", "lobby.password").substring(0, 10);
    4645                </action>
    4746                <action on="Press">
    48                     lobbyStart();
     47                    if (Engine.GetGUIObjectByName("pageRegister").hidden)
     48                        lobbyStart();
    4949                </action>
    5050            </object>
    5151        </object>
    52         <object name="pageRegister" size="0 32 100% 100%" hidden="true">
    53             <object type="text" style="ModernLabelText" size="0 0 400 30" text_align="center">
     52        <!-- Feedback -->
     53        <object name="feedback" type="text" size="50 200 100%-50 240" style="ModernLabelText" textcolor="red" text_align="center"/>
     54
     55        <!-- CONTEXT SENSITIVE PARTS -->
     56        <!-- Context part -->
     57        <object name="pageConnect" size="0 0 100% 100%">
     58            <object type="text" size="0 30 400 60" style="ModernLabelText" text_align="center">
     59                <translatableAttribute id="caption">Connect to the game lobby, or</translatableAttribute>
     60            </object>
     61            <!-- Go to register page -->
     62            <object name="toRegisterPage" type="button" size="50 60 100%-50 84" style="StoneButton">
     63                <translatableAttribute id="caption">Create new account</translatableAttribute>
     64                <translatableAttribute id="tooltip">Need a new account? Register here</translatableAttribute>
     65                <action on="Press">
     66                    switchRegister();
     67                </action>
     68            </object>
     69            <!-- Cancel -->
     70            <object type="button" size="18 100%-45 126 100%-17" style="StoneButton">
     71                <translatableAttribute id="caption">Cancel</translatableAttribute>
     72                <translatableAttribute id="tooltip">Close this window</translatableAttribute>
     73                <action on="Press">
     74                    lobbyStop();
     75                    Engine.PopGuiPage();
     76                </action>
     77            </object>
     78            <!-- Connect -->
     79            <object name="connect" type="button" size="254 100%-45 100%-18 100%-17" style="StoneButton">
     80                <translatableAttribute id="caption">Connect</translatableAttribute>
     81                <action on="Press">
     82                    lobbyStart()
     83                </action>
     84            </object>
     85        </object>
     86        <!-- Register part -->
     87        <object name="pageRegister" size="0 0 100% 100%" hidden="true">
     88            <object type="text" style="ModernLabelText" size="0 30 400 60" text_align="center">
    5489                <translatableAttribute id="caption">Registration</translatableAttribute>
    5590            </object>
    56             <object type="text" size="50 40 170 70" style="ModernLabelText" text_align="right">
     91            <object type="text" size="10 160 50%-10 190" style="ModernLabelText" text_align="right">
    5792                <translatableAttribute id="caption">Password again:</translatableAttribute>
    5893            </object>
    59             <object name="registerPasswordAgain" type="input" size="180 40 100%-50 64" style="ModernInput" mask="true" mask_char="*">
     94            <object name="registerPasswordAgain" type="input" size="50% 160 100%-50 184" style="ModernInput" mask="true" mask_char="*">
    6095                <action on="Press">
    6196                    lobbyStartRegister()
    6297                </action>
    6398            </object>
    64         </object>
    65         <object name="feedback" type="text" size="50 150 100%-50 190" style="ModernLabelText" textcolor="red" text_align="center"/>
    66         <object type="button" size="18 100%-45 126 100%-17" style="StoneButton">
    67             <translatableAttribute id="caption">Cancel</translatableAttribute>
    68             <action on="Press">
    69                 if (Engine.GetGUIObjectByName("pageRegister").hidden)
    70                 {
    71                     lobbyStop();
    72                     Engine.PopGuiPage();
    73                 }
    74                 else
     99            <!-- Cancel -->
     100            <object type="button" size="18 100%-45 126 100%-17" style="StoneButton">
     101                <translatableAttribute id="caption">Cancel</translatableAttribute>
     102                <translatableAttribute id="tooltip">Back to the login screen</translatableAttribute>
     103                <action on="Press">
    75104                    switchRegister();
    76             </action>
    77         </object>
    78         <object name="register" type="button" size="136 100%-45 244 100%-17" style="StoneButton">
    79             <translatableAttribute id="caption">Register</translatableAttribute>
    80             <action on="Press">
    81                 if (Engine.GetGUIObjectByName("pageRegister").hidden)
    82                 {
    83                     switchRegister();
    84                 }
    85                 else
     105                </action>
     106            </object>
     107            <!-- Register -->
     108            <object name="register" type="button" size="254 100%-45 100%-18 100%-17" style="StoneButton">
     109                <translatableAttribute id="caption">Register</translatableAttribute>
     110                <action on="Press">
    86111                    lobbyStartRegister()
    87             </action>
     112                </action>
     113            </object>
    88114        </object>
    89         <object name="connect" type="button" size="254 100%-45 100%-18 100%-17" style="StoneButton">
    90             <translatableAttribute id="caption">Connect</translatableAttribute>
    91             <action on="Press">
    92                 lobbyStart();
    93             </action>
    94         </object>
    95115
    96116    </object>
    97117