Show the NPC portrait on the detail page

Npc::getPortraitPath() maps the name to image/npc-pictures/<NameNoSpaces>.png;
the edit page renders it beside the heading (with family · occupation), and
drops the <img> via onerror when a portrait is missing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Frank
2026-09-06 16:10:00 +02:00
co-authored by Claude Sonnet 5
parent 4d5c3253ed
commit 71b5cb6633
2 changed files with 21 additions and 4 deletions
+10
View File
@@ -227,4 +227,14 @@ class Npc
{
return $this->updatedAt;
}
/**
* AssetMapper logical path of this NPC's portrait, e.g.
* "image/npc-pictures/GarrickVoss.png". The file may not exist for
* NPCs added after the portrait sets were generated.
*/
public function getPortraitPath(): string
{
return 'image/npc-pictures/'.str_replace(' ', '', $this->name).'.png';
}
}