From bed04dbf872983c15ba56ef7b96736ea2e12799e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 31 Jul 2024 14:40:30 +0200 Subject: [PATCH] Hide update_mode for non-root HSMs --- hsm/limbo_hsm.cpp | 7 +++++++ hsm/limbo_hsm.h | 1 + util/limbo_string_names.cpp | 1 + util/limbo_string_names.h | 1 + 4 files changed, 10 insertions(+) diff --git a/hsm/limbo_hsm.cpp b/hsm/limbo_hsm.cpp index cba7608..022a52b 100644 --- a/hsm/limbo_hsm.cpp +++ b/hsm/limbo_hsm.cpp @@ -253,6 +253,13 @@ void LimboHSM::_initialize(Node *p_agent, const Ref &p_blackboard) { } } +void LimboHSM::_validate_property(PropertyInfo &p_property) const { + if (p_property.name == LW_NAME(update_mode) && !is_root()) { + // Hide update_mode for non-root HSMs. + p_property.usage = PROPERTY_USAGE_NONE; + } +} + void LimboHSM::_notification(int p_what) { switch (p_what) { case NOTIFICATION_POST_ENTER_TREE: { diff --git a/hsm/limbo_hsm.h b/hsm/limbo_hsm.h index 57606d3..f0e14a1 100644 --- a/hsm/limbo_hsm.h +++ b/hsm/limbo_hsm.h @@ -64,6 +64,7 @@ protected: static void _bind_methods(); void _notification(int p_what); + void _validate_property(PropertyInfo &p_property) const; virtual void _initialize(Node *p_agent, const Ref &p_blackboard) override; virtual bool _dispatch(const StringName &p_event, const Variant &p_cargo = Variant()) override; diff --git a/util/limbo_string_names.cpp b/util/limbo_string_names.cpp index 3226022..c4f7d50 100644 --- a/util/limbo_string_names.cpp +++ b/util/limbo_string_names.cpp @@ -156,6 +156,7 @@ LimboStringNames::LimboStringNames() { Tools = SN("Tools"); Tree = SN("Tree"); TripleBar = SN("TripleBar"); + update_mode = SN("update_mode"); update_task = SN("update_task"); update_tree = SN("update_tree"); updated = SN("updated"); diff --git a/util/limbo_string_names.h b/util/limbo_string_names.h index 641b121..d7ee502 100644 --- a/util/limbo_string_names.h +++ b/util/limbo_string_names.h @@ -173,6 +173,7 @@ public: StringName Tools; StringName Tree; StringName TripleBar; + StringName update_mode; StringName update_task; StringName update_tree; StringName updated;