Files
fvtt-celestopol/templates/character-factions.hbs
LeRatierBretonnier 9dbd614c5a feat: gestion de l'expérience (XP)
- Schéma xp dans CelestopolCharacter : actuel (éditable), log[] ({montant, raison, date}), depense (calculé dans prepareDerivedData)
- Bouton 'Dépenser XP' → DialogV2 (montant + raison) : décrémente actuel, logge l'entrée
- Suppression d'entrée de log avec remboursement des points (mode édition)
- Section XP en haut de l'onglet Biographie : compteurs, tableau du log, référentiel des coûts
- i18n : section CELESTOPOL.XP.* complète
- CSS : .xp-section avec compteurs, tableau de log et accordéon de référence

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-31 00:33:59 +02:00

75 lines
3.1 KiB
Handlebars

<div class="tab factions {{tab.cssClass}}" data-group="sheet" data-tab="factions">
<table class="factions-table">
<thead>
<tr>
<th>{{localize "CELESTOPOL.Faction.label"}}</th>
<th>{{localize "CELESTOPOL.Faction.score"}}</th>
</tr>
</thead>
<tbody>
{{#each factions as |faction factionId|}}
<tr class="faction-row" data-faction="{{factionId}}">
<td class="faction-name">{{localize faction.label}}</td>
<td class="faction-value">
<div class="faction-checkboxes-container">
<div class="faction-checkboxes">
{{#each (range 9) as |level|}}
<span class="faction-dot {{#if (lte level (lookup @root.system.factions factionId 'value'))}}filled{{/if}}"
{{#if @root.isEditable}}data-action="factionLevel" data-faction="{{factionId}}" data-index="{{level}}"{{/if}}></span>
{{/each}}
</div>
<span class="faction-count">{{lookup @root.system.factions factionId 'value'}}</span>
</div>
</td>
</tr>
{{/each}}
{{!-- Factions personnalisées --}}
<tr class="faction-row custom" data-faction="perso1">
<td>
{{#if isEditMode}}
<input type="text" name="system.factions.perso1.label"
value="{{system.factions.perso1.label}}"
placeholder="{{localize 'CELESTOPOL.Faction.custom'}}">
{{else}}
<span>{{#if system.factions.perso1.label}}{{system.factions.perso1.label}}{{else}}{{/if}}</span>
{{/if}}
</td>
<td>
<div class="faction-checkboxes-container">
<div class="faction-checkboxes">
{{#each (range 9) as |level|}}
<span class="faction-dot {{#if (lte level ../system.factions.perso1.value)}}filled{{/if}}"
{{#if ../isEditable}}data-action="factionLevel" data-faction="perso1" data-index="{{level}}"{{/if}}></span>
{{/each}}
</div>
<span class="faction-count">{{system.factions.perso1.value}}</span>
</div>
</td>
</tr>
<tr class="faction-row custom" data-faction="perso2">
<td>
{{#if isEditMode}}
<input type="text" name="system.factions.perso2.label"
value="{{system.factions.perso2.label}}"
placeholder="{{localize 'CELESTOPOL.Faction.custom'}}">
{{else}}
<span>{{#if system.factions.perso2.label}}{{system.factions.perso2.label}}{{else}}{{/if}}</span>
{{/if}}
</td>
<td>
<div class="faction-checkboxes-container">
<div class="faction-checkboxes">
{{#each (range 9) as |level|}}
<span class="faction-dot {{#if (lte level ../system.factions.perso2.value)}}filled{{/if}}"
{{#if ../isEditable}}data-action="factionLevel" data-faction="perso2" data-index="{{level}}"{{/if}}></span>
{{/each}}
</div>
<span class="faction-count">{{system.factions.perso2.value}}</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>