diff --git a/css/foundryvtt-reve-de-dragon.css b/css/foundryvtt-reve-de-dragon.css index f2231fad..52b95706 100644 --- a/css/foundryvtt-reve-de-dragon.css +++ b/css/foundryvtt-reve-de-dragon.css @@ -924,6 +924,12 @@ select, .system-foundryvtt-reve-de-dragon a:hover { text-shadow: 1px 0px 0px #ff6600; } +.system-foundryvtt-reve-de-dragon .tabs .item.active img, +.system-foundryvtt-reve-de-dragon .blessures-list li ul li:first-child:hover img, +.system-foundryvtt-reve-de-dragon i.moral-radio-checkmark-off:hover img, +.system-foundryvtt-reve-de-dragon a:hover img { + filter: drop-shadow(1px 0px 0px #ff6600); +} .system-foundryvtt-reve-de-dragon .rollable:hover, .system-foundryvtt-reve-de-dragon .rollable:focus { color: #000; @@ -1448,12 +1454,27 @@ select, .system-foundryvtt-reve-de-dragon .competence-list .item-controls.hidden-controls { display: none !important; } -.system-foundryvtt-reve-de-dragon .item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular), +.system-foundryvtt-reve-de-dragon .item-actions-controls, +.system-foundryvtt-reve-de-dragon .item-controls { + vertical-align: super; +} +.system-foundryvtt-reve-de-dragon .item-actions-controls img, +.system-foundryvtt-reve-de-dragon .item-controls img { + display: inline; + max-width: 1rem; + max-height: 1rem; + margin: 0 0.1rem; + border: none; + filter: invert(0.8); +} +.system-foundryvtt-reve-de-dragon .item-actions-controls i:is(.fas, .fa, .fa-solid, .fa-regular), .system-foundryvtt-reve-de-dragon .item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) { font-size: 0.8em; color: var(--color-controls-light); } -.system-foundryvtt-reve-de-dragon .item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular):hover, +.system-foundryvtt-reve-de-dragon .item-actions-controls img:hover, +.system-foundryvtt-reve-de-dragon .item-controls img:hover, +.system-foundryvtt-reve-de-dragon .item-actions-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover, .system-foundryvtt-reve-de-dragon .item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover { opacity: 0.6; } @@ -1596,6 +1617,9 @@ select, color: var(--color-text-dark-primary); border-radius: 0.2rem; } +.system-foundryvtt-reve-de-dragon form.app-personnage-aleatoire h2 { + min-width: 30rem; +} .system-foundryvtt-reve-de-dragon .app-calendar-astrologie div.theme-astral { width: 14rem; margin: 0.4rem; @@ -2737,11 +2761,9 @@ select, } .system-foundryvtt-reve-de-dragon .chat-card-button:hover { background: var(--background-custom-button-hover); - background-color: red; } .system-foundryvtt-reve-de-dragon .chat-card-button-pushed:hover { background: var(--background-custom-button-hover); - background-color: red; } .system-foundryvtt-reve-de-dragon .chat-card-button:active, .system-foundryvtt-reve-de-dragon .chat-card-button-pushed:active { diff --git a/less/foundryvtt-reve-de-dragon.less b/less/foundryvtt-reve-de-dragon.less index fd300b3e..125de5ec 100644 --- a/less/foundryvtt-reve-de-dragon.less +++ b/less/foundryvtt-reve-de-dragon.less @@ -200,6 +200,9 @@ i.moral-radio-checkmark-off:hover, a:hover { text-shadow: 1px 0px 0px #ff6600; + img { + filter: drop-shadow(1px 0px 0px #ff6600); + } } .rollable:hover, .rollable:focus { @@ -741,11 +744,11 @@ .foundryvtt-reve-de-dragon .item-list .item img { display: inline; } - + .foundryvtt-reve-de-dragon .item-list .item-name { margin: 0; } - + .competence-list .item-controls, .competence-list .item-actions-controls { display: contents !important; @@ -754,15 +757,30 @@ .competence-list .item-controls.hidden-controls { display: none !important; } + .item-actions-controls, + .item-controls { + vertical-align: super; + // a { + // } - .item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular), - .item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) { - font-size: 0.8em; - color: var(--color-controls-light); - } - .item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular):hover, - .item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover { - opacity: 0.6; + img { + display: inline; + max-width: 1rem; + max-height: 1rem; + margin: 0 0.1rem; + border: none; + filter: invert(0.8); + } + + i:is(.fas, .fa, .fa-solid, .fa-regular) { + font-size: 0.8em; + color: var(--color-controls-light); + } + + img:hover, + i:is(.fas, .far, .fa-solid, .fa-regular):hover { + opacity: 0.6; + } } .rdd-roll-dialog .description-sort { @@ -910,6 +928,11 @@ color: var(--color-text-dark-primary); border-radius: 0.2rem; } + form.app-personnage-aleatoire { + h2 { + min-width: 30rem, + } + } .app-calendar-astrologie{ div.theme-astral{ width: 14rem; @@ -1998,12 +2021,10 @@ .chat-card-button:hover { background: var(--background-custom-button-hover); - background-color: red; } .chat-card-button-pushed:hover { background: var(--background-custom-button-hover); - background-color: red; } .chat-card-button:active, .chat-card-button-pushed:active { diff --git a/module/actor/random/app-personnage-aleatoire.js b/module/actor/random/app-personnage-aleatoire.js index 8a988d5a..fabd2219 100644 --- a/module/actor/random/app-personnage-aleatoire.js +++ b/module/actor/random/app-personnage-aleatoire.js @@ -20,14 +20,15 @@ const PATHS = [ const RANDOM_VALUES = { 'system.sexe': { 'masculin': 1, 'féminin': 1 }, 'system.main': { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 }, - 'system.cheveux': { 'noirs': 2, 'bruns': 5, 'châtains clair': 5, 'blonds': 4, 'blonds très clair': 1, 'roux carotte': 1, 'roux cuivré': 3 }, - 'system.yeux': { 'noirs': 2, 'noisettes': 3, 'bruns vert': 4, 'verts': 3, 'bleus clair': 3, 'bleus gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 1 }, + 'system.cheveux': { 'noirs': 2, 'bruns': 5, 'châtains': 3, 'châtain clair': 5, 'blonds': 4, 'blond platine': 1, 'roux carotte': 1, 'roux cuivré': 3, 'chauve': 1 }, + 'system.yeux': { 'noirs': 2, 'noisette': 3, 'brun vert': 4, 'verts': 3, 'bleu clair': 3, 'bleu gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 1 }, } export class AppPersonnageAleatoire extends FormApplication { static preloadHandlebars() { foundry.applications.handlebars.loadTemplates([ 'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs', + 'systems/foundryvtt-reve-de-dragon/templates/actor/random/sexe-aleatoire.hbs', ]) } @@ -49,14 +50,14 @@ export class AppPersonnageAleatoire extends FormApplication { this.current = foundry.utils.duplicate(actor) this.checked = { 'name': false, - 'system.sexe': true, - 'system.age': true, - 'system.taille': true, - 'system.poids': true, - 'system.main': true, - 'system.heure': true, - 'system.cheveux': true, - 'system.yeux': true + 'system.sexe': (this.actor.system.sexe ?? '') == '', + 'system.age': this.actor.system.age == 0, + 'system.taille': (this.actor.system.taille ?? '') == '', + 'system.poids': (this.actor.system.poids ?? '') == '', + 'system.main': (this.actor.system.main ?? '') == '', + 'system.heure': (this.actor.system.heure ?? '') == '', + 'system.cheveux': (this.actor.system.cheveux ?? '') == '', + 'system.yeux': (this.actor.system.yeux ?? '') == '', } } @@ -76,6 +77,8 @@ export class AppPersonnageAleatoire extends FormApplication { this.html.find("button.button-apply").click(async event => await this.onApply()) this.html.find("input.current-value").change(async event => await this.onChange(event)) this.html.find("div.random-field[data-path='system.heure'] select.current-value").change(async event => await this.onChange(event)) + this.html.find('a[data-action="sexe-masculin"]').click(async event => await this.onSexe('masculin')) + this.html.find('a[data-action="sexe-feminin"]').click(async event => await this.onSexe('féminin')) this.html.find("a.random").click(async event => await this.onRandom(event)) this.html.find("a.reset").click(async event => await this.onReset(event)) this.html.find("a.randomize-selected").click(async event => await this.onRandomizeSelected()) @@ -96,6 +99,10 @@ export class AppPersonnageAleatoire extends FormApplication { const fields = this.html.find(selector).parents("div.random-field:first") return fields[0].attributes['data-path'].value } + async onSexe(sexe) { + this.current['system.sexe'] = sexe + this.render() + } async onChange(event) { const path = this.getPath(event.currentTarget) @@ -180,8 +187,9 @@ export class AppPersonnageAleatoire extends FormApplication { const variation = Math.floor((caracTaille.poidsMax - caracTaille.poidsMin + base / 5) / 2) const total = await RdDDice.rollTotal(`2d${variation} + ${base}`) const cm = total % 100 + const dm = cm < 10 ? '0' : '' const m = (total - cm) / 100 - return `${m}m${cm}` + return `${m}m${dm}${cm}` } diff --git a/templates/actor/random/app-personnage-aleatoire.hbs b/templates/actor/random/app-personnage-aleatoire.hbs index 4aa71b0b..5eb6655b 100644 --- a/templates/actor/random/app-personnage-aleatoire.hbs +++ b/templates/actor/random/app-personnage-aleatoire.hbs @@ -1,12 +1,12 @@
-

Génération aléatoire pour {{actor.name}}

+

{{actor.name}}

{{#if options.isGM}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" label="Nom" path="name" type="text" value=current.name checked=checked.name }} {{/if}} - {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/sexe-aleatoire.hbs" label="Sexe" path="system.sexe" type="text" value=current.system.sexe checked=checked.system.sexe }} diff --git a/templates/actor/random/champ-aleatoire.hbs b/templates/actor/random/champ-aleatoire.hbs index 30d1b1c8..8523e73a 100644 --- a/templates/actor/random/champ-aleatoire.hbs +++ b/templates/actor/random/champ-aleatoire.hbs @@ -12,8 +12,8 @@ {{/if}}
+ -
\ No newline at end of file diff --git a/templates/actor/random/sexe-aleatoire.hbs b/templates/actor/random/sexe-aleatoire.hbs new file mode 100644 index 00000000..da5bd6ef --- /dev/null +++ b/templates/actor/random/sexe-aleatoire.hbs @@ -0,0 +1,11 @@ +
+ + +
+ + + + + +
+
\ No newline at end of file