Minor fixes

This commit is contained in:
sladecraven 2022-01-25 10:37:28 +01:00
parent 0ef282dd93
commit a203163b12
8 changed files with 24 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -107,13 +107,13 @@ export class PegasusActorSheet extends ActorSheet {
this.actor.delSubActor(actorId); this.actor.delSubActor(actorId);
}); });
html.find('.equipement-moins').click(event => { html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item"); 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"); 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) => { html.find('.unarmed-attack').click((event) => {

View File

@ -630,7 +630,7 @@ export class PegasusActor extends Actor {
updates['data.combat.stunthreshold'] = nrgValue 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) { if (momentum != this.data.data.momentum.max) {
updates['data.momentum.value'] = 0 updates['data.momentum.value'] = 0
updates['data.momentum.max'] = momentum 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 = []) { applyAbility(ability, updates = []) {
if (ability.data.affectedstat != "notapplicable") { if (ability.data.affectedstat != "notapplicable") {

View File

@ -4,7 +4,7 @@ import { PegasusActorCreate } from "./pegasus-create-char.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
const __level2Dice = [ "d0", "d4", "d6", "d8", "d10", "d12" ]; 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 { export class PegasusUtility {

View File

@ -1125,7 +1125,7 @@ ul, li {
top:1px; top:1px;
} }
.plus-moins-button { .plus-minus-button {
box-shadow: inset 0px 1px 0px 0px #a6827e; box-shadow: inset 0px 1px 0px 0px #a6827e;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%); background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
background-color: #7d5d3b00; background-color: #7d5d3b00;
@ -1142,20 +1142,20 @@ ul, li {
} }
.river-button:hover, .river-button:hover,
.plus-moins-button:hover, .plus-minus-button:hover,
.chat-card-button:hover { .chat-card-button:hover {
background: linear-gradient(to bottom, #800000 5%, #3e0101 100%); background: linear-gradient(to bottom, #800000 5%, #3e0101 100%);
background-color: red; background-color: red;
} }
.river-button:active, .river-button:active,
.plus-moins-button:active, .plus-minus-button:active,
.chat-card-button:active { .chat-card-button:active {
position:relative; position:relative;
top:1px; top:1px;
} }
.plus-moins { .plus-minus {
font-size: 0.9rem; font-size: 0.9rem;
font-weight: bold; font-weight: bold;
} }

View File

@ -163,6 +163,6 @@
"templateVersion": 63, "templateVersion": 63,
"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.1.14", "version": "0.1.16",
"background" : "./images/ui/pegasus_welcome_page.webp" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

@ -180,7 +180,6 @@
<h4>{{stat2.label}}</h4> <h4>{{stat2.label}}</h4>
</span> </span>
<span class="small-label padd-right packed-left">Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/> <span class="small-label padd-right packed-left">Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
<span class="small-label padd-right packed-left">&nbsp;Bonus</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/>
<span class="small-label padd-right packed-left">&nbsp;Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/> <span class="small-label padd-right packed-left">&nbsp;Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
</li> </li>
{{/if}} {{/if}}
@ -381,7 +380,10 @@
<li class="item flexrow list-item" data-item-id="{{money._id}}"> <li class="item flexrow list-item" data-item-id="{{money._id}}">
<img class="sheet-competence-img" src="{{money.img}}" /> <img class="sheet-competence-img" src="{{money.img}}" />
<span class="equipement-label">{{money.name}}</span> <span class="equipement-label">{{money.name}}</span>
<span class="generic-label">Qty {{money.data.quantity}}</span> <span class="generic-label">
Qty {{money.data.quantity}}
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</span>
<div class="item-controls"> <div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a> <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>

View File

@ -11,9 +11,6 @@
<div class="tab" data-group="primary"> <div class="tab" data-group="primary">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Value</label>
<input type="text" class="input-numeric-short padd-right" name="data.value" value="{{data.value}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Quantity</label> <li class="flexrow"><label class="generic-label">Quantity</label>
<input type="text" class="input-numeric-short padd-right" name="data.quantity" value="{{data.quantity}}" data-dtype="Number"/> <input type="text" class="input-numeric-short padd-right" name="data.quantity" value="{{data.quantity}}" data-dtype="Number"/>
</li> </li>