fix: use object key for partial ID to match template reference
loadTemplates with an array registers the partial using the full file path as its Handlebars ID (e.g. 'systems/fvtt-lethal-fantasy/templates/chat/_dice-breakdown.hbs'), but the template references it by the short name 'chat/dice-breakdown'. Using an object with explicit keys ensures the partial ID matches.
This commit is contained in:
+7
-4
@@ -114,10 +114,13 @@ Hooks.once("ready", async function () {
|
||||
// Initialiser la table des résultats D30
|
||||
await documents.D30Roll.initialize()
|
||||
|
||||
// Register Handlebars partials used by chat templates
|
||||
await foundry.applications.handlebars.loadTemplates([
|
||||
"systems/fvtt-lethal-fantasy/templates/chat/_dice-breakdown.hbs"
|
||||
])
|
||||
// Register Handlebars partials used by chat templates.
|
||||
// The object key is the partial ID referenced in templates (e.g., {{> chat/dice-breakdown}}),
|
||||
// the value is the file path. Using an array would register with the full path as the ID,
|
||||
// which does NOT match the template reference.
|
||||
await foundry.applications.handlebars.loadTemplates({
|
||||
"chat/dice-breakdown": "systems/fvtt-lethal-fantasy/templates/chat/_dice-breakdown.hbs"
|
||||
})
|
||||
|
||||
// Saignement piloté par le combat tracker
|
||||
_registerBleedingHooks()
|
||||
|
||||
Reference in New Issue
Block a user