diff options
author | DualMatrix <piet.goris@gmail.com> | 2018-10-01 21:44:57 +0200 |
---|---|---|
committer | DualMatrix <piet.goris@gmail.com> | 2018-10-01 21:44:57 +0200 |
commit | 127940bd55751fa33394da2f9536c63bffe18398 (patch) | |
tree | d17aa6703cd5a24847ea3b29e2478ed52a6f1da7 | |
parent | c2abf1a4e93d2870ddecb2e7e7c80ba3f8be3397 (diff) |
Fixed animation editor not moving to next frame of sprites when editing.
Fixed animation editor not moving to next frame of sprites when editing.
-rw-r--r-- | editor/editor_inspector.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 2c4168f1a0..c6258c8493 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -484,6 +484,17 @@ void EditorProperty::update_reload_status() { } bool EditorProperty::use_keying_next() const { + List<PropertyInfo> plist; + object->get_property_list(&plist, true); + + for (List<PropertyInfo>::Element *I = plist.front(); I; I = I->next()) { + PropertyInfo &p = I->get(); + + if (p.name == property) { + return p.hint == PROPERTY_HINT_SPRITE_FRAME; + } + } + return false; } void EditorProperty::set_checkable(bool p_checkable) { @@ -618,6 +629,11 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { if (keying_rect.has_point(mb->get_position())) { emit_signal("property_keyed", property); + + if (use_keying_next()) { + call_deferred("emit_signal", "property_changed", property, object->get(property).operator int64_t() + 1); + call_deferred("update_property"); + } } if (revert_rect.has_point(mb->get_position())) { |