diff options
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r-- | editor/editor_inspector.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index b29417b4c3..96b6a32914 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -644,7 +644,19 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { emit_signal("property_keyed", property, use_keying_next()); if (use_keying_next()) { - call_deferred("emit_changed", property, object->get(property).operator int64_t() + 1, "", false); + if (property == "frame_coords" && (object->is_class("Sprite") || object->is_class("Sprite3D"))) { + Vector2 new_coords = object->get(property); + new_coords.x++; + if (new_coords.x >= object->get("hframes").operator int64_t()) { + new_coords.x = 0; + new_coords.y++; + } + + call_deferred("emit_changed", property, new_coords, "", false); + } else { + call_deferred("emit_changed", property, object->get(property).operator int64_t() + 1, "", false); + } + call_deferred("update_property"); } } @@ -1566,11 +1578,11 @@ void EditorInspector::update_tree() { if (dot != -1) { String ov = name.right(dot); name = name.substr(0, dot); - name = name.camelcase_to_underscore().capitalize(); + name = name.capitalize(); name += ov; } else { - name = name.camelcase_to_underscore().capitalize(); + name = name.capitalize(); } } |