Fix sheets

This commit is contained in:
LeRatierBretonnien 2024-12-10 07:25:55 +01:00
parent 4eb360252f
commit 27c420200e
32 changed files with 65 additions and 215 deletions

View File

@ -132,6 +132,9 @@
},
"Equipment": {
"FIELDS": {
"encLoad": {
"label": "Load"
},
"cost": {
"label": "Cost"
},
@ -238,7 +241,7 @@
"label": "Out of skill"
}
},
"load": {
"encLoad": {
"label": "Load"
},
"cost": {
@ -256,22 +259,22 @@
"heavy": "Heavy"
},
"FIELDS": {
"armortype": {
"armorType": {
"label": "Category"
},
"defense": {
"label": "Defense"
},
"movementreduction": {
"label": "Movement reduction"
"maximumMovement": {
"label": "Maximum movement"
},
"hp": {
"label": "HP"
},
"damagereduction": {
"damageReduction": {
"label": "Damage reduction"
},
"load": {
"encLoad": {
"label": "Load"
},
"cost": {
@ -334,7 +337,7 @@
"damagereduction": {
"label": "Damage reduction"
},
"load": {
"encLoad": {
"label": "Load"
},
"cost": {

View File

@ -46,7 +46,6 @@ Hooks.once("init", function () {
armor: models.LethalFantasyArmor,
shield: models.LethalFantasyShield,
spell: models.LethalFantasySpell,
save: models.LethalFantasySave,
vulnerability: models.LethalFantasyVulnerability,
equipment: models.LethalFantasyEquipment,
miracle: models.LethalFantasyMiracle
@ -61,7 +60,6 @@ Hooks.once("init", function () {
Items.registerSheet("lethalFantasy", applications.LethalFantasySkillSheet, { types: ["skill"], makeDefault: true })
Items.registerSheet("lethalFantasy", applications.LethalFantasyGiftSheet, { types: ["gift"], makeDefault: true })
Items.registerSheet("lethalFantasy", applications.LethalFantasyVulnerabilitySheet, { types: ["vulnerability"], makeDefault: true })
Items.registerSheet("lethalFantasy", applications.LethalFantasySaveSheet, { types: ["save"], makeDefault: true })
Items.registerSheet("lethalFantasy", applications.LethalFantasyWeaponSheet, { types: ["weapon"], makeDefault: true })
Items.registerSheet("lethalFantasy", applications.LethalFantasySpellSheet, { types: ["spell"], makeDefault: true })
Items.registerSheet("lethalFantasy", applications.LethalFantasyArmorSheet, { types: ["armor"], makeDefault: true })

View File

@ -4,7 +4,6 @@ export { default as LethalFantasyWeaponSheet } from "./sheets/weapon-sheet.mjs"
export { default as LethalFantasySkillSheet } from "./sheets/skill-sheet.mjs"
export { default as LethalFantasyGiftSheet } from "./sheets/gift-sheet.mjs"
export { default as LethalFantasyVulnerabilitySheet } from "./sheets/vulnerability-sheet.mjs"
export { default as LethalFantasySaveSheet } from "./sheets/save-sheet.mjs"
export { default as LethalFantasyArmorSheet } from "./sheets/armor-sheet.mjs"
export { default as LethalFantasySpellSheet } from "./sheets/spell-sheet.mjs"
export { default as LethalFantasyEquipmentSheet } from "./sheets/equipment-sheet.mjs"

View File

@ -19,9 +19,12 @@ export default class LethalFantasyArmorSheet extends LethalFantasyItemSheet {
},
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -22,6 +22,7 @@ export default class LethalFantasyEquipmentSheet extends LethalFantasyItemSheet
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -18,4 +18,12 @@ export default class LethalFantasyMiracleSheet extends LethalFantasyItemSheet {
template: "systems/fvtt-lethal-fantasy/templates/miracle.hbs",
},
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -1,28 +0,0 @@
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
export default class LethalFantasyGiftSheet extends LethalFantasyItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["save"],
position: {
width: 600,
},
window: {
contentClasses: ["save-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-lethal-fantasy/templates/save.hbs",
},
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -22,6 +22,7 @@ export default class LethalFantasyShieldSheet extends LethalFantasyItemSheet {
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -18,4 +18,12 @@ export default class LethalFantasySpellSheet extends LethalFantasyItemSheet {
template: "systems/fvtt-lethal-fantasy/templates/spell.hbs",
},
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -18,4 +18,12 @@ export default class LethalFantasyWeaponSheet extends LethalFantasyItemSheet {
template: "systems/fvtt-lethal-fantasy/templates/weapon.hbs",
},
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context
}
}

View File

@ -7,6 +7,5 @@ export { default as LethalFantasyArmor } from "./armor.mjs"
export { default as LethalFantasyShield } from "./shield.mjs"
export { default as LethalFantasyGift } from "./gift.mjs"
export { default as LethalFantasyVulnerability } from "./vulnerability.mjs"
export { default as LethalFantasySave } from "./save.mjs"
export { default as LethalFantasyEquipment } from "./equipment.mjs"
export { default as LethalFantasyMiracle } from "./miracle.mjs"

View File

@ -6,13 +6,13 @@ export default class LethalFantasyArmor extends foundry.abstract.TypeDataModel {
const requiredInteger = { required: true, nullable: false, integer: true }
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.armortype = new fields.StringField({ required: true, initial: "light", choices: SYSTEM.ARMOR_TYPE })
schema.armorType = new fields.StringField({ required: true, initial: "light", choices: SYSTEM.ARMOR_TYPE })
schema.defense = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: -50 })
schema.movementreduction = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.maximumMovement = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.hp = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.damagereduction = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.damageReduction = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.load = new fields.StringField({ required: true, initial: "L" })
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })
@ -23,7 +23,4 @@ export default class LethalFantasyArmor extends foundry.abstract.TypeDataModel {
/** @override */
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Armor"]
get weaponCategory() {
return game.i18n.localize(CATEGORY[this.category].label)
}
}

View File

@ -9,7 +9,7 @@ export default class LethalFantasyEquipment extends foundry.abstract.TypeDataMod
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.category = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.EQUIPMENT_CATEGORIES })
schema.load = new fields.StringField({ required: true, initial: "L" })
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.hi = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.medium = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.lo = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })

View File

@ -1,17 +0,0 @@
export default class LethalFantasySave extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields
const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {}
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.value = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
return schema
}
/** @override */
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Save"]
}

View File

@ -28,7 +28,7 @@ export default class LethalFantasyShield extends foundry.abstract.TypeDataModel
piercing: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
})
schema.load = new fields.StringField({ required: true, initial: "L" })
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })

View File

@ -40,7 +40,7 @@ export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
outOfSkill: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
})
schema.load = new fields.StringField({ required: true, initial: "L" })
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })

View File

@ -10,7 +10,6 @@
@import "armor.less";
@import "spell.less";
@import "vulnerability.less";
@import "save.less";
@import "chat.less";
@import "equipment.less";
@import "shield.less";

View File

@ -1,16 +0,0 @@
.save-content {
.sheet-common();
.item-sheet-common();
.header {
display: flex;
img {
width: 50px;
height: 50px;
}
}
label {
flex: 10%;
}
}

View File

@ -6,7 +6,7 @@
"download": "#{DOWNLOAD}#",
"url": "#{URL}#",
"license": "LICENSE",
"version": "#{VERSION}#",
"version": "12.0.2",
"authors": [
{
"name": "Uberwald",
@ -35,7 +35,6 @@
"skill": { "htmlFields": ["description"] },
"gift": { "htmlFields": ["description"] },
"vulnerability": { "htmlFields": ["description"] },
"save": { "htmlFields": ["description"] },
"weapon": { "htmlFields": ["description"] },
"armor": { "htmlFields": ["description"] },
"shield": { "htmlFields": ["description"] },

View File

@ -4,12 +4,12 @@
{{formInput fields.name value=source.name}}
</div>
{{formField systemFields.armortype value=system.armortype localize=true}}
{{formField systemFields.armorType value=system.armorType localize=true}}
{{formField systemFields.defense value=system.defense}}
{{formField systemFields.movementreduction value=system.movementreduction}}
{{formField systemFields.maximumMovement value=system.maximumMovement}}
{{formField systemFields.hp value=system.hp}}
{{formField systemFields.damagereduction value=system.damagereduction}}
{{formField systemFields.load value=system.load}}
{{formField systemFields.damageReduction value=system.damageReduction}}
{{formField systemFields.encLoad value=system.encLoad}}
{{formField systemFields.cost value=system.cost}}
{{formField systemFields.money value=system.money localize=true}}
@ -17,11 +17,11 @@
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput
systemFields.description
enriched=description
value=system.description
name="system.description"
toggled="false"
systemFields.description
enriched=enrichedDescription
value=system.description
name="system.description"
toggled=true
}}
</fieldset>
</section>

View File

@ -1,12 +0,0 @@
<section>
<div class="header">
<img class="item-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
{{formInput fields.name value=source.name}}
</div>
{{formField systemFields.degats value=system.degats}}
<fieldset>
<legend>{{localize "TENEBRIS.Label.description"}}</legend>
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset>
</section>

View File

@ -3,12 +3,13 @@
<img class="item-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
{{formInput fields.name value=source.name}}
</div>
{{formField systemFields.encLoad value=system.encLoad}}
{{formField systemFields.cost value=system.cost}}
{{formField systemFields.money value=system.money localize=true}}
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput systemFields.description enriched=description value=system.description name="system.description" toggled=true}}
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset>
</section>

View File

@ -1,9 +0,0 @@
{{!log "fortune" this}}
<div class="application-fortune application-fortune-{{ifThen isGM 'gm' 'player'}}">
{{#unless isGM}}
<button type="button" class="action-button frame-brown" data-action="fortune" data-user-id={{userId}}>
<label>Dépenser</label>
</button>
{{/unless}}
<div class="application-fortune-value">{{fortune}}</div>
</div>

View File

@ -23,7 +23,7 @@
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput systemFields.description enriched=description value=system.description name="system.description" toggled=true}}
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset>
</section>

View File

@ -1,7 +0,0 @@
<section class="path-name">
<img class="item-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
{{formInput fields.name value=source.name rootId=partId disabled=isPlayMode}}
<a class="control" data-action="toggleSheet" data-tooltip="TENEBRIS.ToggleSheet">
<i class="fa-solid fa-user-{{ifThen isPlayMode 'lock' 'pen'}}"></i>
</a>
</section>

View File

@ -1,44 +0,0 @@
<section class="tab path-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">
<fieldset>
<legend>{{localize "TENEBRIS.Label.profil"}}</legend>
<div class="profil">
<div class="profil-gauche">
{{formField systemFields.caracteristiques.fields.rob.fields.valeur value=system.caracteristiques.rob.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.caracteristiques.fields.dex.fields.valeur value=system.caracteristiques.dex.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.caracteristiques.fields.int.fields.valeur value=system.caracteristiques.int.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.caracteristiques.fields.per.fields.valeur value=system.caracteristiques.per.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.caracteristiques.fields.vol.fields.valeur value=system.caracteristiques.vol.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.dv value=system.dv rootId=partId disabled=isPlayMode}}
</div>
<div class="profil-droite">
{{formField systemFields.dmax value=system.dmax rootId=partId disabled=isPlayMode}}
{{formField systemFields.ressources.fields.san.fields.valeur value=system.ressources.san.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.ressources.fields.oeil.fields.valeur value=system.ressources.oeil.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.ressources.fields.verbe.fields.valeur value=system.ressources.verbe.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.ressources.fields.bourse.fields.valeur value=system.ressources.bourse.valeur rootId=partId disabled=isPlayMode}}
{{formField systemFields.ressources.fields.magie.fields.valeur value=system.ressources.magie.valeur rootId=partId disabled=isPlayMode}}
</div>
</div>
</fieldset>
<fieldset class="biens">
<legend>{{localize "TENEBRIS.Label.biens"}}</legend>
{{formInput systemFields.biens enriched=enrichedBiens value=system.biens documentUUID=item.uuid name="system.biens" collaborate="true" toggled=true}}
</fieldset>
<fieldset class="langues">
<legend>{{localize "TENEBRIS.Label.langues"}}</legend>
{{formInput systemFields.langues enriched=enrichedLangues value=system.langues documentUUID=item.uuid name="system.langues" collaborate="true" toggled=true}}
</fieldset>
<fieldset class="description">
<legend>{{localize "TENEBRIS.Label.description"}}</legend>
{{formInput
systemFields.description
enriched=enrichedDescription
value=system.description
name="system.description"
toggled=true
}}
</fieldset>
</section>

View File

@ -1,28 +0,0 @@
<section class="tab path-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">
{{!log "path-talents" this}}
{{#each talents as |item|}}
{{!log "path-talent" this}}
<div class="talent" data-item-uuid="{{item.uuid}}">
<div class="header">
<div class="name">{{item.name}} {{#if item.system.canProgress}}<span data-tooltip="{{localize 'TENEBRIS.Label.progressionPossible'}}"> (P)</span>{{/if}}
{{#if item.system.isLearned}}
<span data-tooltip="{{localize 'TENEBRIS.Talent.FIELDS.appris.label'}}"> <i class="fa-solid fa-book"></i>({{item.system.niveau}})</span>
{{/if}}
</div>
{{#if @root.isEditMode}}
<div class="controls">
<a data-tooltip="{{localize 'TENEBRIS.Edit'}}" data-action="edit" data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
<a data-tooltip="{{localize 'TENEBRIS.Delete'}}" data-action="delete" data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div>
{{/if}}
</div>
{{#if item.system.isLearned}}
<div class="progression">
<div>{{localize "TENEBRIS.Label.appris"}}</div>
<div>{{localize "TENEBRIS.Label.niveau"}} {{item.system.niveau}}</div>
</div>
{{/if}}
<div class="description">{{{item.system.improvedDescription}}}</div>
</div>
{{/each}}
</section>

View File

@ -1,13 +0,0 @@
<section>
<div class="header">
<img class="item-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
{{formInput fields.name value=source.name}}
</div>
{{formField systemFields.value value=system.value}}
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset>
</section>

View File

@ -37,7 +37,7 @@
{{formField systemFields.autodestruction.fields.piercing value=system.autodestruction.piercing}}
</div>
{{formField systemFields.load value=system.load}}
{{formField systemFields.encLoad value=system.encLoad}}
{{formField systemFields.cost value=system.cost}}
{{formField systemFields.money value=system.money localize=true}}
@ -50,7 +50,7 @@
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput
systemFields.description
enriched=description
enriched=enrichedDescription
value=system.description
name="system.description"
toggled="false"

View File

@ -23,7 +23,7 @@
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput systemFields.description enriched=description value=system.description name="system.description" toggled=true}}
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset>
</section>

View File

@ -7,7 +7,7 @@
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput systemFields.description enriched=description value=system.description name="system.description" toggled=true}}
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset>
</section>

View File

@ -55,7 +55,7 @@
</div>
{{/if}}
{{formField systemFields.load value=system.load}}
{{formField systemFields.encLoad value=system.encLoad}}
{{formField systemFields.cost value=system.cost}}
{{formField systemFields.money value=system.money localize=true}}
@ -66,7 +66,7 @@
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput
systemFields.description
enriched=description
enriched=enrichedDescription
value=system.description
name="system.description"
toggled=true