Moved error display from chat to cef, cleaned up css code
This commit is contained in:
@@ -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 + `\`)`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user