35 lines
1020 B
JavaScript
35 lines
1020 B
JavaScript
/**
|
|
* @overview Life of German Reallife - Save Main main.js
|
|
* @author VegaZ
|
|
* @copyright (c) 2008 - 2018 Life of German
|
|
*/
|
|
var saveBrowser;
|
|
|
|
mp.events.add('saveBlip', () => {
|
|
|
|
saveBrowser = mp.browsers.new('package://Save/save.html');
|
|
mp.gui.chat.activate(false);
|
|
setTimeout(() => {
|
|
mp.gui.cursor.visible = true
|
|
}, 500);
|
|
});
|
|
|
|
mp.events.add('saveData', (blipSprite, blipName, blipScale, blipColor, blipAlpha, blipDrawDistance, blipShortRange, blipRotation, blipDimension) => {
|
|
if (saveBrowser) {
|
|
saveBrowser.destroy();
|
|
}
|
|
|
|
mp.events.callRemote('OnSaveBlipData', blipSprite, blipName, blipScale, blipColor, blipAlpha,
|
|
blipDrawDistance, blipShortRange, blipRotation, blipDimension);
|
|
mp.gui.chat.push(blipShortRange);
|
|
mp.gui.cursor.show(false, false);
|
|
mp.gui.chat.activate(true);
|
|
});
|
|
|
|
mp.events.add('cancelData', () => {
|
|
if (saveBrowser) {
|
|
saveBrowser.destroy();
|
|
}
|
|
mp.gui.cursor.show(false, false);
|
|
mp.gui.chat.activate(true);
|
|
}); |