Protox Block Tooltip+

Adds more details to the tooltip

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Protox Block Tooltip+
// @namespace    https://restrictedword.github.io/
// @version      1.0
// @description  Adds more details to the tooltip
// @author       Word
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=protox.io
// @grant        none
// ==/UserScript==

(()=>{"use strict";const t="[ProtoxTooltip]",o="https://restrictedword.github.io/protox/data/block_info.json";let e=null,n=!1,r=null;function c(){return document.getElementById("global-tooltip")}function a(t,o){const e=document.createElement("div");e.dataset.extraProp="true",e.textContent=o,t.appendChild(e)}async function fetchJSON(){if(e)return e;try{const n=await fetch(o);e=await n.json()}catch(o){}return e}async function init(){await fetchJSON();const l=c();if(!l)return;new MutationObserver((()=>{const o=l.textContent.match(/id:\s*(\d+)/i);if(!o)return;const i=o[1];i!==r&&(r=i,async function(o){if(!o||!e||n)return;const r=c();if(!r)return;const l=e[String(o)];l&&(n=!0,function(t){t.querySelectorAll("[data-extra-prop]").forEach((t=>t.remove()))}(r),!0===l.transparent&&a(r,"transparent: true"),!0===l.penetrable&&a(r,"penetrable: true"),"number"==typeof l.impactResistance&&a(r,`impactResistance: ${l.impactResistance}`),!0===l.climbable&&a(r,"climbable: true"),requestAnimationFrame((()=>{n=!1})))})(i)})).observe(l,{childList:!0,subtree:!0,characterData:!0})}init()})()