Compare commits
	
		
			41 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d1adf3f6c4 | |||
| 8eb1387be4 | |||
| 85378d74e3 | |||
| 9471420d38 | |||
| 6e456ca92c | |||
| 482256c218 | |||
| fa1c4ff221 | |||
| b777271657 | |||
| d06a55b615 | |||
| adfbc11eb8 | |||
| 9dd905134b | |||
| f32b6af7b6 | |||
| 9b8a600e22 | |||
| 25db7e0712 | |||
| 776d4ce9ec | |||
| 1de0806e37 | |||
| 03366fdf26 | |||
| 14f324360d | |||
| d60c9f1b28 | |||
| cf514470fd | |||
| b09b095897 | |||
| d81965155c | |||
| 9fa8a2e6f3 | |||
| da7f87fd45 | |||
| 6aba92900c | |||
| 4939e5564e | |||
| 40be65a94e | |||
| 633638a9ab | |||
| 88a3464eed | |||
| 921e470498 | |||
| 0009876a6d | |||
| 54785f0c3a | |||
| df76c4bd78 | |||
| 5f3c678195 | |||
| 89bbe63340 | |||
| 149990e352 | |||
| 3e355784c7 | |||
| b92055d5dd | |||
| 220f8142f5 | |||
| a8bb00ad0b | |||
| 78e30b5503 | 
| @@ -1,6 +1,6 @@ | ||||
| name: Release Creation | ||||
|  | ||||
| on: | ||||
| on:  | ||||
|   release: | ||||
|     types: [published] | ||||
|  | ||||
| @@ -9,11 +9,9 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|     - run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner." | ||||
|  | ||||
|      | ||||
|     #- uses: actions/checkout@v3 | ||||
|     - uses: RouxAntoine/checkout@v3.5.4 | ||||
|       with: | ||||
|         ref: 'v13' | ||||
|  | ||||
|     # get part of the tag after the `v` | ||||
|     - name: Extract tag version number | ||||
| @@ -31,7 +29,7 @@ jobs: | ||||
|         url: https://www.uberwald.me/gitea/${{gitea.repository}} | ||||
|         manifest: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json | ||||
|         download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/rddsystem.zip | ||||
|  | ||||
|      | ||||
|     - name: Set up Node.js | ||||
|       uses: actions/setup-node@v2 | ||||
|       with: | ||||
| @@ -39,7 +37,7 @@ jobs: | ||||
|  | ||||
|     - name: Install dependencies | ||||
|       run: npm install | ||||
|  | ||||
|        | ||||
|     - name: Build the compendiums | ||||
|       run: node ./tools/packCompendiumsToDist.mjs | ||||
|  | ||||
| @@ -48,29 +46,29 @@ jobs: | ||||
|          apt update -y | ||||
|          apt install -y zip | ||||
|  | ||||
|     - run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ css/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/ | ||||
|  | ||||
|     - run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/  | ||||
|      | ||||
|     - name: setup go | ||||
|       uses: actions/setup-go@v3 | ||||
|       with: | ||||
|         go-version: '>=1.20.1' | ||||
|  | ||||
|     - name: Use Go Action | ||||
|      | ||||
|     - name: Use Go Action   | ||||
|       id: use-go-action | ||||
|       uses: https://gitea.com/actions/release-action@main | ||||
|       with: | ||||
|         files: |- | ||||
|           ./rddsystem.zip | ||||
|           ./rddsystem.zip   | ||||
|           system.json | ||||
|         api_key: '${{secrets.ALLOW_PUSH_RELEASE}}' | ||||
|  | ||||
|     - name: Publish to Foundry server | ||||
|     - name: Publish to Foundry server   | ||||
|       uses: djlechuck/foundryvtt-publish-package-action@v1 | ||||
|       with: | ||||
|         token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }} | ||||
|         id: 'foundryvtt-reve-de-dragon' | ||||
|         version: ${{github.event.release.tag_name}} | ||||
|         manifest: 'https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json' | ||||
|         notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md' | ||||
|         compatibility-minimum: '13' | ||||
|         compatibility-verified: '13' | ||||
|         notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md' | ||||
|         compatibility-minimum: '12' | ||||
|         compatibility-verified: '12' | ||||
							
								
								
									
										0
									
								
								.gitlab/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										0
									
								
								.gitlab/issue_templates/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										14
									
								
								.gitlab/issue_templates/Bug.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,14 @@ | ||||
| Pour que le bug soit traité, merci de préciser quelques détails. | ||||
|  | ||||
| ### Environment | ||||
|  | ||||
| > Indiquez quelques éléments de votre installation | ||||
|  | ||||
| * Foundry VTT Version: (Example 0.5.4) | ||||
| * OS: [Windows, MacOS, Linux (which distro)] | ||||
| * Modules ?: Liste des modules utilisés | ||||
|  | ||||
| ### Description du problème | ||||
|  | ||||
|  | ||||
| /label ~Bug ~Nonrepro | ||||
							
								
								
									
										14
									
								
								.gitlab/issue_templates/Feature.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,14 @@ | ||||
|  | ||||
| ### Résumé de la fonctionnalité | ||||
|  | ||||
| > Décrivez de manière simple et concise la fonction que vous voulez voir ajoutée. | ||||
|  | ||||
| ### Expérience Utilisateur | ||||
|  | ||||
| > Indiquez ce que l'utilisateur aura comme bénéfice avec cette fonction. | ||||
|  | ||||
| ### Priority/Importance | ||||
|  | ||||
| > Selon vous, quelle est l'importance de cette fonctionnalité. | ||||
|  | ||||
| /label ~Feature | ||||
							
								
								
									
										61
									
								
								changelog.md
									
									
									
									
									
								
							
							
						
						| @@ -1,35 +1,4 @@ | ||||
| # 13.0 | ||||
|  | ||||
| ## 13.0.4 - Le long discours d'Illysis | ||||
|  | ||||
| - On peut de nouveau modifier les descriptions | ||||
| - ne pas proposer l'export csv par défaut | ||||
| - Correction de la macro "Jet quelconque" | ||||
| - Correction de la ligne 'rêve actuel' ajoutée dans les caracs | ||||
| - Corrections d'affichage | ||||
|   - boutons de l'horloge | ||||
|   - boutons de déplacement des TMR | ||||
|   - modification des messages de tchat | ||||
|  | ||||
| ## 13.0.3 - La dernière auberge d'Illysis | ||||
|  | ||||
| - On peut de nouveau acheter aux commerces | ||||
| - La description des Grizzal a des espaces | ||||
| - Corrections v13 | ||||
|   - Affichage des images et noms d'objets en ligne | ||||
|   - affichage des compétences de créature sur une ligne | ||||
|   - Affichage des informations d'acteur sur une ligne dans l'astrologie | ||||
|   - Affichage des résultat de recherche | ||||
|  | ||||
| ## 13.0.0 - Le début de l'errance d'Illysis | ||||
|  | ||||
| - Migration vers la version 13 de Foundry | ||||
|  | ||||
| # 12.0 | ||||
| ## 12.0.50 - Le sommeil d'Astrobazzarh | ||||
| - Le don de double rêve n'interrompt plus le sommeil toutes les heures | ||||
| - la perte de fatigue à la descente des TMR est visible immédiatement | ||||
|  | ||||
| ## 12.0.49 - La deuxième lame d'Astrobazzarh | ||||
| - Corrections | ||||
|   - les défenses particulières sont correctement affichées | ||||
| @@ -47,7 +16,7 @@ | ||||
| ## 12.0.47 | ||||
| - Correction sur les mise à jour en cascade - | ||||
| - Correction sur le force rendering après un changement de competence | ||||
|  | ||||
|    | ||||
| ## 12.0.46 - Le double demi d'Astrobazzarh | ||||
| - correction des raffraîchissement lors du sommeil qui empêchait de dormir | ||||
|   plusieurs heures | ||||
| @@ -75,18 +44,22 @@ | ||||
| - Correction des jets `@roll[vue/-2]` qui tentaient de chercher une compétence -2 (à cause des armes à 1/2 mains) | ||||
|  | ||||
| ## 12.0.41 - La loupe d'Astrobazzarh | ||||
|  | ||||
| - On peut de nouveau effectuer des tirages cachés | ||||
| - Le stress transformé est bien diminué lorsqu'on met le stress dans une compétence | ||||
|  | ||||
| ## 12.0.40 - Les mains d'Astrobazzarh | ||||
|  | ||||
| - correction des attaques particulières en combat | ||||
| - correction de message sur les min/max liés aux modificateurs de races (s'applique uniquement sur la taille) | ||||
|  | ||||
| ## 12.0.39 - Les mains d'Astrobazzarh | ||||
|  | ||||
| - les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés | ||||
| - commande `/jet` pour poster une demande de jet de dés | ||||
|  | ||||
| ## 12.0.38 - Les prévisions d'Astrobazzarh | ||||
|  | ||||
| - Correction de modifications de personnages qui ne s'affichaient pas: | ||||
|   - changements d'endurance/vie/fatigue, transformé, ... | ||||
| - Migration des compétences "Ecriture" en "Écriture" dans les tâches, livres, oeuvres et méditations | ||||
| @@ -96,12 +69,14 @@ | ||||
|   - utilisation de l'extension hbs pour tous les fichiers handlebars | ||||
|  | ||||
| ## 12.0.37 - Les enchantements d'Astrobazzarh | ||||
|  | ||||
| - les potions ont un état, seules les potions liquides sont enchantables | ||||
| - les lancements de sorts du jour sont conservés jusqu'à chateau dormant | ||||
| - lorsqu'un joueur souhaite enchanter une potion, les sorts d'enchantements/purification/permanence doivent avoir été lancés auparavant | ||||
| - on peut enchanter des gemmes exactement comme des potions | ||||
|  | ||||
| ## 12.0.36 - L'alchimie d'Astrobazzarh | ||||
|  | ||||
| - Nouveautés | ||||
|   - ajout d'un bouton pour enchanter les potions | ||||
|   - standardisation des boutons d'actions sur les items | ||||
| @@ -116,14 +91,16 @@ | ||||
|   - Corrections de descriptions pour proposer les jet de dés | ||||
|  | ||||
| ## 12.0.35 - La Solution d'Astrobazzarh | ||||
|  | ||||
| - Fix problème d'initialisation des feuilles d'items | ||||
|  | ||||
| ## 12.0.34 - la tête d'Astrobazzarh | ||||
|  | ||||
| - support de liens "jets de dés" | ||||
|   - on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ... | ||||
|   - avec la syntaxe `@roll[...]` on peut ajouter le lien vers: | ||||
|     - un jet de caractéristique/compétence `@roll[carac/competence/difficulte]` / `@roll[carac/difficulte]` / `@roll[carac/competence]` | ||||
|     - une formule foundry `@roll[2d6]` pour lancer 2d6 | ||||
|     - un jet de caractéristique/compétence `@roll[carac/competence/difficulte]` / `@roll[carac/difficulte]` / `@roll[carac/competence]`  | ||||
|     - une formule foundry `@roll[2d6]` pour lancer 2d6  | ||||
|     - une manipulation alchimique `@roll[couleur vert-bleu]` | ||||
|   - les liens "jet avec caractéristiques" s'appliquent: | ||||
|     - à tous les tokens sélectionnés | ||||
| @@ -133,21 +110,26 @@ | ||||
| - gestion des blocs secrets dans les descriptions | ||||
|  | ||||
| ## 12.0.33 - la vieillesse d'Astrobazzarh | ||||
|  | ||||
| - retour de l'expérience pour les joueurs | ||||
| - suppression du message "Pas de caractéristique" sur les jets d'odorat-goût | ||||
|  | ||||
| ## 12.0.32 - les rêveries d'Astrobazzarh | ||||
|  | ||||
| - Ajout des Items Race pour gérer les ajustements liés aux races | ||||
|  | ||||
| ## 12.0.31 - le mausolée d'Astrobazzarh | ||||
|  | ||||
| - Correction: les automatisation de combat jouer-MJ fonctionnentde nouveau | ||||
|  | ||||
| ## 12.0.30 - le cauchemar d'Astrobazzarh | ||||
|  | ||||
| - calcul automatique du niveau des entités selon leur rêve | ||||
| - la description des créatures venimeuses contient un lien vers leur venin | ||||
| - Correction: les messages de combats ne marchaient plus (Changement combiné Foundry + rêve de Dragon) | ||||
|  | ||||
| ## 12.0.29 - L'indexation d'Astrobazzarh | ||||
|  | ||||
| - les liens dans la descriptions des sorts pointent vers les sorts du compendium | ||||
| - la description du chrasme contient le lien vers son venin plutôt qu'un tableau | ||||
|  | ||||
| @@ -188,7 +170,7 @@ | ||||
|   - les tas dans les conteneurs peuvent être désempilés sans rendre le conteneur inutilisable | ||||
|   - les conteneurs ne peuvent plus être empilés (pour éviter que le contenu de Schroedinger quand on les sépare) | ||||
|   - on peut maintenant saisir et supprimer les bonus de cases de manière intuitive | ||||
|  | ||||
|    | ||||
| ## 12.0.23 - La bibliothèque d'Astrobazzarh | ||||
| - corrections mineures | ||||
|   - meilleure gestion de la parade des armes naturelles | ||||
| @@ -299,7 +281,7 @@ | ||||
|  | ||||
| ## 12.0.6 - Le bazar d'Astrobazzarh | ||||
| - Corrections de l'inventaire en bazar: | ||||
|   - un problème pouvait survenir en déplaçant les objets | ||||
|   - un problème pouvait survenir en déplaçant les objets  | ||||
|     l'inventaire, qui fait qu'un conteneur se retrouve récursivement dans son | ||||
|     propre contenu, ce qui empêche d'ouvrir la feuille d'acteur. | ||||
|   - un objet non-conteneur pouvait dans certains cas avoir un pseudo contenu | ||||
| @@ -307,7 +289,7 @@ | ||||
|     conteneur (et donc non affiché) | ||||
|   - vider les conteneurs supprime correctement toutes les informations liées | ||||
|     aux conteneurs/contenus | ||||
| - Les messages pour les tirages dans le compendium utilisent le "roll mode" | ||||
| - Les messages pour les tirages dans le compendium utilisent le "roll mode"  | ||||
|   courant pour leur visibilité | ||||
| - Fix: restaurer la compatibilité Foundry 11 | ||||
|  | ||||
| @@ -402,7 +384,7 @@ | ||||
|  | ||||
| ## 11.2.9 - La barbe d'Akarlikarlikar | ||||
| - Amélioration des textes de tooltips | ||||
| - Les tooltips sont plus dans le thème de couleur du système Rêve de Dragon | ||||
| - Les tooltips sont plus dans le thème de couleur du système Rêve de Dragon  | ||||
| - Ajouts d'icones pour les attaque/initiative/soins dans les raccourcis sur les tokens (HUD) | ||||
| - Ajout d'une icône et transformation en bouton du lien pour accéder à l'astrologie et aux chiffres astraux | ||||
| - Suppression de message de log inutile sur chaque point de coeur | ||||
| @@ -522,7 +504,7 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi | ||||
|   - le message annonçant le joueur dont c'est le tour ne contient plus d'informations de santé | ||||
|   - un message avec les informations de santé est envoyé au Gardienn et au propriétaire du token.acteur | ||||
|   - le jet de vie est bien fait par le token si besoin | ||||
|   - seul les propriétaires peuvent faire les jets de vie | ||||
|   - seul les propriétaires peuvent faire les jets de vie  | ||||
| - Amélioration de la fenêtre de jets | ||||
|   - le type de dégâts pour les attaques est toujours affiché | ||||
|   - le moral est indiqué avant l'icone d'appel au moral | ||||
| @@ -629,3 +611,4 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi | ||||
| - correction des achats par le MJ sans acteur sélectionné | ||||
|  | ||||
| Cf branche v10 pour l'historique des versions 10 | ||||
|  | ||||
|   | ||||
							
								
								
									
										37
									
								
								gulpfile.js
									
									
									
									
									
								
							
							
						
						| @@ -1,37 +0,0 @@ | ||||
| const gulp = require('gulp'); | ||||
| const less = require('gulp-less'); | ||||
|  | ||||
| function onError(err) { | ||||
|   util.log(util.colors.red.bold('[ERROR LESS]:'),util.colors.bgRed(err.message)); | ||||
|   this.emit('end'); | ||||
| }; | ||||
|  | ||||
| /* ----------------------------------------- */ | ||||
| /*  Compile LESS | ||||
| /* ----------------------------------------- */ | ||||
| function compileLESS() { | ||||
|   return gulp.src("less/foundryvtt-reve-de-dragon.less") | ||||
|       .pipe(less()).on('error',console.log.bind(console)) | ||||
|       .pipe(gulp.dest("./css")) | ||||
| } | ||||
| const css = gulp.series(compileLESS); | ||||
|  | ||||
| /* ----------------------------------------- */ | ||||
| /*  Watch Updates | ||||
| /* ----------------------------------------- */ | ||||
| const SIMPLE_LESS = ["less/*.less", "less/item/*.less"]; | ||||
|  | ||||
| function watchUpdates() { | ||||
|   gulp.watch(SIMPLE_LESS, css); | ||||
| } | ||||
|  | ||||
| /* ----------------------------------------- */ | ||||
| /*  Export Tasks | ||||
| /* ----------------------------------------- */ | ||||
|  | ||||
| exports.default = gulp.series( | ||||
|     gulp.parallel(css), | ||||
|     watchUpdates | ||||
| ); | ||||
| exports.css = css; | ||||
| exports.watchUpdates = watchUpdates; | ||||
| @@ -1,50 +0,0 @@ | ||||
| :root { | ||||
|  | ||||
|   /* =================== 2. DEBUGGING HIGHLIGHTERS ============ */ | ||||
|     // --debug-background-color-red: #ff000054; | ||||
|     // --debug-background-color-blue: #1d00ff54; | ||||
|     // --debug-background-color-green: #54ff0054; | ||||
|  | ||||
|     // --debug-box-shadow-red: inset 0 0 2px red; | ||||
|     // --debug-box-shadow-blue: inset 0 0 2px blue; | ||||
|     // --debug-box-shadow-green: inset 0 0 2px green; | ||||
|  | ||||
|  | ||||
|   /* =================== 3. some constants ============ */ | ||||
|     --fieldset-background: url(/ui/parchment.jpg); | ||||
|     --rdd-color-text-primary: rgba(10, 10, 10, 0.9); | ||||
|     --rdd-input-background:rgba(0, 0, 0, 0.05); | ||||
|     --rdd-color-border-input: rgba(0, 0, 0, 0.2); | ||||
|     --rdd-bg-input: rgba(255, 255, 255, 0.1); | ||||
|     --color-controls:rgba(0, 0, 0, 0.9); | ||||
|     --color-controls-light:hsla(0, 0%, 20%, 0.8); | ||||
|     --color-controls-hover:hsla(60, 100%, 75%, 0.7); | ||||
|     --color-control-border-hover:rgba(255, 128, 0, 0.8); | ||||
|     --color-gold: rgba(191, 149, 63, 0.8); | ||||
|     --gradient-gold: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3)); | ||||
|     --gradient-silver: linear-gradient(30deg, rgba(61, 55, 93, 0.3), rgba(178, 179, 196, 0.3), rgba(59, 62, 63, 0.6), rgba(206, 204, 199, 0.3), rgba(61, 46, 49, 0.3)); | ||||
|     --gradient-green: linear-gradient(30deg, rgba(7, 76, 0, 0.3), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.1), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.3)); | ||||
|     --gradient-red: linear-gradient(150deg, rgba(255, 0, 0, 0.3), rgba(255, 200, 128, 0.05),rgba(255, 200, 128, 0.1), rgba(255,10,0,0.3)); | ||||
|     --gradient-violet: linear-gradient(150deg, rgba(100, 45, 124, 0.6), rgba(216, 157, 192, 0.3), rgba(177, 157, 216, 0.5), rgba(107, 62, 121, 0.3), rgba(100, 45, 124, 0.6)); | ||||
|     --gradient-purple-black: linear-gradient(150deg,  rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7)); | ||||
|     --gradient-silver-light: linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2)); | ||||
|     --gradient-daylight: conic-gradient( | ||||
|       from 0deg, | ||||
|       hsla(50, 100%, 80%, 0.7), | ||||
|       hsla(30, 30%, 40%, 0.1) 25%, | ||||
|       hsla(250, 50%, 40%, 0.1) 25%, | ||||
|       hsla(250, 30%, 30%, 0.7) 50%, | ||||
|       hsla(250, 50%, 40%, 0.1) 75%, | ||||
|       hsla(30, 30%, 40%, 0.1) 75%, | ||||
|       hsla(50, 100%, 80%, 0.7) | ||||
|     ); | ||||
|  | ||||
|     --background-custom-button: linear-gradient(to bottom, rgba(33, 55, 74, 0.988) 5%, rgba(21, 40, 51, 0.671) 100%); | ||||
|     --background-custom-button-hover: linear-gradient(to bottom, rgb(128, 0, 0) 5%, rgb(62, 1, 1) 100%); | ||||
|     --background-control-selected: linear-gradient(to bottom, hsla(0, 100%, 25%, 0.5) 5%, hsla(0, 100%, 12%, 0.5) 100%); | ||||
|     --background-tooltip: hsla(60, 12%, 85%, 0.95); | ||||
|     --color-tooltip:hsla(282, 47%, 33%, 0.9); | ||||
|     --color-tooltip-faint:hsla(282, 47%, 66%, 0.5); | ||||
|     --background-error:hsla(16, 100%, 50%, 0.8); | ||||
|     --color-profile-border: hsla(0, 0%, 80%, 0.05); | ||||
|   } | ||||
| @@ -1,84 +0,0 @@ | ||||
| /* ==================== (A) Fonts ==================== */ | ||||
| @font-face { | ||||
|   font-family: "GoudyAcc"; | ||||
|   src: url('../fonts/goudyacc.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "MedievalSharp"; | ||||
|   src: url('../fonts/MedievalSharp.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "GrenzeGotisch"; | ||||
|   src: url('../fonts/GrenzeGotisch-Regular.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "Fondamento"; | ||||
|   src: url('../fonts/Fondamento.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "CaslonAntique"; | ||||
|   src: url('../fonts/CaslonAntique.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: 'HeuresDraconiques'; | ||||
|   src: | ||||
|       url('../fonts/heuresdraconiques2.woff') format('woff'), | ||||
|       url('../fonts/heuresdraconiques2.woff2') format('woff2'), | ||||
|       url('../fonts/heuresdraconiques2.ttf') format('truetype'); | ||||
|   font-weight: normal; | ||||
|   font-style: normal; | ||||
| } | ||||
|  | ||||
| :root { | ||||
|   /* =================== 1. ACTOR SHEET FONT STYLES =========== */ | ||||
|     --window-header-title-font-family: CaslonAntique; | ||||
|     --window-header-title-font-size: 1.6rem; | ||||
|     --window-header-title-font-weight: normal; | ||||
|     --window-header-title-color: #f5f5f5; | ||||
|  | ||||
|     --major-button-font-family: CaslonAntique; | ||||
|     --major-button-font-size: 1.4rem; | ||||
|     --major-button-font-weight: normal; | ||||
|     --major-button-color: #dadada; | ||||
|  | ||||
|     --tab-header-font-family: CaslonAntique; | ||||
|     --tab-header-font-size: 1.2rem; | ||||
|     --tab-header-font-weight: 700; | ||||
|     --tab-header-color: #403f3e; | ||||
|     --tab-header-color-active: #4a0404; | ||||
|  | ||||
|     --actor-input-font-family: CaslonAntique; | ||||
|     --actor-input-font-size: 1.2rem; | ||||
|     --actor-input-font-weight: 500; | ||||
|     --actor-input-color: black; | ||||
|  | ||||
|     --actor-label-font-family: CaslonAntique; | ||||
|     --actor-label-font-size: 1.2rem; | ||||
|     --actor-label-font-weight: 700; | ||||
|     --actor-label-color: #464331c4; | ||||
| } | ||||
|  | ||||
| /* Global styles & Font */ | ||||
| .window-app { | ||||
|   font-family: CaslonAntique; | ||||
|   text-align: justify; | ||||
|   font-size: 1rem; | ||||
|   letter-spacing: 1px; | ||||
| } | ||||
|  | ||||
| /* Fonts */ | ||||
| .sheet header.sheet-header h1 input, | ||||
| .window-app .window-header, | ||||
| #actors .directory-list, | ||||
| #navigation #scene-list .scene.nav-item { | ||||
|   font-family: "GoudyAcc" | ||||
| } | ||||
|  | ||||
| /* For title, sidebar character and scene */ | ||||
| .sheet nav.sheet-tabs, | ||||
| .window-app input, | ||||
| .sheet header.sheet-header .header-compteurs, | ||||
| .sheet header.sheet-header .flex-group-center.flex-fatigue, | ||||
| select,  .item-checkbox, #sidebar, #players, #navigation #nav-toggle { | ||||
|     font-family: "CaslonAntique"; /* For sheet parts; For nav and title */ | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| // Styles pour la feuille d'objet Monnaie | ||||
| .monnaie-content { | ||||
|  | ||||
|   .item-sheet-common(); | ||||
|   .item-sheet-header(); | ||||
|  | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| // Styles pour la feuille d'objet Monnaie | ||||
| .munition-content { | ||||
|  | ||||
|   .item-sheet-common(); | ||||
|   .item-sheet-header(); | ||||
|  | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| // Styles pour la feuille d'objet Monnaie | ||||
| .tarot-content { | ||||
|  | ||||
|   .item-sheet-common(); | ||||
|   .item-sheet-header(); | ||||
|  | ||||
| } | ||||
							
								
								
									
										108
									
								
								less/sheets.less
									
									
									
									
									
								
							
							
						
						| @@ -1,108 +0,0 @@ | ||||
| .item-sheet-common() { | ||||
|   padding: 0px; | ||||
|  | ||||
|   // Styles pour la section de description, si le partiel utilise une structure standard | ||||
|   .editor, | ||||
|   .editor-content { | ||||
|     height: auto; // Ajuster selon le besoin | ||||
|     min-height: 100px; // Hauteur minimale pour la description | ||||
|     background: var(--rdd-bg-input-alt); // Une couleur de fond alternative | ||||
|     padding: 5px; | ||||
|     border-radius: 3px; | ||||
|     color: var(--rdd-color-text-primary); | ||||
|   } | ||||
|  | ||||
|   .window-content { | ||||
|     font-family: CaslonAntique; | ||||
|     text-align: justify; | ||||
|     font-size: 1rem; | ||||
|     letter-spacing: 1px; | ||||
|     padding: 0% 0 0 0; | ||||
|  | ||||
|     font-size: calc(var(--font-size-standard) * 1); | ||||
|     color: var(--color-dark-1); | ||||
|     background-size: 100% 100%; | ||||
|   } | ||||
|  | ||||
|   fieldset { | ||||
|     background: var(--fieldset-background); | ||||
|     color: var(--rdd-color-text-primary); | ||||
|     margin-bottom: 4px; | ||||
|     border-radius: 6px; | ||||
|     border-color: var(--rdd-color-text-primary); | ||||
|     border-width: 2px; | ||||
|   } | ||||
|  | ||||
|   .form-group { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     flex-wrap: wrap; | ||||
|     justify-content: flex-start; | ||||
|     align-items: center; | ||||
|     padding: 2px 0; | ||||
|     border-bottom: 1px solid var(--rdd-color-shadow-primary); | ||||
|     font-size: 0.9rem; | ||||
|  | ||||
|     label { | ||||
|       font-weight: normal; | ||||
|       flex: 2; | ||||
|       padding-left: 5px; | ||||
|       margin: 0; | ||||
|       color: var( | ||||
|         --rdd-color-text-primary | ||||
|       ); // Assurez-vous que cette variable existe dans colors.less | ||||
|     } | ||||
|  | ||||
|     .attribute-value, | ||||
|     input[type="text"], | ||||
|     input[type="number"], | ||||
|     select { | ||||
|       flex: 3; | ||||
|       background: var(--rdd-input-background); | ||||
|       border: 1px solid var(--rdd-color-border-input); // Assurez-vous que cette variable existe | ||||
|       color: var( | ||||
|         --rdd-color-text-input | ||||
|       ); // Assurez-vous que cette variable existe | ||||
|       padding: 2px 2px; // Augmentation du padding vertical | ||||
|       border-radius: 3px; | ||||
|     } | ||||
|  | ||||
|     input[type="checkbox"] { | ||||
|       flex: 0 0 20px; // Taille fixe pour les cases à cocher | ||||
|       margin-left: 5px; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .item-sheet-header() { | ||||
|   background: #011d33 url(../assets/ui/bg_header.webp) no-repeat left top; | ||||
|   color: rgba(255, 255, 255, 1); | ||||
|   .sheet-header-row { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     align-items: center; | ||||
|     h1, | ||||
|     input { | ||||
|       font-family: CaslonAntique; | ||||
|       font-size: 2.5rem; | ||||
|       font-weight: normal; | ||||
|       color: var(--window-header-title-color); | ||||
|       margin: 4px; | ||||
|       height: 3rem; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   :is( | ||||
|     input[type="text"], | ||||
|     input[type="number"], | ||||
|     input[type="password"], | ||||
|     input[type="datetime-local"], | ||||
|     input[type="date"], | ||||
|     input[type="time"] | ||||
|   ) { | ||||
|     color: rgba(255, 255, 255, 0.75); | ||||
|     background: rgba(255, 255, 255, 0.1); | ||||
|     border: 0 none; | ||||
|     margin-bottom: 0.2rem; | ||||
|   } | ||||
| } | ||||
| @@ -484,7 +484,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|         await this.$recupererFatigue(message); | ||||
|         await this.$jetRecuperationReve(dormi, message); | ||||
|         if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) { | ||||
|           await this.$jetRecuperationReve(dormi, message); | ||||
|           dormi.etat = await this.$jetRecuperationReve(dormi, message); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
| @@ -1795,8 +1795,10 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     }; | ||||
|     RollDataAjustements.calcul(rollData, this); | ||||
|     await RdDResolutionTable.rollData(rollData); | ||||
|     this.gererExperience(rollData); | ||||
|     await RdDRollResult.displayRollData(rollData, this) | ||||
|  | ||||
|     this.gererExperience(rollData); | ||||
|  | ||||
|     return rollData.rolled; | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -341,9 +341,6 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     const selectedCaracName = ['apparence', 'perception', 'force', 'reve'].find(it => carac[it] != undefined) | ||||
|  | ||||
|     await this.openRollDialog({ | ||||
|       name: 'jet-quelconque', | ||||
|       label: 'Jet', | ||||
|       template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.hbs', | ||||
|       rollData: { | ||||
|         alias: this.getAlias(), | ||||
|         carac: carac, | ||||
|   | ||||
| @@ -14,12 +14,11 @@ import { ItemAction } from "../item/item-actions.js"; | ||||
|  * Extend the basic ActorSheet with some very simple modifications | ||||
|  * @extends {ActorSheet} | ||||
|  */ | ||||
| export class RdDBaseActorSheet extends foundry.appv1.sheets.ActorSheet { | ||||
|   static _warnedAppV1 = true | ||||
| export class RdDBaseActorSheet extends ActorSheet { | ||||
|  | ||||
|   /** @override */ | ||||
|   static get defaultOptions() { | ||||
|     return foundry.utils.mergeObject(foundry.appv1.sheets.ActorSheet.defaultOptions, { | ||||
|     return foundry.utils.mergeObject(ActorSheet.defaultOptions, { | ||||
|       classes: ["rdd", "sheet", "actor"], | ||||
|       tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }], | ||||
|       dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }], | ||||
|   | ||||
| @@ -734,7 +734,7 @@ export class RdDBaseActor extends Actor { | ||||
|       name: this.getAlias(), | ||||
|       system: { description: this.system.description } | ||||
|     } | ||||
|     foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData) | ||||
|     renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData) | ||||
|       .then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride))); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,6 @@ | ||||
| import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js"; | ||||
| import { RdDItem } from "../item.js"; | ||||
| import { RdDUtility } from "../rdd-utility.js"; | ||||
| import { RdDBaseActorSheet } from "./base-actor-sheet.js"; | ||||
|  | ||||
| /** | ||||
| @@ -42,8 +44,13 @@ export class RdDCommerceSheet extends RdDBaseActorSheet { | ||||
|   activateListeners(html) { | ||||
|     super.activateListeners(html); | ||||
|  | ||||
|     this.html.find('a.item-acheter').click(async event => await this.vente(this.getItem(event))); | ||||
|     this.html.find('.service-acheter').click(async event => await this.vente(this.getItem(event))); | ||||
|  | ||||
|     if (!this.options.editable) return; | ||||
|  | ||||
|     this.html.find('a.item-quantite-moins').click(async event => await this.getItem(event)?.quantiteIncDec(-1, { supprimerSiZero: false })); | ||||
|     this.html.find('a.item-quantite-plus').click(async event => await this.getItem(event)?.quantiteIncDec(1)); | ||||
|     this.html.find('input.item-quantite').change(async event => { | ||||
|       const newQuantite = Math.max(0, Number.parseInt(this.html.find(event.currentTarget).val())); | ||||
|       await this.getItem(event)?.update({ "system.quantite": newQuantite }); | ||||
| @@ -57,4 +64,28 @@ export class RdDCommerceSheet extends RdDBaseActorSheet { | ||||
|   getTypesInventaire() { | ||||
|     return RdDItem.getItemTypesInventaire('all'); | ||||
|   } | ||||
|  | ||||
|  | ||||
|   async vente(item) { | ||||
|     const acheteur = RdDUtility.getSelectedActor(); | ||||
|     if (!acheteur) { | ||||
|       ui.notifications.warn(`Pas d'acheteur sélectionné`); | ||||
|       return; | ||||
|     } | ||||
|     const disponible = this.actor.getQuantiteDisponible(item) | ||||
|     if (disponible == 0) { | ||||
|       ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`); | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     await DialogItemAchat.onAcheter({ | ||||
|       item, | ||||
|       vendeur: this.actor, | ||||
|       acheteur, | ||||
|       quantiteIllimite: disponible == undefined, | ||||
|       nbLots: disponible ?? 1, | ||||
|       tailleLot: 1, | ||||
|       prixLot: item.calculerPrixCommercant() | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,4 @@ | ||||
| import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js"; | ||||
| import { Misc } from "../misc.js"; | ||||
| import { RdDUtility } from "../rdd-utility.js"; | ||||
| import { RdDBaseActor } from "./base-actor.js"; | ||||
|  | ||||
| export class RdDCommerce extends RdDBaseActor { | ||||
| @@ -39,27 +37,4 @@ export class RdDCommerce extends RdDBaseActor { | ||||
|     const pourcentage = this.system.pourcentage ?? 100; | ||||
|     return Misc.keepDecimals(Math.ceil(item.system.cout * pourcentage) / 100, 2); | ||||
|   } | ||||
|   async vente(item) { | ||||
|     const acheteur = RdDUtility.getSelectedActor(); | ||||
|     if (!acheteur) { | ||||
|       ui.notifications.warn(`Pas d'acheteur sélectionné`); | ||||
|       return; | ||||
|     } | ||||
|     const disponible = this.getQuantiteDisponible(item) | ||||
|     if (disponible == 0) { | ||||
|       ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`); | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     await DialogItemAchat.onAcheter({ | ||||
|       item, | ||||
|       vendeur: this, | ||||
|       acheteur, | ||||
|       quantiteIllimite: disponible == undefined, | ||||
|       nbLots: disponible ?? 1, | ||||
|       tailleLot: 1, | ||||
|       prixLot: item.calculerPrixCommercant() | ||||
|     }); | ||||
|   } | ||||
|    | ||||
| } | ||||
| @@ -7,7 +7,7 @@ import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping. | ||||
|  | ||||
| export class RdDActorExportSheet extends RdDActorSheet { | ||||
|   static init() { | ||||
|     foundry.applications.handlebars.loadTemplates([ | ||||
|     loadTemplates([ | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessure.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessures.hbs", | ||||
| @@ -21,7 +21,7 @@ export class RdDActorExportSheet extends RdDActorSheet { | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/sort.hbs", | ||||
|     ]) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" }) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" }) | ||||
|   } | ||||
|  | ||||
|   static get defaultOptions() { | ||||
|   | ||||
| @@ -3,7 +3,7 @@ import { Misc } from "../../misc.js" | ||||
| import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.js" | ||||
| import { Mapping } from "./mapping.js" | ||||
|  | ||||
| const IMG_SCRIPTARIUM = '<img class="context-menu-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/scriptarium.svg">' | ||||
| const IMG_SCRIPTARIUM = '<img class="context-menu-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/scriptarium.svg">' | ||||
|  | ||||
| export class ExportScriptarium { | ||||
|  | ||||
| @@ -12,18 +12,14 @@ export class ExportScriptarium { | ||||
|   } | ||||
|  | ||||
|   constructor() { | ||||
|     //Hooks.on("getActorDirectoryFolderContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|     Hooks.on("getFolderContextOptions", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|     //Hooks.on("getActorDirectoryEntryContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|     Hooks.on("getActorContextOptions", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|  | ||||
|     Hooks.on("getActorDirectoryFolderContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|     Hooks.on("getActorDirectoryEntryContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|   } | ||||
|  | ||||
|   onActorDirectoryMenu(actorDirectory, menus) { | ||||
|     // DEBUG console.log("ExportScriptarium.onActorDirectoryMenu", actorDirectory, menus) | ||||
|     menus.push({ | ||||
|       name: 'Export Personnages', | ||||
|       icon: '<i class="fa-solid fa-download"></i>', //IMG_SCRIPTARIUM, | ||||
|       name: 'Export Personnages <i class="fa-regular fa-file-csv"></i>', | ||||
|       icon: IMG_SCRIPTARIUM, | ||||
|       condition: (target) => game.user.isGM && | ||||
|         OptionsAvancees.isUsing(EXPORT_CSV_SCRIPTARIUM) && | ||||
|         this.$getActors(actorDirectory, target).length > 0, | ||||
| @@ -32,28 +28,22 @@ export class ExportScriptarium { | ||||
|   } | ||||
|  | ||||
|   $getTargetName(actorDirectory, target) { | ||||
|     target = $(target) | ||||
|     const li = target.closest(".directory-item") | ||||
|     const folderId = li.data("folderId") | ||||
|     const actorId = li.data("entryId") | ||||
|     const actorId = li.data("documentId") | ||||
|     return actorId | ||||
|       ? game.actors.get(actorId).name | ||||
|       : actorDirectory.collection.filter(it => it.folder.id == folderId).name | ||||
|       : actorDirectory.folders.find(it => it.id == folderId).name | ||||
|   } | ||||
|  | ||||
|   $getActors(actorDirectory, target) { | ||||
|     if (actorDirectory.id != "actors") { | ||||
|       return [] | ||||
|     } | ||||
|     // DEBUG console.log("ExportScriptarium.$getActors", actorDirectory, target) | ||||
|     target = $(target) | ||||
|     const li = target.closest(".directory-item") | ||||
|     const folderId = li.data("folderId") | ||||
|     const actorId = li.data("entryId") | ||||
|     const actorId = li.data("documentId") | ||||
|     const actors = actorId | ||||
|       ? [game.actors.get(actorId)] | ||||
|       : folderId | ||||
|         ? actorDirectory.collection.filter(it => it.folder.id == folderId) | ||||
|         ? actorDirectory.folders.find(it => it.id == folderId).contents | ||||
|         : [] | ||||
|     return actors.filter(it => it.type == ACTOR_TYPES.personnage) | ||||
|   } | ||||
| @@ -64,7 +54,7 @@ export class ExportScriptarium { | ||||
|     const actorLines = actors.map(actor => Misc.join(this.getActorLine(actor), ';')) | ||||
|     const data = Misc.join([header, ...actorLines], eol) | ||||
|     const filename = `scriptarium-${targetName?.slugify()}.csv`; | ||||
|     foundry.utils.saveDataToFile(data, "text/csv;charset=windows-1252", `${filename}`); | ||||
|     saveDataToFile(data, "text/csv;charset=windows-1252", `${filename}`); | ||||
|   } | ||||
|  | ||||
|   getHeaderLine() { | ||||
|   | ||||
| @@ -26,7 +26,7 @@ const RANDOM_VALUES = { | ||||
|  | ||||
| export class AppPersonnageAleatoire extends FormApplication { | ||||
|   static preloadHandlebars() { | ||||
|     foundry.applications.handlebars.loadTemplates([ | ||||
|     loadTemplates([ | ||||
|       'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs', | ||||
|     ]) | ||||
|   } | ||||
|   | ||||
| @@ -1,5 +0,0 @@ | ||||
| export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs" | ||||
| export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs" | ||||
| export { default as RdDMunitionSheet } from "./munition-sheet.mjs" | ||||
| export { default as RdDTarotSheet } from "./tarot-sheet.mjs" | ||||
|  | ||||
| @@ -1,111 +0,0 @@ | ||||
| const { HandlebarsApplicationMixin } = foundry.applications.api | ||||
| import { SYSTEM_RDD } from "../../constants.js" | ||||
| import { Misc } from "../../misc.js" | ||||
| import { RdDSheetUtility } from "../../rdd-sheet-utility.js"; | ||||
|  | ||||
|  | ||||
| export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) { | ||||
|  | ||||
|   static preloadHandlebars(...templatesList) { | ||||
|     const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"] | ||||
|     templatesList.forEach(templates => | ||||
|       templates.forEach(t => | ||||
|         t.handlebars().forEach(h => handlebars.push(h)) | ||||
|       ) | ||||
|     ) | ||||
|     loadTemplates(Misc.distinct(handlebars)) | ||||
|   } | ||||
|  | ||||
|   static register(sheetClass) { | ||||
|     const itemType = sheetClass.ITEM_TYPE | ||||
|     Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|       label: Misc.typeName('Item', itemType), | ||||
|       types: [itemType], | ||||
|       makeDefault: true | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   static registerAll(...sheetClasses) { | ||||
|     const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"] | ||||
|     sheetClasses.forEach(sheetClass => { | ||||
|       sheetClass.TEMPLATES.forEach(t => | ||||
|         t.handlebars().forEach(h => handlebars.push(h)) | ||||
|       ) | ||||
|       const itemType = sheetClass.ITEM_TYPE | ||||
|       foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|         label: Misc.typeName('Item', itemType), | ||||
|         types: [itemType], | ||||
|         makeDefault: true | ||||
|       }) | ||||
|     }) | ||||
|     foundry.applications.handlebars.loadTemplates(Misc.distinct(handlebars)) | ||||
|   } | ||||
|  | ||||
|   static get ITEM_TYPE() { return undefined } | ||||
|  | ||||
|   constructor(options = {}) { | ||||
|     super(options) | ||||
|   } | ||||
|  | ||||
|   static get TEMPLATES() { return [] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = { | ||||
|     classes: ["fvtt-rdd", "item"], | ||||
|     position: { | ||||
|       width: 448, | ||||
|       height: "auto", | ||||
|     }, | ||||
|     form: { | ||||
|       submitOnChange: true, | ||||
|     }, | ||||
|     window: { | ||||
|       resizable: true, | ||||
|     }, | ||||
|     actions: { | ||||
|       editImage: RdDItemBaseSheet.#onEditImage, | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return { | ||||
|       item: this.document, | ||||
|       options: RdDSheetUtility.getOptions(this.document, this.isEditable), | ||||
|       fields: this.document.schema.fields, | ||||
|       systemFields: this.document.system.schema.fields, | ||||
|       system: this.document.system, | ||||
|       source: this.document.toObject(), | ||||
|       isEditable: this.isEditable, | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // #region Actions | ||||
|  | ||||
|   /** | ||||
|    * Handle changing a Document's image. | ||||
|    * | ||||
|    * @this RdDItemBaseSheet | ||||
|    * @param {PointerEvent} event   The originating click event | ||||
|    * @param {HTMLElement} target   The capturing HTML element which defined a [data-action] | ||||
|    * @returns {Promise} | ||||
|    * @private | ||||
|    */ | ||||
|   static async #onEditImage(event, target) { | ||||
|     const attr = target.dataset.edit | ||||
|     const current = foundry.utils.getProperty(this.document, attr) | ||||
|     const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {} | ||||
|     const fp = new FilePicker({ | ||||
|       current, | ||||
|       type: "image", | ||||
|       redirectToRoot: img ? [img] : [], | ||||
|       callback: (path) => { | ||||
|         this.document.update({ [attr]: path }) | ||||
|       }, | ||||
|       top: this.position.top + 40, | ||||
|       left: this.position.left + 10, | ||||
|     }) | ||||
|     return fp.browse() | ||||
|   } | ||||
|   // #endregion | ||||
| } | ||||
| @@ -1,35 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs"; | ||||
| import { ITEM_TYPES } from "../../constants.js"; | ||||
| import RdDItemBaseSheet from "./common-item-sheet.mjs"; | ||||
|  | ||||
| export default class RdDMonnaieSheet extends RdDItemBaseSheet { | ||||
|  | ||||
|   /** @override */ | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.monnaie } | ||||
|   static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = Object.assign({}, | ||||
|     RdDItemBaseSheet.DEFAULT_OPTIONS, | ||||
|     { | ||||
|       classes: ["fvtt-rdd", "item", "monnaie"], | ||||
|       position: { width: 448 }, | ||||
|       window: { contentClasses: ["monnaie-content"] } | ||||
|     }) | ||||
|  | ||||
|   /** @override */ | ||||
|   static PARTS = { | ||||
|     main: { | ||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/monnaie.hbs", | ||||
|     }, | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return Object.assign( | ||||
|       await super._prepareContext(), | ||||
|       await TEMPLATE_DESCRIPTION.prepareContext(this.document), | ||||
|       await TEMPLATE_INVENTAIRE.prepareContext(this.document) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,34 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs"; | ||||
| import { ITEM_TYPES } from "../../constants.js"; | ||||
| import RdDItemBaseSheet from "./common-item-sheet.mjs"; | ||||
|  | ||||
| export default class RdDMunitionSheet extends RdDItemBaseSheet { | ||||
|   /** @override */ | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.munition } | ||||
|   static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = Object.assign({}, | ||||
|     RdDItemBaseSheet.DEFAULT_OPTIONS, | ||||
|     { | ||||
|       classes: ["fvtt-rdd", "item", "munition"], | ||||
|       position: { width: 448 }, | ||||
|       window: { contentClasses: ["munition-content"] } | ||||
|     }) | ||||
|  | ||||
|   /** @override */ | ||||
|   static PARTS = { | ||||
|     main: { | ||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/munition.hbs", | ||||
|     }, | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return Object.assign( | ||||
|       await super._prepareContext(), | ||||
|       await TEMPLATE_DESCRIPTION.prepareContext(this.document), | ||||
|       await TEMPLATE_INVENTAIRE.prepareContext(this.document) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,33 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs"; | ||||
| import { ITEM_TYPES } from "../../constants.js"; | ||||
| import RdDItemBaseSheet from "./common-item-sheet.mjs"; | ||||
|  | ||||
| export default class RdDTarotSheet extends RdDItemBaseSheet { | ||||
|   /** @override */ | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.tarot } | ||||
|   static get TEMPLATES() { return [TEMPLATE_DESCRIPTION] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = Object.assign({}, | ||||
|     RdDItemBaseSheet.DEFAULT_OPTIONS, | ||||
|     { | ||||
|       classes: ["fvtt-rdd", "item", "tarot"], | ||||
|       position: { width: 448 }, | ||||
|       window: { contentClasses: ["tarot-content"] } | ||||
|     }) | ||||
|  | ||||
|   /** @override */ | ||||
|   static PARTS = { | ||||
|     main: { | ||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/tarot.hbs", | ||||
|     }, | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return Object.assign( | ||||
|       await super._prepareContext(), | ||||
|       await TEMPLATE_DESCRIPTION.prepareContext(this.document) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -13,7 +13,7 @@ const TEXT_ROLL_MANAGERS = [ | ||||
|  | ||||
| export class RdDTextEditor { | ||||
|   static registerChatCallbacks(html) { | ||||
|     $(html).on("click", '.roll-text', async event => await RdDTextEditor.rollText(event)) | ||||
|     html.on("click", '.roll-text', async event => await RdDTextEditor.rollText(event)) | ||||
|   } | ||||
|  | ||||
|   static async enrichHTML(text, object, options = {showlink:true}) { | ||||
| @@ -30,7 +30,7 @@ export class RdDTextEditor { | ||||
|       context.text = await manager.onReplaceRoll(context); | ||||
|     } | ||||
|  | ||||
|     return await foundry.applications.ux.TextEditor.implementation.enrichHTML(context.text, { | ||||
|     return await TextEditor.enrichHTML(context.text, { | ||||
|       relativeTo: object, | ||||
|       secrets: object?.isOwner, | ||||
|       async: true | ||||
|   | ||||
| @@ -5,12 +5,12 @@ import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Class providing helper methods to get the list of users, and | ||||
|  * Class providing helper methods to get the list of users, and  | ||||
|  */ | ||||
| export class ChatUtility { | ||||
|  | ||||
|   static async init() { | ||||
|     Hooks.on("renderChatMessageHTML", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg)) | ||||
|     Hooks.on("renderChatMessage", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg)) | ||||
|     Hooks.on("createChatMessage", async (chatMessage, options, id) => await ChatUtility.onCreateChatMessage(chatMessage, options, id)) | ||||
|   } | ||||
|  | ||||
| @@ -190,8 +190,8 @@ export class ChatUtility { | ||||
|     if (rddTimestamp) { | ||||
|       const timestamp = new RdDTimestamp(rddTimestamp); | ||||
|       const timestampData = timestamp.toCalendrier(); | ||||
|       const dateHeure = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData); | ||||
|       $(html).find('header.message-header .message-sender').after(dateHeure) | ||||
|       const dateHeure = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData); | ||||
|       html.find('header.message-header .message-sender').after(dateHeure) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -5,13 +5,13 @@ const INFO_COEUR = 'info-coeur'; | ||||
|  | ||||
| export class RdDCoeur { | ||||
|   static registerChatCallbacks(html) { | ||||
|     $(html).on("click", 'a.accepter-tendre-moment', event => { | ||||
|     html.on("click", 'a.accepter-tendre-moment', event => { | ||||
|       RdDCoeur.accepterTendreMoment(RdDCoeur.extractInfoCoeur(event)) | ||||
|     }) | ||||
|     $(html).on("click", 'a.refuser-tendre-moment', event => { | ||||
|     html.on("click", 'a.refuser-tendre-moment', event => { | ||||
|       RdDCoeur.refuserTendreMoment(RdDCoeur.extractInfoCoeur(event)) | ||||
|     }) | ||||
|     $(html).on("click", 'a.perdre-point-coeur-douceur', event => { | ||||
|     html.on("click", 'a.perdre-point-coeur-douceur', event => { | ||||
|       RdDCoeur.perdreEnDouceur( | ||||
|         RdDCoeur.extractInfoCoeur(event), | ||||
|         event.currentTarget.attributes['data-actor-id'].value) | ||||
|   | ||||
| @@ -1,8 +0,0 @@ | ||||
| import { CommonDescription } from "./description.mjs"; | ||||
| import { CommonInventaire } from "./inventaire.mjs"; | ||||
|  | ||||
| export const TEMPLATE_DESCRIPTION = new CommonDescription() | ||||
| export const TEMPLATE_INVENTAIRE = new CommonInventaire() | ||||
|  | ||||
| export const ALL_COMMON_TEMPLATES = [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] | ||||
|  | ||||
| @@ -1,10 +0,0 @@ | ||||
| /** | ||||
|  * class describing common methods implemented by template parts, | ||||
|  * used for sheet/models/documents | ||||
|  */ | ||||
| export default class CommonTemplate { | ||||
|   fields() { } | ||||
|   handlebars() { return [] } | ||||
|   actions() { return {} } | ||||
|   async prepareContext(item) { } | ||||
| } | ||||
| @@ -1,32 +0,0 @@ | ||||
| import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js" | ||||
| import CommonTemplate from "./common-template.mjs" | ||||
| import { HTMLSTRING } from "./field-types.mjs" | ||||
|  | ||||
| const fields = foundry.data.fields | ||||
|  | ||||
| export class CommonDescription extends CommonTemplate { | ||||
|   fields() { | ||||
|     return { | ||||
|       description: new fields.HTMLField({ ...HTMLSTRING }), | ||||
|       descriptionmj: new fields.HTMLField({ gmOnly: true, ...HTMLSTRING }) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   handlebars() { | ||||
|     return [ | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs", | ||||
|     ] | ||||
|   } | ||||
|   actions() { | ||||
|     return {} | ||||
|   } | ||||
|  | ||||
|   async prepareContext(item) { | ||||
|     const enriched = { | ||||
|       description: await RdDTextEditor.enrichHTML(item.system.description, item), | ||||
|       descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item), | ||||
|     } | ||||
|     return { enriched } | ||||
|   } | ||||
|  | ||||
| } | ||||
| @@ -1,9 +0,0 @@ | ||||
| export const INTEGER = { required: true, nullable: false, min: 0, integer: true } | ||||
| export const DECIMAL = { required: true, nullable: false, min: 0, integer: false } /* TODO: validation de nombre décimales?*/ | ||||
| export const INTEGER_SIGNED = { required: true, nullable: false, integer: true } | ||||
| export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false } | ||||
| export const STRING = { required: true, nullable: false, blank: true, trim: true } | ||||
| export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, textSearch: true } | ||||
|  | ||||
| export const MODEL_ARRAY = { initial: [], required: true, nullable: false } | ||||
|  | ||||
| @@ -1,36 +0,0 @@ | ||||
| import CommonTemplate from "./common-template.mjs" | ||||
| import { RARETES } from "../item/raretes.js" | ||||
| import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "./field-types.mjs" | ||||
|  | ||||
| const fields = foundry.data.fields | ||||
|  | ||||
| export class CommonInventaire extends CommonTemplate { | ||||
|   fields() { | ||||
|     return { | ||||
|       encombrement: new fields.NumberField({ label: "Encombrement", initial: 0, ...INTEGER }), | ||||
|       quantite: new fields.NumberField({ label: "Quantité", initial: 1, ...INTEGER }), | ||||
|       qualite: new fields.NumberField({ label: "Qualité", initial: 0, ...INTEGER_SIGNED }), | ||||
|       cout: new fields.NumberField({ label: "Coût", initial: 0.0, ...DECIMAL }), | ||||
|       environnement: new fields.ArrayField( | ||||
|         new fields.SchemaField({ | ||||
|           milieu: new fields.StringField({ label: "Milieu", initial: "", ...STRING }), | ||||
|           rarete: new fields.StringField({ | ||||
|             label: "Rareté", initial: RARETES[0].code, ...STRING, | ||||
|             validate: (value, options) => RARETES.find(it => it.code == value) | ||||
|           }), | ||||
|           frequence: new fields.NumberField({ label: "Fréquence", initial: RARETES[0].frequence, ...INTEGER }), | ||||
|         }), | ||||
|         { label: "Environnement", ...MODEL_ARRAY }), | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   handlebars() { | ||||
|     return [ | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs" | ||||
|     ] | ||||
|   } | ||||
|  | ||||
|   async prepareContext(item) { | ||||
|     return {} | ||||
|   } | ||||
| } | ||||
| @@ -1,3 +0,0 @@ | ||||
| export { default as RdDModelMonnaie } from "./monnaie.mjs" | ||||
| export { default as RdDModelMunition } from "./munition.mjs" | ||||
| export { default as RdDModelTarot } from "./tarot.mjs" | ||||
| @@ -1,11 +0,0 @@ | ||||
| import { RdDItem } from "../item.js"; | ||||
|  | ||||
| export default class RdDItemMonnaie extends RdDItem { | ||||
|  | ||||
|   constructor(data, context) { | ||||
|     if (!data.img) { | ||||
|       data.img = 'systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp' | ||||
|     } | ||||
|     super(data, context); | ||||
|   } | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| import { RdDItem } from "../item.js"; | ||||
|  | ||||
| export default class RdDItemMunition extends RdDItem { | ||||
|   static get defaultIcon() { | ||||
|     return 'systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp' | ||||
|   } | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| import { RdDItem } from "../item.js"; | ||||
|  | ||||
| export default class RdDItemTarot extends RdDItem { | ||||
|   static get defaultIcon() { | ||||
|     return 'systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp' | ||||
|   } | ||||
| } | ||||
| @@ -14,11 +14,12 @@ import { RdDItem } from "./item.js"; | ||||
| import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js"; | ||||
| import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"; | ||||
| import { ItemAction } from "./item/item-actions.js"; | ||||
| import { RdDItemGemme } from "./item/gemme.js"; | ||||
|  | ||||
| /** | ||||
|  * Extend the basic ItemSheet for RdD specific items | ||||
|  */ | ||||
| export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
| export class RdDItemSheet extends ItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { | ||||
|     return undefined | ||||
| @@ -31,7 +32,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|   } | ||||
|  | ||||
|   static register(sheetClass) { | ||||
|     foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|     Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|       label: Misc.typeName('Item', sheetClass.ITEM_TYPE), | ||||
|       types: [sheetClass.ITEM_TYPE], | ||||
|       makeDefault: true | ||||
| @@ -42,7 +43,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|   static get defaultOptions() { | ||||
|     return foundry.utils.mergeObject(super.defaultOptions, { | ||||
|       classes: [SYSTEM_RDD, "sheet", "item"], | ||||
|       template: RdDItemSheetV1.defaultTemplate(RdDItemSheetV1.ITEM_TYPE), | ||||
|       template: RdDItemSheet.defaultTemplate(RdDItemSheet.ITEM_TYPE), | ||||
|       width: 550, | ||||
|       height: 550 | ||||
|     }, { inplace: false }); | ||||
| @@ -50,7 +51,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   get template() { | ||||
|     return RdDItemSheetV1.defaultTemplate(this.item.type); | ||||
|     return RdDItemSheet.defaultTemplate(this.item.type); | ||||
|   } | ||||
|  | ||||
|   get title() { | ||||
| @@ -100,7 +101,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|       description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item), | ||||
|       descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item), | ||||
|       isComestible: this.item.getUtilisationCuisine(), | ||||
|       options: RdDSheetUtility.mergeDocumentRights({}, this.item, this.isEditable), | ||||
|       options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable), | ||||
|       competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage), | ||||
|       categories: RdDItem.getCategories(this.item.type), | ||||
|     } | ||||
| @@ -263,7 +264,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|   _updateObject(event, formData) { | ||||
|     switch (this.item.type) { | ||||
|       case ITEM_TYPES.sort: | ||||
|         formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheetV1._listCaseTmr( | ||||
|         formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheet._listCaseTmr( | ||||
|           formData.caseTmrCoord, | ||||
|           formData.caseTmrBonus, | ||||
|           formData.caseTmrAdd | ||||
| @@ -313,7 +314,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|  | ||||
|   async _onDrop(event) { | ||||
|     // Try to extract the dragData | ||||
|     let dragData = RdDItemSheetV1.$extractDragData(event); | ||||
|     let dragData = RdDItemSheet.$extractDragData(event); | ||||
|     if (!dragData) return false; | ||||
|     const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData); | ||||
|     if (allowed === false) return false; | ||||
|   | ||||
| @@ -78,8 +78,6 @@ export const defaultItemImg = { | ||||
|   souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp", | ||||
|   tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp", | ||||
|   tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp", | ||||
|   monnaie:"systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp", | ||||
|   munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp" | ||||
| } | ||||
|  | ||||
| /* -------------------------------------------- */ | ||||
|   | ||||
| @@ -1,4 +1,3 @@ | ||||
| import { ACTOR_TYPES } from "../constants.js" | ||||
| import { Misc } from "../misc.js" | ||||
| import { RdDSheetUtility } from "../rdd-sheet-utility.js" | ||||
| import { RdDUtility } from "../rdd-utility.js" | ||||
| @@ -20,8 +19,9 @@ const _VENDRE = { | ||||
| } | ||||
| const _ACHAT_SERVICE = { | ||||
|   code: 'item-service-acheter', label: 'Acheter', icon: it => 'fa-regular fa-coins', | ||||
|   filter: it => Misc.toInt(it.system.quantite) > 0 && it.parent?.type == ACTOR_TYPES.commerce, | ||||
|   action: (item, actor) => actor.vente(item) | ||||
|   //filter: it => Misc.toInt(it.system.quantite) > 0, | ||||
|   //optionsFilter: options => options.editable, | ||||
|   //action: (item, actor) => item.proposerVente() | ||||
| } | ||||
| const _MONTRER = { | ||||
|   code: 'item-montrer', label: 'Montrer', icon: it => 'fa-solid fa-comment', | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
| import { HtmlUtility } from "../html-utility.js"; | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
| import { Misc } from "../misc.js"; | ||||
| import { RdDRaretes } from "./raretes.js"; | ||||
|  | ||||
| const TYPE_ITEMS_NATURELS = ["faune", "herbe", "plante", "ingredient"]; | ||||
|  | ||||
| export class RdDItemInventaireSheet extends RdDItemSheetV1 { | ||||
| export class RdDItemInventaireSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get defaultOptions() { | ||||
|     return foundry.utils.mergeObject(RdDItemSheetV1.defaultOptions, { | ||||
|     return foundry.utils.mergeObject(RdDItemSheet.defaultOptions, { | ||||
|       tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }] | ||||
|     }, { inplace: false }) | ||||
|   } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
|  | ||||
| export class RdDBlessureItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDBlessureItemSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "blessure" }; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ export class RdDFauneItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|     if (!this.options.editable) return; | ||||
|  | ||||
|     $(html).find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); | ||||
|     html.find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); | ||||
|   } | ||||
|  | ||||
|   async _onDropActor(event, dragData) { | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { RdDRencontre } from "./rencontre.js"; | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
|  | ||||
| export class RdDRencontreItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDRencontreItemSheet extends RdDItemSheet { | ||||
|    | ||||
|   static get ITEM_TYPE() { return "rencontre" }; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
|  | ||||
| export class RdDServiceItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDServiceItemSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "service" }; | ||||
|  | ||||
|   | ||||
| @@ -1,12 +1,12 @@ | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
| import { RdDItemSigneDraconique } from "./signedraconique.js"; | ||||
| import { TMRUtility } from "../tmr-utility.js"; | ||||
|  | ||||
| /** | ||||
|  * Item sheet pour signes draconiques | ||||
|  * @extends {RdDItemSheetV1} | ||||
|  * @extends {RdDItemSheet} | ||||
|  */ | ||||
| export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDSigneDraconiqueItemSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "signedraconique" } | ||||
|  | ||||
| @@ -36,9 +36,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 { | ||||
|  | ||||
|     if (!this.options.editable) return; | ||||
|  | ||||
|     $(html).find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); | ||||
|     $(html).find("input.select-tmr").change(async event => await this.onSelectTmr(event)); | ||||
|     $(html).find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); | ||||
|     html.find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); | ||||
|     html.find("input.select-tmr").change(async event => await this.onSelectTmr(event)); | ||||
|     html.find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); | ||||
|   } | ||||
|  | ||||
|   async setSigneAleatoire() { | ||||
|   | ||||
| @@ -3,10 +3,10 @@ import { SYSTEM_RDD } from "../constants.js"; | ||||
| import { Misc } from "../misc.js"; | ||||
|  | ||||
|  | ||||
| export class RdDJournalSheet extends foundry.appv1.sheets.JournalTextPageSheet { | ||||
| export class RdDJournalSheet extends JournalTextPageSheet { | ||||
|   static register() { | ||||
|     foundry.applications.apps.DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", foundry.appv1.sheets.JournalTextPageSheet) | ||||
|     foundry.applications.apps.DocumentSheetConfig.registerSheet(JournalEntryPage, | ||||
|     DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", JournalTextPageSheet) | ||||
|     DocumentSheetConfig.registerSheet(JournalEntryPage, | ||||
|       SYSTEM_RDD, | ||||
|       RdDJournalSheet, { | ||||
|       types: ["text"], | ||||
|   | ||||
| @@ -8,7 +8,6 @@ import { RdDTimestamp } from "./time/rdd-timestamp.js"; | ||||
| import { RdDRaretes } from "./item/raretes.js"; | ||||
| import { VOIES_DRACONIC } from "./item-sort.js"; | ||||
| import { SystemCompendiums } from "./settings/system-compendiums.js"; | ||||
| import { Misc } from "./misc.js"; | ||||
|  | ||||
| class Migration { | ||||
|   get code() { return "sample"; } | ||||
| @@ -633,21 +632,12 @@ class _12_0_38_TachesEcriture extends Migration { | ||||
|   async migrate() { | ||||
|     await this.applyItemsUpdates(items => items | ||||
|       .filter(it => [ITEM_TYPES.tache, ITEM_TYPES.livre, ITEM_TYPES.oeuvre, ITEM_TYPES.meditation].includes(it.type) ) | ||||
|       .filter(it => Grammar.equalsInsensitive(it.system.competence, 'ecriture')) | ||||
|       .filter(it => it.system.competence == 'Ecriture') | ||||
|       .map(it => { return { _id: it.id, 'system.competence': 'Écriture' } }) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
|  | ||||
| class _13_0_4_FixReveActuel extends Migration { | ||||
|   get code() { return "fix-revvve-actuel" } | ||||
|   get version() { return "13.0.4" } | ||||
|  | ||||
|   async migrate() { | ||||
|     game.actors.forEach(it => it.update({'system.carac.-=reve-actuel': null})) | ||||
|   } | ||||
| } | ||||
|  | ||||
| export class Migrations { | ||||
|   static getMigrations() { | ||||
|     return [ | ||||
| @@ -670,8 +660,7 @@ export class Migrations { | ||||
|       new _12_0_26_MigrationVoieSorts(), | ||||
|       new _12_0_32_MigrationRaces(), | ||||
|       new _12_0_37_MigrationAlchimieEtat(), | ||||
|       new _12_0_38_TachesEcriture(), | ||||
|       new _13_0_4_FixReveActuel() | ||||
|       new _12_0_38_TachesEcriture() | ||||
|     ]; | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -265,7 +265,7 @@ export class Misc { | ||||
|     const subset = elements.filter(options.preFilter) | ||||
|       .filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value)) | ||||
|       .sort(Misc.ascending(it => options.mapper(it))) | ||||
|     if (subset.length == 0) { | ||||
|     if (subset.length == 0 && options?.onMessage) { | ||||
|       options.onMessage(`Pas de ${options.description} correspondant à ${value}`); | ||||
|     } | ||||
|     return subset; | ||||
|   | ||||
| @@ -1,3 +0,0 @@ | ||||
| export { default as RdDModelMonnaie } from "./monnaie.mjs" | ||||
| export { default as RdDModelMunition } from "./munition.mjs" | ||||
| export { default as RdDModelTarot } from "./tarot.mjs" | ||||
| @@ -1,10 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs"; | ||||
|  | ||||
| export default class RdDModelMonnaie extends foundry.abstract.TypeDataModel { | ||||
|   static defineSchema() { | ||||
|     return Object.assign({}, | ||||
|       TEMPLATE_DESCRIPTION.fields(), | ||||
|       TEMPLATE_INVENTAIRE.fields() | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,10 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs"; | ||||
|  | ||||
| export default class RdDModelMunition extends foundry.abstract.TypeDataModel { | ||||
|   static defineSchema() { | ||||
|     return Object.assign({}, | ||||
|       TEMPLATE_DESCRIPTION.fields(), | ||||
|       TEMPLATE_INVENTAIRE.fields() | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,18 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION } from "../common/_module.mjs"; | ||||
| import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "../common/field-types.mjs" | ||||
|  | ||||
| const fields = foundry.data.fields | ||||
|  | ||||
| export default class RdDModelTarot extends foundry.abstract.TypeDataModel { | ||||
|   static defineSchema() { | ||||
|     let tarotFields = { | ||||
|       concept : new fields.StringField({ label: "Concept", initial: "", ...STRING }), | ||||
|       aspect : new fields.StringField({ label: "Aspect", initial: "", ...STRING }), | ||||
|       frequence : new fields.NumberField({ label: "Fréquence", initial: 1, ...INTEGER })       | ||||
|     } | ||||
|     return Object.assign({}, | ||||
|       TEMPLATE_DESCRIPTION.fields(), | ||||
|       tarotFields | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -483,7 +483,7 @@ export class RdDCombat { | ||||
|       '.appel-destinee-attaque', | ||||
|       '.echec-total-attaque', | ||||
|     ]) { | ||||
|       $(html).on("click", button, event => { | ||||
|       html.on("click", button, event => { | ||||
|         const rddCombat = RdDCombat.rddCombatForAttackerAndDefender( | ||||
|           event.currentTarget.attributes['data-attackerId']?.value, | ||||
|           event.currentTarget.attributes['data-attackerTokenId']?.value, | ||||
| @@ -494,7 +494,7 @@ export class RdDCombat { | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|     $(html).on("click", 'a.chat-jet-vie', event => { | ||||
|     html.on("click", 'a.chat-jet-vie', event => { | ||||
|       event.preventDefault(); | ||||
|       RdDCombat._callJetDeVie(event); | ||||
|     }); | ||||
| @@ -934,7 +934,7 @@ export class RdDCombat { | ||||
|     let defenses = defender.items.filter(it => RdDItemArme.isParade(it)) | ||||
|     defenses = foundry.utils.duplicate(defenses) | ||||
|     defenses.forEach(armeDefense => { | ||||
|       // Ajout du # d'utilisation ce round | ||||
|       // Ajout du # d'utilisation ce round   | ||||
|       armeDefense.nbUsage = defender.getItemUse(armeDefense.id) | ||||
|       armeDefense.typeParade = RdDItemArme.defenseArmeParade(armeAttaque, armeDefense) | ||||
|     }) | ||||
|   | ||||
| @@ -9,7 +9,7 @@ export class RdDCompendiumOrganiser { | ||||
|     console.log('onRenderCompendium', compendium, html, compendiumData); | ||||
|     const pack = compendium.collection | ||||
|     if (pack.metadata.system === SYSTEM_RDD) { | ||||
|       $(html).find('.directory-item').each((i, element) => { | ||||
|       html.find('.directory-item').each((i, element) => { | ||||
|         RdDCompendiumOrganiser.setEntityTypeName(pack, element); | ||||
|       }); | ||||
|     } | ||||
| @@ -26,7 +26,7 @@ export class RdDCompendiumOrganiser { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|  | ||||
|    | ||||
|   static getEntityTypeLabel(entity) { | ||||
|     const documentName = entity?.documentName | ||||
|     const type = entity?.type | ||||
|   | ||||
| @@ -12,7 +12,7 @@ const imgHeures = [1, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12].map(heure => { | ||||
| const imgSigneDragon = imgHeures[4] | ||||
|  | ||||
| /** De pour les jets de rencontre */ | ||||
| export class DeTMR extends foundry.dice.terms.Die { | ||||
| export class DeTMR extends Die { | ||||
|   /** @override */ | ||||
|   static DENOMINATION = "t"; | ||||
|  | ||||
| @@ -50,7 +50,7 @@ export class DeTMR extends foundry.dice.terms.Die { | ||||
| } | ||||
|  | ||||
| /** DeDraconique pour le D8 sans limite avec 8=>0 */ | ||||
| export class DeDraconique extends foundry.dice.terms.Die { | ||||
| export class DeDraconique extends Die { | ||||
|   /** @override */ | ||||
|   static DENOMINATION = "r"; | ||||
|  | ||||
| @@ -89,7 +89,7 @@ export class DeDraconique extends foundry.dice.terms.Die { | ||||
| } | ||||
|  | ||||
| /** De 12 avec les heures */ | ||||
| export class DeHeure extends foundry.dice.terms.Die { | ||||
| export class DeHeure extends Die { | ||||
|  | ||||
|   /** @override */ | ||||
|   static DENOMINATION = "h"; | ||||
|   | ||||
| @@ -15,36 +15,36 @@ export class RdDEmpoignade { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static registerChatCallbacks(html) { | ||||
|     $(html).on("click", '.defense-empoignade-cac', event => { | ||||
|     html.on("click", '.defense-empoignade-cac', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       let defenseMode = event.currentTarget.attributes['data-defense-mode'].value | ||||
|       RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Corps à corps", "melee") | ||||
|     }); | ||||
|     $(html).on("click", '.defense-empoignade-esquive', event => { | ||||
|     html.on("click", '.defense-empoignade-esquive', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       let defenseMode = event.currentTarget.attributes['data-defense-mode'].value | ||||
|       RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Esquive", "derobee") | ||||
|     }); | ||||
|     $(html).on("click", '.empoignade-poursuivre', event => { | ||||
|     html.on("click", '.empoignade-poursuivre', event => { | ||||
|       let attackerId = event.currentTarget.attributes['data-attackerId'].value | ||||
|       let defenderId = event.currentTarget.attributes['data-defenderId'].value | ||||
|       RdDEmpoignade.onAttaqueEmpoignadeValidee(game.actors.get(attackerId), game.actors.get(defenderId)) | ||||
|     }); | ||||
|     $(html).on("click", '.empoignade-entrainer-sol', event => { | ||||
|     html.on("click", '.empoignade-entrainer-sol', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       RdDEmpoignade.entrainerAuSol(rollData) | ||||
|       ChatUtility.removeChatMessageId(chatMessage.id) | ||||
|     }); | ||||
|     $(html).on("click", '.empoignade-projeter-sol', event => { | ||||
|     html.on("click", '.empoignade-projeter-sol', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       RdDEmpoignade.projeterAuSol(rollData) | ||||
|       ChatUtility.removeChatMessageId(chatMessage.id) | ||||
|     }); | ||||
|     $(html).on("change", '.empoignade-perte-endurance', event => { | ||||
|     html.on("change", '.empoignade-perte-endurance', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       if (event.currentTarget.value && event.currentTarget.value != "none") { | ||||
|   | ||||
| @@ -54,7 +54,7 @@ import { RdDItemSouffle } from "./item/souffle.js" | ||||
|  | ||||
| import { RdDRencontre } from "./item/rencontre.js" | ||||
|  | ||||
| import { RdDItemSheetV1 } from "./item-sheet.js" | ||||
| import { RdDItemSheet } from "./item-sheet.js" | ||||
| import { RdDBlessureItemSheet } from "./item/sheet-blessure.js" | ||||
| import { RdDServiceItemSheet } from "./item/sheet-service.js" | ||||
| import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js" | ||||
| @@ -80,10 +80,6 @@ import { RdDItemPotion } from "./item/potion.js" | ||||
| import { RdDItemGemme } from "./item/gemme.js" | ||||
| import { RdDGemmeItemSheet } from "./item/sheet-gemme.js" | ||||
|  | ||||
| import * as models from "./models/_module.mjs" | ||||
| import * as items from "./documents/_module.mjs" | ||||
| import * as sheets from "./applications/sheets/_module.mjs" | ||||
|  | ||||
| /** | ||||
|  * RdD system | ||||
|  * Author: LeRatierBretonnien | ||||
| @@ -104,9 +100,6 @@ export class SystemReveDeDragon { | ||||
|     this.RdDHotbar = RdDHotbar | ||||
|     this.RdDStatBlockParser = RdDStatBlockParser | ||||
|     this.itemClasses = { | ||||
|       monnaie: items.RdDItemMonnaie, | ||||
|       munition: items.RdDItemMunition, | ||||
|       tarot: items.RdDModelTarot, | ||||
|       armure: RdDItemArmure, | ||||
|       blessure: RdDItemBlessure, | ||||
|       gemme: RdDItemGemme, | ||||
| @@ -136,9 +129,6 @@ export class SystemReveDeDragon { | ||||
|   /* -------------------------------------------- */ | ||||
|   onInit() { | ||||
|     game.system.rdd = this | ||||
|  | ||||
|     globalThis.RdD = game.system | ||||
|  | ||||
|     this.AppAstrologie = AppAstrologie | ||||
|  | ||||
|     console.log(`Initializing Reve de Dragon System Settings`) | ||||
| @@ -163,7 +153,7 @@ export class SystemReveDeDragon { | ||||
|     this.initSettings() | ||||
|  | ||||
|     /* -------------------------------------------- */ | ||||
|     // Set an initiative formula for the system | ||||
|     // Set an initiative formula for the system  | ||||
|     CONFIG.Combat.initiative = { formula: "1+(1d6/10)", decimals: 2 } | ||||
|  | ||||
|     /* -------------------------------------------- */ | ||||
| @@ -185,11 +175,6 @@ export class SystemReveDeDragon { | ||||
|     console.log(`Initializing Reve de Dragon Documents`) | ||||
|     CONFIG.Actor.documentClass = RdDBaseActor | ||||
|     CONFIG.Item.documentClass = RdDItem | ||||
|     CONFIG.Item.dataModels = { | ||||
|       monnaie: models.RdDModelMonnaie, | ||||
|       munition: models.RdDModelMunition, | ||||
|       tarot: models.RdDModelTarot, | ||||
|     } | ||||
|     CONFIG.RDD = { | ||||
|       resolutionTable: RdDResolutionTable.resolutionTable, | ||||
|       carac_array: RdDUtility.getCaracArray(), | ||||
| @@ -199,51 +184,45 @@ export class SystemReveDeDragon { | ||||
|  | ||||
|     /* -------------------------------------------- */ | ||||
|     // Register sheet application classes | ||||
|     foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDCommerceSheet, { types: ["commerce"], makeDefault: true }) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorSheet, { types: ["personnage"], makeDefault: true }) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDCreatureSheet, { types: ["creature"], makeDefault: true }) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true }) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true }) | ||||
|     foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet) | ||||
|     Actors.unregisterSheet("core", ActorSheet) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDCommerceSheet, { types: ["commerce"], makeDefault: true }) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDActorSheet, { types: ["personnage"], makeDefault: true }) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDCreatureSheet, { types: ["creature"], makeDefault: true }) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true }) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true }) | ||||
|     Items.unregisterSheet("core", ItemSheet) | ||||
|     RdDActorExportSheet.init() | ||||
|  | ||||
|     foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, { | ||||
|     Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, { | ||||
|       types: [ | ||||
|         "objet", "arme", "armure", "livre", "nourritureboisson", | ||||
|         "objet", "arme", "armure", "livre", "munition", | ||||
|         "monnaie", "nourritureboisson", | ||||
|       ], | ||||
|       makeDefault: true | ||||
|     }) | ||||
|  | ||||
|     sheets.RdDItemBaseSheet.registerAll( | ||||
|       sheets.RdDMonnaieSheet, | ||||
|       sheets.RdDMunitionSheet, | ||||
|       sheets.RdDTarotSheet | ||||
|     ) | ||||
|  | ||||
|     foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, { | ||||
|     Items.registerSheet(SYSTEM_RDD, RdDItemSheet, { | ||||
|       types: [ | ||||
|         "competence", "competencecreature", | ||||
|         "recettealchimique", "musique", "chant", "danse", "jeu", "race", | ||||
|         "recettecuisine", "oeuvre", "meditation", | ||||
|         "queue", "ombre", "souffle", "tete", "casetmr", "sort", "sortreserve", | ||||
|         "nombreastral", "tache", "maladie", "poison", "possession", | ||||
|         "extraitpoetique", "empoignade" | ||||
|         "tarot", "extraitpoetique", "empoignade" | ||||
|       ], | ||||
|       makeDefault: true | ||||
|     }) | ||||
|  | ||||
|     RdDItemSheetV1.register(RdDBlessureItemSheet) | ||||
|     RdDItemSheetV1.register(RdDConteneurItemSheet) | ||||
|     RdDItemSheetV1.register(RdDFauneItemSheet) | ||||
|     RdDItemSheetV1.register(RdDGemmeItemSheet) | ||||
|     RdDItemSheetV1.register(RdDHerbeItemSheet) | ||||
|     RdDItemSheetV1.register(RdDIngredientItemSheet) | ||||
|     RdDItemSheetV1.register(RdDPlanteItemSheet) | ||||
|     RdDItemSheetV1.register(RdDPotionItemSheet) | ||||
|     RdDItemSheetV1.register(RdDRencontreItemSheet) | ||||
|     RdDItemSheetV1.register(RdDServiceItemSheet) | ||||
|     RdDItemSheetV1.register(RdDSigneDraconiqueItemSheet) | ||||
|      | ||||
|     RdDItemSheet.register(RdDBlessureItemSheet) | ||||
|     RdDItemSheet.register(RdDConteneurItemSheet) | ||||
|     RdDItemSheet.register(RdDFauneItemSheet) | ||||
|     RdDItemSheet.register(RdDGemmeItemSheet) | ||||
|     RdDItemSheet.register(RdDHerbeItemSheet) | ||||
|     RdDItemSheet.register(RdDIngredientItemSheet) | ||||
|     RdDItemSheet.register(RdDPlanteItemSheet) | ||||
|     RdDItemSheet.register(RdDPotionItemSheet) | ||||
|     RdDItemSheet.register(RdDRencontreItemSheet) | ||||
|     RdDItemSheet.register(RdDServiceItemSheet) | ||||
|     RdDItemSheet.register(RdDSigneDraconiqueItemSheet) | ||||
|     RdDJournalSheet.register() | ||||
|  | ||||
|     // préparation des différents modules | ||||
|   | ||||
| @@ -268,7 +268,7 @@ export class RdDResolutionTable { | ||||
|     maxCarac = Math.min(maxCarac, minCarac + 20); | ||||
|     minLevel = Math.max(minLevel, -10); | ||||
|     maxLevel = Math.max(Math.min(maxLevel, 30), minLevel + colonnes); | ||||
|     return await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/resolution-table.hbs', { | ||||
|     return await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/resolution-table.hbs', { | ||||
|       carac: carac, | ||||
|       difficulte: level, | ||||
|       min: minLevel, | ||||
|   | ||||
| @@ -12,6 +12,6 @@ export class RdDRollResult { | ||||
|  | ||||
|   static async buildRollDataHtml(rollData, template = 'chat-resultat-general.hbs') { | ||||
|     rollData.show = rollData.show || {}; | ||||
|     return await foundry.applications.handlebars.renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData); | ||||
|     return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -22,7 +22,7 @@ export class RdDRoll extends Dialog { | ||||
|     RdDRoll._ensureCorrectAction(action); | ||||
|     RdDRoll._setDefaultOptions(actor, rollData); | ||||
|  | ||||
|     const html = await foundry.applications.handlebars.renderTemplate(dialogConfig.html, rollData); | ||||
|     const html = await renderTemplate(dialogConfig.html, rollData); | ||||
|  | ||||
|     let options = { classes: ["rdd-roll-dialog"], width: 650, height: 'fit-content', 'z-index': 99999, close: html => { } }; | ||||
|     if (dialogConfig.close) { | ||||
| @@ -40,7 +40,7 @@ export class RdDRoll extends Dialog { | ||||
|       etat: actor.getEtatGeneral(), | ||||
|       moral: actor.getMoralTotal(), /* La valeur du moral pour les jets de volonté */ | ||||
|       amoureux: actor.listeSuivants(it => it.coeur > 0), | ||||
|       carac: foundry.utils.duplicate(actor.system.carac), | ||||
|       carac: actor.system.carac, | ||||
|       finalLevel: 0, | ||||
|       diffConditions: 0, | ||||
|       diffLibre: rollData.competence?.system.default_diffLibre ?? 0, | ||||
| @@ -145,7 +145,7 @@ export class RdDRoll extends Dialog { | ||||
|     } | ||||
|     if (this.rollData.selectedSort) { | ||||
|       this.setSelectedSort(this.rollData.selectedSort); | ||||
|       this.html.find(".draconic").val(this.rollData.selectedSort.system.listIndex); // Uniquement a la selection du sort, pour permettre de changer | ||||
|       this.html.find(".draconic").val(this.rollData.selectedSort.system.listIndex); // Uniquement a la selection du sort, pour permettre de changer  | ||||
|     } | ||||
|     RdDItemSort.setCoutReveReel(this.rollData.selectedSort); | ||||
|     this.html.find("[name='diffLibre']").val(Misc.toInt(this.rollData.diffLibre)); | ||||
| @@ -344,7 +344,7 @@ export class RdDRoll extends Dialog { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async buildAjustements(rollData) { | ||||
|     return await foundry.applications.handlebars.renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.hbs`, rollData); | ||||
|     return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.hbs`, rollData); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   | ||||
| @@ -3,11 +3,11 @@ import { RdDItem } from "./item.js"; | ||||
|  | ||||
| export class RdDSheetUtility { | ||||
|  | ||||
|   static getOptions(document, editable) { | ||||
|   static mergeDocumentRights(options, document, editable) { | ||||
|     const userRightLevel = game.user.isGM | ||||
|       ? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER | ||||
|       : document.getUserLevel(game.user); | ||||
|     return { | ||||
|     let newOptions = { | ||||
|       isGM: game.user.isGM, | ||||
|       isOwned: document.parent ? true : false, | ||||
|       editable: editable, | ||||
| @@ -16,15 +16,10 @@ export class RdDSheetUtility { | ||||
|       isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER, | ||||
|       isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   static mergeDocumentRights(options, document, editable) { | ||||
|     const newOptions = RdDSheetUtility.getOptions(document, editable); | ||||
|     foundry.utils.mergeObject(options, newOptions); | ||||
|     return options; | ||||
|   } | ||||
|  | ||||
|  | ||||
|   static getItem(event, actor) { | ||||
|     return actor.items.get(RdDSheetUtility.getItemId(event)) | ||||
|   } | ||||
|   | ||||
| @@ -47,7 +47,7 @@ export class RdDTMRDialog extends Dialog { | ||||
|  | ||||
|   static async create(actor, tmrData) { | ||||
|     await PixiTMR.init() | ||||
|     let html = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs', tmrData); | ||||
|     let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs', tmrData); | ||||
|     if (tmrData.mode != 'visu' && !game.user.isGM) { | ||||
|       ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() }); | ||||
|     } | ||||
| @@ -345,16 +345,15 @@ export class RdDTMRDialog extends Dialog { | ||||
|     } | ||||
|     this.descenteTMR = true; | ||||
|     if (this.actor.tmrApp) { | ||||
|       this.actor.tmrApp = undefined // Cleanup reference | ||||
|       const appliquerFatigue = ReglesOptionnelles.isUsing("appliquer-fatigue") | ||||
|       await this.actor.santeIncDec( | ||||
|         appliquerFatigue ? "fatigue" : "endurance", | ||||
|         (appliquerFatigue ? 1 : -1) * this.cumulFatigue) | ||||
|       this.actor.tmrApp = undefined; // Cleanup reference | ||||
|       if (!this.viewOnly) { | ||||
|         await this.actor.setEffect(STATUSES.StatusDemiReve, false) | ||||
|         await this.actor.setEffect(STATUSES.StatusDemiReve, false); | ||||
|         this.$tellToUserAndGM(message) | ||||
|       } | ||||
|  | ||||
|       const appliquerFatigue = ReglesOptionnelles.isUsing("appliquer-fatigue"); | ||||
|       await this.actor.santeIncDec( | ||||
|         appliquerFatigue ? "fatigue" : "endurance", | ||||
|         (appliquerFatigue ? 1 : -1) * this.cumulFatigue); | ||||
|     } | ||||
|     this.pixiTMR.close(); | ||||
|     this.pixiTMR = undefined | ||||
| @@ -508,7 +507,7 @@ export class RdDTMRDialog extends Dialog { | ||||
|  | ||||
|     ChatMessage.create({ | ||||
|       whisper: ChatUtility.getOwners(this.actor), | ||||
|       content: await foundry.applications.handlebars.renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData) | ||||
|       content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData) | ||||
|     }); | ||||
|  | ||||
|     this.$updateValuesDisplay(); | ||||
|   | ||||
| @@ -14,8 +14,8 @@ export class RdDTokenHud { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static async removeExtensionHud(app, html, tokenId) { | ||||
|     $(html).find('.control-icon.rdd-combat').remove(); | ||||
|     $(html).find('.control-icon.rdd-initiative').remove(); | ||||
|     html.find('.control-icon.rdd-combat').remove(); | ||||
|     html.find('.control-icon.rdd-initiative').remove(); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -50,7 +50,7 @@ export class RdDTokenHud { | ||||
|         { name: 'Initiative +1', command: 'inc', value: 0.01 }, | ||||
|         { name: 'Initiative -1', command: 'dec', value: -0.01 }] | ||||
|     }; | ||||
|     const controlIconCombat = $(html).find('.control-icon[data-action=combat]'); | ||||
|     const controlIconCombat = html.find('.control-icon[data-action=combat]'); | ||||
|     await RdDTokenHud._configureSubMenu(controlIconCombat, | ||||
|       'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs', | ||||
|       hudData, | ||||
| @@ -69,7 +69,7 @@ export class RdDTokenHud { | ||||
|  | ||||
|   static async addExtensionHudCombat(html, combatant, token, actions) { | ||||
|     const hudData = { combatant, token, actions, commandes: [] }; | ||||
|     const controlIconTarget = $(html).find('.control-icon[data-action=target]'); | ||||
|     const controlIconTarget = html.find('.control-icon[data-action=target]'); | ||||
|     await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs', hudData, | ||||
|       (event) => { | ||||
|         const actionIndex = event.currentTarget.attributes['data-action-index']?.value; | ||||
| @@ -112,8 +112,7 @@ export class RdDTokenHud { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static async addTokenHudExtensions(app, html, tokenId) { | ||||
|     console.log(`Adding token HUD extensions for token ${tokenId}`); | ||||
|     const controlIconCombat = $(html).find('.control-icon[data-action=combat]'); | ||||
|     const controlIconCombat = html.find('.control-icon[data-action=combat]'); | ||||
|     if (controlIconCombat.length > 0) { | ||||
|       controlIconCombat.click(event => { | ||||
|         if (event.currentTarget.className.includes('active')) { | ||||
| @@ -130,7 +129,7 @@ export class RdDTokenHud { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) { | ||||
|     const hud = $(await foundry.applications.handlebars.renderTemplate(template, hudData)); | ||||
|     const hud = $(await renderTemplate(template, hudData)); | ||||
|     const list = hud.find('div.rdd-hud-list'); | ||||
|  | ||||
|     RdDTokenHud._toggleHudListActive(hud, list); | ||||
|   | ||||
| @@ -349,7 +349,7 @@ export class RdDUtility { | ||||
|     Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type)); | ||||
|     Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord)); | ||||
|  | ||||
|     foundry.applications.handlebars.loadTemplates(templatePaths); | ||||
|     loadTemplates(templatePaths); | ||||
|   } | ||||
|  | ||||
|   static getItem(itemId, actorId = undefined) { | ||||
| @@ -733,14 +733,14 @@ export class RdDUtility { | ||||
|     RdDTextEditor.registerChatCallbacks(html) | ||||
|  | ||||
|     // Gestion spécifique message passeurs | ||||
|     $(html).on("click", '.tmr-passeur-coord a', event => { | ||||
|     html.on("click", '.tmr-passeur-coord a', event => { | ||||
|       let coord = event.currentTarget.attributes['data-tmr-coord'].value; | ||||
|       let actorId = event.currentTarget.attributes['data-actor-id'].value; | ||||
|       let actor = game.actors.get(actorId); | ||||
|       actor.tmrApp.positionnerDemiReve(coord); | ||||
|     }); | ||||
|     // Gestion spécifique des sorts en réserve multiples (ie têtes) | ||||
|     $(html).on("click", '.declencher-sort-reserve', event => { | ||||
|     html.on("click", '.declencher-sort-reserve', event => { | ||||
|       let coord = event.currentTarget.attributes['data-tmr-coord'].value; | ||||
|       let sortId = event.currentTarget.attributes['data-sort-id'].value; | ||||
|       let actorId = event.currentTarget.attributes['data-actor-id'].value; | ||||
| @@ -750,7 +750,7 @@ export class RdDUtility { | ||||
|     }); | ||||
|  | ||||
|     // gestion bouton tchat Possession | ||||
|     $(html).on("click", '.defense-possession', event => { | ||||
|     html.on("click", '.defense-possession', event => { | ||||
|       let attackerId = event.currentTarget.attributes['data-attackerId'].value | ||||
|       let defenderId = event.currentTarget.attributes['data-defenderId'].value | ||||
|       let possessionId = event.currentTarget.attributes['data-possessionId'].value | ||||
| @@ -758,16 +758,16 @@ export class RdDUtility { | ||||
|     }); | ||||
|  | ||||
|     // gestion bouton tchat Acheter | ||||
|     $(html).on("click", '.button-acheter', event => { | ||||
|     html.on("click", '.button-acheter', event => { | ||||
|       const venteData = DialogItemAchat.preparerAchat(event.currentTarget); | ||||
|       if (venteData) { | ||||
|         DialogItemAchat.onAcheter(venteData); | ||||
|       } | ||||
|     }); | ||||
|     $(html).on("click", '.button-creer-acteur', event => RdDNameGen.onCreerActeur(event)); | ||||
|     html.on("click", '.button-creer-acteur', event => RdDNameGen.onCreerActeur(event)); | ||||
|  | ||||
|     // Gestion du bouton payer | ||||
|     $(html).on("click", '.payer-button', event => { | ||||
|     html.on("click", '.payer-button', event => { | ||||
|       let sommeAPayer = Number(event.currentTarget.attributes['data-somme-a-payer']?.value ?? 0); | ||||
|       let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:"); | ||||
|       if (actor) { | ||||
| @@ -775,8 +775,8 @@ export class RdDUtility { | ||||
|         ChatUtility.removeChatMessageId(RdDUtility.findChatMessageId(event.currentTarget)); | ||||
|       } | ||||
|     }); | ||||
|     $(html).on("click", '.rdd-world-content-link', async event => { | ||||
|       const htmlElement = $(html).find(event.currentTarget); | ||||
|     html.on("click", '.rdd-world-content-link', async event => { | ||||
|       const htmlElement = html.find(event.currentTarget); | ||||
|       const id = htmlElement?.data("id"); | ||||
|       const doctype = htmlElement?.data("doctype"); | ||||
|       switch (doctype ?? 'Item') { | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import { Misc } from "../misc.js" | ||||
| export const EXPORT_CSV_SCRIPTARIUM = 'export-csv-scriptarium' | ||||
|  | ||||
| const OPTIONS_AVANCEES = [ | ||||
|   { group: 'Menus', name: EXPORT_CSV_SCRIPTARIUM, descr: "Proposer le menu d'export csv Scriptarium", default: false }, | ||||
|   { group: 'Menus', name: EXPORT_CSV_SCRIPTARIUM, descr: "Proposer le menu d'export csv Scriptarium" }, | ||||
| ] | ||||
|  | ||||
| export class OptionsAvancees extends FormApplication { | ||||
| @@ -24,6 +24,10 @@ export class OptionsAvancees extends FormApplication { | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   constructor(...args) { | ||||
|     super(...args) | ||||
|   } | ||||
|  | ||||
|   static _getId(name) { | ||||
|     return `rdd-advanced-${name}` | ||||
|   } | ||||
| @@ -71,7 +75,7 @@ export class OptionsAvancees extends FormApplication { | ||||
|   } | ||||
|  | ||||
|   activateListeners(html) { | ||||
|     $(html).find(".select-option").click((event) => { | ||||
|     html.find(".select-option").click((event) => { | ||||
|       if (event.currentTarget.attributes.name) { | ||||
|         let id = event.currentTarget.attributes.name.value | ||||
|         let isChecked = event.currentTarget.checked | ||||
| @@ -84,3 +88,4 @@ export class OptionsAvancees extends FormApplication { | ||||
|     this.close() | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -19,12 +19,12 @@ const listeReglesOptionnelles = [ | ||||
|   { group: 'Règles de combat', name: 'categorieParade',             descr: "Le défenseur doit obtenir une significative en cas de parade avec des armes de catégories différentes" }, | ||||
|   { group: 'Règles de combat', name: 'tripleSignificative',         descr: "En cas de demi-surprise, d'attaque particulière en finesse, et de catégories d'armes différentes, le défenseur doit obtenir 1/8 des chances de succès" }, | ||||
|   { group: 'Règles de combat', name: 'validation-encaissement-gr',  descr: "Le Gardien des Rêves doit valider les jets d'encaissement et peut les changer.", default: false }, | ||||
|  | ||||
|    | ||||
|   { group: 'Automatisation', name: 'chateau-dormant-gardien',       descr: "Saisie des heures de sommeil/jets de moral par le gardien des rêves", default: true }, | ||||
|  | ||||
|   { group: 'Affichage', name: 'afficher-colonnes-reussite',         descr: "Afficher le nombre de colonnes de réussite ou d'échec", default: false }, | ||||
|   { group: 'Affichage', name: 'afficher-prix-joueurs',              descr: "Afficher le prix de l'équipement des joueurs", uniquementJoueur: true}, | ||||
|  | ||||
|    | ||||
|   { group: 'Confirmations', name: 'confirmer-combat-sans-cible',         descr: "Confirmer avant une attaque sans cible", scope: "client"}, | ||||
|   { group: 'Confirmations', name: 'confirmation-tmr',                    descr: "Confirmer pour monter dans les TMR", scope: "client"}, | ||||
|   { group: 'Confirmations', name: 'confirmation-tmr-rencontre',          descr: "Confirmer pour monter dans les TMR avec rencontre en attente", scope: "client"}, | ||||
| @@ -112,7 +112,7 @@ export class ReglesOptionnelles extends FormApplication { | ||||
|   } | ||||
|  | ||||
|   activateListeners(html) { | ||||
|     $(html).find(".select-option").click((event) => { | ||||
|     html.find(".select-option").click((event) => { | ||||
|       if (event.currentTarget.attributes.name) { | ||||
|         let id = event.currentTarget.attributes.name.value; | ||||
|         let isChecked = event.currentTarget.checked; | ||||
| @@ -125,3 +125,4 @@ export class ReglesOptionnelles extends FormApplication { | ||||
|     this.close(); | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -131,7 +131,7 @@ export class StatusEffects extends FormApplication { | ||||
|   } | ||||
|  | ||||
|   activateListeners(html) { | ||||
|     $(html).find(".select-effect").click((event) => { | ||||
|     html.find(".select-effect").click((event) => { | ||||
|       let id = event.currentTarget.attributes.name?.value; | ||||
|       if (id) { | ||||
|         let selected = StatusEffects._getUseStatusEffects(); | ||||
| @@ -151,3 +151,4 @@ export class StatusEffects extends FormApplication { | ||||
|     this.close(); | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -184,7 +184,7 @@ export class SystemCompendiums extends FormApplication { | ||||
|   } | ||||
|  | ||||
|   activateListeners(html) { | ||||
|     $(html).find("select.system-compendium-setting").change((event) => { | ||||
|     html.find("select.system-compendium-setting").change((event) => { | ||||
|       const compendium = $(event.currentTarget).data('compendium') | ||||
|       const value = $(event.currentTarget).val(); | ||||
|       const systemCompendium = CONFIGURABLE_COMPENDIUMS[compendium]; | ||||
|   | ||||
| @@ -9,7 +9,7 @@ export class DialogChateauDormant extends Dialog { | ||||
|       motifStress: `Nuit du ${date}`, | ||||
|       finChateauDormant: game.system.rdd.calendrier.getTimestampFinChateauDormant() | ||||
|     }; | ||||
|     const html = await foundry.applications.handlebars.renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-chateau-dormant.hbs", | ||||
|     const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-chateau-dormant.hbs", | ||||
|       dialogData); | ||||
|  | ||||
|     new DialogChateauDormant(dialogData, html) | ||||
| @@ -36,7 +36,7 @@ export class DialogChateauDormant extends Dialog { | ||||
|  | ||||
|   activateListeners(html) { | ||||
|     super.activateListeners(html); | ||||
|     this.html = $(html); | ||||
|     this.html = html; | ||||
|     this.html.find('input.sommeil-insomnie').change(event => this.onInsomnie(event)); | ||||
|     this._activateListenerOnActorMoral(this.html); | ||||
|   } | ||||
|   | ||||
| @@ -15,8 +15,6 @@ const TEMPLATE_CALENDRIER = "systems/foundryvtt-reve-de-dragon/templates/time/ca | ||||
| const INITIAL_CALENDAR_POS = { top: 200, left: 200, horlogeAnalogique: true }; | ||||
| /* -------------------------------------------- */ | ||||
| export class RdDCalendrier extends Application { | ||||
|   static _warnedAppV1 = true | ||||
|  | ||||
|   static initSettings() { | ||||
|     game.settings.register(SYSTEM_RDD, "liste-nombre-astral", { | ||||
|       name: "liste-nombre-astral", | ||||
| @@ -244,7 +242,7 @@ export class RdDCalendrier extends Application { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * | ||||
|    *  | ||||
|    * @param {*} indexDate la date pour laquelle obtenir le nombre astral. Si undefined, on prend la date du jour | ||||
|    * @returns le nombre astral pour la date, ou pour la date du jour si la date n'est pas fournie. | ||||
|    *  Si aucun nombre astral n'est trouvé, retourne 0 (cas où l'on demanderait un nombre astral en dehors des 12 jours courant et à venir) | ||||
|   | ||||
| @@ -22,8 +22,8 @@ export class TMRRencontres { | ||||
|   /* -------------------------------------------- */ | ||||
|   /** | ||||
|    * Retourne une recontre en fonction de la case et du tirage | ||||
|    * @param {*} terrain | ||||
|    * @param {*} forcedRoll | ||||
|    * @param {*} terrain  | ||||
|    * @param {*} forcedRoll  | ||||
|    */ | ||||
|   async rollRencontre(terrain, forcedRoll) { | ||||
|     const tmrType = TMRUtility.findTMRLike(terrain, { inclusMauvaise: true })?.type | ||||
| @@ -102,7 +102,7 @@ export class TMRRencontres { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async $chatRolledRencontre(row, rencontre, tmr) { | ||||
|     const flavorContent = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll-rencontre.hbs', | ||||
|     const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll-rencontre.hbs', | ||||
|       { | ||||
|         roll: row.roll, | ||||
|         rencontre, | ||||
| @@ -113,7 +113,7 @@ export class TMRRencontres { | ||||
|       }); | ||||
|     const messageData = { | ||||
|       user: game.user.id, | ||||
|       type: CONST.CHAT_MESSAGE_STYLES.ROLL, | ||||
|       type: CONST.CHAT_MESSAGE_TYPES.ROLL, | ||||
|       roll: row.roll, | ||||
|       sound: CONFIG.sounds.dice, | ||||
|       content: flavorContent | ||||
|   | ||||
| @@ -3,9 +3,9 @@ import { Draconique } from "./draconique.js"; | ||||
| import { PixiTMR } from "./pixi-tmr.js"; | ||||
|  | ||||
| const IMAGE_CARTE_TMR = 'image-carte-tmr'; | ||||
| const TMR_V1 = "systems/foundryvtt-reve-de-dragon/assets/ui/tmr-v1.webp"; | ||||
| const TMR_V2 = "systems/foundryvtt-reve-de-dragon/assets/ui/tmr-v2.webp"; | ||||
| const TMR_V3_COULEUR = "systems/foundryvtt-reve-de-dragon/assets/ui/tmr-v3-couleur.webp"; | ||||
| const TMR_V1 = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v1.webp"; | ||||
| const TMR_V2 = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v2.webp"; | ||||
| const TMR_V3_COULEUR = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v3-couleur.webp"; | ||||
|  | ||||
| export class CarteTmr extends Draconique { | ||||
|  | ||||
|   | ||||
| @@ -106,9 +106,9 @@ export class DialogFatigueVoyage extends Dialog { | ||||
|  | ||||
|   activateListeners(html) { | ||||
|     if (this.html == undefined) { | ||||
|       $(html).find('select[name="code-terrain"]').trigger("focus") | ||||
|       html.find('select[name="code-terrain"]').trigger("focus") | ||||
|     } | ||||
|     this.html = $(html); | ||||
|     this.html = html; | ||||
|     super.activateListeners(html); | ||||
|  | ||||
|     this.html.find('select[name="code-terrain"]').change(event => this.changeParameters()) | ||||
|   | ||||
							
								
								
									
										24
									
								
								package.json
									
									
									
									
									
								
							
							
						
						| @@ -1,37 +1,15 @@ | ||||
| { | ||||
|   "name": "foundryvtt-reve-de-dragon", | ||||
|   "description": "<h2><em>Rêve de Dragon</em> pour Foundry Virtual TableTop</h2>", | ||||
|   "private": true, | ||||
|   "version": "1.0.0", | ||||
|   "license": "Creative Commons", | ||||
|   "main": "gulpfile.js", | ||||
|   "scripts": { | ||||
|     "build": "npx vite build", | ||||
|     "gulp": "gulp", | ||||
|     "run": "npx vite serve", | ||||
|     "packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs", | ||||
|     "packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs", | ||||
|     "unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@eslint/js": "^9.8.0", | ||||
|     "@foundryvtt/foundryvtt-cli": "^1.0.3", | ||||
|     "commander": "^11.1.0", | ||||
|     "eslint": "^9.9.0", | ||||
|     "eslint-config-prettier": "^9.1.0", | ||||
|     "eslint-plugin-jsdoc": "^48.11.0", | ||||
|     "eslint-plugin-prettier": "^5.2.1", | ||||
|     "globals": "^15.9.0", | ||||
|     "less": "^4.1.3", | ||||
|     "prettier": "^3.3.3" | ||||
|     "@foundryvtt/foundryvtt-cli": "^1.0.3" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "gulp": "^5.0.0", | ||||
|     "gulp-less": "^5.0.0", | ||||
|     "rollup-plugin-visualizer": "^5.12.0" | ||||
|   }, | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon.git" | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -3,8 +3,8 @@ type: faune | ||||
| img: systems/foundryvtt-reve-de-dragon/icons/faune/ours.webp | ||||
| system: | ||||
|   description: >- | ||||
|     <p>Ours. Forêt, montagne, 300 kg, 600 sust. Surtout recherché | ||||
|     pour sa peau (voir le grizzal, p405).</p> | ||||
|     <p>Ours. Forêt, montagne, 300 kg, 600 sust.Surtout recherché | ||||
|     pour sa peau (voir legrizzal, p405).</p> | ||||
|   descriptionmj: '' | ||||
|   encombrement: 150 | ||||
|   quantite: 1 | ||||
|   | ||||
| @@ -2,7 +2,7 @@ name: Terres médianes du rêve | ||||
| type: script | ||||
| scope: global | ||||
| author: Hp9ImM4o9YRTSdfu | ||||
| img: systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-normal.svg | ||||
| img: systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg | ||||
| command: |- | ||||
|   const selected = game.system.rdd.RdDUtility.getSelectedActor(); | ||||
|   if (!selected) { | ||||
| @@ -18,8 +18,8 @@ command: |- | ||||
|     title: `Monter dans les TMR`, | ||||
|     content: `Monter dans les TMR`, | ||||
|     buttons: { | ||||
|       normale: { label: `normale`, icon: `<img class="button-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-normal.svg" alt="Montée dans les Terres Médianes !"/>`, callback: () => selected.displayTMR("normal") }, | ||||
|       rapide: { label: `rapide`, icon: `<img class="button-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-rapide.svg" alt="Montée accélérée dans les Terres Médianes !"/>`, callback: () => selected.displayTMR("rapide") }, | ||||
|       normale: { label: `normale`, icon: `<img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg" alt="Montée dans les Terres Médianes !"/>`, callback: () => selected.displayTMR("normal") }, | ||||
|       rapide: { label: `rapide`, icon: `<img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg" alt="Montée accélérée dans les Terres Médianes !"/>`, callback: () => selected.displayTMR("rapide") }, | ||||
|     }, | ||||
|   }); | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ sort: 0 | ||||
| pages: | ||||
|   - name: 'Figure: Documentation MJ/Joueurs' | ||||
|     type: image | ||||
|     src: systems/foundryvtt-reve-de-dragon/assets/logo.webp | ||||
|     src: systems/foundryvtt-reve-de-dragon/styles/img/logo.webp | ||||
|     title: | ||||
|       show: false | ||||
|       level: 1 | ||||
| @@ -94,9 +94,9 @@ pages: | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="icons/svg/bones.svg" width="25" height="30" /> Encaisser des dommages</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="icons/svg/regen.svg" width="25" height="30" /> Remise à neuf (Uniquement pour le MJ) pour enlever toutes les blessures/états du personnage.</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="icons/svg/sleep.svg" width="25" height="30" /> Le sommeil (dormir une heure, une nuit, gris rêve)</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-normal.svg" width="25" height="30" /> Montée dans les Terres Médianes</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-rapide.svg" width="25" height="30" /> Montée rapide</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-view.svg" width="25" height="30" /> Regarder ses terres médianes (sans monter)</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg" width="25" height="30" /> Montée dans les Terres Médianes</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg" width="25" height="30" /> Montée rapide</li> | ||||
|         <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-view.svg" width="25" height="30" /> Regarder ses terres médianes (sans monter)</li> | ||||
|         </ul> | ||||
|         <h1>Combat</h1> | ||||
|         <p>Pour l'initiative et les attaques, des options sont disponibles | ||||
| @@ -171,7 +171,7 @@ pages: | ||||
|         <li>Les retours que vous nous ferez via <a href="https://discord.gg/pPSDNJk">discord</a> | ||||
|         (channel #rêve-de-dragon) ;-)</li> | ||||
|         </ul> | ||||
|         <p><img style="border:0;display:block;margin-left:auto;margin-right:auto" src="systems/foundryvtt-reve-de-dragon/assets/rdd_pause.webp" width="210" height="216" /></p> | ||||
|         <p><img style="border:0;display:block;margin-left:auto;margin-right:auto" src="systems/foundryvtt-reve-de-dragon/styles/img/rdd_pause.webp" width="210" height="216" /></p> | ||||
|     _id: p0xOSy6tZwU4DOq5 | ||||
|     image: {} | ||||
|     video: | ||||
|   | ||||
| @@ -5,7 +5,7 @@ sort: 0 | ||||
| pages: | ||||
|   - name: 'Figure: Passeur fou' | ||||
|     type: image | ||||
|     src: systems/foundryvtt-reve-de-dragon/assets/ui/tmp_main_r1.webp | ||||
|     src: systems/foundryvtt-reve-de-dragon/styles/img/ui/tmp_main_r1.webp | ||||
|     title: | ||||
|       show: false | ||||
|       level: 1 | ||||
|   | ||||
| @@ -5,7 +5,7 @@ sort: 0 | ||||
| pages: | ||||
|   - name: 'Figure: Tourbillon rouge' | ||||
|     type: image | ||||
|     src: systems/foundryvtt-reve-de-dragon/assets/ui/tmp_main_r1.webp | ||||
|     src: systems/foundryvtt-reve-de-dragon/styles/img/ui/tmp_main_r1.webp | ||||
|     title: | ||||
|       show: false | ||||
|       level: 1 | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| name: Rêve de Dragon | ||||
| type: rencontre | ||||
| img: systems/foundryvtt-reve-de-dragon/assets/rdd_pause.webp | ||||
| img: systems/foundryvtt-reve-de-dragon/styles/img/rdd_pause.webp | ||||
| system: | ||||
|   description: '' | ||||
|   descriptionmj: '' | ||||
|   | ||||
| @@ -38,7 +38,7 @@ regions: [] | ||||
| ownership: | ||||
|   default: 0 | ||||
| background: | ||||
|   src: systems/foundryvtt-reve-de-dragon/assets/ecran_rdd.webp | ||||
|   src: systems/foundryvtt-reve-de-dragon/styles/img/ecran_rdd.webp | ||||
|   offsetX: 0 | ||||
|   offsetY: 0 | ||||
|   anchorX: 0 | ||||
|   | ||||
							
								
								
									
										4
									
								
								styles/img/.directory
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,4 @@ | ||||
| [Dolphin] | ||||
| Timestamp=2020,11,21,13,59,38 | ||||
| Version=4 | ||||
| VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails | ||||
| Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB | 
| Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB | 
| Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB | 
| Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB | 
| Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB | 
| Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB | 
| Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB | 
| Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB | 
| Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB | 
| Before Width: | Height: | Size: 716 KiB After Width: | Height: | Size: 716 KiB | 
| Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB | 
| Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB | 
| Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |