summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 75e518e050..d19032da8b 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -623,14 +623,17 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) {
Vector2i new_coords = object->get(property);
new_coords.x++;
- if (new_coords.x >= object->get("hframes").operator int64_t()) {
+ if (new_coords.x >= int64_t(object->get("hframes"))) {
new_coords.x = 0;
new_coords.y++;
}
-
- call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
+ if (new_coords.x < int64_t(object->get("hframes")) && new_coords.y < int64_t(object->get("vframes"))) {
+ call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
+ }
} else {
- call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
+ if (int64_t(object->get(property)) + 1 < (int64_t(object->get("hframes")) * int64_t(object->get("vframes")))) {
+ call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
+ }
}
call_deferred(SNAME("update_property"));
@@ -861,10 +864,10 @@ String EditorProperty::get_tooltip_text() const {
void EditorProperty::menu_option(int p_option) {
switch (p_option) {
case MENU_COPY_PROPERTY: {
- EditorNode::get_singleton()->get_inspector()->set_property_clipboard(object->get(property));
+ InspectorDock::get_inspector_singleton()->set_property_clipboard(object->get(property));
} break;
case MENU_PASTE_PROPERTY: {
- emit_changed(property, EditorNode::get_singleton()->get_inspector()->get_property_clipboard());
+ emit_changed(property, InspectorDock::get_inspector_singleton()->get_property_clipboard());
} break;
case MENU_COPY_PROPERTY_PATH: {
DisplayServer::get_singleton()->clipboard_set(property);
@@ -2592,7 +2595,7 @@ void EditorInspector::update_tree() {
// Ignore properties that do not fit the filter.
if (use_filter && !filter.is_empty()) {
- if (!filter.is_subsequence_ofi(path) && !filter.is_subsequence_ofi(property_label_string) && property_prefix.to_lower().find(filter.to_lower()) == -1) {
+ if (!filter.is_subsequence_ofn(path) && !filter.is_subsequence_ofn(property_label_string) && property_prefix.to_lower().find(filter.to_lower()) == -1) {
continue;
}
}
@@ -2905,6 +2908,7 @@ void EditorInspector::edit(Object *p_object) {
object->connect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback));
update_tree();
}
+ emit_signal("edited_object_changed");
}
void EditorInspector::set_keying(bool p_active) {
@@ -3543,6 +3547,7 @@ void EditorInspector::_bind_methods() {
ADD_SIGNAL(MethodInfo("object_id_selected", PropertyInfo(Variant::INT, "id")));
ADD_SIGNAL(MethodInfo("property_edited", PropertyInfo(Variant::STRING, "property")));
ADD_SIGNAL(MethodInfo("property_toggled", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::BOOL, "checked")));
+ ADD_SIGNAL(MethodInfo("edited_object_changed"));
ADD_SIGNAL(MethodInfo("restart_requested"));
}