feat: dialogue origin tracking

This commit is contained in:
cha0s 2024-07-22 03:55:37 -05:00
parent b95a2e2bb9
commit 2d2adbbfd6
2 changed files with 5 additions and 2 deletions

View File

@ -38,6 +38,9 @@ export default function Entities({
const {dialogues} = updating[id].Interlocutor;
for (const key in dialogue) {
dialogues[key] = dialogue[key];
if ('track' === dialogues[key].origin) {
dialogues[key].origin = () => updating[id].Position;
}
dialogues[key].letters = parseLetters(dialogues[key].body);
setChatMessages((chatMessages) => ({
[[id, key].join('-')]: dialogues[key].letters,

View File

@ -134,8 +134,8 @@ export default class Engine {
Interlocutor.dialogue({
body: payload.value,
linger: 5,
origin: Position.toJSON(),
position: {x: Position.x, y: Position.y - 32},
origin: 'track',
position: {x: Position.x, y: Position.y - 64},
});
break;
}