Moved error display from chat to cef, cleaned up css code

This commit is contained in:
Lennart Kampshoff
2018-09-21 23:14:43 +02:00
parent ecb227be5c
commit 24a8c975cf
3 changed files with 46 additions and 48 deletions

View File

@@ -1,13 +1,13 @@
/**
* @overview Life of German Reallife - Login Main main.js
* @author VegaZ
* @author VegaZ, hydrant
* @copyright (c) 2008 - 2018 Life of German
*/
var loginBrowser;
loginBrowser = mp.browsers.new('package://Login/login.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true);
mp.gui.cursor.show(true, true);
mp.events.add('loginInformationToServer', (password) => {
@@ -21,12 +21,12 @@ mp.events.add('registerInformationToServer', (password) => {
});
mp.events.add('registerSuccess', () => {
mp.gui.chat.push("Erfolgreich registriert!")
if (loginBrowser)
{
loginBrowser.destroy();
}
mp.gui.cursor.show(false);
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
});
@@ -36,14 +36,14 @@ mp.events.add('loginSuccess', () => {
{
loginBrowser.destroy();
}
mp.gui.cursor.show(false);
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
});
mp.events.add('loginFail', (reason) => {
mp.gui.chat.push(reason);
showCefError(reason);
});
@@ -51,14 +51,16 @@ mp.events.add('loginDeny', (reason) => {
if (loginBrowser) {
loginBrowser.destroy();
}
mp.gui.cursor.show(false);
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
mp.gui.chat.push(reason);
showCefError(reason);
});
mp.events.add('registerFail', (reason) => {
mp.gui.chat.push(reason);
showCefError(reason);
});
function showCefError(error) {
loginBrowser.execute(`showError(\`` + error + `\`)`);
}