From fb1fc1ef0d708feab88ab6b54dbe244ea082185a Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Sun, 29 Mar 2026 17:16:21 +0200 Subject: [PATCH] =?UTF-8?q?=C3=89quipement=20:=20simplifi=C3=A9=20=C3=A0?= =?UTF-8?q?=20un=20seul=20champ=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- module/applications/sheets/item-sheets.mjs | 1 - module/models/items.mjs | 13 +------ system.json | 3 +- templates/equipment.hbs | 40 ---------------------- 4 files changed, 2 insertions(+), 55 deletions(-) diff --git a/module/applications/sheets/item-sheets.mjs b/module/applications/sheets/item-sheets.mjs index f8a519f..9041b51 100644 --- a/module/applications/sheets/item-sheets.mjs +++ b/module/applications/sheets/item-sheets.mjs @@ -63,7 +63,6 @@ export class CelestopolEquipmentSheet extends CelestopolItemSheet { } async _prepareContext() { const ctx = await super._prepareContext() - ctx.equipmentTypes = SYSTEM.EQUIPMENT_TYPES ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML( this.document.system.description, { async: true }) return ctx diff --git a/module/models/items.mjs b/module/models/items.mjs index ec687c5..556959c 100644 --- a/module/models/items.mjs +++ b/module/models/items.mjs @@ -60,19 +60,8 @@ export class CelestopolAspect extends foundry.abstract.TypeDataModel { export class CelestopolEquipment extends foundry.abstract.TypeDataModel { static defineSchema() { const fields = foundry.data.fields - const reqInt = { required: true, nullable: false, integer: true } return { - subtype: new fields.StringField({ required: true, nullable: false, initial: "autre", - choices: Object.keys(SYSTEM.EQUIPMENT_TYPES) }), - quantity: new fields.NumberField({ ...reqInt, initial: 1, min: 0 }), - weight: new fields.NumberField({ required: true, nullable: false, initial: 0, min: 0 }), - damage: new fields.StringField({ required: true, nullable: false, initial: "" }), - range: new fields.StringField({ required: true, nullable: false, initial: "" }), - speed: new fields.StringField({ required: true, nullable: false, initial: "" }), - protection: new fields.StringField({ required: true, nullable: false, initial: "" }), - crew: new fields.StringField({ required: true, nullable: false, initial: "" }), - description:new fields.HTMLField({ required: true, textSearch: true }), - notes: new fields.HTMLField({ required: true, textSearch: true }), + description: new fields.HTMLField({ required: true, textSearch: true }), } } } diff --git a/system.json b/system.json index 6b1f50f..505a62a 100644 --- a/system.json +++ b/system.json @@ -78,8 +78,7 @@ }, "equipment": { "htmlFields": [ - "description", - "notes" + "description" ] }, "weapon": { diff --git a/templates/equipment.hbs b/templates/equipment.hbs index ae8db4a..1496cd1 100644 --- a/templates/equipment.hbs +++ b/templates/equipment.hbs @@ -5,49 +5,9 @@
-
- -
- - -
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}