Ajout de génération aléatoire de description
Ajout d'un bouton pour générer aléatoirement les éléments de description: - nom (pour le MJ seul) - sexe - age - main directrice - cheveux, yeux - heure de naissance - taille et poids (selon la caractéristique Taille)
This commit is contained in:
		| @@ -205,6 +205,7 @@ | ||||
|               <label for="system.yeux">Yeux :</label> | ||||
|               <input class="flex-grow" type="text" name="system.yeux" value="{{system.yeux}}" data-dtype="String"/> | ||||
|             </li> | ||||
|             <a class="chat-card-button description-aleatoire" data-tooltip="Déterminer aléatoirement les détails de description">Description <i class="fa-solid fa-dice-d20"></i></a> | ||||
|           </ul> | ||||
|         </article> | ||||
|  | ||||
|   | ||||
							
								
								
									
										53
									
								
								templates/actor/random/app-personnage-aleatoire.hbs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								templates/actor/random/app-personnage-aleatoire.hbs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | ||||
| <form class="app-personnage-aleatoire"> | ||||
|   <h2>Génération aléatoire pour {{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" | ||||
|       label="Sexe" path="system.sexe" type="text" | ||||
|       value=current.system.sexe checked=checked.system.sexe | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Age" path="system.age" type="entier" min=10 max=100 | ||||
|       value=current.system.age checked=checked.system.age | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Taille" path="system.taille" type="text" | ||||
|       value=current.system.taille checked=checked.system.taille | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Poids" path="system.poids" type="text" | ||||
|       value=current.system.poids checked=checked.system.poids | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Main directrice" path="system.main" type="text" | ||||
|       value=current.system.main checked=checked.system.main | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Heure de naissance" path="system.heure" type="heure" | ||||
|       value=current.system.heure checked=checked.system.heure | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Cheveux" path="system.cheveux" type="text" | ||||
|       value=current.system.cheveux checked=checked.system.cheveux | ||||
|     }} | ||||
|     {{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs" | ||||
|       label="Yeux" path="system.yeux" type="text" | ||||
|       value=current.system.yeux checked=checked.system.yeux | ||||
|     }} | ||||
|   </div> | ||||
|   <hr> | ||||
|   <div style="text-align: right;"> | ||||
|     <a class="chat-card-button randomize-selected">Générer les valeurs sélectionnés</a> | ||||
|   </div> | ||||
|   <br> | ||||
|   <div class="flexrow"> | ||||
|   <button class="button-cancel">Annuler</button> | ||||
|   <button class="button-apply">Appliquer à {{actor.name}}</button> | ||||
|   </div> | ||||
|   <br> | ||||
| </form> | ||||
|  | ||||
							
								
								
									
										19
									
								
								templates/actor/random/champ-aleatoire.hbs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								templates/actor/random/champ-aleatoire.hbs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| <div class="flexrow random-field" data-path="{{path}}"> | ||||
|   <label for="{{path}}">{{label}}:</label> | ||||
|   {{#if (eq type 'entier')}} | ||||
|   <input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="number" data-dtype="Number" min="{{min}}" max="{{max}}"/> | ||||
|   {{else if (eq type 'heure')}} | ||||
|   <select class="current-value" name="current.{{path}}" value="{{value}}" type="text" data-dtype="String"> | ||||
|     {{#select value}} | ||||
|     {{> "systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}} | ||||
|     {{/select}} | ||||
|   </select> | ||||
|   {{else}} | ||||
|   <input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/> | ||||
|   {{/if}} | ||||
|   <div class="item-controls"> | ||||
|     <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> | ||||
		Reference in New Issue
	
	Block a user