Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
35f226af5c |
@@ -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 {
|
||||
|
@@ -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 {
|
||||
|
@@ -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}`
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
<form class="app-personnage-aleatoire">
|
||||
<h2>Génération aléatoire pour {{actor.name}}</h2>
|
||||
<h2>{{actor.name}}</h2>
|
||||
<div class="flex-group-left">
|
||||
{{#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
|
||||
}}
|
||||
|
@@ -12,8 +12,8 @@
|
||||
<input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/>
|
||||
{{/if}}
|
||||
<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="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>
|
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