Support des propriétés d'items
Amélioration de l'interface Améliorations cosmétiques
This commit is contained in:
@ -11,8 +11,8 @@ export class BoLItemSheet extends ItemSheet {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["bol", "sheet", "item"],
|
||||
template: "systems/bol/templates/item/item-sheet.hbs",
|
||||
width: 520,
|
||||
height: 480,
|
||||
width: 650,
|
||||
height: 750,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
|
||||
});
|
||||
}
|
||||
@ -30,31 +30,17 @@ export class BoLItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
getData() {
|
||||
const objectData = BoLUtility.data(this.item);
|
||||
// const objectData = BoLUtility.data(this.object);
|
||||
|
||||
let itemData = foundry.utils.deepClone(BoLUtility.templateData(this.item));
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.id,
|
||||
config: game.bol.config,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: itemData,
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
isGM: game.user.isGM,
|
||||
itemProperties : this.item.itemProperties
|
||||
|
||||
}
|
||||
console.log("ITEMDATA", formData);
|
||||
this.options.editable = !(this.object.data.origin == "embeddedItem");
|
||||
return formData;
|
||||
getData(options) {
|
||||
const data = super.getData(options);
|
||||
const itemData = data.data;
|
||||
data.config = game.bol.config;
|
||||
data.item = itemData;
|
||||
data.data = itemData.data;
|
||||
data.category = itemData.category;
|
||||
data.itemProperties = this.item.itemProperties;
|
||||
data.isGM = game.user.isGM;
|
||||
console.log("ITEMDATA", data);
|
||||
return data;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -76,6 +62,13 @@ export class BoLItemSheet extends ItemSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
// Roll handlers, click handlers, etc. would go here.
|
||||
|
||||
html.find('.armorQuality').change(ev => {
|
||||
const li = $(ev.currentTarget);
|
||||
console.log(game.bol.config.soakFormulas[li.val()]);
|
||||
$('.soakFormula').val(game.bol.config.soakFormulas[li.val()]);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user