From f35b8679deba6de87ae338f438682a27b07f2327 Mon Sep 17 00:00:00 2001 From: Holly Date: Fri, 26 Apr 2024 17:34:34 +0100 Subject: [PATCH] support opening the popper with the g key --- client/Terminal-00-Multiuser.user.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/client/Terminal-00-Multiuser.user.js b/client/Terminal-00-Multiuser.user.js index d37868c..a781706 100644 --- a/client/Terminal-00-Multiuser.user.js +++ b/client/Terminal-00-Multiuser.user.js @@ -1,10 +1,11 @@ // ==UserScript== -// @name Terminal 00 Multiuser +// @name MultiProbe // @namespace https://*.angusnicneven.com/* -// @version 20240426.2 +// @version 20240426.3 // @description Probe with friends! // @author tgpholly // @match https://*.angusnicneven.com/* +// @match https://*.heavenonline.xyz/* // @icon https://www.google.com/s2/favicons?sz=64&domain=angusnicneven.com // @grant none // ==/UserScript== @@ -36,7 +37,7 @@ if (!window.TE_ACTIVE) { 'use strict'; // Make sure to change the userscript version too!!!!!!!!!! - const USERSCRIPT_VERSION_RAW = "20240426.2"; + const USERSCRIPT_VERSION_RAW = "20240426.3"; const USERSCRIPT_VERSION = parseInt(USERSCRIPT_VERSION_RAW.replace(".", "")); if (!continueRunningScript) { @@ -262,6 +263,7 @@ kbd { } }, 1000); + let needsToUpdate = false; const versionFetchAddress = window.location.href.replace("127.0.0.1", "localhost").includes("//localhost:") ? "http://localhost:38194/api/version" : "https://multiprobe.eusv.net/api/version"; fetch(versionFetchAddress, { method: "post" }).then(response => { console.log("hi"); @@ -269,6 +271,7 @@ kbd { const versionNumber = parseInt(versionNumberRaw); if (versionNumber > USERSCRIPT_VERSION) { // We're out of date >:( + needsToUpdate = true; createUpdateDialog(`${versionNumberRaw.slice(0, versionNumberRaw.length - 1)}.${versionNumberRaw.slice(-1)}`); } }); @@ -402,6 +405,10 @@ kbd { if (ws && ready && selfCursor) { localStorage["t00mp_cursorStyle"] = selfCursor.element.style.visibility = selfCursor.element.style.visibility === "hidden" ? "" : "hidden"; } + } else if (e.key === "g") { + if (ws && ready && selfCursor) { + groupPopper.click(); + } } } @@ -484,6 +491,9 @@ kbd { windowContainer.remove(); windowContainer = null; } + if (!needsToUpdate) { + createFirstTimeDialog(); + } break; } case MessageType.ClientJoined: @@ -669,6 +679,10 @@ kbd { nameLI.innerHTML = "You can show/hide your own name for screenshots by pressing N"; actionList.appendChild(nameLI); + const groupLI = document.createElement("li"); + groupLI.innerHTML = "You can show/hide the party sidebar if you are in one by pressing G"; + actionList.appendChild(groupLI); + const buttons = document.createElement("div"); buttons.style.marginTop = "1rem";