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);
});
+1 -29
View File
@@ -6,13 +6,6 @@ const { HandlebarsApplicationMixin } = foundry.applications.api
*/
export default class EcrymeBaseItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
constructor(options = {}) {
super(options)
this.#dragDrop = this.#createDragDropHandlers()
}
#dragDrop
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-ecryme", "item"],
@@ -63,7 +56,7 @@ export default class EcrymeBaseItemSheet extends HandlebarsApplicationMixin(foun
item: this.document,
system: this.document.system,
source: this.document.toObject(),
config: game.system.ecryme.config,
config: game.ecryme.config,
isEditable: this.isEditable,
tabs: this._getTabs(),
}
@@ -82,27 +75,6 @@ export default class EcrymeBaseItemSheet extends HandlebarsApplicationMixin(foun
return context
}
/** @override */
_onRender(context, options) {
this.#dragDrop.forEach((d) => d.bind(this.element))
}
// #region Drag-and-Drop
#createDragDropHandlers() {
return this.options.dragDrop.map((d) => {
d.permissions = {
dragstart: this._canDragStart.bind(this),
drop: this._canDragDrop.bind(this),
}
d.callbacks = {
dragstart: this._onDragStart.bind(this),
dragover: this._onDragOver.bind(this),
drop: this._onDrop.bind(this),
}
return new foundry.applications.ux.DragDrop.implementation(d)
})
}
_canDragStart(selector) { return this.isEditable }
_canDragDrop(selector) { return this.isEditable && this.document.isOwner }
_onDragStart(event) {}