Added select button

This commit is contained in:
FlamedDogo99 2024-05-28 15:52:19 -06:00 committed by GitHub
parent a5f33ef933
commit 57b9fb3ab5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@
// @license Apache License 2.0 - http://www.apache.org/licenses/ // @license Apache License 2.0 - http://www.apache.org/licenses/
// @match https://eaglercraft.com/mc/* // @match https://eaglercraft.com/mc/*
// @grant none // @grant none
// @version 1.3 // @version 1.4
// @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js // @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js
// @run-at document-start // @run-at document-start
// ==/UserScript== // ==/UserScript==
@ -335,6 +335,14 @@ function insertCanvasElements() {
breakButton.addEventListener("touchend", function(e){mouseEvent(0, "mouseup", canvas)}, false); breakButton.addEventListener("touchend", function(e){mouseEvent(0, "mouseup", canvas)}, false);
breakButton.addEventListener("touchmove", function(e){e.preventDefault()}, false); breakButton.addEventListener("touchmove", function(e){e.preventDefault()}, false);
document.body.appendChild(breakButton); document.body.appendChild(breakButton);
var selectButton = document.createElement('button');
selectButton.id = "hideButton"
selectButton.textContent = "⬚";
selectButton.style.cssText = "right:20vh;bottom:20vh;"
selectButton.addEventListener("touchstart", function(e){mouseEvent(1, "mousedown", canvas)}, false);
selectButton.addEventListener("touchend", function(e){mouseEvent(1, "mouseup", canvas)}, false);
selectButton.addEventListener("touchmove", function(e){e.preventDefault()}, false);
document.body.appendChild(selectButton);
var scrollUpButton = document.createElement('button'); var scrollUpButton = document.createElement('button');
scrollUpButton.id = "hideButton" scrollUpButton.id = "hideButton"
scrollUpButton.textContent = "⇨"; scrollUpButton.textContent = "⇨";