forked from public/foundryvtt-reve-de-dragon
Correction du générateur aléatoire
- couleurs de cheveux/yeux - les tailles entre 1m00 et 1m09 sont correctement affichées - possibilité de positionner le sexe masculin/féminin en un clic
This commit is contained in:
@@ -924,6 +924,12 @@ select,
|
|||||||
.system-foundryvtt-reve-de-dragon a:hover {
|
.system-foundryvtt-reve-de-dragon a:hover {
|
||||||
text-shadow: 1px 0px 0px #ff6600;
|
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:hover,
|
||||||
.system-foundryvtt-reve-de-dragon .rollable:focus {
|
.system-foundryvtt-reve-de-dragon .rollable:focus {
|
||||||
color: #000;
|
color: #000;
|
||||||
@@ -1448,12 +1454,27 @@ select,
|
|||||||
.system-foundryvtt-reve-de-dragon .competence-list .item-controls.hidden-controls {
|
.system-foundryvtt-reve-de-dragon .competence-list .item-controls.hidden-controls {
|
||||||
display: none !important;
|
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) {
|
.system-foundryvtt-reve-de-dragon .item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
color: var(--color-controls-light);
|
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 {
|
.system-foundryvtt-reve-de-dragon .item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
@@ -1596,6 +1617,9 @@ select,
|
|||||||
color: var(--color-text-dark-primary);
|
color: var(--color-text-dark-primary);
|
||||||
border-radius: 0.2rem;
|
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 {
|
.system-foundryvtt-reve-de-dragon .app-calendar-astrologie div.theme-astral {
|
||||||
width: 14rem;
|
width: 14rem;
|
||||||
margin: 0.4rem;
|
margin: 0.4rem;
|
||||||
@@ -2737,11 +2761,9 @@ select,
|
|||||||
}
|
}
|
||||||
.system-foundryvtt-reve-de-dragon .chat-card-button:hover {
|
.system-foundryvtt-reve-de-dragon .chat-card-button:hover {
|
||||||
background: var(--background-custom-button-hover);
|
background: var(--background-custom-button-hover);
|
||||||
background-color: red;
|
|
||||||
}
|
}
|
||||||
.system-foundryvtt-reve-de-dragon .chat-card-button-pushed:hover {
|
.system-foundryvtt-reve-de-dragon .chat-card-button-pushed:hover {
|
||||||
background: var(--background-custom-button-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:active,
|
||||||
.system-foundryvtt-reve-de-dragon .chat-card-button-pushed:active {
|
.system-foundryvtt-reve-de-dragon .chat-card-button-pushed:active {
|
||||||
|
|||||||
@@ -200,6 +200,9 @@
|
|||||||
i.moral-radio-checkmark-off:hover,
|
i.moral-radio-checkmark-off:hover,
|
||||||
a:hover {
|
a:hover {
|
||||||
text-shadow: 1px 0px 0px #ff6600;
|
text-shadow: 1px 0px 0px #ff6600;
|
||||||
|
img {
|
||||||
|
filter: drop-shadow(1px 0px 0px #ff6600);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rollable:hover, .rollable:focus {
|
.rollable:hover, .rollable:focus {
|
||||||
@@ -754,15 +757,30 @@
|
|||||||
.competence-list .item-controls.hidden-controls {
|
.competence-list .item-controls.hidden-controls {
|
||||||
display: none !important;
|
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),
|
img {
|
||||||
.item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
|
display: inline;
|
||||||
font-size: 0.8em;
|
max-width: 1rem;
|
||||||
color: var(--color-controls-light);
|
max-height: 1rem;
|
||||||
}
|
margin: 0 0.1rem;
|
||||||
.item-actions-controls a.actionItem i:is(.fas, .fa, .fa-solid, .fa-regular):hover,
|
border: none;
|
||||||
.item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover {
|
filter: invert(0.8);
|
||||||
opacity: 0.6;
|
}
|
||||||
|
|
||||||
|
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 {
|
.rdd-roll-dialog .description-sort {
|
||||||
@@ -910,6 +928,11 @@
|
|||||||
color: var(--color-text-dark-primary);
|
color: var(--color-text-dark-primary);
|
||||||
border-radius: 0.2rem;
|
border-radius: 0.2rem;
|
||||||
}
|
}
|
||||||
|
form.app-personnage-aleatoire {
|
||||||
|
h2 {
|
||||||
|
min-width: 30rem,
|
||||||
|
}
|
||||||
|
}
|
||||||
.app-calendar-astrologie{
|
.app-calendar-astrologie{
|
||||||
div.theme-astral{
|
div.theme-astral{
|
||||||
width: 14rem;
|
width: 14rem;
|
||||||
@@ -1998,12 +2021,10 @@
|
|||||||
|
|
||||||
.chat-card-button:hover {
|
.chat-card-button:hover {
|
||||||
background: var(--background-custom-button-hover);
|
background: var(--background-custom-button-hover);
|
||||||
background-color: red;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-card-button-pushed:hover {
|
.chat-card-button-pushed:hover {
|
||||||
background: var(--background-custom-button-hover);
|
background: var(--background-custom-button-hover);
|
||||||
background-color: red;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-card-button:active, .chat-card-button-pushed:active {
|
.chat-card-button:active, .chat-card-button-pushed:active {
|
||||||
|
|||||||
@@ -20,14 +20,15 @@ const PATHS = [
|
|||||||
const RANDOM_VALUES = {
|
const RANDOM_VALUES = {
|
||||||
'system.sexe': { 'masculin': 1, 'féminin': 1 },
|
'system.sexe': { 'masculin': 1, 'féminin': 1 },
|
||||||
'system.main': { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 },
|
'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.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, 'noisettes': 3, 'bruns vert': 4, 'verts': 3, 'bleus clair': 3, 'bleus gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 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 {
|
export class AppPersonnageAleatoire extends FormApplication {
|
||||||
static preloadHandlebars() {
|
static preloadHandlebars() {
|
||||||
foundry.applications.handlebars.loadTemplates([
|
foundry.applications.handlebars.loadTemplates([
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs',
|
'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.current = foundry.utils.duplicate(actor)
|
||||||
this.checked = {
|
this.checked = {
|
||||||
'name': false,
|
'name': false,
|
||||||
'system.sexe': true,
|
'system.sexe': (this.actor.system.sexe ?? '') == '',
|
||||||
'system.age': true,
|
'system.age': this.actor.system.age == 0,
|
||||||
'system.taille': true,
|
'system.taille': (this.actor.system.taille ?? '') == '',
|
||||||
'system.poids': true,
|
'system.poids': (this.actor.system.poids ?? '') == '',
|
||||||
'system.main': true,
|
'system.main': (this.actor.system.main ?? '') == '',
|
||||||
'system.heure': true,
|
'system.heure': (this.actor.system.heure ?? '') == '',
|
||||||
'system.cheveux': true,
|
'system.cheveux': (this.actor.system.cheveux ?? '') == '',
|
||||||
'system.yeux': true
|
'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("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("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("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.random").click(async event => await this.onRandom(event))
|
||||||
this.html.find("a.reset").click(async event => await this.onReset(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())
|
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")
|
const fields = this.html.find(selector).parents("div.random-field:first")
|
||||||
return fields[0].attributes['data-path'].value
|
return fields[0].attributes['data-path'].value
|
||||||
}
|
}
|
||||||
|
async onSexe(sexe) {
|
||||||
|
this.current['system.sexe'] = sexe
|
||||||
|
this.render()
|
||||||
|
}
|
||||||
|
|
||||||
async onChange(event) {
|
async onChange(event) {
|
||||||
const path = this.getPath(event.currentTarget)
|
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 variation = Math.floor((caracTaille.poidsMax - caracTaille.poidsMin + base / 5) / 2)
|
||||||
const total = await RdDDice.rollTotal(`2d${variation} + ${base}`)
|
const total = await RdDDice.rollTotal(`2d${variation} + ${base}`)
|
||||||
const cm = total % 100
|
const cm = total % 100
|
||||||
|
const dm = cm < 10 ? '0' : ''
|
||||||
const m = (total - cm) / 100
|
const m = (total - cm) / 100
|
||||||
return `${m}m${cm}`
|
return `${m}m${dm}${cm}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<form class="app-personnage-aleatoire">
|
<form class="app-personnage-aleatoire">
|
||||||
<h2>Génération aléatoire pour {{actor.name}}</h2>
|
<h2>{{actor.name}}</h2>
|
||||||
<div class="flex-group-left">
|
<div class="flex-group-left">
|
||||||
{{#if options.isGM}}
|
{{#if options.isGM}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||||
label="Nom" path="name" type="text" value=current.name checked=checked.name
|
label="Nom" path="name" type="text" value=current.name checked=checked.name
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/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"
|
label="Sexe" path="system.sexe" type="text"
|
||||||
value=current.system.sexe checked=checked.system.sexe
|
value=current.system.sexe checked=checked.system.sexe
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
<input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/>
|
<input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="item-controls">
|
<div class="item-controls">
|
||||||
|
<input class="check-for-random" type="checkbox" data-tooltip="Sélectionné pour génération automatique" {{#if checked}}checked{{/if}}/>
|
||||||
<a class="random" data-action="random" data-tooltip="Aléatoire"><i class="fa-solid fa-dice-d20"></i></a>
|
<a class="random" data-action="random" data-tooltip="Aléatoire"><i class="fa-solid fa-dice-d20"></i></a>
|
||||||
<a class="reset" data-action="reset" data-tooltip="Reset"><i class="fa-solid fa-eraser"></i></a>
|
<a class="reset" data-action="reset" data-tooltip="Reset"><i class="fa-solid fa-eraser"></i></a>
|
||||||
<input class="check-for-random" type="checkbox" data-tooltip="Sélectionné pour génération automatique" {{#if checked}}checked{{/if}}/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
11
templates/actor/random/sexe-aleatoire.hbs
Normal file
11
templates/actor/random/sexe-aleatoire.hbs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<div class="flexrow random-field" data-path="{{path}}">
|
||||||
|
<label for="{{path}}">{{label}}:</label>
|
||||||
|
<input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/>
|
||||||
|
<div class="item-controls">
|
||||||
|
<input class="check-for-random" type="checkbox" data-tooltip="Sélectionné pour génération automatique" {{#if checked}}checked{{/if}}/>
|
||||||
|
<a data-action="sexe-feminin" data-tooltip="sexe féminin"><i class="fa-solid fa-venus"></i></a>
|
||||||
|
<a data-action="sexe-masculin" data-tooltip="sexe masculin"><i class="fa-solid fa-mars"></i></a>
|
||||||
|
<a class="random" data-action="random" data-tooltip="Aléatoire"><i class="fa-solid fa-dice-d20"></i></a>
|
||||||
|
<a class="reset" data-action="reset" data-tooltip="Reset"><i class="fa-solid fa-eraser"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user