DC - BlockUse Fixed

Bloque l'utilisation de consommables par défaut. Faut déverouiller le petit cadenas 'BU' pour pouvoir.

Stan na 08-01-2021. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        DC - BlockUse Fixed
// @namespace   InGame
// @include     https://www.dreadcast.net/Main
// @include     https://www.dreadcast.eu/Main
// @author      Odul, Fixed by Lorkah
// @version     1.2
// @description Bloque l'utilisation de consommables par défaut. Faut déverouiller le petit cadenas 'BU' pour pouvoir.
// @grant       none
// ==/UserScript==

function checkActivable(){
  if( document.getElementById('blockUse').style.backgroundImage.replace(/\"/g,'') == 'url(https://i.imgur.com/SNOpqJt.png)')
  {
   $('.objets .non_activable').each(function (index) {
      $(this).removeClass("non_activable").addClass("activable");
    });
  }
  else
  {
     $('.objets .activable').each(function (index) {
      $(this).removeClass("activable").addClass("non_activable");
    });
  }
}

(function () {
var blockUse = document.createElement('li');
blockUse.id='blockUse';
blockUse.setAttribute("style", "height:30px;background-image:url('https://i.imgur.com/qKgO7xV.png');background-repeat: no-repeat;z-index: 999999;");

$('#bandeau ul')[0].insertBefore(blockUse,$('#bandeau ul')[0].firstChild);          
$('#blockUse').css('background-position','0px 6px').css('top','5px').css('background-size','15px 15px').addClass('link').text('BU').css("color","#999");

blockUse.onclick = function(){
    if( document.getElementById('blockUse').style.backgroundImage.replace(/\"/g,'') == 'url(https://i.imgur.com/SNOpqJt.png)')
    document.getElementById('blockUse').style.backgroundImage = 'url("https://i.imgur.com/qKgO7xV.png")';
  else
    document.getElementById('blockUse').style.backgroundImage = 'url("https://i.imgur.com/SNOpqJt.png")';
};
    
  
  var myVar = setInterval(function () {
    checkActivable()
  }, 3000);
}) ();