diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-01 14:56:06 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-01 14:56:06 +0100 |
commit | c1377920cdf919e7316e43f5039c46ac91fd96e0 (patch) | |
tree | 0a865a1885f183aecdb170b3d0fbfc4e7bb6c935 /scene/animation/animation_blend_tree.cpp | |
parent | 1e950dea5aeec11227c2f84e1f0256601ead23ac (diff) | |
parent | cd2032a90b7b1a499ccf08fbf62d70e0ac9bb8fa (diff) | |
download | redot-engine-c1377920cdf919e7316e43f5039c46ac91fd96e0.tar.gz |
Merge pull request #86743 from Mickeon/autocompletion-optimise-object
Optimise comparisons for Object's `get_argument_options`
Diffstat (limited to 'scene/animation/animation_blend_tree.cpp')
-rw-r--r-- | scene/animation/animation_blend_tree.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 1b9a9e812d..4a01b2ad65 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -1545,8 +1545,9 @@ void AnimationNodeBlendTree::_node_changed(const StringName &p_node) { emit_signal(SNAME("node_changed"), p_node); } +#ifdef TOOLS_ENABLED void AnimationNodeBlendTree::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { - String pf = p_function; + const String pf = p_function; bool add_node_options = false; if (p_idx == 0) { add_node_options = (pf == "get_node" || pf == "has_node" || pf == "rename_node" || pf == "remove_node" || pf == "set_node_position" || pf == "get_node_position" || pf == "connect_node" || pf == "disconnect_node"); @@ -1554,12 +1555,13 @@ void AnimationNodeBlendTree::get_argument_options(const StringName &p_function, add_node_options = (pf == "connect_node" || pf == "disconnect_node"); } if (add_node_options) { - for (KeyValue<StringName, Node> E : nodes) { + for (const KeyValue<StringName, Node> &E : nodes) { r_options->push_back(String(E.key).quote()); } } AnimationRootNode::get_argument_options(p_function, p_idx, r_options); } +#endif void AnimationNodeBlendTree::_bind_methods() { ClassDB::bind_method(D_METHOD("add_node", "name", "node", "position"), &AnimationNodeBlendTree::add_node, DEFVAL(Vector2())); |