Ticket #2312: lobby.diff
File lobby.diff, 8.3 KB (added by , 10 years ago) |
---|
-
binaries/data/mods/public/gui/lobby/prelobby.js
61 61 feedback.caption = translate("Passwords do not match"); 62 62 Engine.GetGUIObjectByName("connectPassword").caption = ""; 63 63 Engine.GetGUIObjectByName("registerPasswordAgain").caption = ""; 64 switchRegister();65 64 return; 66 65 } 67 66 … … 79 78 lobbyStop(); 80 79 Engine.GetGUIObjectByName("pageRegister").hidden = false; 81 80 Engine.GetGUIObjectByName("pageConnect").hidden = true; 82 Engine.GetGUIObjectByName("connect").enabled = false;83 81 } 84 82 else 85 83 { 86 84 Engine.GetGUIObjectByName("pageRegister").hidden = true; 87 85 Engine.GetGUIObjectByName("pageConnect").hidden = false; 88 Engine.GetGUIObjectByName("connect").enabled = true;89 86 } 90 87 } 91 88 … … 125 122 connectButton.enabled = true; 126 123 registerButton.enabled = true; 127 124 } 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 128 135 // If the password hasn't been entered again, we can't complete registation. 129 136 if (!pageRegisterHidden && !passwordAgain) 130 137 registerButton.enabled = false; -
binaries/data/mods/public/gui/lobby/prelobby.xml
8 8 <!-- Add a translucent black background to fade out the menu page --> 9 9 <object type="image" z="0" sprite="ModernFade"/> 10 10 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"> 12 12 13 13 <action on="Tick"> 14 14 onTick(); … … 24 24 <translatableAttribute id="caption">Multiplayer Lobby</translatableAttribute> 25 25 </object> 26 26 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"> 32 29 <translatableAttribute id="caption">Login:</translatableAttribute> 33 30 </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"> 35 32 <action on="Load"> 36 33 this.caption = Engine.ConfigDB_GetValue("user", "lobby.login"); 37 34 </action> 38 35 </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"> 40 39 <translatableAttribute id="caption">Password:</translatableAttribute> 41 40 </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="*"> 43 42 <action on="Load"> 44 43 // We only show 10 characters to make it look decent. 45 44 this.caption = Engine.ConfigDB_GetValue("user", "lobby.password").substring(0, 10); 46 45 </action> 47 46 <action on="Press"> 48 lobbyStart(); 47 if (Engine.GetGUIObjectByName("pageRegister").hidden) 48 lobbyStart(); 49 49 </action> 50 50 </object> 51 51 </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"> 54 89 <translatableAttribute id="caption">Registration</translatableAttribute> 55 90 </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"> 57 92 <translatableAttribute id="caption">Password again:</translatableAttribute> 58 93 </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="*"> 60 95 <action on="Press"> 61 96 lobbyStartRegister() 62 97 </action> 63 98 </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"> 75 104 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"> 86 111 lobbyStartRegister() 87 </action> 112 </action> 113 </object> 88 114 </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>95 115 96 116 </object> 97 117