diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_dialog.cpp | 19 | ||||
-rw-r--r-- | editor/editor_file_dialog.h | 1 | ||||
-rw-r--r-- | editor/editor_plugin.cpp | 11 | ||||
-rw-r--r-- | editor/editor_plugin.h | 3 | ||||
-rw-r--r-- | editor/fileserver/editor_file_server.cpp | 2 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 10 | ||||
-rw-r--r-- | editor/filesystem_dock.h | 2 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 11 |
8 files changed, 53 insertions, 6 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index f356c16827..22b33cc98f 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -458,6 +458,23 @@ void EditorFileDialog::_item_selected(int p_item) { get_ok()->set_disabled(_is_open_should_be_disabled()); } +void EditorFileDialog::_multi_selected(int p_item, bool p_selected) { + + int current = p_item; + if (current < 0 || current >= item_list->get_item_count()) + return; + + Dictionary d = item_list->get_item_metadata(current); + + if (!d["dir"] && p_selected) { + + file->set_text(d["name"]); + _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); + } + + get_ok()->set_disabled(_is_open_should_be_disabled()); +} + void EditorFileDialog::_items_clear_selection() { item_list->unselect_all(); @@ -1290,6 +1307,7 @@ void EditorFileDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("_unhandled_input"), &EditorFileDialog::_unhandled_input); ClassDB::bind_method(D_METHOD("_item_selected"), &EditorFileDialog::_item_selected); + ClassDB::bind_method(D_METHOD("_multi_selected"), &EditorFileDialog::_multi_selected); ClassDB::bind_method(D_METHOD("_items_clear_selection"), &EditorFileDialog::_items_clear_selection); ClassDB::bind_method(D_METHOD("_item_list_item_rmb_selected"), &EditorFileDialog::_item_list_item_rmb_selected); ClassDB::bind_method(D_METHOD("_item_list_rmb_clicked"), &EditorFileDialog::_item_list_rmb_clicked); @@ -1598,6 +1616,7 @@ EditorFileDialog::EditorFileDialog() { connect("confirmed", this, "_action_pressed"); item_list->connect("item_selected", this, "_item_selected", varray(), CONNECT_DEFERRED); + item_list->connect("multi_selected", this, "_multi_selected", varray(), CONNECT_DEFERRED); item_list->connect("item_activated", this, "_item_db_selected", varray()); item_list->connect("nothing_selected", this, "_items_clear_selection"); dir->connect("text_entered", this, "_dir_entered"); diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 05f66eadbf..b1f8f1108c 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -159,6 +159,7 @@ private: void _recent_selected(int p_idx); void _item_selected(int p_item); + void _multi_selected(int p_item, bool p_selected); void _items_clear_selection(); void _item_dc_selected(int p_item); diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 9dd8a7232f..b1a0efaea6 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -235,6 +235,14 @@ Control *EditorInterface::get_base_control() { return EditorNode::get_singleton()->get_gui_base(); } +void EditorInterface::set_plugin_enabled(const String &p_plugin, bool p_enabled) { + EditorNode::get_singleton()->set_addon_plugin_enabled(p_plugin, p_enabled); +} + +bool EditorInterface::is_plugin_enabled(const String &p_plugin) const { + return EditorNode::get_singleton()->is_addon_plugin_enabled(p_plugin); +} + Error EditorInterface::save_scene() { if (!get_edited_scene_root()) return ERR_CANT_CREATE; @@ -271,6 +279,9 @@ void EditorInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("select_file", "p_file"), &EditorInterface::select_file); ClassDB::bind_method(D_METHOD("get_selected_path"), &EditorInterface::get_selected_path); + ClassDB::bind_method(D_METHOD("set_plugin_enabled", "plugin", "enabled"), &EditorInterface::set_plugin_enabled); + ClassDB::bind_method(D_METHOD("is_plugin_enabled", "plugin"), &EditorInterface::is_plugin_enabled); + ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene); ClassDB::bind_method(D_METHOD("save_scene_as", "path", "with_preview"), &EditorInterface::save_scene_as, DEFVAL(true)); } diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 145dccc2d5..3d585120c0 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -90,6 +90,9 @@ public: Control *get_base_control(); + void set_plugin_enabled(const String &p_plugin, bool p_enabled); + bool is_plugin_enabled(const String &p_plugin) const; + Error save_scene(); void save_scene_as(const String &p_scene, bool p_with_preview = true); diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 56fb7633e7..a218070933 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -55,7 +55,7 @@ void EditorFileServer::_subthread_start(void *s) { ClientData *cd = (ClientData *)s; - cd->connection->set_nodelay(true); + cd->connection->set_no_delay(true); uint8_t buf4[8]; Error err = cd->connection->get_data(buf4, 4); if (err != OK) { diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index cc9c9a11d7..8ead8d3982 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -77,7 +77,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory return true; } -void FileSystemDock::_update_tree(bool keep_collapse_state) { +void FileSystemDock::_update_tree(bool keep_collapse_state, bool p_uncollapse_root) { Vector<String> uncollapsed_paths; if (keep_collapse_state) { @@ -129,6 +129,10 @@ void FileSystemDock::_update_tree(bool keep_collapse_state) { ti->set_metadata(0, fave); } + if (p_uncollapse_root) { + uncollapsed_paths.push_back("res://"); + } + _create_tree(root, EditorFileSystem::get_singleton()->get_filesystem(), uncollapsed_paths); tree->ensure_cursor_is_visible(); updating_tree = false; @@ -154,6 +158,7 @@ void FileSystemDock::_notification(int p_what) { } else { tree->set_v_size_flags(SIZE_FILL); + button_tree->hide(); if (!tree->is_visible()) { tree->show(); button_favorite->show(); @@ -163,7 +168,6 @@ void FileSystemDock::_notification(int p_what) { if (!file_list_vb->is_visible()) { file_list_vb->show(); - button_tree->hide(); _update_files(true); } } @@ -204,7 +208,7 @@ void FileSystemDock::_notification(int p_what) { if (EditorFileSystem::get_singleton()->is_scanning()) { _set_scanning_mode(); } else { - _update_tree(false); + _update_tree(false, true); } } break; diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index af80557465..2e86b83efc 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -157,7 +157,7 @@ private: bool import_dock_needs_update; bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths); - void _update_tree(bool keep_collapse_state); + void _update_tree(bool keep_collapse_state, bool p_uncollapse_root = false); void _update_files(bool p_keep_selection); void _update_file_display_toggle_button(); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 704ec40e4c..058f517ae9 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -750,7 +750,16 @@ void ProjectSettingsEditor::_item_add() { String catname = category->get_text().strip_edges(); String propname = property->get_text().strip_edges(); - String name = catname != "" ? catname + "/" + propname : propname; + + if (propname.empty()) { + return; + } + + if (catname.empty()) { + catname = "global"; + } + + String name = catname + "/" + propname; undo_redo->create_action(TTR("Add Global Property")); |