Fix location and quantities
This commit is contained in:
@ -52,21 +52,22 @@ export class BoLActorSheet extends ActorSheet {
|
||||
const dataset = ev.currentTarget.dataset;
|
||||
const operator = dataset.operator;
|
||||
const target = dataset.target;
|
||||
const incr = parseInt(dataset.incr);
|
||||
const min = parseInt(dataset.min);
|
||||
const max = parseInt(dataset.max);
|
||||
const incr = parseInt(dataset.incr)
|
||||
const min = parseInt(dataset.min)
|
||||
const max = parseInt(dataset.max) || 10000
|
||||
const itemData = item.data;
|
||||
let value = eval("itemData."+target);
|
||||
let value = eval("itemData."+target)
|
||||
value = value || 0
|
||||
console.log("IncDec", item, target, value, operator, min, max)
|
||||
if(operator === "minus"){
|
||||
if(value >= min + incr) value -= incr;
|
||||
else value = min;
|
||||
}
|
||||
if(operator === "plus"){
|
||||
if(operator === "plus") {
|
||||
if(value <= max - incr) value += incr;
|
||||
else value = max;
|
||||
}
|
||||
let update = {};
|
||||
update[target] = value;
|
||||
let update = { [`${target}`]: value};
|
||||
item.update(update);
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,11 @@ export class BoLItemSheet extends ItemSheet {
|
||||
if (!itemData.data.category) {
|
||||
itemData.data.category = "equipment"
|
||||
}
|
||||
if ( itemData.data.category == "equipment" && itemData.data.properties.equipable) {
|
||||
if (!itemData.data.properties.slot) {
|
||||
itemData.data.properties.slot = "-"
|
||||
}
|
||||
}
|
||||
if (itemData.data.category == 'spell') {
|
||||
for (let i = 0; i < 4; i++) {
|
||||
itemData.data.properties.mandatoryconditions[i] = itemData.data.properties.mandatoryconditions[i] ?? ""
|
||||
|
Reference in New Issue
Block a user