Thug's Tools

From Infinite Worlds
Jump to navigation Jump to search

This is a userscript that makes a number of visual changes to the Infinite Worlds site:

  • Makes the main display and most pop-up windows use a lot more of the display's width.
  • Always displays the Secret Information.

To use this userscript:

  1. Install a userscript manager extension for your browser
  2. Copy and Paste the script below into a new entry.

Note: I've only tested this script with GreaseMonkey on PC and Android.

// ==UserScript==
// @name         Thug's IW Display Tweaks
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Always show secrets. Widen display.
// @author       Thug
// @match        *://infiniteworlds.app/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=infiniteworlds.app
// @grant        GM_addStyle
// @require      http://code.jquery.com/jquery-3.7.1.min.js
// ==/UserScript==

(function() {
    'use strict';

    function clickRevealSecrets() {
        let links = $('button').children("i.fa-eye");
        if (links.length >= 1) {
            $(links[0]).parent().click(); // Reveal Secret Information
        }
    }

    // Observe DOM changes so it works with dynamic content
    const observer = new MutationObserver(() => { clickRevealSecrets(); })
    observer.observe(document.body, { childList: true, subtree: true });

    // Initial run
    clickRevealSecrets();

    // Inject CSS overrides
    var css = `
        .modal-lg {
            width: 90% !important;
        }
        .modal-dialog:has(.anvil-role-saveload-dialog) {
            width: 90% !important;
        }
        .modal-sm {
            width: 60%;
        }
        .anvil-panel-section-container {
            max-width: 2000px !important;
        }
        `;
    GM_addStyle(css);

})();
  • v1.0: Initial Release
  • v1.1: Added additional CSS for new Save/Load modal dialog.