AWBW Pixel Pefector

Forces all game sprites to look cleaner and nicer and cuter

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         AWBW Pixel Pefector
// @namespace    https://awbw.amarriner.com/
// @version      1.5
// @description  Forces all game sprites to look cleaner and nicer and cuter
// @author       twiggy_
// @match        https://awbw.amarriner.com/*?games_id=*
// @match        https://awbw.amarriner.com/*?replays_id=*
// @match        https://awbw.amarriner.com/*?moveplanner*
// @match        https://awbw.amarriner.com/*prevmaps*
// @match        https://awbw.amarriner.com/*editmap*
// @match        https://awbw.amarriner.com/*yourgames*
// @match        https://awbw.amarriner.com/*yourturn*
// @match        https://awbw.amarriner.com/*design*
// @match        https://awbw.amarriner.com/*profile*
// @match        https://awbw.amarriner.com/*
// @icon         https://awbw.amarriner.com/favicon.ico
// @license MIT
// ==/UserScript==


let pixelPerfect = {
    'image-rendering': 'pixelated',
};

if (document.getElementById('main') !== null)
{
    Object.assign(document.getElementById('main').style, pixelPerfect);
}


// Game Map, and the root obj
if (document.getElementById('gamemap') !== null)
{
    Object.assign(document.getElementById('gamemap').style, pixelPerfect);
}

// Controls UI
if (document.getElementById('map-controls-container') !== null)
{
    Object.assign(document.getElementById('map-controls-container').style, pixelPerfect);
}

// DMG Calc
if (document.getElementById('calculator') !== null)
{
    Object.assign(document.getElementById('calculator').style, pixelPerfect);
}

// Weather canvas
if (document.getElementById('weather-canvas') !== null)
{
    Object.assign(document.getElementById('weather-canvas'), pixelPerfect);
}

// Tile info window
let tileInfoWindow = document.getElementsByClassName('tile-info');
Array.prototype.forEach.call(tileInfoWindow, function(win) {
    win.style.imageRendering = 'pixelated';
});

// Player CO containers
let playerContainers = document.getElementsByClassName('player-overview-container');
Array.prototype.forEach.call(playerContainers, function(container) {
    container.style.imageRendering = 'pixelated';
});

// Event screen COs
let eventCOs = document.getElementsByClassName('event-cos');
Array.prototype.forEach.call(eventCOs, function(co) {
    co.style.imageRendering = 'pixelated';
});