From 1ec159d2f6c8745aab511ea5c44fefd9b2c0f713 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 16 Oct 2026 12:24:17 +0300 Subject: [PATCH] add 'translucent' entity property --- src/content/loading/EntityLoader.cpp | 1 + src/objects/EntityDef.cpp | 1 + src/objects/EntityDef.hpp | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/content/loading/EntityLoader.cpp b/src/content/loading/EntityLoader.cpp index 625b1927a..fbc29bddf 100644 --- a/src/content/loading/EntityLoader.cpp +++ b/src/content/loading/EntityLoader.cpp @@ -94,6 +94,7 @@ template<> void ContentUnitLoader::loadUnit( root.at("mass").get(def.mass); root.at("elasticity").get(def.elasticity); root.at("step-height").get(def.stepHeight); + root.at("translucent").get(def.translucent); std::string lightingModeName; root.at("lighting-mode").get(lightingModeName); diff --git a/src/objects/EntityDef.cpp b/src/objects/EntityDef.cpp index 54e0aefef..6c3999e98 100644 --- a/src/objects/EntityDef.cpp +++ b/src/objects/EntityDef.cpp @@ -15,4 +15,5 @@ void EntityDef::cloneTo(EntityDef& dst) { dst.stepHeight = stepHeight; dst.save = save; dst.lightingMode = lightingMode; + dst.translucent = translucent; } diff --git a/src/objects/EntityDef.hpp b/src/objects/EntityDef.hpp index 139bce48c..7fc1c113c 100644 --- a/src/objects/EntityDef.hpp +++ b/src/objects/EntityDef.hpp @@ -42,6 +42,9 @@ struct EntityDef { /// @brief Model lighting mode ModelLightingMode lightingMode = ModelLightingMode::SOLID; + /// @brief Render the entity in the translucent pass + bool translucent = true; + /// @brief Can the entity be interacted with cursor (on_attack, on_use) bool selectable = true;