ENH: Gold

master
U~man 2020-07-19 19:00:13 +02:00
parent b91356766d
commit 83fa2f1744
7 changed files with 40 additions and 5 deletions

BIN
src/assets/gold.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -15,7 +15,9 @@
"OSE.dialog.partysheet": "Fiche de Groupe",
"OSE.dialog.selectActors": "Choisir PJs",
"OSE.dialog.dealXP": "Donner XP",
"OSE.dialog.generator": "Générateur de personnage",
"OSE.dialog.generateSaves": "Générer les Sauvegardes",
"OSE.dialog.generateScore": "Création: {score}",
"OSE.Formula": "Formule",
"OSE.SitMod": "Mod. de situation",

View File

@ -82,6 +82,7 @@ export class OseActorSheet extends ActorSheet {
let summary = li.parents(".item-entry").children(".item-summary");
summary.slideUp(200, () => summary.remove());
} else {
// Add item tags
let div = $(`<div class="item-summary"><ol class="tag-list">${item.getTags()}</ol><div>${description}</div></div>`);
li.parents(".item-entry").append(div.hide());
div.slideDown(200);

View File

@ -41,7 +41,6 @@ export class OseActorSheetCharacter extends OseActorSheet {
async _render(...args) {
super._render(...args).then(() => {
if (this.actor.isNew()) {
event.preventDefault();
new OseCharacterCreator(this.actor, {
top: this.position.top + 40,
left: this.position.left + (this.position.width - 400) / 2,

View File

@ -68,10 +68,6 @@ export class OseActor extends Actor {
}
}
generator() {
}
generateSave(hd) {
let saves = {};
for (let i = 0; i <= hd; i++) {

View File

@ -94,11 +94,37 @@ export class OseCharacterCreator extends FormApplication {
});
});
html.find('a.gold-roll').click((ev) => {
let el = ev.currentTarget.parentElement.parentElement.parentElement;
this.rollScore("Gold", {event: ev}).then(r => {
$(el).find('.gold-value').val(r.total * 10);
});
});
html.find('input.score-value').change(ev => {
this.doStats(ev);
})
}
async _onSubmit(event, {updateData=null, preventClose=false, preventRender=false}={}) {
super._onSubmit(event, {updateData: updateData, preventClose: preventClose, preventRender: preventRender});
// Generate gold
let gold = event.target.elements.namedItem('gold').value;
const itemData = {
name: "Gold pieces",
type: "item",
img: "/systems/ose/assets/gold.png",
data: {
treasure: true,
cost: 1,
weight: 1,
quantity: {
value: gold
}
}
};
this.object.createOwnedItem(itemData);
}
/**
* This method is called upon form submission after form data is validated
* @param event {Event} The initial triggering submission event

View File

@ -29,6 +29,17 @@
<span class="std">0</span>
</div>
</div>
<hr>
<div class="form-group">
<label>Gold&nbsp;</label>
<div class="form-fields">
<a class="gold-roll"><i class="fas fa-dice"></i></a>
</div>
</div>
<div></div>
<div class="form-group">
<input id="gold" class="gold-value" type="text" value="0" disabled/>
</div>
</div>
</div>
<footer class="sheet-footer">