Compare commits
2 Commits
fvtt-warhe
...
fvtt-warhe
| Author | SHA1 | Date | |
|---|---|---|---|
| c8f7c7c1e5 | |||
| d922d77736 |
@@ -119,6 +119,7 @@
|
|||||||
"WH.ui.magicschool": "Magic School",
|
"WH.ui.magicschool": "Magic School",
|
||||||
"WH.ui.providedslot": "Provided slot",
|
"WH.ui.providedslot": "Provided slot",
|
||||||
"WH.ui.skilllevelacquired": "Acquired at level",
|
"WH.ui.skilllevelacquired": "Acquired at level",
|
||||||
|
"WH.ui.totalmoney": "Total money owned",
|
||||||
|
|
||||||
"WH.chat.save": "Save",
|
"WH.chat.save": "Save",
|
||||||
"WH.chat.mweaponmalus": "Multiple weapons malus ",
|
"WH.chat.mweaponmalus": "Multiple weapons malus ",
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export class WarheroActorSheet extends ActorSheet {
|
|||||||
competency: this.actor.getCompetency(),
|
competency: this.actor.getCompetency(),
|
||||||
race: duplicate(race),
|
race: duplicate(race),
|
||||||
class: duplicate(this.actor.getClass()),
|
class: duplicate(this.actor.getClass()),
|
||||||
|
totalMoney: this.actor.computeTotalMoney(),
|
||||||
//moneys: duplicate(this.actor.getMoneys()),
|
//moneys: duplicate(this.actor.getMoneys()),
|
||||||
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
|
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
|
||||||
notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, {async: true}),
|
notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, {async: true}),
|
||||||
|
|||||||
@@ -174,19 +174,29 @@ export class WarheroActor extends Actor {
|
|||||||
return listItem
|
return listItem
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
computeTotalMoney() {
|
||||||
|
let nbMoney = 0
|
||||||
|
this.items.forEach(it => {if (it.type == 'money') { nbMoney += it.system.quantity} } )
|
||||||
|
return nbMoney
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
buildEquipmentsSlot() {
|
buildEquipmentsSlot() {
|
||||||
let containers = {}
|
let containers = {}
|
||||||
for (let slotName in game.system.warhero.config.slotNames) {
|
for (let slotName in game.system.warhero.config.slotNames) {
|
||||||
let slotDef = game.system.warhero.config.slotNames[slotName]
|
let slotDef = game.system.warhero.config.slotNames[slotName]
|
||||||
containers[slotName] = duplicate(slotDef)
|
containers[slotName] = duplicate(slotDef)
|
||||||
containers[slotName].content = this.items.filter(it => (it.type == 'weapon' || it.type == 'armor' || it.type == 'shield' || it.type == 'equipment')
|
containers[slotName].content = this.items.filter(it => (it.type == 'money' || it.type == 'weapon' || it.type == 'armor' || it.type == 'shield' || it.type == 'equipment')
|
||||||
&& it.system.slotlocation == slotName)
|
&& it.system.slotlocation == slotName)
|
||||||
let slotUsed = 0
|
let slotUsed = 0
|
||||||
for (let item of containers[slotName].content) {
|
for (let item of containers[slotName].content) {
|
||||||
let q = (item.system.quantity) ? item.system.quantity : 1
|
let q = (item.system.quantity) ? item.system.quantity : 1
|
||||||
containers[slotName].nbslots += (item.system.providedslot?? 0) * q
|
containers[slotName].nbslots += (item.system.providedslot?? 0) * q
|
||||||
|
if ( item.type == "money") {
|
||||||
|
slotUsed += Math.ceil(item.system.quantity / 1000)
|
||||||
|
} else {
|
||||||
slotUsed += item.system.slotused * q
|
slotUsed += item.system.slotused * q
|
||||||
}
|
}
|
||||||
|
}
|
||||||
slotUsed = Math.ceil(slotUsed)
|
slotUsed = Math.ceil(slotUsed)
|
||||||
containers[slotName].slotUsed = slotUsed
|
containers[slotName].slotUsed = slotUsed
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
"styles": [
|
"styles": [
|
||||||
"styles/simple.css"
|
"styles/simple.css"
|
||||||
],
|
],
|
||||||
"version": "10.0.31",
|
"version": "10.0.33",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "10",
|
"verified": "10",
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
},
|
},
|
||||||
"title": "Warhero RPG",
|
"title": "Warhero RPG",
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json",
|
||||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.31.zip",
|
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.33.zip",
|
||||||
"url": "https://www.uberwald.me/gitea/public/fvtt-warhero",
|
"url": "https://www.uberwald.me/gitea/public/fvtt-warhero",
|
||||||
"background": "images/ui/warhero_welcome_page.webp",
|
"background": "images/ui/warhero_welcome_page.webp",
|
||||||
"id": "fvtt-warhero"
|
"id": "fvtt-warhero"
|
||||||
|
|||||||
@@ -240,7 +240,8 @@
|
|||||||
"language",
|
"language",
|
||||||
"condition",
|
"condition",
|
||||||
"class",
|
"class",
|
||||||
"genericitem"
|
"genericitem",
|
||||||
|
"money"
|
||||||
],
|
],
|
||||||
"templates": {
|
"templates": {
|
||||||
"commonclassrace": {
|
"commonclassrace": {
|
||||||
@@ -264,6 +265,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"money": {
|
||||||
|
"quantity": 0,
|
||||||
|
"slotlocation": "backpack",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"genericitem": {
|
"genericitem": {
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -428,6 +428,10 @@
|
|||||||
{{!-- Equipement Tab --}}
|
{{!-- Equipement Tab --}}
|
||||||
<div class="tab equipment" data-group="primary" data-tab="equipment">
|
<div class="tab equipment" data-group="primary" data-tab="equipment">
|
||||||
|
|
||||||
|
<div class="flexrow">
|
||||||
|
<label class="">{{localize "WH.ui.totalmoney"}} : {{totalMoney}}</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{#each slotEquipments as |slot slotKey|}}
|
{{#each slotEquipments as |slot slotKey|}}
|
||||||
<ul class="item-list alternate-list">
|
<ul class="item-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg {{#if (gt slot.slotUsed slot.nbslots)}}items-title-bg-red{{/if}}">
|
<li class="item flexrow list-item items-title-bg {{#if (gt slot.slotUsed slot.nbslots)}}items-title-bg-red{{/if}}">
|
||||||
|
|||||||
37
templates/item-money-sheet.html
Normal file
37
templates/item-money-sheet.html
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
|
<header class="sheet-header">
|
||||||
|
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||||
|
<div class="header-fields">
|
||||||
|
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{{> systems/fvtt-warhero/templates/partial-item-nav.html}}
|
||||||
|
|
||||||
|
|
||||||
|
{{!-- Sheet Body --}}
|
||||||
|
<section class="sheet-body">
|
||||||
|
|
||||||
|
{{> systems/fvtt-warhero/templates/partial-item-description.html}}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="tab details" data-group="primary" data-tab="details">
|
||||||
|
<ul>
|
||||||
|
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.quantity"}}</label>
|
||||||
|
<input type="text" class="item-field-label-long" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
|
||||||
|
</li>
|
||||||
|
<li class="flexrow"><label class="item-field-label-medium ">{{localize "WH.ui.slotlocation"}}</label>
|
||||||
|
<select class="item-field-label-long " type="text" name="system.slotlocation" value="{{system.slotlocation}}" data-dtype="String">
|
||||||
|
{{#select system.slotlocation}}
|
||||||
|
{{#each config.slotNames as |type key|}}
|
||||||
|
<option value="{{key}}">{{localize type.label}}</option>
|
||||||
|
{{/each}}
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
Reference in New Issue
Block a user