add introduction at noobspawn

This commit is contained in:
michael.reiswich
2021-01-18 15:36:33 +01:00
parent f52c813514
commit f18c47c530
9 changed files with 291 additions and 1 deletions

View File

@@ -0,0 +1,44 @@
/**
* @overview Life of German Reallife - Gui Introduction
* @author MichaPlays
* @copyright (c) 2008 - 2021 Life of German
*/
export default function Introduction(globalData: IGlobalData): void {
var IntroductionBrowser: BrowserMp = null;
mp.events.add("showIntroduction", () => {
if (IntroductionBrowser !== null) {
IntroductionBrowser.destroy();
IntroductionBrowser = null;
globalData.InInput = false;
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
}
else if (!globalData.InInput) {
globalData.InInput = true;
IntroductionBrowser = mp.browsers.new('package://assets/html/Introduction/Introduciton.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true, true);
}
});
mp.events.add("removeIntroduction", () => {
if (IntroductionBrowser == null) {
return;
}
else if (globalData.InInput) {
IntroductionBrowser.destroy();
IntroductionBrowser = null;
globalData.InInput = false;
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
}
});
}