summaryrefslogtreecommitdiff
path: root/resources/js/ui.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-31 20:23:06 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-31 20:23:06 +0200
commitc657c77d0cf49afba627b93848e1915e2ce7d3ff (patch)
tree5d96a65df277f52558cd5ff84f2fefbf4480a926 /resources/js/ui.js
parent7f6ab8779bd143b1b5f3465e3681abcbc113d19d (diff)
story and npcs
Diffstat (limited to 'resources/js/ui.js')
-rw-r--r--resources/js/ui.js7
1 files changed, 4 insertions, 3 deletions
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'));