feat: remplace les inputs modificateur/aspect par des selects -4 à +4
- roll.mjs : passe modifierChoices dans le contexte du dialogue - roll-dialog.hbs : <select> pour modifier et aspectModifier (-4..+4) - roll.less : select inclus dans la règle width:100% du form-two-col Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -42,6 +42,11 @@ export class CelestopolRoll extends Roll {
|
|||||||
? game.i18n.localize(SYSTEM.WOUND_LEVELS[woundLevelId]?.label ?? "")
|
? game.i18n.localize(SYSTEM.WOUND_LEVELS[woundLevelId]?.label ?? "")
|
||||||
: null
|
: null
|
||||||
|
|
||||||
|
const modifierChoices = [-4, -3, -2, -1, 0, 1, 2, 3, 4].map(v => ({
|
||||||
|
value: v,
|
||||||
|
label: v > 0 ? `+${v}` : `${v}`,
|
||||||
|
}))
|
||||||
|
|
||||||
const dialogContext = {
|
const dialogContext = {
|
||||||
actorName: options.actorName,
|
actorName: options.actorName,
|
||||||
statLabel: options.statLabel,
|
statLabel: options.statLabel,
|
||||||
@@ -53,6 +58,7 @@ export class CelestopolRoll extends Roll {
|
|||||||
defaultDifficulty: options.difficulty ?? "normal",
|
defaultDifficulty: options.difficulty ?? "normal",
|
||||||
destGaugeFull,
|
destGaugeFull,
|
||||||
defaultRollMoonDie: options.rollMoonDie ?? false,
|
defaultRollMoonDie: options.rollMoonDie ?? false,
|
||||||
|
modifierChoices,
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = await foundry.applications.handlebars.renderTemplate(
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
input { width: 100%; box-sizing: border-box; }
|
input, select { width: 100%; box-sizing: border-box; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,19 @@
|
|||||||
<div class="form-two-col">
|
<div class="form-two-col">
|
||||||
<div class="form-row-line">
|
<div class="form-row-line">
|
||||||
<label for="modifier">{{localize "CELESTOPOL.Roll.modifier"}}</label>
|
<label for="modifier">{{localize "CELESTOPOL.Roll.modifier"}}</label>
|
||||||
<input type="number" id="modifier" name="modifier" value="0" min="-10" max="10">
|
<select id="modifier" name="modifier">
|
||||||
|
{{#each modifierChoices as |choice|}}
|
||||||
|
<option value="{{choice.value}}" {{#if (eq choice.value 0)}}selected{{/if}}>{{choice.label}}</option>
|
||||||
|
{{/each}}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row-line">
|
<div class="form-row-line">
|
||||||
<label for="aspectModifier">{{localize "CELESTOPOL.Roll.aspect"}}</label>
|
<label for="aspectModifier">{{localize "CELESTOPOL.Roll.aspect"}}</label>
|
||||||
<input type="number" id="aspectModifier" name="aspectModifier" value="0" min="-4" max="4">
|
<select id="aspectModifier" name="aspectModifier">
|
||||||
|
{{#each modifierChoices as |choice|}}
|
||||||
|
<option value="{{choice.value}}" {{#if (eq choice.value 0)}}selected{{/if}}>{{choice.label}}</option>
|
||||||
|
{{/each}}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user