Browse Source

Round 2: Fix mesh library remove selected item menu option

Previous pr: #46435
Fixes: #45969
MmAaXx500 2 years ago
parent
commit
aa9d2149e7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      editor/plugins/mesh_library_editor_plugin.cpp

+ 2 - 2
editor/plugins/mesh_library_editor_plugin.cpp

@@ -232,8 +232,8 @@ void MeshLibraryEditor::_menu_cbk(int p_option) {
 		} break;
 		} break;
 		case MENU_OPTION_REMOVE_ITEM: {
 		case MENU_OPTION_REMOVE_ITEM: {
 			String p = InspectorDock::get_inspector_singleton()->get_selected_path();
 			String p = InspectorDock::get_inspector_singleton()->get_selected_path();
-			if (p.begins_with("/MeshLibrary/item") && p.get_slice_count("/") >= 2) {
-				to_erase = p.get_slice("/", 3).to_int();
+			if (p.begins_with("item") && p.get_slice_count("/") >= 2) {
+				to_erase = p.get_slice("/", 1).to_int();
 				cd_remove->set_text(vformat(TTR("Remove item %d?"), to_erase));
 				cd_remove->set_text(vformat(TTR("Remove item %d?"), to_erase));
 				cd_remove->popup_centered(Size2(300, 60));
 				cd_remove->popup_centered(Size2(300, 60));
 			}
 			}