mirror of
https://github.com/godotengine/godot.git
synced 2025-01-10 12:11:05 +00:00
Merge pull request #23380 from volzhs/hide_attach_script
Hide "Attach Script" if node has one
This commit is contained in:
commit
21dc20cd07
@ -2071,7 +2071,9 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
existing_script = selected->get_script();
|
||||
}
|
||||
|
||||
menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
|
||||
if (!existing_script.is_valid()) {
|
||||
menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
|
||||
}
|
||||
if (selection.size() > 1 || existing_script.is_valid()) {
|
||||
menu->add_icon_shortcut(get_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT);
|
||||
menu->add_icon_shortcut(get_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_ATTACH_SCRIPT);
|
||||
|
Loading…
Reference in New Issue
Block a user