From f218aed9da6d250f8df7093838e5197fb95f14db Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Thu, 15 Feb 2024 22:41:57 +0300 Subject: [PATCH] PIXI Control: Clear VirtualGamepad with interactive --- www.rus/js/plugins/VND_ONSControls.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index 3fdb569..7a86825 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -334,6 +334,12 @@ ONSControls.clearInteractive = function() { for (elem of this.getControlElements()) { elem.removeAllListeners(); } + // Clear status of VirtualGamepad + for (button of VirtualGamepad.gamepad.buttons) { + button.pressed = false; + button.touched = false; + button.value = 0; + } } //============================================================================= // * Setup drag'n drop events for element @@ -371,7 +377,7 @@ ONSControls.disableTouch = function() { ONSControls.replaceBackEvent = function() { document.addEventListener("backbutton", function(event){ event.preventDefault(); - this.closeEditMode(); + ONSControls.closeEditMode(); }); } //=============================================================================