add help-command & eddit ahelp
This commit is contained in:
61
ReallifeGamemode.Client/Gui/ahelp.ts
Normal file
61
ReallifeGamemode.Client/Gui/ahelp.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Gui ahelp
|
||||
* @author MichaPlays
|
||||
* @copyright (c) 2008 - 2021 Life of German
|
||||
*/
|
||||
|
||||
export default function ahelp(globalData: IGlobalData): void {
|
||||
|
||||
var ahelpBrowser: BrowserMp = null;
|
||||
|
||||
mp.events.add("showAhelp", () => {
|
||||
|
||||
if (ahelpBrowser !== null) {
|
||||
ahelpBrowser.destroy();
|
||||
ahelpBrowser = null;
|
||||
globalData.InInput = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
else if (!globalData.InInput) {
|
||||
globalData.InInput = true;
|
||||
ahelpBrowser = mp.browsers.new('package://assets/html/helpcommand/ahelp.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("removeAhelp", () => {
|
||||
|
||||
if (ahelpBrowser == null) {
|
||||
return;
|
||||
}
|
||||
else if (globalData.InInput) {
|
||||
ahelpBrowser.destroy();
|
||||
ahelpBrowser = null;
|
||||
globalData.InInput = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("showShelp", () => {
|
||||
|
||||
if (ahelpBrowser !== null) {
|
||||
ahelpBrowser.destroy();
|
||||
ahelpBrowser = null;
|
||||
globalData.InInput = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
else if (!globalData.InInput) {
|
||||
globalData.InInput = true;
|
||||
ahelpBrowser = mp.browsers.new('package://assets/html/helpcommand/shelp.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user