Aspect : simplifié à un seul champ description
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -35,20 +35,15 @@ export class CelestopolAnomalySheet extends CelestopolItemSheet {
|
||||
export class CelestopolAspectSheet extends CelestopolItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["aspect"],
|
||||
position: { width: 620, height: 520 },
|
||||
position: { width: 480, height: 360 },
|
||||
}
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-celestopol/templates/aspect.hbs" },
|
||||
}
|
||||
async _prepareContext() {
|
||||
const ctx = await super._prepareContext()
|
||||
ctx.skills = SYSTEM.SKILLS
|
||||
ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,14 +45,8 @@ export class CelestopolAnomaly extends foundry.abstract.TypeDataModel {
|
||||
export class CelestopolAspect extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const reqInt = { required: true, nullable: false, integer: true }
|
||||
return {
|
||||
value: new fields.NumberField({ ...reqInt, initial: 0, min: 0, max: 8 }),
|
||||
scores: skillScoresSchema(),
|
||||
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 }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,10 +70,7 @@
|
||||
},
|
||||
"aspect": {
|
||||
"htmlFields": [
|
||||
"description",
|
||||
"technique",
|
||||
"narratif",
|
||||
"notes"
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"equipment": {
|
||||
|
||||
@@ -5,54 +5,15 @@
|
||||
</div>
|
||||
<div class="item-header-fields">
|
||||
<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>
|
||||
</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-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">
|
||||
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user