diff --git a/lang/en.json b/lang/en.json index 5fa689c..b89e086 100644 --- a/lang/en.json +++ b/lang/en.json @@ -128,7 +128,8 @@ "type_group": "Groupe", "type_character": "Personnage", "type_npc": "PNJ", - "type_creature": "Créature" + "type_creature": "Créature", + "totem_picker": "Sélecteur de totem" }, "ITEMS": { "defense": "Protection", diff --git a/module/sheets/character-sheet.mjs b/module/sheets/character-sheet.mjs index 74cd8fe..72428cd 100644 --- a/module/sheets/character-sheet.mjs +++ b/module/sheets/character-sheet.mjs @@ -1,6 +1,7 @@ import {onManageActiveEffect, prepareActiveEffectCategories} from "../system/effects.mjs"; import { VermineActorSheet } from "./actor-sheet.mjs"; import { getRollBox } from "../system/dialogs.mjs"; +import { TotemPicker } from "../system/applications.mjs"; /** * Extend the basic ActorSheet with some very simple modifications @@ -175,7 +176,7 @@ export class VermineCharacterSheet extends VermineActorSheet { }); // Choose Totem - html.find('.changeTotem').click(this._onTotemButton.bind(this)); + html.find('.chooseTotem').click(this._onTotemButton.bind(this)); // Drag events for macros. if (this.actor.isOwner) { @@ -268,11 +269,11 @@ export class VermineCharacterSheet extends VermineActorSheet { */ _onTotemButton(event) { event.preventDefault(); - const element = event.currentTarget; - const dataset = element.dataset; + const el = event.currentTarget; + // const dataset = el.dataset; - console.log('on va ouvrir une dialog box totem'); - + const totemPicker = new TotemPicker(el); + totemPicker.render(true); } } diff --git a/module/system/applications.mjs b/module/system/applications.mjs new file mode 100644 index 0000000..397af2b --- /dev/null +++ b/module/system/applications.mjs @@ -0,0 +1,42 @@ +export class TotemPicker extends Application { + + constructor(element) { + super(); + } + + + /* -------------------------------------------- */ + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + id:"TOTEM_PICKER", + title:game.i18n.localize("VERMINE.totem_picker"), + template:'systems/vermine2047/templates/applications/choose-totem.hbs', + popOut:true, + resizable:true, + height:"600", + width:"600" + }); + } + + getData() { + // Send data to the template + return { + config: CONFIG.VERMINE + /*anarchy: this.gmAnarchy.getAnarchy(), + convergences: this.gmConvergence.getConvergences(), + difficultyPools: this.gmDifficulty.getDifficultyData(), + options: { + classes: [game.system.anarchy.styles.selectCssClass()] + }*/ + } + } + + activateListeners(html) { + super.activateListeners(html); + // html.find('.app-title-bar').mousedown(event => this.handleDrag.onMouseDown(event)); + } + + async _updateObject(event, formData) { + // console.log(formData.exampleInput); + } +} diff --git a/templates/actor/parts/character-header.hbs b/templates/actor/parts/character-header.hbs index 20fd85b..b90d9f7 100644 --- a/templates/actor/parts/character-header.hbs +++ b/templates/actor/parts/character-header.hbs @@ -11,17 +11,19 @@
+
({{ ageType "name" system.identity.ageType }}) +
-
+
diff --git a/templates/dialogs/choose-totem.hbs b/templates/applications/choose-totem.hbs similarity index 100% rename from templates/dialogs/choose-totem.hbs rename to templates/applications/choose-totem.hbs