From b4ecfab5b893d08d0d5784ef0b567b8cf0564a7e Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 3 Jun 2025 09:57:53 +1000 Subject: add statusText to world.nametagEntity --- source/game/scripting/StarWorldLuaBindings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/game/scripting/StarWorldLuaBindings.cpp b/source/game/scripting/StarWorldLuaBindings.cpp index 64d1f30..9f5465a 100644 --- a/source/game/scripting/StarWorldLuaBindings.cpp +++ b/source/game/scripting/StarWorldLuaBindings.cpp @@ -1455,16 +1455,19 @@ namespace LuaBindings { Maybe WorldEntityCallbacks::entityNametag(World* world, EntityId entityId) { auto entity = world->entity(entityId); + Json result; if (auto nametagEntity = as(entity)) { - return JsonObject{ + Json result = JsonObject{ {"nametag", nametagEntity->nametag()}, {"displayed", nametagEntity->displayNametag()}, {"color", jsonFromColor(Color::rgb(nametagEntity->nametagColor()))}, {"origin", jsonFromVec2F(nametagEntity->nametagOrigin())}, }; + if (auto status = nametagEntity->statusText()) + result.set("status", *status); } - return {}; + return result; } Maybe WorldEntityCallbacks::entityDescription(World* world, EntityId entityId, Maybe const& species) { -- cgit v1.2.3