Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Kasowanie flot, obiektów, reskaler
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
- // @version 2.1
- // @include *hegira.com.pl/*
- // @author Thing
- // @updateURL https://pastebin.com/43pZHcbA
- // @downloadURL https://pastebin.com/43pZHcbA
- // @copyright free
- // ==/UserScript==
- ("use strict");
- //funkcja kasujaca
- const kasownik = function (a) {
- $(`img[${a}]`).parent().remove();
- };
- //html guzików
- $('button[name="show_g"]')
- ?.parent()
- ?.after(
- `<td><button type ="button" id ="kas_fl" title ="Kasuj ikony flot z podglądu.">KF</button></td>><td><button type ="button" id ="kas_orb_strz" title ="Kasuj ikony budynków orbitalnych i strzałki.">KOS</button></td><td><button type="button" id ="scale" title ="Reskaluj duże obiekty kosmiczne. ${
- localStorage.AUTOScale === "1" ? "WŁĄCZONE" : "WYŁĄCZONE"
- }" style = "color:${
- localStorage.AUTOScale === "1" ? "red" : "green"
- }">SK</button></td>`
- );
- //kasownik floty
- $("button#kas_fl").click(function () {
- kasownik('name*="przyciskja2"');
- });
- //kasownik obikety
- $("button#kas_orb_strz").click(function () {
- kasownik('title*="rbitaln"');
- kasownik('title*="osmiczny"');
- kasownik('title*="UL Zebren"');
- kasownik('src ="img/bud/orbitalna_plat_ob_80px.png"');
- $('img[title*="obiekt jest"]').remove();
- });
- //reskaler
- $("button#scale").click(function () {
- if (localStorage.AUTOScale === "0" || !localStorage.AUTOScale) {
- this.style.color = "red";
- this.title = this.title.replace("WYŁĄCZONE", "WŁĄCZONE");
- localStorage.AUTOScale = 1;
- skaler();
- } else {
- this.style.color = "green";
- this.title = this.title.replace("WŁĄCZONE", "WYŁĄCZONE");
- localStorage.AUTOScale = 0;
- location.reload();
- }
- });
- //funkcja reskalująca
- const skaler = function () {
- if (localStorage.AUTOScale === "1") {
- $('img[src*="img/ico_p/NowySol"]')
- .parent()
- .parent()
- .each(function () {
- this.style.transformOrigin = "top left";
- if (
- $(this)
- .find('img[src*="img/ico_p/NowySol"]')[0]
- .title.includes("Gwiazda")
- ) {
- console.log($(this).find('img[src*="img/ico_p/NowySol"]')[0].src);
- const img = new Image();
- img.src = $(this).find('img[src*="img/ico_p/NowySol"]')[0].src;
- const sizeX = img.width;
- const sizeY = img.height;
- this.style.transform = `scale(${75 / sizeX} , ${75 / sizeY})`;
- $(this).children('div[id*="Menujaa"]')[0].style.transformOrigin =
- "top left";
- $(this).children(
- 'div[id*="Menujaa"]'
- )[0].style.transform = `Scale(${sizeX / 75},${sizeY / 75})`;
- } else {
- this.style.transform = "scale(0.2 , 0.2)";
- $(this).children('div[id*="Menujaa"]')[0].style.transformOrigin =
- "top left";
- $(this).children('div[id*="Menujaa"]')[0].style.transform =
- "Scale(5,5)";
- }
- });
- }
- };
- skaler();
Add Comment
Please, Sign In to add comment