Fix roll dialog CSS + JS: template <div> wrapper, moon-section, selectors
- Remplace <form class='roll-dialog celestopol'> par <div class='roll-dialog-content'>
pour éviter les formulaires HTML imbriqués invalides (DialogV2 a son propre <form>)
- Corrige le sélecteur CSS de .roll-dialog.celestopol vers .application.roll-dialog .roll-dialog-content
- Remplace .form-group.form-moon par .moon-section (classe custom) pour éviter
les conflits avec le CSS grid de FoundryVTT standard-form (label 130px de hauteur)
- Met à jour le script JS inline pour utiliser document.querySelector('.roll-dialog-content')
- Ajoute white-space: nowrap sur le label Destin pour éviter le wrapping sur 3 lignes
- Supprime .application.roll-dialog .window-content padding override (remplacé par dialog-content)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -19,10 +19,18 @@ export default class CelestopolCharacter extends foundry.abstract.TypeDataModel
|
||||
value: new fields.NumberField({ ...reqInt, initial: 0, min: 0, max: 8 }),
|
||||
})
|
||||
|
||||
// Les 4 stats avec leurs compétences
|
||||
// Les 4 stats avec leurs domaines
|
||||
const skillField = (label) => new fields.SchemaField({
|
||||
label: new fields.StringField({ required: true, initial: label }),
|
||||
value: new fields.NumberField({ ...reqInt, initial: 0, min: 0, max: 8 }),
|
||||
level1: new fields.BooleanField({ required: true, initial: false }),
|
||||
level2: new fields.BooleanField({ required: true, initial: false }),
|
||||
level3: new fields.BooleanField({ required: true, initial: false }),
|
||||
level4: new fields.BooleanField({ required: true, initial: false }),
|
||||
level5: new fields.BooleanField({ required: true, initial: false }),
|
||||
level6: new fields.BooleanField({ required: true, initial: false }),
|
||||
level7: new fields.BooleanField({ required: true, initial: false }),
|
||||
level8: new fields.BooleanField({ required: true, initial: false }),
|
||||
})
|
||||
|
||||
const statField = (statId) => {
|
||||
@@ -85,9 +93,18 @@ export default class CelestopolCharacter extends foundry.abstract.TypeDataModel
|
||||
vision: persoAttrField(),
|
||||
})
|
||||
|
||||
// Factions
|
||||
// Factions - 9 checkboxes per faction (like wound tracks)
|
||||
const factionField = () => new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...reqInt, initial: 0 }),
|
||||
level1: new fields.BooleanField({ required: true, initial: false }),
|
||||
level2: new fields.BooleanField({ required: true, initial: false }),
|
||||
level3: new fields.BooleanField({ required: true, initial: false }),
|
||||
level4: new fields.BooleanField({ required: true, initial: false }),
|
||||
level5: new fields.BooleanField({ required: true, initial: false }),
|
||||
level6: new fields.BooleanField({ required: true, initial: false }),
|
||||
level7: new fields.BooleanField({ required: true, initial: false }),
|
||||
level8: new fields.BooleanField({ required: true, initial: false }),
|
||||
level9: new fields.BooleanField({ required: true, initial: false }),
|
||||
})
|
||||
schema.factions = new fields.SchemaField({
|
||||
pinkerton: factionField(),
|
||||
@@ -150,9 +167,9 @@ export default class CelestopolCharacter extends foundry.abstract.TypeDataModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Lance les dés pour une compétence donnée.
|
||||
* Lance les dés pour un domaine donné.
|
||||
* @param {string} statId - Id de la stat (ame, corps, coeur, esprit)
|
||||
* @param {string} skillId - Id de la compétence
|
||||
* @param {string} skillId - Id du domaine
|
||||
*/
|
||||
async roll(statId, skillId) {
|
||||
const { CelestopolRoll } = await import("../documents/roll.mjs")
|
||||
@@ -169,6 +186,7 @@ export default class CelestopolCharacter extends foundry.abstract.TypeDataModel
|
||||
skillLabel: skill.label,
|
||||
skillValue: skill.value,
|
||||
woundMalus: this.getWoundMalus(),
|
||||
woundLevel: this.blessures.lvl,
|
||||
moonPhase: this.prefs.moonPhase,
|
||||
difficulty: this.prefs.difficulty,
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SYSTEM } from "../config/system.mjs"
|
||||
|
||||
/** Schéma partagé pour les bonus/malus par compétence (utilisé dans anomaly/aspect/attribute). */
|
||||
/** Schéma partagé pour les bonus/malus par domaine (utilisé dans anomaly/aspect/attribute). */
|
||||
function skillScoresSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const reqInt = { required: true, nullable: false, integer: true }
|
||||
|
||||
Reference in New Issue
Block a user