function enableButtonsPerSettings() {

      let checkAvailability = game.settings.get("LightsHUD", "checkAvailability");
      let spellName = game.settings.get('LightsHUD', "spell.nameLightSpell").toLowerCase();
      let lantern = game.settings.get('LightsHUD', "lanternType.nameConsumableLantern").toLowerCase();
      let torch = game.settings.get('LightsHUD', "torchType.nameConsumableTorch").toLowerCase();

      let noCheck;// = game.system.id !== "dnd5e";
      if (!noCheck) noCheck = !checkAvailability;

      if (noCheck || canCastLight(spellName)) {
        enableLightsHUDButton(tbuttonLight);
      } else {
        disableLightsHUDButton(tbuttonLight);
      }

      if (noCheck || hasItem(lantern)) {
        enableLightsHUDButton(tbuttonLantern);
      } else {
        disableLightsHUDButton(tbuttonLantern);
      }

      if (noCheck || hasItem(torch)) {
        enableLightsHUDButton(tbuttonTorch);
      } else {
        disableLightsHUDButton(tbuttonTorch);
      }
    }
// Enable or disable buttons according to parameters
Enable or disable buttons according to parameters
Enable or disable buttons according to parameters
function enableButtonsPerSettings() {
      let checkAvailability = game.settings.get("LightsHUD", "checkAvailability");
      let spellName = game.settings.get('LightsHUD', "spell.nameLightSpell").toLowerCase();
      let lantern = game.settings.get('LightsHUD', "lanternType.nameConsumableLantern").toLowerCase();
      let torch = game.settings.get('LightsHUD', "torchType.nameConsumableTorch").toLowerCase();
      let noCheck;
      if (!noCheck) noCheck = !checkAvailability;
      if (noCheck || canCastLight(spellName)) {
        enableLightsHUDButton(tbuttonLight);
      } else {
        disableLightsHUDButton(tbuttonLight);
      }
      if (noCheck || hasItem(lantern)) {
        enableLightsHUDButton(tbuttonLantern);
      } else {
        disableLightsHUDButton(tbuttonLantern);
      }
      if (noCheck || hasItem(torch)) {
        enableLightsHUDButton(tbuttonTorch);
      } else {
        disableLightsHUDButton(tbuttonTorch);
      }
    }
function enableButtonsPerSettings ( ) { let checkAvailability = game . settings . get ( "LightsHUD" , "checkAvailability" ) ; let spellName = game . settings . get ( 'LightsHUD' , "spell.nameLightSpell" ) . toLowerCase ( ) ; let lantern = game . settings . get ( 'LightsHUD' , "lanternType.nameConsumableLantern" ) . toLowerCase ( ) ; let torch = game . settings . get ( 'LightsHUD' , "torchType.nameConsumableTorch" ) . toLowerCase ( ) ; let noCheck ; if ( ! noCheck ) noCheck = ! checkAvailability ; if ( noCheck || canCastLight ( spellName ) ) { enableLightsHUDButton ( tbuttonLight ) ; } else { disableLightsHUDButton ( tbuttonLight ) ; } if ( noCheck || hasItem ( lantern ) ) { enableLightsHUDButton ( tbuttonLantern ) ; } else { disableLightsHUDButton ( tbuttonLantern ) ; } if ( noCheck || hasItem ( torch ) ) { enableLightsHUDButton ( tbuttonTorch ) ; } else { disableLightsHUDButton ( tbuttonTorch ) ; } }
Enable or disable buttons according to parameters
Enable or disable buttons according to parameters
// = game.system.id !== "dnd5e";