From c657c77d0cf49afba627b93848e1915e2ce7d3ff Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 31 Aug 2023 20:23:06 +0200 Subject: story and npcs --- resources/js/ui.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'resources/js/ui.js') diff --git a/resources/js/ui.js b/resources/js/ui.js index 6884e14..e5afb53 100644 --- a/resources/js/ui.js +++ b/resources/js/ui.js @@ -556,7 +556,8 @@ const UI = { }, drawBattle () { - UI.elements.battle.style.backgroundImage = `url(/modules/tuxemon/mods/tuxemon/gfx/ui/combat/${Memory.state.currentArea.environment.battle_graphics.background})`; + UI.elements.battle.style.backgroundImage = `url(${Memory.state.currentArea.environment.battle_graphics.background})`; + UI.elements.battle.style.backgroundPosition = `${Memory.state.currentArea.environment.battle_graphics.background_position || 'top'}`; UI.showBattle(); UI.drawOpponentMonster(); @@ -1945,8 +1946,8 @@ const UI = { applyStoryPopupContent (popup, { speaker, text }) { const template = UI.createTemplate(Template.storyPopup); - template.querySelector('[data-template-slot="speaker.sprite"]').src = `/modules/tuxemon/mods/tuxemon/gfx/sprites/player/${speaker.template[0].sprite_name}.png`; - template.querySelector('[data-template-slot="speaker.name"]').textContent = slugToName(speaker.slug.replace('spyder_', '')); + template.querySelector('[data-template-slot="speaker.sprite"]').src = speaker.sprite; + template.querySelector('[data-template-slot="speaker.name"]').textContent = speaker.name; template.querySelector('[data-template-slot="text"]').innerHTML = nl2br(text); template.querySelector('[data-template-slot="next"]').addEventListener('click', UI.wrapCallback(() => { popup.dispatchEvent(new Event('next')); -- cgit v1.2.3