feat: ajoute le champ 'valeur' sur l'item Aspect
- DataModel : champ NumberField 'valeur' (entier, min 0, défaut 0) - Fiche item aspect.hbs : champ valeur dans le header - Fiche personnage : affiche item.system.valeur dans la liste des aspects - CSS : .item-value dans cel-item-row (vert, gras) ; .item-header-valeur dans items.less - i18n : CELESTOPOL.Aspect.valeur Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -253,6 +253,9 @@
|
||||
"protectionHint": "Réduit les blessures subies de ce montant",
|
||||
"malus": "Malus",
|
||||
"malusHint": "Malus aux tests de Mobilité et Discrétion (ou Domaine Corps pour PNJ)"
|
||||
},
|
||||
"Aspect": {
|
||||
"valeur": "Valeur"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@ export class CelestopolAspect extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
return {
|
||||
valeur: new fields.NumberField({ required: true, integer: true, initial: 0, min: 0 }),
|
||||
description: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,29 @@
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
.item-header-valeur {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
label {
|
||||
font-size: 0.8em;
|
||||
color: var(--cel-orange-light);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
input[type="number"] {
|
||||
width: 52px;
|
||||
background: rgba(0,0,0,0.15);
|
||||
border: 1px solid var(--cel-orange-light);
|
||||
border-radius: 3px;
|
||||
color: var(--cel-orange);
|
||||
font-weight: bold;
|
||||
font-size: 1em;
|
||||
text-align: center;
|
||||
padding: 1px 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-meta {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
|
||||
@@ -72,6 +72,13 @@
|
||||
|
||||
.item-name { flex: 1; font-style: italic; }
|
||||
|
||||
.item-value {
|
||||
font-weight: bold;
|
||||
min-width: 24px;
|
||||
text-align: center;
|
||||
color: var(--cel-green);
|
||||
}
|
||||
|
||||
.item-controls {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
</div>
|
||||
<div class="item-header-fields">
|
||||
<input type="text" name="name" value="{{item.name}}" {{#unless isEditable}}disabled{{/unless}}>
|
||||
<div class="item-header-valeur">
|
||||
<label>{{localize "CELESTOPOL.Aspect.valeur"}}</label>
|
||||
{{formInput systemFields.valeur value=system.valeur name="system.valeur"}}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
<div class="item-row" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">
|
||||
<img src="{{item.img}}" class="item-icon" alt="{{item.name}}">
|
||||
<span class="item-name">{{item.name}}</span>
|
||||
<span class="item-value">{{item.system.value}}</span>
|
||||
<span class="item-value">{{item.system.valeur}}</span>
|
||||
<div class="item-controls">
|
||||
<a data-action="edit" data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
|
||||
{{#if ../isEditMode}}<a data-action="delete" data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user