diff --git a/images/icons/icon_money.webp b/images/icons/icon_money.webp new file mode 100644 index 0000000..e32cef9 Binary files /dev/null and b/images/icons/icon_money.webp differ diff --git a/modules/pegasus-actor-sheet.js b/modules/pegasus-actor-sheet.js index 06f9a34..f2c5c13 100644 --- a/modules/pegasus-actor-sheet.js +++ b/modules/pegasus-actor-sheet.js @@ -107,13 +107,13 @@ export class PegasusActorSheet extends ActorSheet { this.actor.delSubActor(actorId); }); - html.find('.equipement-moins').click(event => { + html.find('.quantity-minus').click(event => { const li = $(event.currentTarget).parents(".item"); - this.actor.decrementeQuantite( li.data("item-id") ); + this.actor.incDecQuantity( li.data("item-id"), -1 ); } ); - html.find('.equipement-plus').click(event => { + html.find('.quantity-plus').click(event => { const li = $(event.currentTarget).parents(".item"); - this.actor.incrementeQuantite( li.data("item-id") ); + this.actor.incDecQuantity( li.data("item-id"), +1 ); } ); html.find('.unarmed-attack').click((event) => { diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 46d92be..adcf515 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -630,7 +630,7 @@ export class PegasusActor extends Actor { updates['data.combat.stunthreshold'] = nrgValue } - let momentum = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod + let momentum = this.data.data.statistics.foc.value + this.data.data.statistics.foc.mod if (momentum != this.data.data.momentum.max) { updates['data.momentum.value'] = 0 updates['data.momentum.max'] = momentum @@ -685,6 +685,15 @@ export class PegasusActor extends Actor { } } + /* -------------------------------------------- */ + async incDecQuantity( objetId, incDec = 0 ) { + let objetQ = this.data.items.get(objetId ) + if (objetQ) { + let newQ = objetQ.data.data.quantity + incDec; + const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'data.quantity': newQ }]); // pdates one EmbeddedEntity + } + } + /* -------------------------------------------- */ applyAbility(ability, updates = []) { if (ability.data.affectedstat != "notapplicable") { diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 2404d67..36949c8 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -4,7 +4,7 @@ import { PegasusActorCreate } from "./pegasus-create-char.js"; /* -------------------------------------------- */ const __level2Dice = [ "d0", "d4", "d6", "d8", "d10", "d12" ]; -const __name2DiceValue = { "d0": 0, "d4": 4, "d6": 6, "d8": 8, "d10" : 10, "d12": 12 } +const __name2DiceValue = { "0": 0, "d0": 0, "d4": 4, "d6": 6, "d8": 8, "d10" : 10, "d12": 12 } /* -------------------------------------------- */ export class PegasusUtility { diff --git a/styles/simple.css b/styles/simple.css index 3ce540f..0ab9522 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1125,7 +1125,7 @@ ul, li { top:1px; } -.plus-moins-button { +.plus-minus-button { box-shadow: inset 0px 1px 0px 0px #a6827e; background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%); background-color: #7d5d3b00; @@ -1142,20 +1142,20 @@ ul, li { } .river-button:hover, -.plus-moins-button:hover, +.plus-minus-button:hover, .chat-card-button:hover { background: linear-gradient(to bottom, #800000 5%, #3e0101 100%); background-color: red; } .river-button:active, -.plus-moins-button:active, +.plus-minus-button:active, .chat-card-button:active { position:relative; top:1px; } -.plus-moins { +.plus-minus { font-size: 0.9rem; font-weight: bold; } diff --git a/system.json b/system.json index 6389978..a2fa193 100644 --- a/system.json +++ b/system.json @@ -163,6 +163,6 @@ "templateVersion": 63, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.1.14", + "version": "0.1.16", "background" : "./images/ui/pegasus_welcome_page.webp" } diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index bca9f1c..36d7685 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -180,7 +180,6 @@

{{stat2.label}}

Cur -  Bonus  Max {{/if}} @@ -381,7 +380,10 @@
  • {{money.name}} - Qty {{money.data.quantity}} + + Qty {{money.data.quantity}} + ( -/+) +
    diff --git a/templates/item-money-sheet.html b/templates/item-money-sheet.html index 7d7512a..846c43c 100644 --- a/templates/item-money-sheet.html +++ b/templates/item-money-sheet.html @@ -11,9 +11,6 @@
      -
    • - -