From 5761587649b50a87225067a4803ee645ad1d66c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Guillois?= Date: Thu, 20 Apr 2023 18:27:54 +0200 Subject: [PATCH] first page --- lang/en.json | 85 +++++++++++++++-- module/sheets/actor-sheet.mjs | 5 +- module/system/config.mjs | 102 ++++++++++----------- module/system/dialogs.mjs | 39 +------- module/system/hooks.mjs | 16 +--- module/totem.mjs | 10 +- template.json | 55 ++++------- templates/actor/actor-character-sheet.html | 94 +++++++++---------- templates/actor/parts/actor-items.html | 1 + 9 files changed, 207 insertions(+), 200 deletions(-) diff --git a/lang/en.json b/lang/en.json index 8882383..8930796 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,11 +1,4 @@ { - "TOTEM.AbilityStr": "Strength", - "TOTEM.AbilityCon": "Constitution", - "TOTEM.AbilityDex": "Dexterity", - "TOTEM.AbilityInt": "Intelligence", - "TOTEM.AbilityWis": "Wisdom", - "TOTEM.AbilityCha": "Charisma", - "TOTEM.AbilityStrAbbr": "str", "TOTEM.AbilityConAbbr": "con", "TOTEM.AbilityDexAbbr": "dex", @@ -13,10 +6,86 @@ "TOTEM.AbilityWisAbbr": "wis", "TOTEM.AbilityChaAbbr": "cha", + "TOTEM.level": "Niveau", + "TOTEM.pool": "Réserve", + "TOTEM.pools": "Réserves", + "TOTEM.self_control": "Sang-Froid", + "TOTEM.effort": "Effort", + "TOTEM.group": "Groupe", + + + "TOTEM.abilities.vigor":"Vigueur", + "TOTEM.abilities.health":"Santé", + "TOTEM.abilities.precision":"Précision", + "TOTEM.abilities.reflexes":"Réflexes", + "TOTEM.abilities.knowledge":"Savoir", + "TOTEM.abilities.perception":"Perception", + "TOTEM.abilities.will":"Volonté", + "TOTEM.abilities.empathy":"Empathie", + "TOTEM.EffectCreate": "Create Effect", "TOTEM.EffectToggle": "Toggle Effect", "TOTEM.EffectEdit": "Edit Effect", "TOTEM.EffectDelete": "Delete Effect", - "TOTEM.Add": "Add" + "TOTEM.Add": "Add", + + "TOTEM.SkillLevel.beginner": "Débutant", + "TOTEM.SkillLevel.proficient": "Confirmé", + "TOTEM.SkillLevel.expert": "Expert", + "TOTEM.SkillLevel.master": "Maître", + "TOTEM.SkillLevel.legend": "Légende", + + "TOTEM.totems.human": "l'Humain", + "TOTEM.totems.scavenger": "le Prédateur", + "TOTEM.totems.symbiote": "le Symbiote", + "TOTEM.totems.parasite": "le Parasite", + "TOTEM.totems.builder": "le Bâtisseur", + "TOTEM.totems.horde": "la Horde", + "TOTEM.totems.hive": "la Ruche", + "TOTEM.totems.solitary": "le Solitaire", + "TOTEM.totems.adapted": "l'Adapté", + + "TOTEM.abilityCategory.physical": "Physiques", + "TOTEM.abilityCategory.manual": "Manuelles", + "TOTEM.abilityCategory.mental": "Mentales", + "TOTEM.abilityCategory.social": "Sociales", + + "TOTEM.skillCategory.man": "L'Homme", + "TOTEM.skillCategory.animal": "L'Animal", + "TOTEM.skillCategory.machine": "La Machine", + "TOTEM.skillCategory.weapon": "L'Arme", + "TOTEM.skillCategory.survival": "La Survie", + "TOTEM.skillCategory.earth": "La Terre", + + "TOTEM.skills.arts":"Arts", + "TOTEM.skills.civilization":"Civilisation", + "TOTEM.skills.psychology":"Psychologie", + "TOTEM.skills.rumors":"Rumeurs", + "TOTEM.skills.healing":"Soins", + "TOTEM.skills.animalism":"Animalisme", + "TOTEM.skills.dissection":"Dissection", + "TOTEM.skills.wildlife":"Faune", + "TOTEM.skills.repulsion":"Répulsion", + "TOTEM.skills.tracks":"Traces", + "TOTEM.skills.crafting":"Artisanat", + "TOTEM.skills.diy":"Bricolage", + "TOTEM.skills.mecanical":"Mécanique", + "TOTEM.skills.driving":"Pilotage", + "TOTEM.skills.technology":"Technologie", + "TOTEM.skills.firearms":"Armes à feu", + "TOTEM.skills.archery":"Armes de tir", + "TOTEM.skills.armory":"Armurerie", + "TOTEM.skills.throwing":"Armes de jet", + "TOTEM.skills.melee":"Mêlée", + "TOTEM.skills.feed":"Alimentation", + "TOTEM.skills.atletics":"Atlétisme", + "TOTEM.skills.brawling":"Corps à corps", + "TOTEM.skills.stealth":"Furtivité", + "TOTEM.skills.alertness":"Vigilance", + "TOTEM.skills.environment":"Environnement", + "TOTEM.skills.flora":"Flote", + "TOTEM.skills.road":"Route", + "TOTEM.skills.toxics":"Toxiques", + "TOTEM.skills.remains":"Vestiges" } \ No newline at end of file diff --git a/module/sheets/actor-sheet.mjs b/module/sheets/actor-sheet.mjs index f4685a2..5285cbd 100644 --- a/module/sheets/actor-sheet.mjs +++ b/module/sheets/actor-sheet.mjs @@ -38,7 +38,8 @@ export class TotemActorSheet extends ActorSheet { // Add the actor's data to context.data for easier access, as well as flags. context.system = actorData.system; context.flags = actorData.flags; - + context.config = CONFIG.TOTEM; + // Prepare character data and items. if (actorData.type == 'character') { this._prepareItems(context); @@ -69,7 +70,7 @@ export class TotemActorSheet extends ActorSheet { _prepareCharacterData(context) { // Handle ability scores. for (let [k, v] of Object.entries(context.system.abilities)) { - v.label = game.i18n.localize(CONFIG.TOTEM.abilities[k]) ?? k; + v.label = game.i18n.localize(context.system.abilities[k].label) ?? k; } } diff --git a/module/system/config.mjs b/module/system/config.mjs index 5aebee7..a785687 100644 --- a/module/system/config.mjs +++ b/module/system/config.mjs @@ -4,63 +4,61 @@ export const TOTEM = {}; * The set of Ability Scores used within the sytem. * @type {Object} */ -/* +TOTEM.SkillLevels = { + 1:{ "label":"TOTEM.SkillLevel.beginner", "dicePool":1, "reroll":0}, + 2:{ "label":"TOTEM.SkillLevel.proficient", "dicePool":1, "reroll":1}, + 3:{ "label":"TOTEM.SkillLevel.expert", "dicePool":2, "reroll":1}, + 4:{ "label":"TOTEM.SkillLevel.master", "dicePool":2, "reroll":2}, + 5:{ "label":"TOTEM.SkillLevel.legend", "dicePool":3, "reroll":2}, +} -TOTEM.nations = { - "istanie1":{ - "label": "Istanie (îles du couchant)", - "cities": ["tanger", "argan", "ar'kobah", "ishandra"] +TOTEM.TotemNumbers = { + 1:{ "label":"TOTEM.totems.human", "key":"human"}, + 2:{ "label":"TOTEM.totems.scavenger", "key":"scavenger"}, + 3:{ "label":"TOTEM.totems.symbiote", "key":"symbiote"}, + 4:{ "label":"TOTEM.totems.parasite", "key":"parasite"}, + 5:{ "label":"TOTEM.totems.builder", "key":"builder"}, + 6:{ "label":"TOTEM.totems.horde", "key":"horde"}, + 7:{ "label":"TOTEM.totems.hive", "key":"hive"}, + 8:{ "label":"TOTEM.totems.solitary", "key":"solitary"}, + 9:{ "label":"TOTEM.totems.adapted", "key":"adapted"} +} + + +TOTEM.abilityCategories = { + "physical": { + "label":"TOTEM.abilityCategory.physical" }, - "istanie2":{ - "label": "Istanie (monts dinariques)", - "cities": ["montenegro", "ishandra"] + "manual": { + "label":"TOTEM.abilityCategory.manual" }, - "istanie3":{ - "label": "Istanie (anatolie)", - "cities": ["ismyr", "istanbul", "ankara"] + "mental": { + "label":"TOTEM.abilityCategory.mental" }, - "pentapolie":{ - "label": "Pentapolie", - "cities": ["serone", "éole", "relais de l'affrevie", "relais de bragee", "géode", "théorie", "démos", "négoce", "lucé"] - }, - "venice":{ - "label": "Venice", - "cities": ["venice"] - }, - "rhodesiennes":{ - "label": "Provinces rhodesiennes", - "cities": ["alsyde", "spicule", "urbs", "les syénites"] - }, - "methalune":{ - "label": "Méthalune", - "cities": ["méthalune", "ferraille"] - }, - "gloriana":{ - "label": "Gloriana", - "cities": ["enclosure", "londres", "camelot", "hivernee"] - }, - "antipolie":{ - "label": "Antipolie", - "cities": ["paris", "ithar","candbury","abaya", "relais d'elphiel", "entrelace", "prague", "vienne"] - }, - "olmune":{ - "label": "Principautés d'Olmune", - "cities": ["entrepont", "olmune","arssens","braysine"] - }, - "lansk":{ - "label": "Lansk", - "cities": ["saint-petersbourg", "hypogée","sancre","moscou", "kiev","kryo"] - }, - "nordanie":{ - "label": "Nordanie", - "cities": ["souspente", "gottenborg","solth", "nacre", "dorvik", "mystille"] - }, - "terraincognita":{ - "label": "Terra Incognita", - "cities": ["chantier de transécryme"] + "social": { + "label":"TOTEM.abilityCategory.social" } +} -} -*/ \ No newline at end of file +TOTEM.skillCategories = { + "man": { + "label":"TOTEM.skillCategory.man" + }, + "animal": { + "label":"TOTEM.skillCategory.animal" + }, + "machine": { + "label":"TOTEM.skillCategory.machine" + }, + "weapon": { + "label":"TOTEM.skillCategory.weapon" + }, + "survival": { + "label":"TOTEM.skillCategory.survival" + }, + "earth": { + "label":"TOTEM.skillCategory.earth" + } +} \ No newline at end of file diff --git a/module/system/dialogs.mjs b/module/system/dialogs.mjs index 39ab57c..4949f29 100644 --- a/module/system/dialogs.mjs +++ b/module/system/dialogs.mjs @@ -1,49 +1,14 @@ -export class WarningDialog extends Dialog { - - constructor(dialogData) { - let options = { classes: ["warning"] }; - let conf = { - title: "Avertissement", - content: dialogData.content - }; - super(conf, options); - this.dialogData = dialogData; - } - - /* -------------------------------------------- */ - activateListeners(html) { - /*super.activateListeners(html); - this.html = html; - this.setEphemere(this.dialogData.signe.system.ephemere); - html.find(".signe-aleatoire").click(event => this.setSigneAleatoire()); - html.find("[name='signe.system.ephemere']").change((event) => this.setEphemere(event.currentTarget.checked)); - html.find(".signe-xp-sort").change((event) => this.onValeurXpSort(event)); - html.find("input.select-actor").change((event) => this.onSelectActor(event)); - html.find("input.select-tmr").change((event) => this.onSelectTmr(event));*/ - } - - - async onSelectActor(event) { - /*const actorId = this.html.find(event.currentTarget)?.data("actor-id"); - const actor = this.dialogData.actors.find(it => it.id == actorId); - if (actor) { - actor.selected = event.currentTarget.checked; - }*/ - } - - - } export class CombatResultDialog extends Dialog { constructor(dialogData, options) { - let options = { classes: ["combat", "result"], ...options }; + /*let options = { classes: ["combat", "result"], ...options }; let conf = { title: "Résultat de la confrontation", content: dialogData.content }; super(conf, options); - this.dialogData = dialogData; + this.dialogData = dialogData;*/ } /* -------------------------------------------- */ diff --git a/module/system/hooks.mjs b/module/system/hooks.mjs index 28292f4..9fc9864 100644 --- a/module/system/hooks.mjs +++ b/module/system/hooks.mjs @@ -14,21 +14,11 @@ export const registerHooks = function () { if ($("#pause").attr("class") !== "paused") return; $(".paused img").attr("src", 'systems/totem/images/pause.webp'); $(".paused img").css({ "opacity": 1}); - $("#pause.paused").css({ "display": "flex", "justify-content": "center" }); - $("#pause.paused figcaption").css({ "width": `256px`, "height": `256px` }); - $("#pause.paused figcaption").text(game.i18n.localize("TOTEM.PausedText")); + $("#pause.paused figcaption").text("En cours de destruction..."); }); - /*Hooks.on("renderPause", ((_app, html) => { - html.find("img").attr("src", "systems/bol/ui/pause2.webp") - })) - - Hooks.on('renderChatLog', (log, html, data) => BoLUtility.chatListeners(html)) - Hooks.on('renderChatMessage', (message, html, data) => BoLUtility.chatMessageHandler(message, html, data)) - */ - console.log("rendering hooks"); - Hooks.on('renderChatLog', (log, html, data) => TotemFight.chatListeners(html)); - Hooks.on('renderChatMessage', (message, html, data) => TotemFight.chatMessageHandler(message, html, data)); + // Hooks.on('renderChatLog', (log, html, data) => TotemFight.chatListeners(html)); + // Hooks.on('renderChatMessage', (message, html, data) => TotemFight.chatMessageHandler(message, html, data)); /** * Create a macro when dropping an entity on the hotbar diff --git a/module/totem.mjs b/module/totem.mjs index 7f0dcff..da1dbc3 100644 --- a/module/totem.mjs +++ b/module/totem.mjs @@ -1,3 +1,7 @@ +import { registerHandlebarsHelpers } from "./system/helpers.mjs"; +import { registerHooks } from "./system/hooks.mjs"; +import { registerSettings } from "./system/settings.mjs"; + // Import document classes. import { TotemActor } from "./documents/actor.mjs"; import { TotemItem } from "./documents/item.mjs"; @@ -6,7 +10,7 @@ import { TotemActorSheet } from "./sheets/actor-sheet.mjs"; import { TotemItemSheet } from "./sheets/item-sheet.mjs"; // Import helper/utility classes and constants. import { preloadHandlebarsTemplates } from "./helpers/templates.mjs"; -import { TOTEM } from "./helpers/config.mjs"; +import { TOTEM } from "./system/config.mjs"; /* -------------------------------------------- */ /* Init Hook */ @@ -44,6 +48,10 @@ Hooks.once('init', async function() { Items.unregisterSheet("core", ItemSheet); Items.registerSheet("totem", TotemItemSheet, { makeDefault: true }); + registerHandlebarsHelpers(); // Register Handlebars helpers + registerHooks(); // register Hooks + registerSettings(); // register Engrenages Settings + // Preload Handlebars templates. return preloadHandlebarsTemplates(); }); diff --git a/template.json b/template.json index ee318dd..18ed818 100644 --- a/template.json +++ b/template.json @@ -21,23 +21,28 @@ "templates": ["base"], "attributes": { "level": { + "label":"TOTEM.level", "value": 1 + }, + "self_control": { + "label":"TOTEM.self_control", + "value": 0, + "min": 0, + "max": 5 + }, + "effort": { + "label":"TOTEM.effort", + "value": 0, + "min": 0, + "max": 5 + }, + "group": { + "label":"TOTEM.group", + "value": 0, + "min": 0, + "max": 5 } - }, - "AbilityCategories": { - "physical": { - "label":"TOTEM.abilityCategory.physical" - }, - "manual": { - "label":"TOTEM.abilityCategory.manual" - }, - "mental": { - "label":"TOTEM.abilityCategory.mental" - }, - "social": { - "label":"TOTEM.abilityCategory.social" - } - }, + }, "abilities": { "vig": { "label":"TOTEM.abilities.vigor", @@ -96,26 +101,6 @@ "category": "social" } }, - "skillCategories": { - "man": { - "label":"TOTEM.skillCategory.man" - }, - "animal": { - "label":"TOTEM.skillCategory.animal" - }, - "machine": { - "label":"TOTEM.skillCategory.machine" - }, - "weapon": { - "label":"TOTEM.skillCategory.weapon" - }, - "survival": { - "label":"TOTEM.skillCategory.survival" - }, - "earth": { - "label":"TOTEM.skillCategory.earth" - } - }, "skills": { "arts": { "label":"TOTEM.skills.arts", diff --git a/templates/actor/actor-character-sheet.html b/templates/actor/actor-character-sheet.html index 84c9ba1..f8ec4ed 100644 --- a/templates/actor/actor-character-sheet.html +++ b/templates/actor/actor-character-sheet.html @@ -8,35 +8,15 @@ {{!-- The grid classes are defined in scss/global/_grid.scss. To use, use both the "grid" and "grid-Ncol" class where "N" can be any number from 1 to 12 and will create that number of columns. --}} -
- - {{!-- "flex-group-center" is also defined in the _grid.scss file - and it will add a small amount of padding, a border, and will - center all of its child elements content and text. --}} +
+ {{#each system.attributes as |attribute att|}}
- +
- - / - +
-
- -
- -
- - / - -
-
- -
- -
- -
-
+
+ {{/each}}
@@ -45,11 +25,11 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -57,30 +37,40 @@ {{!-- Owned Features Tab --}}
-
- - - {{!-- For the main features list, span the right two columns --}} -
- {{!-- This is a Handlebars partial. They're stored in the `/parts` folder next to this sheet, and defined in module/helpers/templates.mjs --}} - {{> "systems/totem/templates/actor/parts/actor-features.html"}} -
- + {{/each}}
+

Compétences

+
+ {{#each config.skillCategories as |skillCategory sckey|}} +
+

{{ localize skillCategory.label }}

+ {{#each @root.system.skills as |skill skey|}} + + {{#ife skill.category sckey }} +
+ + +
+ {{/ife}} + {{/each}} +
+ {{/each}} +
+
{{!-- Biography Tab --}} diff --git a/templates/actor/parts/actor-items.html b/templates/actor/parts/actor-items.html index 66739b3..dc906c3 100644 --- a/templates/actor/parts/actor-items.html +++ b/templates/actor/parts/actor-items.html @@ -1,3 +1,4 @@ +{{> "systems/totem/templates/actor/parts/actor-features.html"}}
  1. Name