diff --git a/editor/app.js b/editor/app.js index 639a58c48f..1c7162e3bb 100644 --- a/editor/app.js +++ b/editor/app.js @@ -1044,6 +1044,7 @@ async function renderTrainers() { grid.innerHTML += `
+ ${getTrainerPicHtml(t.pic, 48)}

${escHtml(t.name || '(unnamed)')}

${escHtml(t.id)}
@@ -1125,6 +1126,13 @@ function openTrainerModal(trainer, isNew) { function renderModalBody() { const body = $('#trainer-modal-body'); body.innerHTML = ` +
+ ${getTrainerPicHtml(trainer.pic, 64)} +
+
${escHtml(trainer.name || '(unnamed)')}
+
${escHtml(trainer.pic || 'No pic set')}
+
+
@@ -2133,6 +2141,20 @@ function getSpriteHtml(graphicsId, size = 32) {
`; } +function getTrainerPicUrl(pic) { + const name = (pic || '').toLowerCase().replace(/\s+/g, '_'); + return `../graphics/trainers/front_pics/${name}.png`; +} + +function getTrainerPicHtml(pic, size = 64) { + const url = getTrainerPicUrl(pic); + const name = pic || ''; + return `
+ ${escAttr(name)} + +
`; +} + function getPreviewUrl(dirName) { return `previews/${encodeURIComponent(dirName)}.png`; }