- // ==UserScript==
- // @name Panel Dodatków NI
- // @namespace http://the-crudness.xaa.pl/NIAddons/panel.user.js
- // @version 2.5
- // @description Dodaje do wbudowanego panelu dodatków inne dodatki.
- // @author Priveeq
- // @include http://aldous.margonem.pl/
- // @include http://tempest.margonem.pl/
- // @include http://mordor.margonem.pl/
- // @include http://invisible.margonem.pl/
- // @include http://dionizos.margonem.pl/
- // @include http://genos.margonem.pl/
- // @include http://majorka.margonem.pl/
- // @include http://aequus.margonem.pl/
- // @include http://experimental-ni.margonem.pl/
- // @include http://husaria.margonem.com/
- // @include http://cronus.margonem.com/
- // @grant none
- // ==/UserScript==
- // ==Changelog==
- // 2.5 - znów pełno zmian w API, kolejny nowy dodatek
- // 2.4 - pierdyliard zmian w API, nowy dodatek, usunięte na obecną chwile dodatki darrefulla bo mu hosting padł czy coś
- // 2.3 - nowy dodatek, naprawione loader.require
- // 2.2 - włączenie dodatku pokazywanie kolizji dla angielskiego margonem, bo działają już tam widgety. Trochę wewnętrznych zmian w tym skrypcie
- // 2.1 - dodatek lepsza walka, trochę zmian w tym kodzie żeby łatwiej się robiło dodatki (event emmitery anyone?)
- // 2.0.1 - pierwsza nietestowa wersja
- // ==/Changelog==
- window.priwAddons = new (function() {
- var addons = this;
- window.API.priw = this;
- var Storage = API.Storage;
- var Templates = API.Templates;
- this.list = {
- priw_clbl: {
- namePL: "Błoga klanowe",
- nameEN: "Guild blessings",
- descPL: "Dodaje pod torbami panel wyboru błogosławieństwa klanowego, taki skrót. Nie ma sensu instalować na nakładce NI, bo w starym systemie klanów tych błogosławieństw nie ma.",
- descEN: "Adds shortcuts to guild blessings under the bags.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/NIblesspanel.js?",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/NIblesspanel.js?",
- img: "http://aldous.margonem.pl/img/gui/buttony.png?v=4|-561 -12",
- author: "Priveeq|3779166"
- },
- priw_ntpd: {
- namePL: "Notatnik",
- nameEN: "Notepad",
- descPL: "Dodaje prosty notatnik, dostępny pod torbami.",
- descEN: "Adds a simple notepad under the bags.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/notepadNI.js?",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/notepadNI.js?",
- img: "http://aldous.margonem.pl/img/gui/buttony.png?v=4|-437 -12",
- author: "Priveeq|3779166"
- },
- priw_extl: {
- namePL: "Instalator zewnętrznych skryptów",
- nameEN: "External script loader",
- descPL: "Pozwala instalować zewnętrzne dodatki przez wpisanie adresu do skryptu. <a href='https://gyazo.com/42856b0a644881f93b17e27ec02674ac' target='_blank'>Wygląda to tak.</a>",
- descEN: "Allows installing external scripts from a given url, as shown <a href='https://gyazo.com/dbdbffca2a65e982293caef243b96981' target='_blank'>here.</a>",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/NIextLoader.js?",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/NIextLoader.js?",
- img: "http://aldous.margonem.pl/img/gui/buttony.png?v=4|-282 -12",
- author: "Priveeq|3779166",
- widget: {
- color: "blue",
- }
- },
- priw_obw: {
- namePL: "Lepsza walka",
- nameEN: "Better battle",
- descPL: "Dodaje następujące rzeczy do walki:<br>-animowanie przesuwania się postaci<br>-bardziej widoczne pokazywanie naszej tury<br>-mniejsze odległości między postaciami w walce<br>-ilość życia, many i energii w tipach (dymkach) nad postaciami<br>-wybór umiejętności jak na starym interfejsie (można wyłączyć w dolnej części konfiguracji gry)",
- descEN: "Adds following features to the battle window:<br>-characters now move smoothly from place to place, instead of teleporting<br>-better indication of player's turn<br>-distance between characters is smaller<br>-health, energy and mana is shown in tooltips above characters<br>-alternative skill selection method, samilar to how it was on the old interface (this feature can be disabled at the bottom of game config)",
- //urlPL: "http://192.168.0.110:1337/NIoldBattle.js",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/NIoldBattle.js?7",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/NIoldBattle.js?7",
- img: "http://aldous.margonem.pl/img/gui/addons-icons.png|-4 -34",
- author: "Priveeq|3779166"
- },
- priw_mmp: {
- namePL: "miniMap+",
- nameEN: "miniMap+",
- descPL: "Dodaje do gry wielofunkcyjną minimapę. Domyślnie otwiera sie klawiszem [R]",
- descEN: "Adds a multifunctional minimap. Default hotkey to open it is set to [R]. Note that it hasn't been translated to english.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/miniMapPlusNI.js",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/miniMapPlusNI.js",
- img: "http://aldous.margonem.pl/img/gui/buttony.png|-158 -12",
- author: "Priveeq|3779166"
- },
- priw_tth: {
- namePL: "Titan Helper+",
- nameEN: "Titan Helper+",
- descPL: "Pokazuje w oknie walki użyteczne informacje (ilość tur od użycia aury SA, aktualnie ładowany atak specjalny tytana itp)",
- descEN: "Shows some useful info in the battle window (amount of turns that has passed since someone used attack speed aura, spell that is currently being charged by a titan etc). It hasn't been translated from polish, but I think it should be easy enough to figure out what it shows.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/titanHelperPlusNI.js",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/titanHelperPlusNI.js",
- img: "http://aldous.margonem.pl/img/gui/addons-icons.png|-4 -34",
- author: "Priveeq|3779166"
- },
- priw_sf: {
- namePL: "ShopFilter",
- nameEN: "ShopFilter",
- descPL: "Dodaje do sklepów dodatkowe opcje filtrowania.",
- descEN: "Adds additional filters to shops.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/shopFilterNI.js",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/shopFilterNI.js",
- img: "http://aldous.margonem.pl/img/gui/addons-icons.png|-128 -3",
- author: "Priveeq|3779166"
- },
- priw_sakwa: {
- namePL: "Sakwa",
- nameEN: "Pouch",
- descPL: "Przywraca funkcjonalną sakwę ze starego interfejsu.",
- descEN: "Restores a functional pouch from the old interface.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/pouch.js",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/pouch.js",
- img: "/obrazki/npc/mas/nic32x32.gif",
- author: "Priveeq|3779166"
- },
- priw_h2h: {
- namePL: "https2http",
- nameEN: "https2http",
- descPL: "Linki które mają z przodu https nie działają na chacie. Dodatek zamienia w wysyłanych wiadomościach https na http i wtedy działają.",
- descEN: "Fixes a bizzare bug that causes links that contain https to not work by replacing https with http in sent messages.",
- urlPL: "http://the-crudness.xaa.pl/NIAddons/get/https2httpNI.js",
- urlEN: "http://the-crudness.xaa.pl/NIAddons/get/https2httpNI.js",
- img: "http://aldous.margonem.pl/img/gui/buttony.png?v=4|-406 -12",
- author: "Priveeq|3779166"
- },
- groov_gll: {
- namePL: "Global lootlog",
- descPL: "Jest to dodatek, który umieszcza nasze looty heroiczne i legendarne na stronie, aby później móc je przeglądać. Podczas lootnięcia itemu zawsze mamy możliwość zdecydowania, czy ma on zostać tam dodany, czy też nie.<br><br>Dodatek zapisuje zdobycze ze światów publicznych i prywatnych.<br><br>Strona główna: <a href='http://grooove.pl/lootlog/' target='_blank'>http://grooove.pl/lootlog/</a>",
- urlPL: "http://addons2.margonem.pl/get/70/70663dev.js",
- img: "http://aldous.margonem.pl/img/gui/buttony.png|-158 -12",
- author: "Groove Armada|3088295",
- beforeInstall: function() {
- if ($("#GLobalLootlogLauncher").length) {
- message("Global lootlog jest już zainstalowany z innego źródła.");
- return true;
- };
- },
- noEN: true
- },
- groov_pw: {
- namePL: "Panel walk",
- nameEN: "Battle panel",
- descPL: "Dodatek automatycznie zapisuje walki z graczami na stronie, gdzie później ładnie je wyświetla.<br>Przykład: <a href='http://grooove.pl/battle/id-1' target='_blank'>http://grooove.pl/battle/id-1</a>",
- descEN: "This addon automatically saves battles aganist other players on a website, where they are nicely displayed.<br>Example: <a href='http://grooove.pl/battle/id-1' target='_blank'>http://grooove.pl/battle/id-1</a>",
- urlPL: "http://addons2.margonem.pl/get/70/70674dev.js",
- urlEN: "http://addons2.margonem.pl/get/70/70674dev.js",
- img: "http://aldous.margonem.pl/img/gui/addons-icons.png|-4 -34",
- author: "Groove Armada|3088295",
- beforeInstall: function() {
- if ($("#PWLauncher").length) {
- message("Panel walk jest już zainstalowany z innego źródła.");
- return true;
- };
- },
- },
- groov_count: {
- namePL: "Licznik ubić by Groove",
- nameEN: "Kill counter",
- descPL: "Liczy ubicia elit, elit II, herosów, tytanów i eventowych potworów.<br><br>Aby zresetować licznik lub usunąć pojedynczy wpis, należy wejść na stronę <a href='http://grooove.pl/licznik/' target='_blank'>http://grooove.pl/licznik/</a> i się zalogować.",
- descEN: "Counts how many times you've killed monsters with ranks above elite. To reset the counter or delete a single entry, you have to visit <a href='http://grooove.pl/licznik/' target='_blank'>http://grooove.pl/licznik/</a> and log in.",
- urlPL: "http://addons2.margonem.pl/get/70/70632dev.js",
- urlEN: "http://addons2.margonem.pl/get/70/70688dev.js",
- img: "http://aldous.margonem.pl/img/gui/addons-icons.png|-97 -34",
- author: "Groove Armada|3088295",
- beforeInstall: function() {
- if ($("#GACounterLauncher").length) {
- message("Licznik ubić jest już zainstalowany z innego źródła.");
- return true;
- };
- },
- },
- ake_coll: {
- namePL: "Pokazywanie kolizji",
- nameEN: "Show collisions",
- descPL: "Pokazuje kolizje na mapie.",
- descEN: "Shows map collisions.",
- urlPL: "http://addons2.margonem.pl/get/76/76788dev.js?3",
- urlEN: "http://addons2.margonem.pl/get/76/76788dev.js?3",
- img: "http://aldous.margonem.pl/img/gui/buttony.png|-702 -710",
- author: "Akechi|229327",
- widget: {
- color: "blue"
- }
- },
- ccar_evo: {
- namePL: "Evolution Manager",
- nameEN: "Evolution Manager",
- descPL: "Wielofunkcyjny manager dodatków. <a target='_blank' href='https://www.margonem.pl/?task=forum&show=posts&id=469794'>Temat na forum</a>.<br>Instaluje się jego osobny userscript.",
- descEN: "multifunctional addon manager. <a target='_blank' href='https://www.margonem.pl/?task=forum&show=posts&id=469794'>Polish forum thread</a>.<br>Installs as a separate userscript.",
- urlPL: "http://m.ccrr.pl/evo/client/start.user.js",
- urlEN: "http://m.ccrr.pl/evo/client/start.user.js",
- img: "http://aldous.margonem.pl/img/gui/buttony.png|-437 -12",
- author: "Programista CcarderR|2210626",
- beforeInstall: function() {
- if (typeof (evoStart) != "undefined") {
- message("Evolution Manager jest już zainstalowany.");
- } else {
- window.open("http://m.ccrr.pl/evo/client/start.user.js");
- };
- return true;
- },
- },
- //eeeeeee darrowi padł hosting to na chwilę obecną wywalam z panelu
- /*darr_mm: {
- namePL: "Margomap",
- nameEN: "Margomap",
- descPL: "Prosta minimapa, otwiera się przyciskiem [E]",
- descEN: "A simple minimap, can be opened with the [E] button.",
- urlPL: "http://addons2.margonem.pl/get/77/77011dev.js?3",
- urlEN: "http://addons2.margonem.pl/get/77/77011dev.js?3",
- data: "http://addons2.darro.eu/js/margomap.js",
- img: "http://aldous.margonem.pl/img/gui/buttony.png|-158 -12",
- author: "Darrefull|359424",
- beforeInstall: function() {
- if (typeof window.DMargoMap != "undefined") {
- message("Margomap jest już zainstalowany z innego źródła.");
- return true;
- };
- },
- },
- darr_akh: {
- namePL: "Licznik Akh-Mater",
- descPL: "Liczy nawróconych i zapytanych do questa Słowo Akh-Mater..",
- urlPL: "http://addons2.margonem.pl/get/77/77011dev.js?3",
- data: "http://addons2.darro.eu/js/akh-mater.js",
- img: "http://aldous.margonem.pl/img/gui/buttony.png|-189 -12",
- author: "Darrefull|359424",
- beforeInstall: function() {
- if ($("div[data-tip*='Licznik do questa <br>Słowo Akh-Mate']").length > 0) {
- message("Licznik Akh-Mater jest już zainstalowany z innego źródła.");
- return true;
- };
- },
- noEN: true
- },
- darr_coun: {
- namePL: "Licznik ubić by Darrefull",
- descPL: "Liczy ubicia elit/e2/herosów/tytanów.",
- urlPL: "http://addons2.margonem.pl/get/77/77011dev.js?3",
- data: "http://addons2.darro.eu/js/counter.js",
- img: "http://aldous.margonem.pl/img/gui/addons-icons.png|-97 -34",
- author: "Darrefull|359424",
- beforeInstall: function() {
- if (typeof window.eCounter != "undefined") {
- message("Licznik ubić by Darrefull jest już zainstalowany z innego źródła.");
- return true;
- };
- },
- noEN: true
- }*/
- };
- this.addonIds = Object.keys(this.list);
- this.storageKey = "priwAddons";
- this.getStorage = function() {
- if (!this.storageCache) {
- this.storageCache = localStorage.getItem(this.storageKey) ? JSON.parse(localStorage.getItem(this.storageKey)) : [];
- };
- return this.storageCache;
- };
- this.setStorage = function(storage) {
- this.storageCache = storage;
- localStorage.setItem(this.storageKey, JSON.stringify(storage));
- };
- this.fixStorage = function() {
- var storage = this.getStorage();
- var len = storage.length;
- for (var i=0; i<storage.length; i++) {
- if (this.addonIds.indexOf(storage[i]) == -1) { //gracz ma nieinstniejący dodatek który zaśmieca storage
- //jak dodatek co został wywalony z listy miał widget to go trza wywalić
- if (typeof storage[i] == "number") { //stare wersje dodatku były dziwaczne, tak just in case gdyby ktoś miał stary typ jeszcze. Kiedyś to wywalę
- if (API.Storage.get("hotWidget/addon_"+(storage[i]+1000))) API.Storage.remove("hotWidget/addon_"+(storage[i]+1000));
- } else {
- if (API.Storage.get("hotWidget/addon_"+storage[i])) API.Storage.remove("hotWidget/addon_"+storage[i]);
- };
- storage.splice(i, 1);
- i--;
- };
- };
- if (len != storage.length) this.setStorage(storage);
- };
- this.getAddonState = function(id) {
- var storage = this.getStorage();
- return (storage.indexOf(id) > -1);
- };
- this.toggleAddon = function(id) {
- var storage = this.getStorage();
- if (storage.indexOf(id) > -1) {
- storage.splice(storage.indexOf(id), 1);
- } else {
- storage.push(id);
- };
- this.setStorage(storage);
- };
- this.fixStorage();
- this.loader = new (function(_ajax){
- var self = this;
- this.addonsLoaded = 0;
- this.waitForInterfaceChanger = false; //eliminuje potencjalną możliwość zagryzienia się z dodatkiem SI2NI
- if (typeof __bootNI != "undefined" && __bootNI) {
- var _reCallInitQueue = Engine.reCallInitQueue;
- this.waitForInterfaceChanger = true;
- Engine.reCallInitQueue = function() { //funckja ta zostaje uruchomiona przez SI2NI gdy skończy ładować swoje dodatki
- self.waitForInterfaceChanger = false;
- Engine.reCallInitQueue = _reCallInitQueue;
- self.loadAddon();
- };
- };
- $.ajax = function(options) {
- if (self.addonsLoaded < addons.addonIds.length && options.url.indexOf("engine?t=init") > -1) {
- self.loadAddon();
- return;
- } else if (options.url.indexOf("margonem.pl/config.php") > -1) {
- var oldsuccess = options.success;
- options.success = function(data) {
- addons.afterGameBoot();
- var ret = oldsuccess.apply(this, arguments);
- addons.afterInterfaceLoad();
- return ret;
- };
- } else if (options.url.indexOf("engine?t=") > -1) {
- var oldsuccess = options.success;
- var url = options.url;
- options.success = function(data) {
- var ret = oldsuccess.apply(this, arguments);
- addons.callbackParser(data, url);
- return ret;
- };
- };
- return _ajax.apply(this, arguments);
- };
- this.loadAddon = function() {
- var id = addons.addonIds[this.addonsLoaded];
- if (addons.getAddonState(id)) {
- var addon = addons.list[id];
- if (addon.beforeInstall && addon.beforeInstall()) { //failsafe jakby ktoś coś odwalił
- addons.toggleAddon(id);
- return this.onAddonLoad();
- };
- if (!$.cachedScript) jQuery.cachedScript=function(e,c){return c=$.extend(c||{},{dataType:"script",cache:!0,url:e}),jQuery.ajax(c)};
- var url = this.getUrl(addon);
- window.__currentAddon = {
- id: addons.addonIds[this.addonsLoaded],
- data: addon.data
- };
- if (url.indexOf("?") > -1) url += "&v="+((new Date()).toLocaleDateString());
- else url += "?v="+((new Date()).toLocaleDateString());
- $.cachedScript(url).done(this.onAddonLoad).fail((xhr) => this.failedAddonLoad(id, xhr));
- //$.getScript(url).done(this.onAddonLoad).fail((xhr) => this.failedAddonLoad(id, xhr));
- } else {
- this.onAddonLoad();
- };
- };
- this.onAddonLoad = function() {
- self.addonsLoaded++;
- if (self.addonsLoaded < addons.addonIds.length) {
- self.loadAddon();
- } else {
- self.loadExtraAddons();
- };
- };
- var extraLoadFinished = false;
- var extraAddonsLoaded = -1;
- this.loadExtraAddons = function() {
- extraAddonsLoaded++;
- if (extraAddonsLoaded < extraAddons.length) {
- var url = extraAddons[extraAddonsLoaded];
- $.cachedScript(url).done(self.loadExtraAddons).fail((xhr) => self.failedExtraAddonLoad(url, xhr));
- } else {
- if (!self.waitForInterfaceChanger) {
- extraLoadFinished = true;
- Engine.reCallInitQueue();
- };
- };
- };
- this.require = function(url) {
- if (!extraLoadFinished) extraAddons.push(url);
- else throw "Ładowanie już się zakończyło.";
- };
- var extraAddons = [];
- this.failedAddonLoad = function(id, xhr) {
- var addon = addons.list[id];
- if (_l() == "pl") console.warn("Nie udało się załadować dodatku "+addon.namePL+" ["+this.getUrl(addon)+"] ("+xhr.status + " - "+xhr.statusText+")");
- else console.warn("Failed to load addon "+addon.nameEN+" ["+this.getUrl(addon)+"] ("+xhr.status + " - "+xhr.statusText+")");
- this.onAddonLoad();
- };
- this.failedExtraAddonLoad = function(url, xhr) {
- if (_l() == "pl") console.warn("Nie udało się załadować skryptu z require "+url);
- else console.warn("Failed to load required script "+url);
- this.loadExtraAddons();
- };
- this.getUrl = function(addon) {
- return _l() == "pl" ? addon.urlPL : addon.urlEN;
- };
- })($.ajax);
- var __g = _g;
- _g = function(url, extra) {
- var ret = addons.requestParser(url, extra);
- arguments[0] = ret[0];
- arguments[1] = ret[1];
- return __g.apply(this, arguments);
- };
- this.requestParser = function(url, extra) {
- for (var i=0; i<this.requestParsers.length; i++) {
- var ret =this.requestParsers[i](url, extra);
- url = ret[0];
- extra = ret[1];
- };
- return [url, extra];
- };
- this.requestParsers = [];
- this.callbackParser = function(data, url) {
- for (var i=0; i<this.extraServerCallbacks.length; i++) {
- this.extraServerCallbacks[i](data, url);
- };
- for (var i in data) {
- this.emmiter.emit(i, data[i]);
- };
- this.emmiter.emit("game-response", data);
- };
- //idk moja implementacja pewnie nie w 100% taka sama
- this.Emmiter = function() {
- var on = [];
- var once = [];
- this.on = function(type, fun) {
- on.push(type, fun);
- return fun;
- };
- this.once = function(type, fun) {
- once.push(type, fun);
- return fun;
- };
- this.off = function(fun) {
- for (var i=1; i<on.length; i+=2) {
- if (on[i] == fun) {
- return on.splice(i-1, 2);
- };
- };
- };
- this.emit = function(type, data) {
- for (var i=0; i<once.length; i+=2) {
- if (once[i] == type) {
- once[i+1](data);
- once.splice(i, 2);
- i -= 2;
- };
- };
- for (var i=0; i<on.length; i+=2) {
- if (on[i] == type) {
- on[i+1](data);
- }
- };
- };
- };
- this.emmiter = new this.Emmiter();
- this.extraServerCallbacks = [];
- this.checkForMismatch = function() { //jakby coś poszło nie tak
- for (var i in this.list) {
- if (this.getAddonState(i) != Engine.addonsPanel.getStorageStateOfAddon(i)) {
- Engine.addonsPanel.toggleStateAddon(i);
- };
- };
- };
- this.addedCustomAddons = false;
- this.doAfterGameBoot = [];
- this.doAfterInterfaceLoad = [];
- this.afterGameBoot = function() {
- for (var i in this.list) {
- var addon = this.list[i];
- if (addon.widget) {
- var store = API.Storage.get("hotWidget/addon_"+i);
- if (store) Engine.addonsPanel.addKeyToWidgets(i, store, _l() == "pl" ? addon.namePL : addon.nameEN);
- };
- };
- var _addonsShow = Engine.addonsPanel.manageVisible;
- Engine.addonsPanel.manageVisible = function() {
- var ret = _addonsShow.apply(this, arguments);
- if (!addons.addedCustomAddons) {
- addons.checkForMismatch();
- addons.addCustomAddonsToList();
- addons.addedCustomAddons = true;
- };
- addons.emmiter.emit("addons-toggle");
- return ret;
- };
- var fun = function(id) {
- if (addons.isCustomAddon(id)) {
- if (addons.addedCustomAddons && !addons.getAddonState(id)) {
- message(addons.reloadMsg);
- addons.toggleAddon(id);
- var addon = addons.list[id];
- if (addon.widget && !window["addon_"+id]) {
- window["addon_"+id] = {
- manageVisible: () => message("Dodatek zacznie działać po odświeżeniu gry")
- };
- };
- };
- } else {
- _startAddonScript.apply(this, arguments);
- };
- };
- //dziwna różnica iędzy polskim a angielskim margonem
- if (Engine.addonsPanel.startAddonScript) {
- var _startAddonScript = Engine.addonsPanel.startAddonScript;
- Engine.addonsPanel.startAddonScript = fun;
- } else {
- var _startAddonScript = Engine.addonsPanel.turnOnAddon;
- Engine.addonsPanel.turnOnAddon = fun;
- };
- var _turnOffAddon = Engine.addonsPanel.turnOffAddon;
- Engine.addonsPanel.turnOffAddon = function(id) {
- if (addons.isCustomAddon(id)) {
- if (addons.addedCustomAddons && addons.getAddonState(id)) {
- message(addons.reloadMsg);
- addons.toggleAddon(id);
- if (addons.list[id].widget) {
- $(".icon.addon_"+id).parent().remove();
- if (API.Storage.get("hotWidget/addon_"+id)) API.Storage.remove("hotWidget/addon_"+id);
- };
- };
- } else {
- _turnOffAddon.apply(this, arguments);
- };
- };
- var _setStateAddon = Engine.addonsPanel.setStateAddon;
- Engine.addonsPanel.setStateAddon = function(state, id) {
- if (addons.isCustomAddon(id) && state && addons.addedCustomAddons) {
- var addon = addons.list[id];
- if (addon.beforeInstall && addon.beforeInstall()) return;
- };
- return _setStateAddon.apply(this, arguments);
- };
- this.initCss();
- for (var i=0; i<this.doAfterGameBoot.lenth; i++) {
- this.doAfterGameBoot[i]();
- };
- this.emmiter.emit("game-load");
- };
- this.afterInterfaceLoad = function() {
- for (var i=0; i<this.doAfterInterfaceLoad.length; i++) {
- this.doAfterInterfaceLoad[i]();
- };
- this.emmiter.emit("interface-load");
- };
- this.isCustomAddon = function(id) {
- return (this.addonIds.indexOf(id) > -1);
- };
- this.addCustomAddonsToList = function() {
- for (var i in this.list) {
- var addon = this.list[i];
- if (_l() == "en" && addon.noEN) continue;
- if (_l() == "pl" && addon.noPL) continue;
- var author = addon.author.split("|");
- var authorHtml = "<div class='addon-author'>by <a href='http://www.margonem.pl/?task=profile&id="+author[1]+"' target='_blank'>"+author[0]+"</a></div>";
- var addonToAdd = {
- pl: {
- name: addon.namePL,
- description: addon.descPL + authorHtml
- },
- en: {
- name: addon.nameEN,
- description: addon.descEN + authorHtml
- },
- image: addon.img,
- options: addon.widget ? 1 : 0
- };
- Engine.addonsPanel.createOneAddonOnList(addonToAdd, i);
- Engine.addonsPanel.createOneAddonDescription(addonToAdd, i);
- }
- };
- this.reloadMsg = _l() == "pl" ? "Zmiany będą widoczne po odświeżeniu gry..." : "Changes will come into effect once the page has been reloaded...";
- this.initCss = function() {
- var css = `
- .addon-author {
- font-size: 75%;
- text-align: right;
- color: #333333;
- }
- `;
- var widgets = {};
- for (var i in this.list) {
- var addon = this.list[i];
- if (!addon.widget) continue;
- if (addon.widget !== true) {
- widgets[i] = addon.widget;
- widgets[i].id = i;
- };
- css += `
- .icon.addon_`+i+` {
- background: `+Engine.addonsPanel.createBackgroundString(addon.img)+` !important;
- }
- `;
- };
- this.emmiter.once("interface-load", ()=>this.widget.changeWidgetCss(widgets));
- $("<style>"+css+"</style>").appendTo("head");
- };
- //kod z Interface.showPopupMenu
- var $aLayer = $(document.getElementsByClassName("alerts-layer")[0]);
- this.popupMenu = function(menu, e) {
- if (!menu.length) return;
- var $m = $('<div class="custom-popup-menu"></div>');
- var $btn = API.Templates.get('button').addClass('small');
- for (var i in menu) {
- (function (i) {
- var clone = $('<div class="menu-item">' + menu[i][0] + '</div>');
- if (isset(menu[i][2])) {
- clone.addClass(menu[i][2].button.cls);
- }
- $(clone).click(function (e) {
- if (menu[i][1]()) e.stopPropagation();
- });
- $m.append(clone);
- })(i);
- };
- var zIndex = $aLayer.children().size() + 1;
- $aLayer.append($m);
- $m.css({
- top: e.clientY - $m.height() / 2,
- left: e.clientX - $m.width() / 2,
- 'z-index': zIndex
- }).addClass('show');
- };
- document.addEventListener("click", () => {
- $('.custom-popup-menu').remove();
- })
- var $popupStyle = document.createElement("style");
- //nie, nie mogę użyć normalnej klasy popup-menu bo gra kasuje element zanim mój eveneListener odpali ._.
- //nie rozumiem jakim prawem tak się dzieje, ale niektóre rzeczy trzeba po prostu przyjąć do wiadomości bez rozumienia
- $popupStyle.innerHTML = `
- .custom-popup-menu {
- border: 5px solid;
- max-width: 150px;
- border-image: url(../img/gui/ramka.png) 6 repeat;
- -webkit-transform: scale(0);
- -webkit-transition: 0.2s linear;
- -webkit-transition-timing-function: cubic-bezier(0.68, 0.77, 0.4, 1.89);
- z-index: 1;
- background-color: #3F3B3D;
- background-clip: padding-box;
- pointer-events: auto;
- position: absolute;
- }
- .custom-popup-menu .menu-item {
- cursor: url(../img/gui/cursor/5.png), auto;
- padding: 2px 5px;
- display: block;
- margin-bottom: 1px;
- font-size: 12px;
- text-align: center;
- border-radius: 3px;
- background-color: #244518;
- color: white;
- border: 1px solid #396420;
- }
- .custom-popup-menu .menu-item:last-child {
- margin-bottom: 0px;
- }
- .custom-popup-menu .menu-item.label {
- cursor: url(../img/gui/cursor/1.png), auto;
- border: 0px;
- background-color: transparent;
- }
- .custom-popup-menu .menu-item:hover:not(.label) {
- border: 1px solid #4f7b21;
- background-color: #2e4f18;
- }
- .custom-popup-menu.show {
- -webkit-transform: scale(1);
- }
- .custom-popup-menu .s_cost {
- display: inline-block;
- margin-left: 5px;
- font-weight: bold;
- border: 1px solid rgba(0, 0, 0, 0.3);
- border-radius: 3px;
- background-color: rgba(0, 0, 0, 0.2);
- padding: 0px 3px;
- color: lightblue;
- line-height: 15px;
- }
- `;
- document.head.appendChild($popupStyle);
- this.dictionary = new (function() {
- var list = {};
- this.get = function(id, data) {
- var str = list[id];
- if (!str) return "missing["+id+"]";
- str = str[_l()];
- if (!str) return "nolang["+id+"]";
- for (var i in data) {
- str = str.replace(i, data[i]);
- };
- return str;
- };
- this.add = function(id, txt) {
- list[id] = txt; //txt = {en: "txten", pl: "txtpl"}
- };
- this.addMany = function(data) {
- for (var i=0; i<data.length; i++) {
- this.add(data[i].id, data[i].txt);
- };
- };
- })();
- var _txt = this.dictionary.get;
- //custom settings for addons
- this.settings = new (function() {
- var self = this;
- var extraSettings = [];
- var $extraSettings, $scrollPane;
- addons.dictionary.add("addon_settings", {
- pl: "Ustawienia dodatków",
- en: "Addon settings"
- })
- if (!Storage.get("addonsettings")) {
- Storage.set("addonsettings", {});
- };
- this.init = function() {
- var _old = Engine.settings.toggle;
- self.initSettingTable();
- Engine.settings.toggle = function() {
- var ret = _old.apply(this, arguments);
- self.manageExtraSettings();
- addons.emmiter.emit("settings-toggle");
- return ret;
- };
- };
- this.initSettingTable = function() {
- $extraSettings = document.createElement("div");
- $extraSettings.classList.add("seccond-c");
- var $header = document.createElement("h2");
- $header.classList.add("settings-addons");
- $header.innerHTML = "<span>"+_txt("addon_settings")+"</span>";
- $extraSettings.appendChild($header);
- var $list = document.createElement("ul");
- $list.classList.add("hero-options");
- var html = "", setting, enabled;
- for (var i=0; i<extraSettings.length; i++) {
- setting = extraSettings[i];
- enabled = Storage.get("addonsettings/"+setting.id) ? " active" : "";
- html += "<li data-setting_id='"+setting.id+"'><span class='checkbox"+enabled+"'></span><span class='label'>"+setting.txt+"</span></li>";
- };
- $list.innerHTML = html;
- $list.addEventListener("click", this.toggleSetting);
- $extraSettings.appendChild($list);
- };
- this.toggleSetting = function(e) {
- for (var i=0; i<e.path.length; i++) {
- if (e.path[i].dataset["setting_id"]) {
- var li = e.path[i];
- var children = li.children;
- var enabled = !Storage.get("addonsettings/"+li.dataset["setting_id"]);
- Storage.set("addonsettings/"+li.dataset["setting_id"], enabled);
- for (var i=0; i<children.length; i++) {
- if (children[i].classList.contains("checkbox")) {
- if (enabled) children[i].classList.add("active");
- else children[i].classList.remove("active");
- break;
- };
- };
- addons.emmiter.emit("toggle-addon-"+li.dataset["setting_id"], enabled);
- break;
- };
- };
- };
- this.manageExtraSettings = function() {
- if (!extraSettings.length) return;
- var $settings = document.getElementsByClassName("settings-window")[0];
- if ($settings) {
- //tfw uparłeś się na nieużywanie jquery
- var children = $settings.children;
- for (var i=0; i<children.length; i++) {
- if (children[i].classList.contains("hero-options-config")) {
- children = children[i].children[0].children; //xd
- break;
- };
- };
- for (var i=0; i<children.length; i++) {
- if (children[i].classList.contains("scroll-pane")) {
- $scrollPane = children[i];
- break;
- };
- };
- if (!$scrollPane) return console.warn("coś się zepsuło");
- $scrollPane.appendChild($extraSettings);
- };
- };
- this.add = function(data) {
- extraSettings.push(data);
- if (Storage.get("addonsettings/"+data.id) == null) Storage.set("addonsettings/"+data.id, data.default);
- };
- this.get = function(id) {
- return Storage.get("addonsettings/"+id);
- };
- //this.add({
- // txt: "test",
- // id: "test-setting",
- // default: true
- //});
- addons.emmiter.once("interface-load", this.init);
- })();
- //window constructor
- this.Window = function(options) {
- //zrobiłem to zanim odkryłem że jest API.Window
- //także iksde, ale to się chyba łatwiej używa to eeee zostawie, zwłaszcza że już 1 dodatek z tym zrobiłem xDD
- /* =OPTIONS=
- WYMAGANE:
- /Jedno z dwóch:
- -txt: zawartość HTML okna
- -element: element do podpięcia do zawartości okna (przez $(...).append)
- /
- -header: nagłówek okna
- OPCJONALNE
- -likemAlert: bool, czy okno ma posiadać klasę mAlert (default: false)
- -noClose: bool, czy ma zostać usunięty przycisk zamykania (default: false)
- -callbacks: array, taki sam jak ma mAlert w drugim argumencie (default: [])
- -onClose: f, funkcja jaka wykona się przy zamknięciu okna (default: none)
- -css: style css które będą nadane oknu
- */
- var txt = "this will be hijacked " + new Date().getTime();
- options.callbacks = options.callbacks ? options.callbacks : [];
- mAlert(txt, options.callbacks);
- this.$ = $(".border-window:contains('"+txt+"')"); //dobra użyję jquery bo robienie tego bez przekracza moją cierpliwość
- var $content = this.$.find(".inner-content");
- if (options.txt) $content[0].innerHTML = options.txt;
- else {
- $content[0].innerHTML = "";
- $content.append(options.element);
- };
- if (options.css) {
- Object.assign(this.$[0].style, options.css);
- }
- var $header = this.$.find(".text");
- $header[0].innerHTML = options.header;
- var $close = this.$.find(".close-button");
- var close = $._data($close[0], "events").click[0].handler; //kradniemy funkcję zamykającą okno
- $close[0].removeEventListener("click", close);
- if (options.noClose) $close.parent().remove();
- if (!options.likemAlert) this.$[0].classList.remove("mAlert");
- this.setContent = function(html) {
- $content[0].innerHTML = html;
- };
- this.setHeader = function(html) {
- $header[0].innerHTML = html;
- };
- this.appendContent = function(element) {
- $content.append(element);
- };
- this.clearContent = function() {
- $content[0].innerHTML = "";
- };
- this.close = function() {
- if (options.onClose) options.onClose();
- close();
- };
- $close[0].addEventListener("click", this.close);
- };
- //widget-related functionality
- this.widget = new (function(addons) {
- /*
- stored widget data (in hotWidget/widgetID/):
- [0] - number of spaces from corner
- [1] - corner (top-left, bottom-right etc, can also be top-left-additional)
- widget instance:
- name: displayed name
- index: stored data[0]
- corner: stored data[1]; if set to FREE empty space for the widget will be found automatically (and index parameter can be ommited)
- id: id to be stored
- icon: bg, in format url|bpos, e.g. http://aldous.margonem.pl/img/gui/buttony.png?v=4|-406 -12
- clb: callback function when widget is clicked
- color (optional): color for the widget. Can be blue, red, violet or green. Defaults to green.
- css (optional): object with css style that will be added to the widget. Set by Object.assign and not $(...).css, so all values must be valid
- */
- var self = this,
- addedWidgets = {},
- loaded = false,
- addedWidgets2 = {};
- var dict = addons.dictionary;
- this.addWidgetData = function() {
- var widgets = self.getCustomAddonList();
- var realID;
- var style = "";
- for (var id in widgets) {
- realID = id.substring(14, id.length);
- if (addedWidgets[realID]) {
- Engine.addonsPanel.addKeyToWidgets("_custom_"+realID, widgets[id], addedWidgets[realID].name);
- style += self.getAddonStyle(addedWidgets[realID].id, addedWidgets[realID].icon);
- } else API.Storage.remove("hotWidget/"+id);
- };
- var $style = document.createElement("style");
- $style.innerHTML = style;
- document.head.appendChild($style);
- loaded = true;
- }
- this.getCustomAddonList = function() {
- var widgets = API.Storage.get("hotWidget");
- var custom = {};
- for (var id in widgets) {
- if (id.indexOf("_custom_") > -1) {
- custom[id] = widgets[id];
- }
- }
- return custom;
- }
- this.add = function(widget) {
- if (!API.Storage.get("hotWidget/addon__custom_"+widget.id)) {
- var pos = this.generateWidgetPos(widget);
- if (pos) API.Storage.set("hotWidget/addon__custom_"+widget.id, pos);
- else return true;
- };
- addedWidgets[widget.id] = widget;
- window["addon__custom_"+widget.id] = {
- manageVisible: widget.clb
- };
- return false;
- }
- this.generateWidgetPos = function(widget) {
- if (widget.corner != "FREE") return [index, corner];
- else return this.findFreeWidgetPosition();
- }
- this.findFreeWidgetPosition = function() {
- var widgets = API.Storage.get("hotWidget");
- for (var i=0; i<2; i++) {
- var pos1 = !i ? "top" : "bottom";
- for (var j=0; j<2; j++) {
- var pos2 = !j ? "left" : "right";
- for (var k=0; k<2; k++) {
- if (pos1 == "top" && k) continue;
- var additional = !k ? "" : "-additional";
- var fullpos = pos1+"-"+pos2+additional;
- for (var l=0; l<7; l++) {
- if (!this.checkIfWidgetExists(l, fullpos, widgets)) return [l, fullpos];
- };
- }
- }
- }
- return false;
- }
- this.checkIfWidgetExists = function(pos, corner, widgets) {
- if (!widgets) widgets = API.Storage.get("hotWidget");
- for (var i in widgets) {
- if (widgets[i][0] == pos && widgets[i][1] == corner) return true;
- }
- return false;
- }
- this.getAddonStyle = function(id, icon) {
- return `
- .icon.addon__custom_${id} {
- background: ${Engine.addonsPanel.createBackgroundString(icon)} !important;
- }
- `;
- }
- this.changeWidgetCss = function(widgets, custom) {
- //cache stuff
- if (!custom) addedWidgets2 = widgets;
- for (var id in widgets) {
- var widget = widgets[id];
- if (widget.color || widget.css) {
- var $widget = document.getElementsByClassName((custom ? "addon__custom_" : "addon_")+widget.id)[0];
- if (!$widget) continue;
- else $widget = $widget.parentElement;
- if (widget.color) {
- $widget.classList.remove("green");
- $widget.classList.add(widget.color);
- }
- if (widget.css) {
- Object.assign($widget.style, widget.css);
- }
- }
- }
- }
- this.init = function() {
- addons.emmiter.once("game-load", this.addWidgetData);
- addons.emmiter.once("interface-load", ()=>{
- this.changeWidgetCss(addedWidgets, true);
- var observer = new MutationObserver(this.onWidgetUpdate);
- for (var i=0; i<2; i++) {
- var pos1 = i ? "top" : "bottom";
- for (var j=0; j<2; j++) {
- var pos2 = j ? "right" : "left";
- observer.observe(document.querySelector("."+pos1+"-"+pos2+".main-buttons-container"), {
- childList: true
- })
- }
- }
- });
- }
- this.onWidgetUpdate = function(mutations, observer) {
- if (mutations.length > 1) {
- addons.emmiter.emit("widget-update");
- //readd css to widgets as they are all reset if this code runs
- self.changeWidgetCss(addedWidgets, true);
- self.changeWidgetCss(addedWidgets2);
- };
- }
- this.init();
- })(this);
- this.addonDisplay = new (function(addons) {
- //TODO
- //zmienić pokazywanie ikonek i nazwy klas bo założenia się trochę zmieniły w trakcie robienia a nazwy zostały
- var self = this,
- list = [],
- movedToWindow = [],
- hidden = true,
- $wrapper,
- $singleWrapper,
- $scrollWrapper,
- $scrollContent,
- $title,
- currentDisplay = false;
- this.add = function(options) {
- if (hidden) {
- $wrapper.style["display"] = "block";
- hidden = false;
- }
- var $element = document.createElement("div");
- $element.classList.add("addonDisplay-single-display")
- if (options.html) {
- $element.innerHTML += options.html;
- } else if (options.element) {
- $element.appendChild(options.element);
- }
- var $shortcut = document.createElement("div");
- if (!options.icon) {
- $shortcut.innerHTML = options.name.charAt(0);
- } else {
- $shortcut.innerHTML = "<img width='25px' height='25px' src='"+options.icon+"'>";
- }
- $shortcut.addEventListener("click", () => {
- this.loadDisplay(options.id);
- });
- $shortcut.addEventListener("contextmenu", e => {
- e.preventDefault();
- this.moveDisplayToWindow(options.id);
- });
- $shortcut.dataset["tip"] = options.name;
- $scrollContent.appendChild($shortcut);
- list.push({
- $: $element,
- $short: $shortcut,
- id: options.id,
- name: options.name,
- wndStyle: options.wndStyle
- })
- }
- this.moveDisplayToWindow = function(id) {
- var display = this.getDisplayById(id);
- display.$short.style["display"] = "none";
- if (currentDisplay == display) {
- //display.$.remove();
- //$title.innerHTML = "";
- //currentDisplay = false;
- for (var i=0; i<list.length; i++) {
- var disp = list[i];
- if (disp.id != display.id && movedToWindow.indexOf(disp.id) == -1) {
- this.loadDisplay(disp.id);
- break;
- }
- if (i+1 == list.length) {
- currentDisplay = false;
- }
- }
- }
- if (movedToWindow.indexOf(id) == -1) {
- movedToWindow.push(id);
- Storage.set("addonDisplay/movedToWindow", movedToWindow);
- }
- if (movedToWindow.length == list.length) {
- hidden = true;
- $wrapper.style["display"] = "none";
- }
- this.createDisplayWindow(display);
- }
- this.createDisplayWindows = function() {
- for (var i=0; i<movedToWindow.length; i++) {
- var display = this.getDisplayById(movedToWindow[i]);
- if (display) {
- this.moveDisplayToWindow(display.id);
- } else {
- movedToWindow.splice(i,1);
- i -= 1;
- }
- }
- Storage.set("addonDisplay/movedToWindow", movedToWindow);
- }
- this.createDisplayWindow = function(display) {
- var hwnd = new API.Window({
- onclose: () => {
- setTimeout( ()=>this.removeDisplayWindow(display), 200);
- hwnd.fadeAndRemove();
- }
- });
- Object.assign(hwnd.$[0].style, {
- width: "241px;",
- height: "260px"
- });
- if (display.wndStyle) {
- Object.assign(hwnd.$[0].style, display.wndStyle);
- }
- hwnd.title(display.name);
- hwnd.content(display.$);
- hwnd.setTransparentWindon();
- hwnd.changeDragableContainment('.game-window-positioner');
- hwnd.setSavePosWnd("display_"+display.id, {
- x: '251',
- y: '100'
- });
- $('.alerts-layer').append(hwnd.$);
- hwnd.updatePos();
- }
- this.removeDisplayWindow = function(display) {
- if (movedToWindow.length == list.length) {
- hidden = false;
- $wrapper.style["display"] = "block";
- this.loadDisplay(display.id);
- }
- display.$short.style["display"] = "block";
- movedToWindow.splice(movedToWindow.indexOf(display.id),1);
- }
- this.loadDefaultDisplay = function() {
- if (!list.length) return;
- var lastId = Storage.get("addonDisplay/active");
- if (lastId == null) lastId = list[0].id;
- self.loadDisplay(lastId);
- self.createDisplayWindows();
- }
- this.getDisplayById = function(id) {
- for (var i=0; i<list.length; i++) {
- if (list[i].id == id) return list[i];
- }
- return false;
- }
- this.loadDisplay = function(id) {
- var display = this.getDisplayById(id);
- if (!display) display = list[0];
- if (currentDisplay) {
- $singleWrapper.removeChild(currentDisplay.$);
- currentDisplay.$short.classList.remove("active");
- }
- display.$short.classList.add("active");
- $singleWrapper.appendChild(display.$);
- $title.innerHTML = display.name;
- currentDisplay = display;
- Storage.set("addonDisplay/active", id);
- addons.emmiter.emit("display-load-"+id);
- }
- this.tutorial = function() {
- if (Storage.get("addonDisplay/tutorial") || list.length == 0) return;
- new addons.Window({
- header: "Tutorial",
- txt: _l() == "pl" ?
- "Wygląda na to, że zainstalowałeś dodatek wykorzystujący mechanikę pokazywania rzeczy pod torbami. Kilka informacji:<br>-na dole są ikonki dodatków korzystających z tej machaniki. Klikając je można się między nimi przełączać.<br>-kliknięcie ikonki prawym przyciskiem myszy spowoduje przeniesienie dodatku spod toreb do oddzielnego okienka, któte można dowolnie przesuwać." :
- "It appears that you've installed an addon that uses the mechanic of showing stuff under the bags. Some information:<br>-on the bottom, there are icons of addons using said mechanic. You can switch between addons by clicking these.<br>-by right clicking an icon you can move addon display to a separate window, which can be moved around freely.",
- css: {
- "max-width": "350px"
- }
- })
- Storage.set("addonDisplay/tutorial", true);
- }
- this.init = function() {
- if (typeof Storage.get("addonDisplay") != "object") {
- Storage.set("addonDisplay", {});
- }
- var moved = Storage.get("addonDisplay/movedToWindow")
- if (moved) movedToWindow = moved;
- $wrapper = document.getElementById("b_wrapper");
- $wrapper.innerHTML = "";
- $title = document.createElement("div");
- $title.classList.add("addonDisplay-header");
- $wrapper.appendChild($title);
- $singleWrapper = document.createElement("div");
- $singleWrapper.classList.add("addonDisplay-single-wrapper");
- $wrapper.appendChild($singleWrapper);
- $scrollWrapper = document.createElement("div");
- $scrollWrapper.classList.add("addonDisplay-scroll-wrapper");
- $scrollContent = document.createElement("div");
- $scrollContent.classList.add("addonDisplay-scroll-content");
- $scrollWrapper.appendChild($scrollContent);
- $wrapper.appendChild($scrollWrapper);
- var style = `
- #b_wrapper {
- width: 241px;
- display: none;
- background: rgba(0,0,0,0.3);
- color: white;
- margin-left: 10px;
- }
- .addonDisplay-single-wrapper {
- overflow: hidden;
- width: 100%;
- height: 260px;
- padding: 5px;
- }
- .addonDisplay-single-display {
- color: white;
- width: 100%;
- overflow-y: scroll;
- overflow-x: hidden;
- height: 260px;
- padding-right: 17px;
- margin-top: 4px;
- }
- .addonDisplay-header {
- border-bottom: 1px gray dashed;
- font-size: 125%;
- padding: 5px;
- }
- .addonDisplay-scroll-wrapper {
- width: 100%;
- height: 27px;
- margin-top: 5px;
- border-top: 1px gray dashed;
- }
- .addonDisplay-scroll-content > div {
- float: left;
- width: 24.5px;
- height: 25px;
- line-height: 25px;
- font-size: 110%;
- text-align: center;
- border: 1px solid black;
- border-collapse: collapse;
- background: rgba(0,0,0,0.08);
- cursor: url(http://aldous.margonem.pl/img/gui/cursor/5.png), auto;;
- transition: background .1s ease-in-out;
- }
- .addonDisplay-scroll-content > div:hover {
- background: rgba(55,55,55,0.47);
- }
- .addonDisplay-scroll-content > div.active {
- background: rgba(70,70,70,0.47);
- }
- `;
- var $style = document.createElement("style");
- $style.innerHTML = style;
- document.head.appendChild($style);
- addons.emmiter.once("game-load", this.loadDefaultDisplay);
- addons.emmiter.once("interface-load", this.tutorial);
- }
- this.init();
- })(this);
- this.cursors = {
- default: "url(http://aldous.margonem.pl/img/gui/cursor/1.png), auto",
- npctalk: "url(http://aldous.margonem.pl/img/gui/cursor/2.png), auto",
- fight: "url(http://aldous.margonem.pl/img/gui/cursor/3.png), auto",
- grab: "url(http://aldous.margonem.pl/img/gui/cursor/4.png), auto",
- pointer: "url(http://aldous.margonem.pl/img/gui/cursor/5.png), auto"
- }
- })();