Compat FVTT v13 - adding namespaces

This commit is contained in:
Vlyan
2025-05-01 14:41:43 +02:00
parent 95fa36d7a8
commit 897ccefd71
19 changed files with 87 additions and 71 deletions

View File

@@ -55,15 +55,15 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
*/
_createDragDropHandlers() {
return [
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dropSelector: ".warlord",
callbacks: { drop: this._onDropActors.bind(this, "warlord") },
}),
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dropSelector: ".commander",
callbacks: { drop: this._onDropActors.bind(this, "commander") },
}),
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dropSelector: null,
callbacks: { drop: this._onDrop.bind(this) },
}),
@@ -120,7 +120,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
// Editors enrichment
for (const name of ["army_abilities", "supplies_logistics", "past_battles"]) {
sheetData.data.enrichedHtml[name] = await TextEditor.enrichHTML(sheetData.data.system[name], {
sheetData.data.enrichedHtml[name] = await foundry.applications.ux.TextEditor.implementation.enrichHTML(sheetData.data.system[name], {
async: true,
});
}

View File

@@ -1,7 +1,7 @@
/**
* Base Sheet for Actor and Npc
*/
export class BaseSheetL5r5e extends ActorSheet {
export class BaseSheetL5r5e extends foundry.appv1.sheets.ActorSheet {
/**
* Commons options
*/
@@ -81,8 +81,8 @@ export class BaseSheetL5r5e extends ActorSheet {
// Editors enrichment
sheetData.data.enrichedHtml = {
description: await TextEditor.enrichHTML(sheetData.data.system.description, { async: true }),
notes: await TextEditor.enrichHTML(sheetData.data.system.notes, { async: true }),
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(sheetData.data.system.description, { async: true }),
notes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(sheetData.data.system.notes, { async: true }),
};
// Shortcut for some tests

View File

@@ -101,19 +101,19 @@ export class TwentyQuestionsDialog extends FormApplication {
*/
_createDragDropHandlers() {
return [
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dragSelector: ".item",
dropSelector: ".items",
permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "item") },
}),
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dragSelector: ".technique",
dropSelector: ".techniques",
permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "technique") },
}),
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dragSelector: ".peculiarity",
dropSelector: ".peculiarities",
permissions: { dragstart: this.isEditable, drop: this.isEditable },
@@ -122,7 +122,7 @@ export class TwentyQuestionsDialog extends FormApplication {
drop: this._onDropItem.bind(this, "peculiarity"),
},
}),
new DragDrop({
new foundry.applications.ux.DragDrop.implementation({
dragSelector: ".bond",
dropSelector: ".bonds",
permissions: { dragstart: this.isEditable, drop: this.isEditable },