#6 : Skill experience management

This commit is contained in:
2021-03-12 20:57:41 +01:00
parent 3285bd416e
commit 9d610215d4
12 changed files with 113 additions and 15 deletions

View File

@@ -45,7 +45,12 @@ export class SoSItemSheet extends ItemSheet {
async getData() {
let data = super.getData();
data.isGM = game.user.isGM;
if ( data.item.type == 'skillexperience') {
data.skillList = await SoSUtility.loadCompendiumNames("foundryvtt-shadows-over-sol.skills");
}
if ( data.item.type == 'skill' && this.object.options?.actor) {
data.skillExperienceList = this.object.options.actor.getSkillExperience( data.item.name );
}
return data;
}
@@ -57,6 +62,19 @@ export class SoSItemSheet extends ItemSheet {
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.object.options.actor.getOwnedItem(li.data("item-id"));
console.log("ITEM", item, li.data("item-id"), li);
item.sheet.render(true);
});
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.object.options.actor.deleteOwnedItem( li.data("item-id") ).then( this.render(true));
//this.render(true);
});
}