From 2d2adbbfd61e67e07c5541933fdc12e23482dd85 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 22 Jul 2024 03:55:37 -0500 Subject: [PATCH] feat: dialogue origin tracking --- app/react/components/dom/entities.jsx | 3 +++ app/server/engine.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/react/components/dom/entities.jsx b/app/react/components/dom/entities.jsx index 5afca90..955cd48 100644 --- a/app/react/components/dom/entities.jsx +++ b/app/react/components/dom/entities.jsx @@ -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, diff --git a/app/server/engine.js b/app/server/engine.js index b199f1b..0b18787 100644 --- a/app/server/engine.js +++ b/app/server/engine.js @@ -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; }