GC - Gormball character selector

Remembers your last played character in the dropdown

目前為 2022-11-14 提交的版本,檢視 最新版本

// ==UserScript==
// @name         GC - Gormball character selector
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Remembers your last played character in the dropdown
// @author       wibreth
// @match        https://www.grundos.cafe/games/gormball/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';
    /* globals $:false */
    $('document').ready(() => {
        if ($('img[src$="gorm.gif"]').length == 0)
            return; //not on the character select page

        let playerDD = GM_getValue("playerDD", 1); //default Thyassa
        $('#playerDD').val(playerDD);

        $('#playerDD').change(function() {
            playerDD = $(this).val();
            GM_setValue("playerDD", playerDD);
        });
    });
})();