This commit is contained in:
rwanoux
2024-11-15 22:05:29 +01:00
parent a163528acb
commit e721c706eb
37 changed files with 334 additions and 185 deletions
+10 -2
View File
@@ -1,3 +1,5 @@
import { TraitSelector } from "../system/applications.mjs";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
@@ -55,7 +57,6 @@ export class VermineItemSheet extends ItemSheet {
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.isEditable) return;
//click on wound radio
@@ -63,7 +64,9 @@ export class VermineItemSheet extends ItemSheet {
this._onClickDamage(ev)
})
// Roll handlers, click handlers, etc. would go here.
html.find('.traits-selector').click(ev => {
this.openTraitSelector(ev)
})
}
async _onClickDamage(ev) {
if (!ev.currentTarget.checked) { return }
@@ -73,4 +76,9 @@ export class VermineItemSheet extends ItemSheet {
this.item.update(update)
}
async openTraitSelector(ev) {
let selector = new TraitSelector(this.item);
selector.render(true)
}
}