From 2aeef9c83ec97516a23b49ef3418ec352e6859d9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 23 Aug 2020 22:08:37 +0200 Subject: [PATCH] add cursor & close inputhelper --- ReallifeGamemode.Client/Jobs/RefuseCollector.ts | 6 +++--- .../assets/js/inputhelper/application.js | 5 +++-- ReallifeGamemode.Client/inputhelper/index.ts | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Client/Jobs/RefuseCollector.ts b/ReallifeGamemode.Client/Jobs/RefuseCollector.ts index 498f08a3..17215784 100644 --- a/ReallifeGamemode.Client/Jobs/RefuseCollector.ts +++ b/ReallifeGamemode.Client/Jobs/RefuseCollector.ts @@ -34,9 +34,9 @@ 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 }); - 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 }); - ShapeTonneBase = mp.colshapes.newSphere(-426.69382, -1691.0972, 19.02909 - 1, 10); + 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(-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(-442.3999, -1701.5234, 18.933002 - 1, 10); }); mp.events.add('SERVER:MuellmannBCSEntfernen', () => { for (var i = 0; i < BlipTonne.length; i++) { diff --git a/ReallifeGamemode.Client/assets/js/inputhelper/application.js b/ReallifeGamemode.Client/assets/js/inputhelper/application.js index de9f956b..a4435abf 100644 --- a/ReallifeGamemode.Client/assets/js/inputhelper/application.js +++ b/ReallifeGamemode.Client/assets/js/inputhelper/application.js @@ -21,6 +21,7 @@ function setInputFieldType(value) { return field; } + function setText(heading, description) { setHeading(heading); setDescription(description); @@ -47,8 +48,8 @@ function getInput() { return input.value.length != 0 ? input.value : null; } -function closeWindow() { - // TODO: Fenster schließen +close.onclick = function closeWindow() { + mp.trigger('closeinputhelper'); console.log('Fenster geschlossen!'); } diff --git a/ReallifeGamemode.Client/inputhelper/index.ts b/ReallifeGamemode.Client/inputhelper/index.ts index e6c5de12..b0fc9880 100644 --- a/ReallifeGamemode.Client/inputhelper/index.ts +++ b/ReallifeGamemode.Client/inputhelper/index.ts @@ -23,6 +23,9 @@ export default class InputHelper { this.getValue = this.getValue.bind(this); this.value = undefined; + + mp.events.add('closeinputhelper', this.finish); + } show() { @@ -32,6 +35,7 @@ export default class InputHelper { this.data.InInput = true; this.created = true; this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html'); + mp.gui.cursor.show(true, true); } private finish() { @@ -43,6 +47,7 @@ export default class InputHelper { this.data.InMenu = false; this.created = false; this.browser = null; + mp.gui.cursor.show(false, false); } }