diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 16 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 1 | ||||
-rw-r--r-- | editor/plugin_config_dialog.cpp | 7 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.h | 1 |
5 files changed, 31 insertions, 8 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())) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 2dec21fffb..1e97920f7e 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -531,7 +531,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("docks/property_editor/texture_preview_width", 48); _initial_set("docks/property_editor/auto_refresh_interval", 0.3); - _initial_set("text_editor/help/doc_path", ""); _initial_set("text_editor/help/show_help_index", true); _initial_set("filesystem/import/ask_save_before_reimport", false); diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 93bed035a5..a334f79f5a 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -76,7 +76,10 @@ void PluginConfigDialog::_on_confirmed() { "extends EditorPlugin\n" "\n" "func _enter_tree():\n" - "\tpass"); + "\tpass\n" + "\n" + "func _exit_tree():\n" + "\tpass\n"); String script_path = path.plus_file(script_edit->get_text()); gdscript->set_path(script_path); ResourceSaver::save(script_path, gdscript); @@ -84,7 +87,7 @@ void PluginConfigDialog::_on_confirmed() { } //TODO: other languages - emit_signal("plugin_ready", script.operator->(), active_edit->is_pressed() ? name_edit->get_text() : ""); + emit_signal("plugin_ready", script.operator->(), active_edit->is_pressed() ? subfolder_edit->get_text() : ""); } else { EditorNode::get_singleton()->get_project_settings()->update_plugins(); } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index f65c8cbd0d..e8f00ce0ba 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -179,6 +179,10 @@ void CanvasItemEditor::_snap_if_closer_float(float p_value, float p_target_snap, } } +bool CanvasItemEditor::_is_node_editable(const Node *p_node) { + return (!(p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_")) && !(ClassDB::is_parent_class(p_node->get_parent()->get_class_name(), "Container") && ClassDB::is_parent_class(p_node->get_class_name(), "Control"))); +} + void CanvasItemEditor::_snap_if_closer_point(Point2 p_value, Point2 p_target_snap, Point2 &r_current_snap, bool (&r_snapped)[2], real_t rotation, float p_radius) { Transform2D rot_trans = Transform2D(rotation, Point2()); p_value = rot_trans.inverse().xform(p_value); @@ -411,7 +415,7 @@ void CanvasItemEditor::_expand_encompassing_rect_using_children(Rect2 &r_rect, c } } - if (canvas_item && canvas_item->is_visible_in_tree() && (include_locked_nodes || !canvas_item->has_meta("_edit_lock_"))) { + if (canvas_item && canvas_item->is_visible_in_tree() && (include_locked_nodes || !_is_node_editable(canvas_item))) { Transform2D xform = p_parent_xform * p_canvas_xform * canvas_item->get_transform(); Rect2 rect = canvas_item->_edit_get_rect(); if (r_first) { @@ -509,7 +513,7 @@ void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_Sel } //Remove the item if invalid - if (!canvas_item || duplicate || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner())) || (canvas_item->has_meta("_edit_lock_") && canvas_item->get_meta("_edit_lock_"))) { + if (!canvas_item || duplicate || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner())) || !_is_node_editable(canvas_item)) { r_items.remove(i); i--; } else { @@ -610,7 +614,7 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n bool editable = p_node == scene || p_node->get_owner() == scene || scene->is_editable_instance(p_node->get_owner()); bool lock_children = p_node->has_meta("_edit_group_") && p_node->get_meta("_edit_group_"); - bool locked = p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_"); + bool locked = !_is_node_editable(p_node); if (!lock_children || !editable) { for (int i = p_node->get_child_count() - 1; i >= 0; i--) { @@ -677,7 +681,7 @@ List<CanvasItem *> CanvasItemEditor::_get_edited_canvas_items(bool retreive_lock List<CanvasItem *> selection; for (Map<Node *, Object *>::Element *E = editor_selection->get_selection().front(); E; E = E->next()) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->key()); - if (canvas_item && canvas_item->is_visible_in_tree() && canvas_item->get_viewport() == EditorNode::get_singleton()->get_scene_root() && (retreive_locked || !canvas_item->has_meta("_edit_lock_"))) { + if (canvas_item && canvas_item->is_visible_in_tree() && canvas_item->get_viewport() == EditorNode::get_singleton()->get_scene_root() && (retreive_locked || _is_node_editable(canvas_item))) { CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (se) { selection.push_back(canvas_item); @@ -2946,7 +2950,7 @@ void CanvasItemEditor::_draw_invisible_nodes_positions(Node *p_node, const Trans _draw_invisible_nodes_positions(p_node->get_child(i), parent_xform, canvas_xform); } - if (canvas_item && !canvas_item->_edit_use_rect() && (!editor_selection->is_selected(canvas_item) || (canvas_item->has_meta("_edit_lock_") && canvas_item->get_meta("_edit_lock_")))) { + if (canvas_item && !canvas_item->_edit_use_rect() && (!editor_selection->is_selected(canvas_item) || !_is_node_editable(canvas_item))) { Transform2D xform = transform * canvas_xform * parent_xform; // Draw the node's position diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index c788a63d56..6a788692d7 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -365,6 +365,7 @@ private: Ref<ShortCut> multiply_grid_step_shortcut; Ref<ShortCut> divide_grid_step_shortcut; + bool _is_node_editable(const Node *p_node); void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, Vector<_SelectResult> &r_items, int p_limit = 0, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D()); void _get_canvas_items_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items, int p_limit = 0); void _get_bones_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items); |