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) { async addPerkSpecialisation( event, item, dataItem) {
let newItem = duplicate(item.data); let newItem = duplicate(item.data);
await this.object.update( { 'data.features.affectedspec.value': newItem.name} ); 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 { .ul-level1 {
padding-left: 2rem; padding-left: 2rem;
} }
.drop-spec-perk,
.drop-ability-power, .drop-ability-power,
.drop-ability-spec, .drop-ability-spec,
.drop-spec-power, .drop-spec-power,

View File

@ -50,9 +50,9 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"templateVersion": 22, "templateVersion": 23,
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-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" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

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

View File

@ -66,6 +66,13 @@
{{#if (eq feature.type "string")}} {{#if (eq feature.type "string")}}
<input type="text" class="padd-right" name="data.features.{{key}}.value" value="{{feature.value}}" data-dtype="String"/> <input type="text" class="padd-right" name="data.features.{{key}}.value" value="{{feature.value}}" data-dtype="String"/>
{{/if}} {{/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")}} {{#if (eq feature.type "text")}}
<div class="small-editor item-text-long-line"> <div class="small-editor item-text-long-line">
{{editor content=features.value target="data.features.{{key}}.value" button=true owner=owner editable=editable}} {{editor content=features.value target="data.features.{{key}}.value" button=true owner=owner editable=editable}}