Update perks

This commit is contained in:
sladecraven 2021-12-23 15:31:56 +01:00
parent ac6f71de65
commit 7a06989d87
5 changed files with 22 additions and 7 deletions

View File

@ -292,7 +292,15 @@ export class PegasusItemSheet extends ItemSheet {
/* -------------------------------------------- */
async addPerkSpecialisation( event, item, dataItem) {
let newItem = duplicate(item.data);
if ( event.toElement.className == 'drop-spec-perk') {
//console.log("PER SPEC", event)
let key = event.toElement.dataset["key"];
if ( key == 'affectedspec') {
await this.object.update( { 'data.features.affectedspec.value': newItem.name} );
} else {
await this.object.update( { 'data.features.gainspecdice.value': newItem.name} );
}
}
}
/* -------------------------------------------- */

View File

@ -1146,7 +1146,7 @@ ul, li {
.ul-level1 {
padding-left: 2rem;
}
.drop-spec-perk,
.drop-ability-power,
.drop-ability-spec,
.drop-spec-power,

View File

@ -50,9 +50,9 @@
"styles": [
"styles/simple.css"
],
"templateVersion": 22,
"templateVersion": 23,
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.0.22",
"version": "0.0.23",
"background" : "./images/ui/pegasus_welcome_page.webp"
}

View File

@ -203,7 +203,7 @@
"gainspecdice": {
"label": "Gain Specialisation Dice Level",
"flag": false,
"type": "statdice",
"type": "dropspec",
"value": ""
},
"gainbonusdice": {
@ -215,7 +215,7 @@
"gainotherdice": {
"label": "Gain Other Dice Level",
"flag": false,
"type": "statdice",
"type": "string",
"value": ""
},
"targethindrance": {
@ -239,7 +239,7 @@
"affectedspec": {
"label": "Affected Specialisation",
"flag": false,
"type": "string",
"type": "dropspec",
"value": ""
},
"affectspecial": {

View File

@ -66,6 +66,13 @@
{{#if (eq feature.type "string")}}
<input type="text" class="padd-right" name="data.features.{{key}}.value" value="{{feature.value}}" data-dtype="String"/>
{{/if}}
{{#if (eq feature.type "dropspec")}}
<ul class="ul-level1">
<li class="flexrow"><div class="drop-spec-perk" data-key={{key}}><label>Drop Specialisation here !</label></div>
</li>
<input type="text" class="padd-right" name="data.features.{{key}}.value" value="{{feature.value}}" data-dtype="String"/>
</ul>
{{/if}}
{{#if (eq feature.type "text")}}
<div class="small-editor item-text-long-line">
{{editor content=features.value target="data.features.{{key}}.value" button=true owner=owner editable=editable}}