Various fixes
This commit is contained in:
parent
a63ec19362
commit
fef42b7093
@ -53,6 +53,7 @@ export class MournbladeActorSheet extends ActorSheet {
|
|||||||
metier: duplicate(this.actor.getMetier() || {}),
|
metier: duplicate(this.actor.getMetier() || {}),
|
||||||
combat: this.actor.getCombatValues(),
|
combat: this.actor.getCombatValues(),
|
||||||
equipements: duplicate(this.actor.getEquipments()),
|
equipements: duplicate(this.actor.getEquipments()),
|
||||||
|
monnaies: duplicate(this.actor.getMonnaies()),
|
||||||
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
|
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
|
||||||
options: this.options,
|
options: this.options,
|
||||||
owner: this.document.isOwner,
|
owner: this.document.isOwner,
|
||||||
@ -95,7 +96,7 @@ export class MournbladeActorSheet extends ActorSheet {
|
|||||||
let value = ev.currentTarget.value
|
let value = ev.currentTarget.value
|
||||||
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
|
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
|
||||||
})
|
})
|
||||||
|
|
||||||
html.find('.quantity-minus').click(event => {
|
html.find('.quantity-minus').click(event => {
|
||||||
const li = $(event.currentTarget).parents(".item");
|
const li = $(event.currentTarget).parents(".item");
|
||||||
this.actor.incDecQuantity( li.data("item-id"), -1 );
|
this.actor.incDecQuantity( li.data("item-id"), -1 );
|
||||||
@ -131,7 +132,16 @@ export class MournbladeActorSheet extends ActorSheet {
|
|||||||
let armeId = li.data("item-id")
|
let armeId = li.data("item-id")
|
||||||
this.actor.rollArmeDegats(armeId)
|
this.actor.rollArmeDegats(armeId)
|
||||||
})
|
})
|
||||||
|
html.find('.quantity-modify').click(event => {
|
||||||
|
const li = $(event.currentTarget).parents(".item")
|
||||||
|
const value = Number($(event.currentTarget).data("quantite-value"))
|
||||||
|
this.actor.incDecQuantity( li.data("item-id"), value );
|
||||||
|
})
|
||||||
|
html.find('.item-add').click((event) => {
|
||||||
|
const itemType = $(event.currentTarget).data("type")
|
||||||
|
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
html.find('.lock-unlock-sheet').click((event) => {
|
html.find('.lock-unlock-sheet').click((event) => {
|
||||||
this.options.editScore = !this.options.editScore;
|
this.options.editScore = !this.options.editScore;
|
||||||
|
@ -96,27 +96,33 @@ export class MournbladeActor extends Actor {
|
|||||||
armes.push(this.prepareBouclier(arme))
|
armes.push(this.prepareBouclier(arme))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
MournbladeUtility.sortArrayObjectsByName(armes)
|
||||||
return armes
|
return armes
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getDons() {
|
getItemSorted( types) {
|
||||||
return this.items.filter(item => item.type == "don")
|
let items = this.items.filter(item => types.includes(item.type )) || []
|
||||||
|
MournbladeUtility.sortArrayObjectsByName(items)
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
getDons() {
|
||||||
|
return this.getItemSorted(["don"])
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
|
||||||
getTendances() {
|
getTendances() {
|
||||||
return this.items.filter(item => item.type == "tendance")
|
return this.getItemSorted(["tendance"])
|
||||||
}
|
}
|
||||||
getRunes() {
|
getRunes() {
|
||||||
return this.items.filter(item => item.type == "rune")
|
return this.getItemSorted(["rune"])
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
|
||||||
getEquipments() {
|
getEquipments() {
|
||||||
return this.items.filter(item => item.type == "equipement")
|
return this.getItemSorted(["monnaie"])
|
||||||
|
}
|
||||||
|
getMonnaies() {
|
||||||
|
return this.getItemSorted(["monnaie"])
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
|
||||||
getArmors() {
|
getArmors() {
|
||||||
return this.items.filter(item => item.type == "protection")
|
return this.getItemSorted(["protection"])
|
||||||
}
|
}
|
||||||
getOrigine() {
|
getOrigine() {
|
||||||
return this.items.find(item => item.type == "origine")
|
return this.items.find(item => item.type == "origine")
|
||||||
@ -147,17 +153,8 @@ export class MournbladeActor extends Actor {
|
|||||||
comp.push(item)
|
comp.push(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return comp.sort(function (a, b) {
|
MournbladeUtility.sortArrayObjectsByName(comp)
|
||||||
let fa = a.name.toLowerCase(),
|
return comp
|
||||||
fb = b.name.toLowerCase();
|
|
||||||
if (fa < fb) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (fa > fb) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -359,11 +356,10 @@ export class MournbladeActor extends Actor {
|
|||||||
async incDecQuantity(objetId, incDec = 0) {
|
async incDecQuantity(objetId, incDec = 0) {
|
||||||
let objetQ = this.items.get(objetId)
|
let objetQ = this.items.get(objetId)
|
||||||
if (objetQ) {
|
if (objetQ) {
|
||||||
let newQ = objetQ.system.quantity + incDec;
|
let newQ = objetQ.system.quantite + incDec;
|
||||||
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]); // pdates one EmbeddedEntity
|
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantite': newQ }]); // pdates one EmbeddedEntity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getCompetence(compId) {
|
getCompetence(compId) {
|
||||||
return this.items.get(compId)
|
return this.items.get(compId)
|
||||||
|
@ -68,7 +68,8 @@ function welcomeMessage() {
|
|||||||
content: `<div id="welcome-message-Mournblade"><span class="rdd-roll-part">
|
content: `<div id="welcome-message-Mournblade"><span class="rdd-roll-part">
|
||||||
<strong>Bienvenue dans les Jeunes Royaumes de Mournblade !</strong>
|
<strong>Bienvenue dans les Jeunes Royaumes de Mournblade !</strong>
|
||||||
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
|
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
|
||||||
<p>Mournblade est jeude rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.<p>
|
<p>Mournblade est jeu de rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.</p>
|
||||||
|
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
|
||||||
` });
|
` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,13 @@ export class MournbladeUtility {
|
|||||||
return opt.concat("\n")
|
return opt.concat("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static sortArrayObjectsByName(myArray) {
|
||||||
|
myArray.sort((a, b) => {
|
||||||
|
return a.name.localeCompare(b.name);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getPointAmeOptions() {
|
static getPointAmeOptions() {
|
||||||
let opt = []
|
let opt = []
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "fvtt-mournblade",
|
"id": "fvtt-mournblade",
|
||||||
"description": "Mournblade RPG for FoundryVTT",
|
"description": "Mournblade RPG for FoundryVTT",
|
||||||
"version": "10.0.12",
|
"version": "10.0.13",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Uberwald/LeRatierBretonnien",
|
"name": "Uberwald/LeRatierBretonnien",
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"gridUnits": "m",
|
"gridUnits": "m",
|
||||||
"license": "LICENSE.txt",
|
"license": "LICENSE.txt",
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/fvtt-mournblade/raw/branch/v10/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/fvtt-mournblade/raw/branch/v10/system.json",
|
||||||
"download": "https://www.uberwald.me/gitea/public/fvtt-mournblade/archive/fvtt-mournblade-10.0.12.zip",
|
"download": "https://www.uberwald.me/gitea/public/fvtt-mournblade/archive/fvtt-mournblade-10.0.13.zip",
|
||||||
"packs": [
|
"packs": [
|
||||||
{
|
{
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
@ -137,7 +137,6 @@
|
|||||||
"background": "systems/fvtt-mournblade/assets/ui/fond_mournblade.webp",
|
"background": "systems/fvtt-mournblade/assets/ui/fond_mournblade.webp",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "10.286",
|
"verified": "10.288"
|
||||||
"maximum": "10"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -233,6 +233,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"monnaie": {
|
"monnaie": {
|
||||||
|
"quantite": 0,
|
||||||
|
"unite": "",
|
||||||
"templates": [
|
"templates": [
|
||||||
"base"
|
"base"
|
||||||
]
|
]
|
||||||
|
@ -277,7 +277,7 @@
|
|||||||
<span class="item-name-label-header">
|
<span class="item-name-label-header">
|
||||||
<h3><label class="items-title-text">Runes</label></h3>
|
<h3><label class="items-title-text">Runes</label></h3>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-long">
|
||||||
<label class="short-label">Haut parler</label>
|
<label class="short-label">Haut parler</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
@ -291,7 +291,7 @@
|
|||||||
<li class="item flexrow " data-item-id="{{rune._id}}" data-item-type="rune">
|
<li class="item flexrow " data-item-id="{{rune._id}}" data-item-type="rune">
|
||||||
<img class="item-name-img" src="{{rune.img}}" />
|
<img class="item-name-img" src="{{rune.img}}" />
|
||||||
<span class="item-name-label competence-name"><a class="roll-rune">{{rune.name}}</a></span>
|
<span class="item-name-label competence-name"><a class="roll-rune">{{rune.name}}</a></span>
|
||||||
<span class="item-field-label-short">{{rune.system.formule}}</span>
|
<span class="item-field-label-long">{{rune.system.formule}}</span>
|
||||||
<span class="item-field-label-short">{{rune.system.seuil}}</span>
|
<span class="item-field-label-short">{{rune.system.seuil}}</span>
|
||||||
<div class="item-filler"> </div>
|
<div class="item-filler"> </div>
|
||||||
<div class="item-controls item-controls-fixed">
|
<div class="item-controls item-controls-fixed">
|
||||||
@ -342,6 +342,43 @@
|
|||||||
|
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
|
|
||||||
|
<div class="sheet-box color-bg-archetype">
|
||||||
|
<ul class="item-list alternate-list">
|
||||||
|
<li class="item flexrow list-item items-title-bg">
|
||||||
|
<span class="item-name-label-header">
|
||||||
|
<h3><label class="items-title-text">Richesses et Argent</label></h3>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-medium">
|
||||||
|
<label class="short-label">Quantité</label>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-medium">
|
||||||
|
<label class="short-label">Unité</label>
|
||||||
|
</span>
|
||||||
|
<div class="item-filler"> </div>
|
||||||
|
<div class="item-controls item-controls-fixed">
|
||||||
|
<a class="item-control item-add" data-type="monnaie" title="Ajouter une monnaie"><i
|
||||||
|
class="fas fa-plus"></i></a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{#each monnaies as |monnaie key|}}
|
||||||
|
<li class="item flexrow " data-item-id="{{monnaie._id}}" data-item-type="monnaie">
|
||||||
|
<img class="item-name-img" src="{{monnaie.img}}" />
|
||||||
|
<span class="item-name-label competence-name">{{monnaie.name}}</span>
|
||||||
|
<span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.quantite}}
|
||||||
|
<a class="quantity-modify plus-minus-button" data-quantite-value="-1">-</a>
|
||||||
|
<a class="quantity-modify plus-minus-button" data-quantite-value="+1">+</a>
|
||||||
|
</span>
|
||||||
|
<span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.unite}}</span>
|
||||||
|
<div class="item-filler"> </div>
|
||||||
|
<div class="item-controls item-controls-fixed">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="sheet-box color-bg-archetype">
|
<div class="sheet-box color-bg-archetype">
|
||||||
<ul class="item-list alternate-list">
|
<ul class="item-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
@ -413,7 +450,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="item-filler"> </div>
|
<div class="item-filler"> </div>
|
||||||
<div class="item-controls item-controls-fixed">
|
<div class="item-controls item-controls-fixed">
|
||||||
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
|
<a class="item-control item-add" data-type="protection" title="Ajouter une protection"><i
|
||||||
class="fas fa-plus"></i></a>
|
class="fas fa-plus"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -442,7 +479,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="item-filler"> </div>
|
<div class="item-filler"> </div>
|
||||||
<div class="item-controls item-controls-fixed">
|
<div class="item-controls item-controls-fixed">
|
||||||
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
|
<a class="item-control item-add" data-type="equipement" title="Ajouter un équipement"><i
|
||||||
class="fas fa-plus"></i></a>
|
class="fas fa-plus"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -10,8 +10,18 @@
|
|||||||
<section class="sheet-body">
|
<section class="sheet-body">
|
||||||
|
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
|
|
||||||
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
|
<div class="flexcol">
|
||||||
|
<span class="flexrow">
|
||||||
|
<label class="generic-label">Quantité : </label>
|
||||||
|
<input type="text" class="padd-right status-small-label color-class-common" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
|
||||||
|
</span>
|
||||||
|
<span class="flexrow">
|
||||||
|
<label class="generic-label">Unité/Monnaie : </label>
|
||||||
|
<input type="text" class="padd-right color-class-common" name="system.unite" value="{{data.unite}}" data-dtype="String" />
|
||||||
|
</span>
|
||||||
|
|
||||||
|
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user