Hidden Gikos

This script makes all the hidden gikopoi characters visible in the selection screen and removes the message indicating that they are secret. このスクリプトは、隠されていたgikopoiのキャラクターをすべて選択画面で見えるようにし、秘密であることを示すメッセージを削除します。

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         Hidden Gikos
// @namespace    http://tampermonkey.net/
// @version      0.2.5
// @description  This script makes all the hidden gikopoi characters visible in the selection screen and removes the message indicating that they are secret. このスクリプトは、隠されていたgikopoiのキャラクターをすべて選択画面で見えるようにし、秘密であることを示すメッセージを削除します。
// @author       dinghy
// @author       roris
// @author       feor
// @match        *://gikopoipoi.net/*
// @grant        none
// ==/UserScript==

(async function () {
  'use strict';
  console.log("Hidden Gikos Enabled");

  function waitFor(getValue, timeout) {
    return new Promise((resolve, reject) => {
      const end = Date.now() + (timeout || 5000);

      (function check() {
        const value = getValue();
        if (value) return resolve(value);
        if (Date.now() > end) return reject(new Error('Timed out'));
        setTimeout(check, 50);
      })();
    });
  }

  await waitFor(() =>
    document.getElementsByTagName('label').length &&
    document.getElementById('login-button')
  );

  var elems = document.getElementsByTagName('label');
  for (var i = 0; i < elems.length; i++) {
    if (elems[i].style.display == 'none') {
      elems[i].style.display = 'block';
      elems[i].style.fontSize = 0;
    }
  }

  const loginButton = document.getElementById('login-button');
  loginButton.addEventListener('click', async () => {
    const siteArea = await waitFor(() => window.vueApp?._container?._vnode?.component?.proxy?.getSiteArea?.());
    const sendButton = await waitFor(() => document.getElementById('send-button'));
    const settingsButton = await waitFor(() => {
      const buttons = document.getElementsByClassName('fa-cogs');
      return buttons.length ? buttons[0] : null;
    });

    const henshinButton = document.createElement('button');
    if (siteArea.id == 'gen') {
      console.log("Server: " + siteArea.id);
      henshinButton.textContent = '#変身';
    } else {
      henshinButton.textContent = '#henshin';
    }
    henshinButton.setAttribute('type', 'button');

    henshinButton.addEventListener('click', () => {
      const input = document.getElementById('input-textbox');
      input.value = '#henshin';
      sendButton.click();
    });

    settingsButton.parentElement.appendChild(henshinButton);
  });
})();