diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/connections_dialog.cpp | 68 | ||||
-rw-r--r-- | editor/editor_node.cpp | 8 | ||||
-rw-r--r-- | editor/editor_spin_slider.cpp | 9 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 60 | ||||
-rw-r--r-- | editor/icons/icon_rotate_left.svg | 1 | ||||
-rw-r--r-- | editor/icons/icon_rotate_right.svg | 1 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 2 |
9 files changed, 76 insertions, 79 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index cfc2ec11cf..1e5eabc24e 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -108,8 +108,8 @@ public: }; /* -Signal automatically called by parent dialog. -*/ + * Signal automatically called by parent dialog. + */ void ConnectDialog::ok_pressed() { if (dst_method->get_text() == "") { @@ -134,8 +134,8 @@ void ConnectDialog::_cancel_pressed() { } /* -Called each time a target node is selected within the target node tree. -*/ + * Called each time a target node is selected within the target node tree. + */ void ConnectDialog::_tree_node_selected() { Node *current = tree->get_selected(); @@ -148,8 +148,8 @@ void ConnectDialog::_tree_node_selected() { } /* -Adds a new parameter bind to connection. -*/ + * Adds a new parameter bind to connection. + */ void ConnectDialog::_add_bind() { if (cdbinds->params.size() >= VARIANT_ARG_MAX) @@ -184,8 +184,8 @@ void ConnectDialog::_add_bind() { } /* -Remove parameter bind from connection. -*/ + * Remove parameter bind from connection. + */ void ConnectDialog::_remove_bind() { String st = bind_editor->get_selected_path(); @@ -265,18 +265,18 @@ bool ConnectDialog::get_oneshot() const { } /* -Returns true if ConnectDialog is being used to edit an existing connection. -*/ + * Returns true if ConnectDialog is being used to edit an existing connection. + */ bool ConnectDialog::is_editing() const { return bEditMode; } /* -Initialize ConnectDialog and populate fields with expected data. -If creating a connection from scratch, sensible defaults are used. -If editing an existing connection, previous data is retained. -*/ + * Initialize ConnectDialog and populate fields with expected data. + * If creating a connection from scratch, sensible defaults are used. + * If editing an existing connection, previous data is retained. + */ void ConnectDialog::init(Connection c, bool bEdit) { source = static_cast<Node *>(c.source); @@ -482,9 +482,9 @@ struct _ConnectionsDockMethodInfoSort { }; /* -Post-ConnectDialog callback for creating/editing connections. -Creates or edits connections based on state of the ConnectDialog when "Connect" is pressed. -*/ + * Post-ConnectDialog callback for creating/editing connections. + * Creates or edits connections based on state of the ConnectDialog when "Connect" is pressed. + */ void ConnectionsDock::_make_or_edit_connection() { TreeItem *it = tree->get_selected(); @@ -552,8 +552,8 @@ void ConnectionsDock::_make_or_edit_connection() { } /* -Creates single connection w/ undo-redo functionality. -*/ + * Creates single connection w/ undo-redo functionality. + */ void ConnectionsDock::_connect(Connection cToMake) { Node *source = static_cast<Node *>(cToMake.source); @@ -575,8 +575,8 @@ void ConnectionsDock::_connect(Connection cToMake) { } /* -Break single connection w/ undo-redo functionality. -*/ + * Break single connection w/ undo-redo functionality. + */ void ConnectionsDock::_disconnect(TreeItem &item) { Connection c = item.get_metadata(0); @@ -595,9 +595,9 @@ void ConnectionsDock::_disconnect(TreeItem &item) { } /* -Break all connections of currently selected signal. -Can undo-redo as a single action. -*/ + * Break all connections of currently selected signal. + * Can undo-redo as a single action. + */ void ConnectionsDock::_disconnect_all() { TreeItem *item = tree->get_selected(); @@ -659,8 +659,8 @@ bool ConnectionsDock::_is_item_signal(TreeItem &item) { } /* -Open connection dialog with TreeItem data to CREATE a brand-new connection. -*/ + * Open connection dialog with TreeItem data to CREATE a brand-new connection. + */ void ConnectionsDock::_open_connection_dialog(TreeItem &item) { String signal = item.get_metadata(0).operator Dictionary()["name"]; @@ -700,8 +700,8 @@ void ConnectionsDock::_open_connection_dialog(TreeItem &item) { } /* -Open connection dialog with Connection data to EDIT an existing connection. -*/ + * Open connection dialog with Connection data to EDIT an existing connection. + */ void ConnectionsDock::_open_connection_dialog(Connection cToEdit) { Node *src = static_cast<Node *>(cToEdit.source); @@ -715,8 +715,8 @@ void ConnectionsDock::_open_connection_dialog(Connection cToEdit) { } /* -Open slot method location in script editor. -*/ + * Open slot method location in script editor. + */ void ConnectionsDock::_go_to_script(TreeItem &item) { if (_is_item_signal(item)) @@ -914,7 +914,6 @@ void ConnectionsDock::update_tree() { String signaldesc = "("; PoolStringArray argnames; if (mi.arguments.size()) { - signaldesc += " "; for (int i = 0; i < mi.arguments.size(); i++) { PropertyInfo &pi = mi.arguments[i]; @@ -927,10 +926,9 @@ void ConnectionsDock::update_tree() { } else if (pi.type != Variant::NIL) { tname = Variant::get_type_name(pi.type); } - signaldesc += tname + " " + (pi.name == "" ? String("arg " + itos(i)) : pi.name); + signaldesc += (pi.name == "" ? String("arg " + itos(i)) : pi.name) + ": " + tname; argnames.push_back(pi.name + ":" + tname); } - signaldesc += " "; } signaldesc += ")"; @@ -1000,14 +998,14 @@ void ConnectionsDock::update_tree() { path += " (oneshot)"; if (c.binds.size()) { - path += " binds( "; + path += " binds("; for (int i = 0; i < c.binds.size(); i++) { if (i > 0) path += ", "; path += c.binds[i].operator String(); } - path += " )"; + path += ")"; } TreeItem *item2 = tree->create_item(item); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index df1e8005ed..05b50d5dfe 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2365,6 +2365,9 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } } } break; + case RUN_PROJECT_DATA_FOLDER: { + OS::get_singleton()->shell_open(String("file://") + OS::get_singleton()->get_user_data_dir()); + } break; case FILE_EXPLORE_ANDROID_BUILD_TEMPLATES: { OS::get_singleton()->shell_open("file://" + ProjectSettings::get_singleton()->get_resource_path().plus_file("android")); } break; @@ -2571,8 +2574,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { save_all_scenes(); restart_editor(); } break; - default: { - } } } @@ -2605,9 +2606,6 @@ void EditorNode::_tool_menu_option(int p_idx) { case TOOLS_ORPHAN_RESOURCES: { orphan_resources->show(); } break; - case RUN_PROJECT_DATA_FOLDER: { - OS::get_singleton()->shell_open(String("file://") + OS::get_singleton()->get_user_data_dir()); - } break; case TOOLS_CUSTOM: { if (tool_menu->get_item_submenu(p_idx) == "") { Array params = tool_menu->get_item_metadata(p_idx); diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 35fe366526..918b0ef96d 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -109,13 +109,8 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { } if (grabbing_spinner) { - if (mm->get_control() || updown_offset != -1) { - set_value(Math::round(get_value())); - if (ABS(grabbing_spinner_dist_cache) > 6) { - set_value(get_value() + SGN(grabbing_spinner_dist_cache)); - grabbing_spinner_dist_cache = 0; - pre_grab_value = get_value(); - } + if (mm->get_control()) { + set_value(Math::round(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10)); } else { set_value(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10); } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 426ea8f196..e3f0021fbc 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -477,6 +477,7 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa } void FileSystemDock::navigate_to_path(const String &p_path) { + file_list_search_box->clear(); _navigate_to_path(p_path); } @@ -2099,6 +2100,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str bool all_folders = true; bool all_favorites = true; bool all_not_favorites = true; + for (int i = 0; i < p_paths.size(); i++) { String fpath = p_paths[i]; if (fpath.ends_with("/")) { @@ -2128,25 +2130,25 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str if (all_files) { if (all_files_scenes) { if (filenames.size() == 1) { - p_popup->add_item(TTR("Open Scene"), FILE_OPEN); - p_popup->add_item(TTR("New Inherited Scene"), FILE_INHERIT); + p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open Scene"), FILE_OPEN); + p_popup->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("New Inherited Scene"), FILE_INHERIT); } else { - p_popup->add_item(TTR("Open Scenes"), FILE_OPEN); + p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open Scenes"), FILE_OPEN); } - p_popup->add_item(TTR("Instance"), FILE_INSTANCE); + p_popup->add_icon_item(get_icon("Instance", "EditorIcons"), TTR("Instance"), FILE_INSTANCE); p_popup->add_separator(); } else if (filenames.size() == 1) { - p_popup->add_item(TTR("Open"), FILE_OPEN); + p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN); p_popup->add_separator(); } } if (p_paths.size() >= 1) { if (!all_favorites) { - p_popup->add_item(TTR("Add to Favorites"), FILE_ADD_FAVORITE); + p_popup->add_icon_item(get_icon("Favorites", "EditorIcons"), TTR("Add to Favorites"), FILE_ADD_FAVORITE); } if (!all_not_favorites) { - p_popup->add_item(TTR("Remove from Favorites"), FILE_REMOVE_FAVORITE); + p_popup->add_icon_item(get_icon("NonFavorite", "EditorIcons"), TTR("Remove from Favorites"), FILE_REMOVE_FAVORITE); } p_popup->add_separator(); } @@ -2159,36 +2161,36 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str } } else if (all_folders && foldernames.size() > 0) { - p_popup->add_item(TTR("Open"), FILE_OPEN); + p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN); p_popup->add_separator(); } if (p_paths.size() == 1) { - p_popup->add_item(TTR("Copy Path"), FILE_COPY_PATH); + p_popup->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Path"), FILE_COPY_PATH); if (p_paths[0] != "res://") { - p_popup->add_item(TTR("Rename..."), FILE_RENAME); - p_popup->add_item(TTR("Duplicate..."), FILE_DUPLICATE); + p_popup->add_icon_item(get_icon("Rename", "EditorIcons"), TTR("Rename..."), FILE_RENAME); + p_popup->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate..."), FILE_DUPLICATE); } } if (p_paths.size() > 1 || p_paths[0] != "res://") { - p_popup->add_item(TTR("Move To..."), FILE_MOVE); - p_popup->add_item(TTR("Delete"), FILE_REMOVE); + p_popup->add_icon_item(get_icon("MoveUp", "EditorIcons"), TTR("Move To..."), FILE_MOVE); + p_popup->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete"), FILE_REMOVE); } if (p_paths.size() == 1) { p_popup->add_separator(); if (p_display_path_dependent_options) { - p_popup->add_item(TTR("New Folder..."), FILE_NEW_FOLDER); - p_popup->add_item(TTR("New Scene..."), FILE_NEW_SCENE); - p_popup->add_item(TTR("New Script..."), FILE_NEW_SCRIPT); - p_popup->add_item(TTR("New Resource..."), FILE_NEW_RESOURCE); + p_popup->add_icon_item(get_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); + p_popup->add_icon_item(get_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); + p_popup->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); + p_popup->add_icon_item(get_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); p_popup->add_separator(); } String fpath = p_paths[0]; String item_text = fpath.ends_with("/") ? TTR("Open in File Manager") : TTR("Show in File Manager"); - p_popup->add_item(item_text, FILE_SHOW_IN_EXPLORER); + p_popup->add_icon_item(get_icon("Filesystem", "EditorIcons"), item_text, FILE_SHOW_IN_EXPLORER); } } @@ -2198,8 +2200,8 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { if (paths.size() == 1) { if (paths[0].ends_with("/")) { - tree_popup->add_item(TTR("Expand All"), FOLDER_EXPAND_ALL); - tree_popup->add_item(TTR("Collapse All"), FOLDER_COLLAPSE_ALL); + tree_popup->add_icon_item(get_icon("GuiTreeArrowDown", "EditorIcons"), TTR("Expand All"), FOLDER_EXPAND_ALL); + tree_popup->add_icon_item(get_icon("GuiTreeArrowRight", "EditorIcons"), TTR("Collapse All"), FOLDER_COLLAPSE_ALL); tree_popup->add_separator(); } } @@ -2219,10 +2221,10 @@ void FileSystemDock::_tree_rmb_empty(const Vector2 &p_pos) { path = "res://"; tree_popup->clear(); tree_popup->set_size(Size2(1, 1)); - tree_popup->add_item(TTR("New Folder..."), FILE_NEW_FOLDER); - tree_popup->add_item(TTR("New Scene..."), FILE_NEW_SCENE); - tree_popup->add_item(TTR("New Script..."), FILE_NEW_SCRIPT); - tree_popup->add_item(TTR("New Resource..."), FILE_NEW_RESOURCE); + tree_popup->add_icon_item(get_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); + tree_popup->add_icon_item(get_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); + tree_popup->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); + tree_popup->add_icon_item(get_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); tree_popup->set_position(tree->get_global_position() + p_pos); tree_popup->popup(); } @@ -2262,12 +2264,12 @@ void FileSystemDock::_file_list_rmb_pressed(const Vector2 &p_pos) { file_list_popup->clear(); file_list_popup->set_size(Size2(1, 1)); - file_list_popup->add_item(TTR("New Folder..."), FILE_NEW_FOLDER); - file_list_popup->add_item(TTR("New Scene..."), FILE_NEW_SCENE); - file_list_popup->add_item(TTR("New Script..."), FILE_NEW_SCRIPT); - file_list_popup->add_item(TTR("New Resource..."), FILE_NEW_RESOURCE); + file_list_popup->add_icon_item(get_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); + file_list_popup->add_icon_item(get_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); + file_list_popup->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); + file_list_popup->add_icon_item(get_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); file_list_popup->add_separator(); - file_list_popup->add_item(TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER); + file_list_popup->add_icon_item(get_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER); file_list_popup->set_position(files->get_global_position() + p_pos); file_list_popup->popup(); } diff --git a/editor/icons/icon_rotate_left.svg b/editor/icons/icon_rotate_left.svg new file mode 100644 index 0000000000..223a725332 --- /dev/null +++ b/editor/icons/icon_rotate_left.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0" fill-opacity=".99608" transform="translate(0 -1036.4)"><path d="m9 2a6 6 0 0 0 -6 6h2a4 4 0 0 1 4-4 4 4 0 0 1 4 4 4 4 0 0 1 -4 4v2a6 6 0 0 0 6-6 6 6 0 0 0 -6-6z" transform="translate(0 1036.4)"/><path d="m4.118 1048.3-1.6771-.9683-1.6771-.9682 1.6771-.9683 1.6771-.9682-.0000001 1.9365z" transform="matrix(0 -1.1926 1.5492 0 -1617 1049.3)"/></g></svg>
\ No newline at end of file diff --git a/editor/icons/icon_rotate_right.svg b/editor/icons/icon_rotate_right.svg new file mode 100644 index 0000000000..2b66bae998 --- /dev/null +++ b/editor/icons/icon_rotate_right.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0" fill-opacity=".99608" transform="matrix(-1 0 0 1 16.026308 -1036.4)"><path d="m9 2a6 6 0 0 0 -6 6h2a4 4 0 0 1 4-4 4 4 0 0 1 4 4 4 4 0 0 1 -4 4v2a6 6 0 0 0 6-6 6 6 0 0 0 -6-6z" transform="translate(0 1036.4)"/><path d="m4.118 1048.3-1.6771-.9683-1.6771-.9682 1.6771-.9683 1.6771-.9682-.0000001 1.9365z" transform="matrix(0 -1.1926 1.5492 0 -1617 1049.3)"/></g></svg>
\ No newline at end of file diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index df5511f540..49091dc812 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -156,7 +156,7 @@ static Transform _arr_to_xform(const Array &p_array) { } String EditorSceneImporterGLTF::_sanitize_scene_name(const String &name) { - RegEx regex("([^a-zA-Z0-9_ ]+)"); + RegEx regex("([^a-zA-Z0-9_ -]+)"); String p_name = regex.sub(name, "", true); return p_name; } diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 86d538e702..2d66087699 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -71,8 +71,8 @@ void TileMapEditor::_notification(int p_what) { picker_button->set_icon(get_icon("ColorPick", "EditorIcons")); select_button->set_icon(get_icon("ActionCopy", "EditorIcons")); - rotate_left_button->set_icon(get_icon("Rotate270", "EditorIcons")); - rotate_right_button->set_icon(get_icon("Rotate90", "EditorIcons")); + rotate_left_button->set_icon(get_icon("RotateLeft", "EditorIcons")); + rotate_right_button->set_icon(get_icon("RotateRight", "EditorIcons")); flip_horizontal_button->set_icon(get_icon("MirrorX", "EditorIcons")); flip_vertical_button->set_icon(get_icon("MirrorY", "EditorIcons")); clear_transform_button->set_icon(get_icon("Clear", "EditorIcons")); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 6a9dbb103a..e96dfdd7b9 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -423,10 +423,12 @@ void ScriptEditorDebugger::_scene_tree_request() { int ScriptEditorDebugger::_update_scene_tree(TreeItem *parent, const Array &nodes, int current_index) { String filter = EditorNode::get_singleton()->get_scene_tree_dock()->get_filter(); String item_text = nodes[current_index + 1]; + String item_type = nodes[current_index + 2]; bool keep = filter.is_subsequence_ofi(item_text); TreeItem *item = inspect_scene_tree->create_item(parent); item->set_text(0, item_text); + item->set_tooltip(0, TTR("Type:") + " " + item_type); ObjectID id = ObjectID(nodes[current_index + 3]); Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(nodes[current_index + 2], ""); if (icon.is_valid()) { |