Équipement : simplifié à un seul champ description
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -63,7 +63,6 @@ export class CelestopolEquipmentSheet extends CelestopolItemSheet {
|
|||||||
}
|
}
|
||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
const ctx = await super._prepareContext()
|
const ctx = await super._prepareContext()
|
||||||
ctx.equipmentTypes = SYSTEM.EQUIPMENT_TYPES
|
|
||||||
ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
this.document.system.description, { async: true })
|
this.document.system.description, { async: true })
|
||||||
return ctx
|
return ctx
|
||||||
|
|||||||
@@ -60,19 +60,8 @@ export class CelestopolAspect extends foundry.abstract.TypeDataModel {
|
|||||||
export class CelestopolEquipment extends foundry.abstract.TypeDataModel {
|
export class CelestopolEquipment extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields
|
const fields = foundry.data.fields
|
||||||
const reqInt = { required: true, nullable: false, integer: true }
|
|
||||||
return {
|
return {
|
||||||
subtype: new fields.StringField({ required: true, nullable: false, initial: "autre",
|
description: new fields.HTMLField({ required: true, textSearch: true }),
|
||||||
choices: Object.keys(SYSTEM.EQUIPMENT_TYPES) }),
|
|
||||||
quantity: new fields.NumberField({ ...reqInt, initial: 1, min: 0 }),
|
|
||||||
weight: new fields.NumberField({ required: true, nullable: false, initial: 0, min: 0 }),
|
|
||||||
damage: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
|
||||||
range: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
|
||||||
speed: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
|
||||||
protection: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
|
||||||
crew: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
|
||||||
description:new fields.HTMLField({ required: true, textSearch: true }),
|
|
||||||
notes: new fields.HTMLField({ required: true, textSearch: true }),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,8 +78,7 @@
|
|||||||
},
|
},
|
||||||
"equipment": {
|
"equipment": {
|
||||||
"htmlFields": [
|
"htmlFields": [
|
||||||
"description",
|
"description"
|
||||||
"notes"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"weapon": {
|
"weapon": {
|
||||||
|
|||||||
@@ -5,49 +5,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item-header-fields">
|
<div class="item-header-fields">
|
||||||
<input type="text" name="name" value="{{item.name}}" {{#unless isEditable}}disabled{{/unless}}>
|
<input type="text" name="name" value="{{item.name}}" {{#unless isEditable}}disabled{{/unless}}>
|
||||||
<div class="item-meta">
|
|
||||||
<select name="system.subtype" {{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
{{#each equipmentTypes as |etype key|}}
|
|
||||||
<option value="{{key}}" {{#if (eq key ../system.subtype)}}selected{{/if}}>{{localize etype.label}}</option>
|
|
||||||
{{/each}}
|
|
||||||
</select>
|
|
||||||
<div class="item-qty">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.quantity"}}</label>
|
|
||||||
<input type="number" name="system.quantity" value="{{system.quantity}}" min="0"
|
|
||||||
{{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="equipment-stats">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.damage"}}</label>
|
|
||||||
<input type="text" name="system.damage" value="{{system.damage}}" {{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.range"}}</label>
|
|
||||||
<input type="text" name="system.range" value="{{system.range}}" {{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.protection"}}</label>
|
|
||||||
<input type="text" name="system.protection" value="{{system.protection}}" {{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.speed"}}</label>
|
|
||||||
<input type="text" name="system.speed" value="{{system.speed}}" {{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.crew"}}</label>
|
|
||||||
<input type="text" name="system.crew" value="{{system.crew}}" {{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "CELESTOPOL.Item.weight"}}</label>
|
|
||||||
<input type="number" name="system.weight" value="{{system.weight}}" min="0"
|
|
||||||
{{#unless isEditable}}disabled{{/unless}}>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group description-group">
|
<div class="form-group description-group">
|
||||||
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
|
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user