add help-command & eddit ahelp

This commit is contained in:
michael.reiswich
2021-01-19 13:20:44 +01:00
parent f18c47c530
commit eb801fce1a
15 changed files with 414 additions and 74 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 userhelp(globalData: IGlobalData): void {
var userhelpBrowser: BrowserMp = null;
mp.events.add("showUserhelp", () => {
if (userhelpBrowser !== null) {
userhelpBrowser.destroy();
userhelpBrowser = null;
globalData.InInput = false;
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
}
else if (!globalData.InInput) {
globalData.InInput = true;
userhelpBrowser = mp.browsers.new('package://assets/html/helpcommand/userhelp.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true, true);
}
});
mp.events.add("removeUserhelp", () => {
if (userhelpBrowser == null) {
return;
}
else if (globalData.InInput) {
userhelpBrowser.destroy();
userhelpBrowser = null;
globalData.InInput = false;
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
}
});
}