add cursor & close inputhelper

This commit is contained in:
Michael
2020-08-23 22:08:37 +02:00
parent 98df538403
commit 2aeef9c83e
3 changed files with 11 additions and 5 deletions

View File

@@ -34,9 +34,9 @@
ShapeTonne.push(mp.colshapes.newSphere(posArr[i].x, posArr[i].y, posArr[i].z + 0.5, 1.75)); ShapeTonne.push(mp.colshapes.newSphere(posArr[i].x, posArr[i].y, posArr[i].z + 0.5, 1.75));
} }
BlipTonneBase = mp.blips.new(1, new mp.Vector3(-426.69382, -1691.0972, 19.02909 - 1), { name: 'Recylinganlage', color: 5, shortRange: false }); BlipTonneBase = mp.blips.new(1, new mp.Vector3(-442.3999, -1701.5234, 18.933002 - 1), { name: 'Recylinganlage', color: 5, shortRange: false });
CheckpointTonneBase = mp.markers.new(1, new mp.Vector3(-426.69382, -1691.0972, 19.02909 - 1), 10, { direction: new mp.Vector3(-235.5747, -1685.475, 32.7207), color: [255, 255, 0, 150], visible: true, dimension: 0 }); CheckpointTonneBase = mp.markers.new(1, new mp.Vector3(-442.3999, -1701.5234, 18.933002 - 1), 10, { direction: new mp.Vector3(-235.5747, -1685.475, 32.7207), color: [255, 255, 0, 150], visible: true, dimension: 0 });
ShapeTonneBase = mp.colshapes.newSphere(-426.69382, -1691.0972, 19.02909 - 1, 10); ShapeTonneBase = mp.colshapes.newSphere(-442.3999, -1701.5234, 18.933002 - 1, 10);
}); });
mp.events.add('SERVER:MuellmannBCSEntfernen', () => { mp.events.add('SERVER:MuellmannBCSEntfernen', () => {
for (var i = 0; i < BlipTonne.length; i++) { for (var i = 0; i < BlipTonne.length; i++) {

View File

@@ -21,6 +21,7 @@ function setInputFieldType(value) {
return field; return field;
} }
function setText(heading, description) { function setText(heading, description) {
setHeading(heading); setHeading(heading);
setDescription(description); setDescription(description);
@@ -47,8 +48,8 @@ function getInput() {
return input.value.length != 0 ? input.value : null; return input.value.length != 0 ? input.value : null;
} }
function closeWindow() { close.onclick = function closeWindow() {
// TODO: Fenster schließen mp.trigger('closeinputhelper');
console.log('Fenster geschlossen!'); console.log('Fenster geschlossen!');
} }

View File

@@ -23,6 +23,9 @@ export default class InputHelper {
this.getValue = this.getValue.bind(this); this.getValue = this.getValue.bind(this);
this.value = undefined; this.value = undefined;
mp.events.add('closeinputhelper', this.finish);
} }
show() { show() {
@@ -32,6 +35,7 @@ export default class InputHelper {
this.data.InInput = true; this.data.InInput = true;
this.created = true; this.created = true;
this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html'); this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html');
mp.gui.cursor.show(true, true);
} }
private finish() { private finish() {
@@ -43,6 +47,7 @@ export default class InputHelper {
this.data.InMenu = false; this.data.InMenu = false;
this.created = false; this.created = false;
this.browser = null; this.browser = null;
mp.gui.cursor.show(false, false);
} }
} }