Anomalie : refonte fiche — 3 champs Technique/Narratif/Exemples
- DataModel : suppression 'description', ajout 'exemples' (HTMLField) - Template anomaly.hbs : suppression onglets, 3 sections éditables directement (sans bouton masqué), scroll interne - Styles : fond crème + titres de section Art Déco + éditeurs blancs avec texte sombre lisible (fix couleur jaune illisible) - item-sheets.mjs : contexte enrichedExemples + hauteur fenêtre 560px - lang/fr.json : clé CELESTOPOL.Item.exemples Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -180,6 +180,7 @@
|
||||
"scores": "Scores bonus / malus",
|
||||
"technique": "Description technique",
|
||||
"narratif": "Description narrative",
|
||||
"exemples": "Exemples d'utilisation",
|
||||
"quantity": "Quantité",
|
||||
"damage": "Dégâts",
|
||||
"range": "Portée",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { SYSTEM } from "../../config/system.mjs"
|
||||
export class CelestopolAnomalySheet extends CelestopolItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["anomaly"],
|
||||
position: { width: 560, height: 460 },
|
||||
position: { width: 560, height: 560 },
|
||||
}
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-celestopol/templates/anomaly.hbs" },
|
||||
@@ -22,12 +22,12 @@ export class CelestopolAnomalySheet extends CelestopolItemSheet {
|
||||
return key
|
||||
})
|
||||
|
||||
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 })
|
||||
ctx.enrichedExemples = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||
this.document.system.exemples, { async: true })
|
||||
return ctx
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ export class CelestopolAnomaly extends foundry.abstract.TypeDataModel {
|
||||
choices: Object.keys(SYSTEM.ANOMALY_TYPES) }),
|
||||
level: new fields.NumberField({ ...reqInt, initial: 2, min: 1, max: 4 }),
|
||||
usesRemaining: new fields.NumberField({ ...reqInt, initial: 2, min: 0, max: 4 }),
|
||||
description: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
technique: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
narratif: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
exemples: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,6 +276,50 @@
|
||||
color: var(--cel-orange-light);
|
||||
}
|
||||
}
|
||||
|
||||
// Corps principal sans onglets
|
||||
.anomaly-body {
|
||||
background: var(--cel-cream, #f0e8d4);
|
||||
padding: 10px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
overflow-y: auto;
|
||||
max-height: 370px;
|
||||
}
|
||||
|
||||
.anomaly-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
|
||||
.anomaly-section-title {
|
||||
font-family: var(--cel-font-title);
|
||||
font-size: 0.78em;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.07em;
|
||||
color: var(--cel-green-dark, #0c4c0c);
|
||||
background: linear-gradient(to right, rgba(12,76,12,0.12), transparent);
|
||||
border-left: 3px solid var(--cel-orange, #e07b00);
|
||||
padding: 2px 6px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.anomaly-editor-wrap {
|
||||
background: white;
|
||||
border: 1px solid rgba(122,92,32,0.3);
|
||||
border-radius: 3px;
|
||||
min-height: 60px;
|
||||
padding: 4px 6px;
|
||||
color: #1a1209;
|
||||
font-size: 0.88em;
|
||||
line-height: 1.5;
|
||||
|
||||
// ProseMirror reset
|
||||
.editor-content, .prosemirror { color: #1a1209; background: transparent; }
|
||||
p { margin: 0 0 4px 0; color: #1a1209; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Equipment-specific
|
||||
|
||||
@@ -53,25 +53,29 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<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>
|
||||
</nav>
|
||||
{{!-- Corps principal : 3 sections sans onglets --}}
|
||||
<div class="anomaly-body">
|
||||
|
||||
<section class="tab active" data-group="item-tabs" data-tab="description">
|
||||
<div class="form-group">
|
||||
{{editor system.description target="system.description" button=true editable=isEditable}}
|
||||
<div class="anomaly-section">
|
||||
<div class="anomaly-section-title">{{localize "CELESTOPOL.Item.technique"}}</div>
|
||||
<div class="anomaly-editor-wrap">
|
||||
{{editor system.technique target="system.technique" button=false editable=isEditable}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="tab" data-group="item-tabs" data-tab="technique">
|
||||
<div class="form-group">
|
||||
<label>{{localize "CELESTOPOL.Item.technique"}}</label>
|
||||
{{editor system.technique target="system.technique" button=true editable=isEditable}}
|
||||
<div class="anomaly-section">
|
||||
<div class="anomaly-section-title">{{localize "CELESTOPOL.Item.narratif"}}</div>
|
||||
<div class="anomaly-editor-wrap">
|
||||
{{editor system.narratif target="system.narratif" button=false editable=isEditable}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{localize "CELESTOPOL.Item.narratif"}}</label>
|
||||
{{editor system.narratif target="system.narratif" button=true editable=isEditable}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="anomaly-section">
|
||||
<div class="anomaly-section-title">{{localize "CELESTOPOL.Item.exemples"}}</div>
|
||||
<div class="anomaly-editor-wrap">
|
||||
{{editor system.exemples target="system.exemples" button=false editable=isEditable}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user