1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00

Fix mesh library remove selected item menu option

Fixes #45969.

(cherry picked from commits 189acbee60
and aa9d2149e7)
This commit is contained in:
Haz
2021-02-25 19:06:32 -05:00
committed by Rémi Verschelde
parent b884fe2c76
commit 2783deb939

View File

@@ -229,8 +229,8 @@ void MeshLibraryEditor::_menu_cbk(int p_option) {
} break; } break;
case MENU_OPTION_REMOVE_ITEM: { case MENU_OPTION_REMOVE_ITEM: {
String p = editor->get_inspector()->get_selected_path(); String p = editor->get_inspector()->get_selected_path();
if (p.begins_with("/MeshLibrary/item") && p.get_slice_count("/") >= 3) { if (p.begins_with("item") && p.get_slice_count("/") >= 2) {
to_erase = p.get_slice("/", 3).to_int(); 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));
} }