Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Can pause game on mobile by touching the play area
authorJulian Fietkau <git@fietkau.software>
Thu, 26 Sep 2024 23:48:38 +0000 (01:48 +0200)
committerJulian Fietkau <git@fietkau.software>
Thu, 26 Sep 2024 23:48:38 +0000 (01:48 +0200)
main.js

diff --git a/main.js b/main.js
index 1f5f076989d71d36900c6f1f7926e2fbbdd1b930..8e4b90754a27c4493fe98082ab5e8cd9c79a190c 100644 (file)
--- a/main.js
+++ b/main.js
@@ -407,6 +407,10 @@ function init(game, canvas) {
     cursorMoveEvent(game, e.target, e.touches[0].clientX, e.touches[0].clientY, true);
   });
   document.body.addEventListener('touchend', e => {
+    if(e.target.closest('.ui-container') && game.settings['controls'] != 'mouse' && ['gameplay', 'openingcutscene', 'endingcutscene'].includes(game.ui.currentPage)) {
+      game.ui.moveToPage('pause', true);
+      e.preventDefault();
+    }
     if(game.settings['controls'] == 'thumbstick') {
       cursorMoveEvent(game, e.target, 0, 0, false);
       game.ui.virtualInput.inProgress = false;