Merge pull request #23380 from volzhs/hide_attach_script
Hide "Attach Script" if node has one
This commit is contained in:
commit
21dc20cd07
1 changed files with 3 additions and 1 deletions
|
@ -2071,7 +2071,9 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||||
existing_script = selected->get_script();
|
existing_script = selected->get_script();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!existing_script.is_valid()) {
|
||||||
menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
|
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()) {
|
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("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);
|
menu->add_icon_shortcut(get_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_ATTACH_SCRIPT);
|
||||||
|
|
Loading…
Reference in a new issue