Aspect : simplifié à un seul champ description

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-29 17:28:52 +02:00
parent 7b2662bdd5
commit 8f6f3823c6
4 changed files with 8 additions and 61 deletions

View File

@@ -35,20 +35,15 @@ export class CelestopolAnomalySheet extends CelestopolItemSheet {
export class CelestopolAspectSheet extends CelestopolItemSheet { export class CelestopolAspectSheet extends CelestopolItemSheet {
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {
classes: ["aspect"], classes: ["aspect"],
position: { width: 620, height: 520 }, position: { width: 480, height: 360 },
} }
static PARTS = { static PARTS = {
main: { template: "systems/fvtt-celestopol/templates/aspect.hbs" }, main: { template: "systems/fvtt-celestopol/templates/aspect.hbs" },
} }
async _prepareContext() { async _prepareContext() {
const ctx = await super._prepareContext() const ctx = await super._prepareContext()
ctx.skills = SYSTEM.SKILLS
ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML( ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
this.document.system.description, { async: true }) this.document.system.description, { async: true })
ctx.enrichedTechnique = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
this.document.system.technique, { async: true })
ctx.enrichedNarratif = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
this.document.system.narratif, { async: true })
return ctx return ctx
} }
} }

View File

@@ -45,14 +45,8 @@ export class CelestopolAnomaly extends foundry.abstract.TypeDataModel {
export class CelestopolAspect extends foundry.abstract.TypeDataModel { export class CelestopolAspect extends foundry.abstract.TypeDataModel {
static defineSchema() { static defineSchema() {
const fields = foundry.data.fields const fields = foundry.data.fields
const reqInt = { required: true, nullable: false, integer: true }
return { return {
value: new fields.NumberField({ ...reqInt, initial: 0, min: 0, max: 8 }),
scores: skillScoresSchema(),
description: new fields.HTMLField({ required: true, textSearch: true }), description: new fields.HTMLField({ required: true, textSearch: true }),
technique: new fields.HTMLField({ required: true, textSearch: true }),
narratif: new fields.HTMLField({ required: true, textSearch: true }),
notes: new fields.HTMLField({ required: true, textSearch: true }),
} }
} }
} }

View File

@@ -70,10 +70,7 @@
}, },
"aspect": { "aspect": {
"htmlFields": [ "htmlFields": [
"description", "description"
"technique",
"narratif",
"notes"
] ]
}, },
"equipment": { "equipment": {

View File

@@ -5,54 +5,15 @@
</div> </div>
<div class="item-header-fields"> <div class="item-header-fields">
<input type="text" name="name" value="{{item.name}}" {{#unless isEditable}}disabled{{/unless}}> <input type="text" name="name" value="{{item.name}}" {{#unless isEditable}}disabled{{/unless}}>
<div class="item-meta">
<div class="item-value-field">
<label>{{localize "CELESTOPOL.Item.value"}}</label>
{{#if isEditable}}
<input type="number" name="system.value" value="{{system.value}}" min="0" max="8">
{{else}}
<span class="item-value-display">{{system.value}}</span>
{{/if}}
</div>
</div>
</div> </div>
</header> </header>
<nav class="item-tabs sheet-tabs tabs" data-group="item-tabs">
<a class="item active" data-group="item-tabs" data-tab="description">{{localize "CELESTOPOL.Tab.description"}}</a>
<a class="item" data-group="item-tabs" data-tab="technique">{{localize "CELESTOPOL.Tab.technique"}}</a>
<a class="item" data-group="item-tabs" data-tab="scores">{{localize "CELESTOPOL.Item.scores"}}</a>
</nav>
<section class="tab active" data-group="item-tabs" data-tab="description">
<div class="anomaly-body"> <div class="anomaly-body">
<div class="anomaly-section"> <div class="anomaly-section">
<div class="anomaly-section-title">{{localize "CELESTOPOL.Tab.description"}}</div> <div class="anomaly-section-title">{{localize "CELESTOPOL.Actor.description"}}</div>
<div class="anomaly-editor-wrap"> <div class="anomaly-editor-wrap">
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}} {{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</div> </div>
</div> </div>
</div> </div>
</section>
<section class="tab" data-group="item-tabs" data-tab="technique">
<div class="anomaly-body">
<div class="anomaly-section">
<div class="anomaly-section-title">{{localize "CELESTOPOL.Item.technique"}}</div>
<div class="anomaly-editor-wrap">
{{formInput systemFields.technique enriched=enrichedTechnique value=system.technique name="system.technique" toggled=true}}
</div>
</div>
<div class="anomaly-section">
<div class="anomaly-section-title">{{localize "CELESTOPOL.Item.narratif"}}</div>
<div class="anomaly-editor-wrap">
{{formInput systemFields.narratif enriched=enrichedNarratif value=system.narratif name="system.narratif" toggled=true}}
</div>
</div>
</div>
</section>
<section class="tab" data-group="item-tabs" data-tab="scores">
{{> "systems/fvtt-celestopol/templates/partials/item-scores.hbs" skills=skills system=system}}
</section>
</div> </div>