v13 - Item munition et corrections #749
@ -1,2 +1,4 @@
|
|||||||
export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs"
|
export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs"
|
||||||
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
||||||
|
export { default as RdDMunitionSheet } from "./munition-sheet.mjs"
|
||||||
|
|
||||||
|
34
module/applications/sheets/munition-sheet.mjs
Normal file
34
module/applications/sheets/munition-sheet.mjs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||||
|
import { ITEM_TYPES } from "../../constants.js";
|
||||||
|
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||||
|
|
||||||
|
export default class RdDMunitionSheet extends RdDItemBaseSheet {
|
||||||
|
/** @override */
|
||||||
|
static get ITEM_TYPE() { return ITEM_TYPES.munition }
|
||||||
|
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = Object.assign({},
|
||||||
|
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||||
|
{
|
||||||
|
classes: ["fvtt-rdd", "item", "munition"],
|
||||||
|
position: { width: 400 },
|
||||||
|
window: { contentClasses: ["munition-content"] }
|
||||||
|
})
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
main: {
|
||||||
|
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/munition.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
return Object.assign(
|
||||||
|
await super._prepareContext(),
|
||||||
|
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
|
||||||
|
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
7
module/documents/munition.mjs
Normal file
7
module/documents/munition.mjs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { RdDItem } from "../item.js";
|
||||||
|
|
||||||
|
export default class RdDItemMunition extends RdDItem {
|
||||||
|
static get defaultIcon() {
|
||||||
|
return 'systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp'
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1,2 @@
|
|||||||
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
||||||
|
export { default as RdDModelMunition } from "./munition.mjs"
|
||||||
|
10
module/models/munition.mjs
Normal file
10
module/models/munition.mjs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
|
||||||
|
|
||||||
|
export default class RdDModelMunition extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
return Object.assign({},
|
||||||
|
TEMPLATE_DESCRIPTION.fields(),
|
||||||
|
TEMPLATE_INVENTAIRE.fields()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -105,6 +105,7 @@ export class SystemReveDeDragon {
|
|||||||
this.RdDStatBlockParser = RdDStatBlockParser
|
this.RdDStatBlockParser = RdDStatBlockParser
|
||||||
this.itemClasses = {
|
this.itemClasses = {
|
||||||
monnaie: items.RdDModelMonnaie,
|
monnaie: items.RdDModelMonnaie,
|
||||||
|
munition: items.RdDModelMunition,
|
||||||
armure: RdDItemArmure,
|
armure: RdDItemArmure,
|
||||||
blessure: RdDItemBlessure,
|
blessure: RdDItemBlessure,
|
||||||
gemme: RdDItemGemme,
|
gemme: RdDItemGemme,
|
||||||
@ -185,6 +186,7 @@ export class SystemReveDeDragon {
|
|||||||
CONFIG.Item.documentClass = RdDItem
|
CONFIG.Item.documentClass = RdDItem
|
||||||
CONFIG.Item.dataModels = {
|
CONFIG.Item.dataModels = {
|
||||||
monnaie: models.RdDModelMonnaie,
|
monnaie: models.RdDModelMonnaie,
|
||||||
|
munition: models.RdDModelMunition,
|
||||||
}
|
}
|
||||||
CONFIG.RDD = {
|
CONFIG.RDD = {
|
||||||
resolutionTable: RdDResolutionTable.resolutionTable,
|
resolutionTable: RdDResolutionTable.resolutionTable,
|
||||||
@ -206,17 +208,16 @@ export class SystemReveDeDragon {
|
|||||||
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||||
types: [
|
types: [
|
||||||
"objet", "arme", "armure", "livre", "munition", "nourritureboisson",
|
"objet", "arme", "armure", "livre", "nourritureboisson",
|
||||||
],
|
],
|
||||||
makeDefault: true
|
makeDefault: true
|
||||||
})
|
})
|
||||||
|
|
||||||
sheets.RdDItemBaseSheet.registerAll(
|
sheets.RdDItemBaseSheet.registerAll(
|
||||||
sheets.RdDMonnaieSheet
|
sheets.RdDMonnaieSheet,
|
||||||
|
sheets.RdDMunitionSheet
|
||||||
)
|
)
|
||||||
|
|
||||||
// ,
|
|
||||||
// sheets.RdDMunitionSheet
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, {
|
||||||
types: [
|
types: [
|
||||||
"competence", "competencecreature",
|
"competence", "competencecreature",
|
||||||
|
@ -750,9 +750,6 @@
|
|||||||
"inertie": 0,
|
"inertie": 0,
|
||||||
"enchantabilite": 0
|
"enchantabilite": 0
|
||||||
},
|
},
|
||||||
"munition": {
|
|
||||||
"templates": ["description", "inventaire"]
|
|
||||||
},
|
|
||||||
"nourritureboisson": {
|
"nourritureboisson": {
|
||||||
"templates": ["description", "inventaire", "comestible"],
|
"templates": ["description", "inventaire", "comestible"],
|
||||||
"cuisinier": "",
|
"cuisinier": "",
|
||||||
|
14
templates/item/munition.hbs
Normal file
14
templates/item/munition.hbs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.hbs"}}
|
||||||
|
<nav class="sheet-tabs tabs" data-group="primary">
|
||||||
|
<a class="item" data-tab="informations">Informations</a>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.hbs"}}
|
||||||
|
</nav>
|
||||||
|
<section class="sheet-body">
|
||||||
|
<div class="tab items flexcol" data-group="primary" data-tab="informations">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.hbs"}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.hbs"}}
|
||||||
|
</div>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.hbs"}}
|
||||||
|
</section>
|
||||||
|
</form>
|
5
templates/sheets/item/munition.hbs
Normal file
5
templates/sheets/item/munition.hbs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<section>
|
||||||
|
{{> "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs"}}
|
||||||
|
</section>
|
Loading…
x
Reference in New Issue
Block a user