fix: 4 bugs post-review (JSON, rangMagie, GM guard, inline styles)
- Trailing comma dans fr.json qui cassait le parsing JSON (critique) - RANG_MAGICIEN utilisait val.name au lieu de val.label - Bouton tirage MJ accessible aux non-GM (ajout guard game.user.isGM) - style='flex:1' et style='display:none' externalisés dans roll.less
This commit is contained in:
+28
-4
@@ -3410,10 +3410,34 @@ i.fvtt-hamalron {
|
||||
font-weight: bold;
|
||||
color: var(--color-dark-1);
|
||||
}
|
||||
.fvtt-hamalron-roll-dialog .difficulty-select {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0.25rem;
|
||||
.fvtt-hamalron-roll-dialog .difficulty-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
.fvtt-hamalron-roll-dialog .difficulty-row .difficulty-select-input {
|
||||
flex: 1;
|
||||
}
|
||||
.fvtt-hamalron-roll-dialog .difficulty-row .draw-difficulty-btn {
|
||||
padding: 4px 10px;
|
||||
background: #2a2a4a;
|
||||
color: #e0e0e0;
|
||||
border: 1px solid #555;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.fvtt-hamalron-roll-dialog .difficulty-row .draw-difficulty-btn:hover {
|
||||
background: #3a3a6a;
|
||||
border-color: #e94560;
|
||||
}
|
||||
.fvtt-hamalron-roll-dialog .drawn-card-info {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #e94560;
|
||||
font-style: italic;
|
||||
}
|
||||
.fvtt-hamalron-roll-dialog .drawn-card-info#drawn-card-info {
|
||||
display: none;
|
||||
}
|
||||
.dialog-modifier {
|
||||
display: flex;
|
||||
|
||||
+1
-1
@@ -854,6 +854,6 @@
|
||||
"Remove": "Guérir la blessure",
|
||||
"RemoveConfirm": "La blessure est-elle guérie ? Cela restaurera vos capacités physiques.",
|
||||
"Healed": "Blessure guérie !"
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,6 +279,7 @@ export default class HamalronTirageTarot extends Roll {
|
||||
|
||||
// Tirage d'une carte pour la difficulté (épreuve sous tension)
|
||||
$("#draw-difficulty-btn").click(async function () {
|
||||
if (!game.user.isGM) return
|
||||
const deckManager = globalThis.HamalronTarotDeckManager?._instance
|
||||
if (!deckManager || deckManager.deck.length === 0) {
|
||||
ui.notifications.warn(game.i18n.localize("HAMALRON.Notifications.deckEmpty"))
|
||||
|
||||
@@ -34,7 +34,7 @@ export default class HamalronPersonnage extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.historial = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.progression = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.rangMagie = new fields.StringField({ required: true, initial: "initie", choices: Object.fromEntries(Object.entries(SYSTEM.RANG_MAGICIEN).map(([key, val]) => [key, val.name])) })
|
||||
schema.rangMagie = new fields.StringField({ required: true, initial: "initie", choices: Object.fromEntries(Object.entries(SYSTEM.RANG_MAGICIEN).map(([key, val]) => [key, val.label])) })
|
||||
schema.resistanceRecovery = new fields.ObjectField({ required: false, initial: {} })
|
||||
schema.blessureIncapacitante = new fields.BooleanField({ required: true, initial: false })
|
||||
schema.malusBlessure = new fields.NumberField({ required: true, integer: true, initial: 0, min: -8, max: 0 })
|
||||
|
||||
+26
-4
@@ -229,10 +229,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
.difficulty-select {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0.25rem;
|
||||
.difficulty-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
|
||||
.difficulty-select-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.draw-difficulty-btn {
|
||||
padding: 4px 10px;
|
||||
background: #2a2a4a;
|
||||
color: #e0e0e0;
|
||||
border: 1px solid #555;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
&:hover { background: #3a3a6a; border-color: #e94560; }
|
||||
}
|
||||
}
|
||||
|
||||
.drawn-card-info {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #e94560;
|
||||
font-style: italic;
|
||||
&#drawn-card-info { display: none; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<fieldSet>
|
||||
<legend>{{localize "HAMALRON.Label.difficulty"}}</legend>
|
||||
<div class="difficulty-row">
|
||||
<select name="difficulty" class="difficulty-select" style="flex:1">
|
||||
<select name="difficulty" class="difficulty-select" class="difficulty-select-input">
|
||||
{{selectOptions
|
||||
difficultyChoices
|
||||
selected="soustension_oppose"
|
||||
@@ -75,7 +75,7 @@
|
||||
<i class="fas fa-cards"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div id="drawn-card-info" class="drawn-card-info" style="display:none">
|
||||
<div id="drawn-card-info" class="drawn-card-info">
|
||||
<span id="drawn-card-name"></span>
|
||||
</div>
|
||||
</fieldSet>
|
||||
|
||||
Reference in New Issue
Block a user