1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Use range iterators for Map

This commit is contained in:
Lightning_A
2021-08-09 14:13:42 -06:00
parent e4dfa69bcf
commit c63b18507d
154 changed files with 1897 additions and 1897 deletions

View File

@@ -776,16 +776,16 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
}
if (player) {
for (Map<StringName, ProgressBar *>::Element *E = animations.front(); E; E = E->next()) {
Ref<AnimationNodeAnimation> an = blend_tree->get_node(E->key());
for (const KeyValue<StringName, ProgressBar *> &E : animations) {
Ref<AnimationNodeAnimation> an = blend_tree->get_node(E.key);
if (an.is_valid()) {
if (player->has_animation(an->get_animation())) {
Ref<Animation> anim = player->get_animation(an->get_animation());
if (anim.is_valid()) {
E->get()->set_max(anim->get_length());
E.value->set_max(anim->get_length());
//StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + E.input_node;
StringName time_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E->key()) + "/time";
E->get()->set_value(AnimationTreeEditor::get_singleton()->get_tree()->get(time_path));
StringName time_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E.key) + "/time";
E.value->set_value(AnimationTreeEditor::get_singleton()->get_tree()->get(time_path));
}
}
}