Nombreuses corrections sur les fiches settlement/NPC
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||
import { ARMOR_TYPE_CHOICES, WEAPON_PROFICIENCY_GROUPS } from "../../config/system.mjs"
|
||||
import { ARMOR_TYPE_CHOICES, CLASS_RESTRICTION_CHOICES, SYSTEM, WEAPON_PROFICIENCY_GROUPS } from "../../config/system.mjs"
|
||||
import { rollRarityCheck } from "../../rolls.mjs"
|
||||
|
||||
export default class OathHammerItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
||||
@@ -57,6 +57,10 @@ export default class OathHammerItemSheet extends HandlebarsApplicationMixin(foun
|
||||
if (this.document.system.description !== undefined) {
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description ?? "", { async: true })
|
||||
}
|
||||
if (this.document.system.magicEffect !== undefined) {
|
||||
context.enrichedMagicEffect = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.magicEffect ?? "", { async: true })
|
||||
}
|
||||
context.classRestrictionChoices = CLASS_RESTRICTION_CHOICES
|
||||
// Armor-specific numeric selects
|
||||
context.armorValueChoices = Object.fromEntries(
|
||||
Array.from({ length: 13 }, (_, i) => [i, String(i)])
|
||||
@@ -71,6 +75,13 @@ export default class OathHammerItemSheet extends HandlebarsApplicationMixin(foun
|
||||
context.apChoices = Object.fromEntries(
|
||||
Array.from({ length: 7 }, (_, i) => [i, String(i)])
|
||||
)
|
||||
// Skill choices for weapon skill override (empty = auto-detect)
|
||||
context.skillChoices = {
|
||||
"": `— ${game.i18n.localize("OATHHAMMER.Weapon.SkillOverrideAuto")} —`,
|
||||
...Object.fromEntries(
|
||||
Object.entries(SYSTEM.SKILLS).map(([k, v]) => [k, game.i18n.localize(v.label)])
|
||||
)
|
||||
}
|
||||
// Class proficiency choices (for class-sheet checkboxes)
|
||||
context.armorTypeChoices = ARMOR_TYPE_CHOICES
|
||||
context.weaponGroupChoices = WEAPON_PROFICIENCY_GROUPS
|
||||
|
||||
Reference in New Issue
Block a user