- Timestamp:
- 06/08/18 15:39:52 (7 years ago)
- Location:
- ps/trunk/binaries/data/mods/public/gui
- Files:
-
- 3 edited
-
manual/manual.xml (modified) (1 diff)
-
prelobby/prelobby.js (modified) (3 diffs)
-
prelobby/prelobby.xml (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/gui/manual/manual.xml
r21804 r21846 20 20 <object type="button" style="ModernButtonRed" tooltip_style="snToolTip" size="100%-408 100%-52 100%-218 100%-24" hotkey="cancel"> 21 21 <translatableAttribute id="caption">Close</translatableAttribute> 22 <action on="Press"> <![CDATA[closeManual();]]></action>22 <action on="Press">closeManual();</action> 23 23 </object> 24 24 <object name="url" type="button" style="ModernButtonRed" size="100%-214 100%-52 100%-24 100%-24" hidden="true"> -
ps/trunk/binaries/data/mods/public/gui/prelobby/prelobby.js
r21311 r21846 2 2 var g_EncryptedPassword = ""; 3 3 var g_PasswordInputIsHidden = false; 4 var g_TermsOfServiceRead = false;5 var g_TermsOfUseRead = false;6 4 var g_DisplayingSystemMessage = false; 7 5 6 var g_Terms = { 7 "Service": { 8 "title": translate("Terms of Service"), 9 "instruction": translate("Please read the Terms of Service"), 10 "file": "prelobby/Terms_of_Service", 11 "read": false 12 }, 13 "Use": { 14 "title": translate("Terms of Use"), 15 "instruction": translate("Please read the Terms of Use"), 16 "file": "prelobby/Terms_of_Use", 17 "read": false 18 } 19 }; 20 8 21 function init() 9 22 { 23 let username = Engine.ConfigDB_GetValue("user", "lobby.login"); 24 g_EncryptedPassword = Engine.ConfigDB_GetValue("user", "lobby.password"); 25 26 // We only show 10 characters to make it look decent. 27 Engine.GetGUIObjectByName("connectUsername").caption = username; 28 Engine.GetGUIObjectByName("connectPassword").caption = g_EncryptedPassword.substring(0, 10); 29 10 30 Engine.GetGUIObjectByName("rememberPassword").checked = 11 31 Engine.ConfigDB_GetValue("user", "lobby.rememberpassword") == "true"; 12 g_EncryptedPassword = Engine.ConfigDB_GetValue("user", "lobby.password"); 13 if ( Engine.ConfigDB_GetValue("user", "lobby.login")&& g_EncryptedPassword)32 33 if (username && g_EncryptedPassword) 14 34 switchPage("connect"); 15 35 } … … 130 150 } 131 151 // Check that they read the Terms of Service. 132 else if (!g_Terms OfServiceRead)133 { 134 continueButton.enabled = false; 135 feedback.caption = translate("Please read the Terms of Service");152 else if (!g_Terms.Service.read) 153 { 154 continueButton.enabled = false; 155 feedback.caption = g_Terms.Service.instruction; 136 156 } 137 157 // Check that they read the Terms of Use. 138 else if (!g_Terms OfUseRead)139 { 140 continueButton.enabled = false; 141 feedback.caption = translate("Please read the Terms of Use");158 else if (!g_Terms.Use.read) 159 { 160 continueButton.enabled = false; 161 feedback.caption = g_Terms.Use.instruction; 142 162 } 143 163 // Check that they agree to the terms of service and use. … … 258 278 } 259 279 } 260 function openTermsOfService() 261 { 262 g_TermsOfServiceRead = true; 280 281 function openTerms(terms) 282 { 283 g_Terms[terms].read = true; 284 285 Engine.GetGUIObjectByName("registerAgreeTerms").enabled = g_Terms.Service.read && g_Terms.Use.read; 286 263 287 Engine.PushGuiPage("page_manual.xml", { 264 "page": "prelobby/Terms_of_Service",265 "title": translate("Terms of Service"),288 "page": g_Terms[terms].file, 289 "title": g_Terms[terms].title 266 290 }); 267 291 } 268 292 269 function openTermsOfUse() 270 { 271 g_TermsOfUseRead = true; 272 Engine.PushGuiPage("page_manual.xml", { 273 "page": "prelobby/Terms_of_Use", 274 "title": translate("Terms of Use"), 275 }); 293 function prelobbyConnect() 294 { 295 if (!Engine.GetGUIObjectByName("pageConnect").hidden) 296 lobbyStartConnect(); 297 else if (!Engine.GetGUIObjectByName("pageRegister").hidden) 298 lobbyStartRegister(); 276 299 } 277 300 -
ps/trunk/binaries/data/mods/public/gui/prelobby/prelobby.xml
r21311 r21846 18 18 <object name="dialog" type="image" style="ModernDialog" size="50%-230 50%-130 50%+230 50%+130"> 19 19 20 <action on="Tick"> 21 onTick(); 22 </action> 20 <action on="Tick">onTick();</action> 23 21 24 22 <object style="ModernLabelText" type="text" size="50%-128 -18 50%+128 14"> … … 43 41 <translatableAttribute id="caption">Login:</translatableAttribute> 44 42 </object> 45 <object name="connectUsername" type="input" size="50%+10 40 100%-20 64" style="ModernInput"> 46 <action on="Load"> 47 this.caption = Engine.ConfigDB_GetValue("user", "lobby.login"); 48 </action> 49 </object> 43 <object name="connectUsername" type="input" size="50%+10 40 100%-20 64" style="ModernInput"/> 44 50 45 <object name="connectPasswordLabel" type="text" size="20 80 50% 110" style="ModernRightLabelText"> 51 46 <translatableAttribute id="caption">Password:</translatableAttribute> 52 47 </object> 53 48 <object name="connectPassword" type="input" size="50%+10 80 100%-20 104" style="ModernInput" mask="true" mask_char="*"> 54 <action on="Load"> 55 // We only show 10 characters to make it look decent. 56 this.caption = Engine.ConfigDB_GetValue("user", "lobby.password").substring(0, 10); 57 </action> 58 <action on="Press"> 59 lobbyStartConnect(); 60 </action> 49 <action on="Press">lobbyStartConnect();</action> 61 50 </object> 62 51 <object name="rememberPassword" type="checkbox" size="50%-19 115 50% 135" style="ModernTickBox"> 63 <action on="Press"> 64 toggleRememberPassword(); 65 </action> 52 <action on="Press">toggleRememberPassword();</action> 66 53 </object> 67 54 <object type="text" size="50%+10 115 100%-20 135" style="ModernLeftLabelText"> … … 69 56 </object> 70 57 </object> 58 71 59 <object name="pageRegister" size="0 32 100% 100%" hidden="true"> 72 60 … … 92 80 <object type="button" size="20 160 100%-20 188" style="ModernButtonRed"> 93 81 <translatableAttribute id="caption">Terms of Service</translatableAttribute> 94 <action on="Press">openTerms OfService();</action>82 <action on="Press">openTerms("Service");</action> 95 83 </object> 96 84 97 85 <object type="button" size="20 200 100%-20 228" style="ModernButtonRed"> 98 86 <translatableAttribute id="caption">Terms of Use</translatableAttribute> 99 <action on="Press">openTerms OfUse();</action>87 <action on="Press">openTerms("Use");</action> 100 88 </object> 101 89 … … 103 91 <translatableAttribute id="caption">I have read and agree to the Terms of Service and Terms of Use:</translatableAttribute> 104 92 </object> 105 <object name="registerAgreeTerms" type="checkbox" size="100%-60 245 100%-20 270" style="ModernTickBox" enabled="false"> 106 <action on="Tick"><![CDATA[this.enabled = g_TermsOfServiceRead && g_TermsOfUseRead;]]></action> 107 </object> 93 94 <object name="registerAgreeTerms" type="checkbox" size="100%-60 245 100%-20 270" style="ModernTickBox" enabled="false"/> 108 95 109 96 </object> 97 110 98 <object name="feedback" type="text" size="50 100%-110 100%-50 100%-50" style="ModernLabelText" textcolor="red"/> 111 99 <object name="cancel" type="button" size="18 100%-45 50%-5 100%-17" style="ModernButtonRed" hotkey="cancel"> … … 115 103 <object name="continue" hotkey="confirm" type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed" enabled="false" hidden="true"> 116 104 <translatableAttribute id="caption">Connect</translatableAttribute> 117 <action on="Press"> 118 if (!Engine.GetGUIObjectByName("pageConnect").hidden) 119 lobbyStartConnect(); 120 else if (!Engine.GetGUIObjectByName("pageRegister").hidden) 121 lobbyStartRegister(); 122 </action> 105 <action on="Press">prelobbyConnect();</action> 123 106 </object> 124 107
Note:
See TracChangeset
for help on using the changeset viewer.
