Hide update_mode for non-root HSMs

This commit is contained in:
Serhii Snitsaruk 2024-07-31 14:40:30 +02:00
parent 64df43c7c9
commit bed04dbf87
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
4 changed files with 10 additions and 0 deletions

View File

@ -253,6 +253,13 @@ void LimboHSM::_initialize(Node *p_agent, const Ref<Blackboard> &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) { void LimboHSM::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_POST_ENTER_TREE: { case NOTIFICATION_POST_ENTER_TREE: {

View File

@ -64,6 +64,7 @@ protected:
static void _bind_methods(); static void _bind_methods();
void _notification(int p_what); void _notification(int p_what);
void _validate_property(PropertyInfo &p_property) const;
virtual void _initialize(Node *p_agent, const Ref<Blackboard> &p_blackboard) override; virtual void _initialize(Node *p_agent, const Ref<Blackboard> &p_blackboard) override;
virtual bool _dispatch(const StringName &p_event, const Variant &p_cargo = Variant()) override; virtual bool _dispatch(const StringName &p_event, const Variant &p_cargo = Variant()) override;

View File

@ -156,6 +156,7 @@ LimboStringNames::LimboStringNames() {
Tools = SN("Tools"); Tools = SN("Tools");
Tree = SN("Tree"); Tree = SN("Tree");
TripleBar = SN("TripleBar"); TripleBar = SN("TripleBar");
update_mode = SN("update_mode");
update_task = SN("update_task"); update_task = SN("update_task");
update_tree = SN("update_tree"); update_tree = SN("update_tree");
updated = SN("updated"); updated = SN("updated");

View File

@ -173,6 +173,7 @@ public:
StringName Tools; StringName Tools;
StringName Tree; StringName Tree;
StringName TripleBar; StringName TripleBar;
StringName update_mode;
StringName update_task; StringName update_task;
StringName update_tree; StringName update_tree;
StringName updated; StringName updated;