DC - BlockUse Fixed

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
}) ();