feat: separate skill value/max (transcendence pool vs level)
Release Creation / build (release) Successful in 58s

- skill.value = spendable transcendence pool (editable select)
- skill.max = max level (locked by default, unlock btn)
- computeRollFormula/computeResults/confront use skill.max
- clamp transcendence spend to skill.value
- resetTranscendence button in Bio&Notes
- v14 compat: duplicate→deepClone, mergeObject→spread, socket fixes
- Dialog v1 removed, DragDrop dedup, await fixes
This commit is contained in:
2026-07-24 09:00:26 +02:00
parent 8c79e6f0ba
commit 31e2561797
63 changed files with 385 additions and 340 deletions
+8 -21
View File
@@ -8,28 +8,15 @@ export class EcrymeItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
return {
...super.defaultOptions,
classes: ["fvtt-ecryme", "sheet", "item"],
template: "systems/fvtt-ecryme/templates/item-sheet.hbs",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 580,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
};
}
/* -------------------------------------------- */
@@ -56,8 +43,8 @@ export class EcrymeItemSheet extends foundry.appv1.sheets.ItemSheet {
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: foundry.utils.duplicate(this.object.system),
config: foundry.utils.duplicate(game.system.ecryme.config),
system: foundry.utils.deepClone(this.object.system),
config: foundry.utils.deepClone(game.ecryme.config),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
@@ -89,7 +76,7 @@ export class EcrymeItemSheet extends foundry.appv1.sheets.ItemSheet {
/* -------------------------------------------- */
postItem() {
let chatData = foundry.utils.duplicate(this.item)
let chatData = foundry.utils.deepClone(this.item)
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
@@ -104,7 +91,7 @@ export class EcrymeItemSheet extends foundry.appv1.sheets.ItemSheet {
payload: chatData,
});
renderTemplate('systems/Ecryme/templates/post-item.html', chatData).then(html => {
foundry.applications.handlebars.renderTemplate('systems/fvtt-ecryme/templates/post-item.html', chatData).then(html => {
let chatOptions = EcrymeUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
@@ -154,7 +141,7 @@ export class EcrymeItemSheet extends foundry.appv1.sheets.ItemSheet {
// 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"));
const item = this.actor?.items.get(li.data("item-id"));
item.sheet.render(true);
});