Added buttons to Add or Subtract money
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
- Added English Compendiums for Field of Victory (thanks to mdosantos).
|
||||
- Added English "Blessed Treasures" in items for Field of Victory (thanks to PlatFleece)
|
||||
- Added English/French "Blessed Treasures" and "Concealed Horror" in items for Shadowlands.
|
||||
- Added label for grips in Weapon sheet (thanks to TesserWract)
|
||||
- Fixed the "empty sheet" bug ! (I hope)
|
||||
- QoL : Added label for grips in Weapon sheet (thanks to TesserWract).
|
||||
- QoL : Added buttons to Add or Subtract money.
|
||||
- Fixed the "empty sheet" bug (I hope).
|
||||
- Fixed the "bought_at_rank" does not change according to the PC rank value when an Item is drop on a sheet.
|
||||
- Fixed the issue #23 "Token image does not save". Now we reflect the change on the token name/image only if it's a linked actor and if the token/sheet have the same values.
|
||||
- Fixed the "unlink actor data" who still change the Actor Data.
|
||||
|
||||
@@ -95,6 +95,9 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
|
||||
this.render(false);
|
||||
});
|
||||
|
||||
// Money +/-
|
||||
html.find(".money-control").on("click", this._modifyMoney.bind(this));
|
||||
|
||||
// Advancements Tab to current rank onload
|
||||
// TODO class "Active" Bug on load, dunno why :/
|
||||
this._tabs
|
||||
@@ -212,4 +215,33 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
|
||||
_moneyToZeni(koku, bu, zeni) {
|
||||
return Math.floor(koku * CONFIG.l5r5e.money[0]) + Math.floor(bu * CONFIG.l5r5e.money[1]) + Math.floor(zeni);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or Subtract money (+/- buttons)
|
||||
* @param {Event} event
|
||||
* @private
|
||||
*/
|
||||
_modifyMoney(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const elmt = $(event.currentTarget);
|
||||
const type = elmt.data("type");
|
||||
let mod = elmt.data("value");
|
||||
if (!mod || !type) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (type !== "zeni") {
|
||||
mod = Math.floor(mod * CONFIG.l5r5e.money[type === "koku" ? 0 : 1]);
|
||||
}
|
||||
|
||||
this.actor.data.data.zeni = +this.actor.data.data.zeni + mod;
|
||||
this.actor.update({
|
||||
data: {
|
||||
zeni: this.actor.data.data.zeni,
|
||||
},
|
||||
});
|
||||
this.render(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -689,6 +689,9 @@
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
}
|
||||
.money-buttons {
|
||||
line-height: 13px;
|
||||
}
|
||||
}
|
||||
table {
|
||||
font-size: 0.85rem;
|
||||
|
||||
@@ -3,14 +3,26 @@
|
||||
<label>
|
||||
{{localize 'l5r5e.money.koku'}}
|
||||
<input name="data.money.koku" type="number" value="{{data.data.money.koku}}" data-dtype="Number" min="0" placeholder="0"/>
|
||||
<span class="money-buttons">
|
||||
<i class="money-control pointer-choice fa fa-plus-square" data-type="koku" data-value="1"></i>
|
||||
<i class="money-control pointer-choice fa fa-minus-square" data-type="koku" data-value="-1"></i>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
{{localize 'l5r5e.money.bu'}}
|
||||
<input name="data.money.bu" type="number" value="{{data.data.money.bu}}" data-dtype="Number" min="0" placeholder="0"/>
|
||||
<span class="money-buttons">
|
||||
<i class="money-control pointer-choice fa fa-plus-square" data-type="bu" data-value="1"></i>
|
||||
<i class="money-control pointer-choice fa fa-minus-square" data-type="bu" data-value="-1"></i>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
{{localize 'l5r5e.money.zeni'}}
|
||||
<input name="data.money.zeni" type="number" value="{{data.data.money.zeni}}" data-dtype="Number" min="0" placeholder="0"/>
|
||||
<span class="money-buttons">
|
||||
<i class="money-control pointer-choice fa fa-plus-square" data-type="zeni" data-value="1"></i>
|
||||
<i class="money-control pointer-choice fa fa-minus-square" data-type="zeni" data-value="-1"></i>
|
||||
</span>
|
||||
</label>
|
||||
</fieldset>
|
||||
{{!-- items list --}}
|
||||
|
||||
Reference in New Issue
Block a user