application choose totem
This commit is contained in:
+2
-1
@@ -128,7 +128,8 @@
|
|||||||
"type_group": "Groupe",
|
"type_group": "Groupe",
|
||||||
"type_character": "Personnage",
|
"type_character": "Personnage",
|
||||||
"type_npc": "PNJ",
|
"type_npc": "PNJ",
|
||||||
"type_creature": "Créature"
|
"type_creature": "Créature",
|
||||||
|
"totem_picker": "Sélecteur de totem"
|
||||||
},
|
},
|
||||||
"ITEMS": {
|
"ITEMS": {
|
||||||
"defense": "Protection",
|
"defense": "Protection",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {onManageActiveEffect, prepareActiveEffectCategories} from "../system/effects.mjs";
|
import {onManageActiveEffect, prepareActiveEffectCategories} from "../system/effects.mjs";
|
||||||
import { VermineActorSheet } from "./actor-sheet.mjs";
|
import { VermineActorSheet } from "./actor-sheet.mjs";
|
||||||
import { getRollBox } from "../system/dialogs.mjs";
|
import { getRollBox } from "../system/dialogs.mjs";
|
||||||
|
import { TotemPicker } from "../system/applications.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ActorSheet with some very simple modifications
|
* Extend the basic ActorSheet with some very simple modifications
|
||||||
@@ -175,7 +176,7 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Choose Totem
|
// Choose Totem
|
||||||
html.find('.changeTotem').click(this._onTotemButton.bind(this));
|
html.find('.chooseTotem').click(this._onTotemButton.bind(this));
|
||||||
|
|
||||||
// Drag events for macros.
|
// Drag events for macros.
|
||||||
if (this.actor.isOwner) {
|
if (this.actor.isOwner) {
|
||||||
@@ -268,11 +269,11 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
|||||||
*/
|
*/
|
||||||
_onTotemButton(event) {
|
_onTotemButton(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const element = event.currentTarget;
|
const el = event.currentTarget;
|
||||||
const dataset = element.dataset;
|
// const dataset = el.dataset;
|
||||||
|
|
||||||
console.log('on va ouvrir une dialog box totem');
|
const totemPicker = new TotemPicker(el);
|
||||||
|
totemPicker.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,17 +11,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flexrow flex-group-center">
|
<div class="flexrow flex-group-center">
|
||||||
<label for="system.identity.age">{{ localize 'IDENTITY.age' }}</label>
|
<label for="system.identity.age">{{ localize 'IDENTITY.age' }}</label>
|
||||||
|
<div>
|
||||||
<input type="number" name="system.identity.age" value="{{ system.identity.age }}" data-dtype="Number"/>
|
<input type="number" name="system.identity.age" value="{{ system.identity.age }}" data-dtype="Number"/>
|
||||||
<span id="ageType">({{ ageType "name" system.identity.ageType }})</span>
|
<span id="ageType">({{ ageType "name" system.identity.ageType }})</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="char-level">
|
<section class="char-level">
|
||||||
<div class="char-vermine2047 flexrow flex-group-left">
|
<div class="char-vermine2047 flexrow flex-group-center">
|
||||||
<label for="system.identity.totem">{{ localize 'IDENTITY.totem' }}</label>
|
<label for="system.identity.totem">{{ localize 'IDENTITY.totem' }}</label>
|
||||||
{{#if (eq system.identity.totem "")}}
|
{{#if (eq system.identity.totem "")}}
|
||||||
<a name="chooseTotem" class="chooseTotem">Choisissez votre totem</button>
|
<a name="chooseTotem" class="chooseTotem">Choisissez votre totem</button>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<a name="chooseTotem" class="chooseTotem 2">{{ system.identity.totem }}</button>
|
<a name="chooseTotem" class="chooseTotem">{{ smarttl "TOTEMS" system.identity.totem }}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="reputation flexrow flex-group-center">
|
<div class="reputation flexrow flex-group-center">
|
||||||
|
|||||||
Reference in New Issue
Block a user