From a5eb96cd97fdf092ca34356ee2dcae7423beb470 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 12 Jan 2022 17:21:37 +0100 Subject: [PATCH] Sync --- modules/pegasus-item-sheet.js | 5 +++++ modules/pegasus-utility.js | 6 +++++- styles/simple.css | 1 + system.json | 4 ++-- template.json | 1 + templates/actor-sheet.html | 5 +++-- templates/item-effect-sheet.html | 18 +++++++++++++++++- templates/item-specialisation-sheet.html | 8 +------- 8 files changed, 35 insertions(+), 13 deletions(-) diff --git a/modules/pegasus-item-sheet.js b/modules/pegasus-item-sheet.js index 57c3dc4..655ffb4 100644 --- a/modules/pegasus-item-sheet.js +++ b/modules/pegasus-item-sheet.js @@ -348,6 +348,11 @@ export class PegasusItemSheet extends ItemSheet { specArray.push( newItem ); await this.object.update( { 'data.recoveryrollspec': specArray} ); } + if ( event.toElement.className =='drop-effect-specaffected') { + let specArray = duplicate(this.object.data.data.specaffected); + specArray.push( newItem ); + await this.object.update( { 'data.specaffected': specArray} ); + } } /* -------------------------------------------- */ diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 10d4602..f669777 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -23,7 +23,11 @@ export class PegasusUtility { Handlebars.registerHelper('upper', function (text) { return text.toUpperCase(); - }); + }); + Handlebars.registerHelper('upperFirst', function (text) { + if (typeof text !== 'string') return text + return text.charAt(0).toUpperCase() + text.slice(1) + }); } diff --git a/styles/simple.css b/styles/simple.css index 5388ba8..be5b928 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1160,6 +1160,7 @@ ul, li { .ul-level1 { padding-left: 2rem; } +.drop-effect-specaffected, .drop-effect-spec, .drop-ability-weapon, .drop-ability-armor, diff --git a/system.json b/system.json index b61a752..1ee8f11 100644 --- a/system.json +++ b/system.json @@ -100,9 +100,9 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 49, + "templateVersion": 51, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.0.49", + "version": "0.0.51", "background" : "./images/ui/pegasus_welcome_page.webp" } \ No newline at end of file diff --git a/template.json b/template.json index 0ee0ff2..348c09d 100644 --- a/template.json +++ b/template.json @@ -180,6 +180,7 @@ "genre": "", "effectlevel": 0, "stataffected": "", + "specaffected": [], "statdice": false, "bonusdice": false, "otherdice": false, diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 18a0978..67734b3 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -230,8 +230,9 @@
  • {{effect.name}} - {{effect.data.type}} - {{effect.data.genre}} + {{upperFirst effect.data.type}} + {{upperFirst effect.data.genre}} + Lvl:{{effect.data.effectlevel}}
    diff --git a/templates/item-effect-sheet.html b/templates/item-effect-sheet.html index b20d5ab..4fbdbd1 100644 --- a/templates/item-effect-sheet.html +++ b/templates/item-effect-sheet.html @@ -29,12 +29,28 @@ {{/select}} -
  • +
  • +
  • +
  • + +
  • + {{#if (eq data.genre "positive")}}
  • diff --git a/templates/item-specialisation-sheet.html b/templates/item-specialisation-sheet.html index 9761221..d92e242 100644 --- a/templates/item-specialisation-sheet.html +++ b/templates/item-specialisation-sheet.html @@ -18,13 +18,7 @@ {{/select}}
  • -
  • - -
  • +