You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Add EditorStringNames singleton
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "editor/editor_quick_open.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/gui/editor_file_dialog.h"
|
||||
#include "editor/inspector_dock.h"
|
||||
@@ -1319,7 +1320,7 @@ void SceneTreeDock::_notification(int p_what) {
|
||||
|
||||
node_shortcuts_toggle = memnew(Button);
|
||||
node_shortcuts_toggle->set_flat(true);
|
||||
node_shortcuts_toggle->set_icon(get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
node_shortcuts_toggle->set_icon(get_editor_theme_icon(SNAME("Favorites")));
|
||||
node_shortcuts_toggle->set_toggle_mode(true);
|
||||
node_shortcuts_toggle->set_tooltip_text(TTR("Switch to Favorite Nodes"));
|
||||
node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection"));
|
||||
@@ -1344,19 +1345,19 @@ void SceneTreeDock::_notification(int p_what) {
|
||||
button_2d = memnew(Button);
|
||||
beginner_node_shortcuts->add_child(button_2d);
|
||||
button_2d->set_text(TTR("2D Scene"));
|
||||
button_2d->set_icon(get_theme_icon(SNAME("Node2D"), SNAME("EditorIcons")));
|
||||
button_2d->set_icon(get_editor_theme_icon(SNAME("Node2D")));
|
||||
button_2d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_2D_SCENE, false));
|
||||
|
||||
button_3d = memnew(Button);
|
||||
beginner_node_shortcuts->add_child(button_3d);
|
||||
button_3d->set_text(TTR("3D Scene"));
|
||||
button_3d->set_icon(get_theme_icon(SNAME("Node3D"), SNAME("EditorIcons")));
|
||||
button_3d->set_icon(get_editor_theme_icon(SNAME("Node3D")));
|
||||
button_3d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_3D_SCENE, false));
|
||||
|
||||
button_ui = memnew(Button);
|
||||
beginner_node_shortcuts->add_child(button_ui);
|
||||
button_ui->set_text(TTR("User Interface"));
|
||||
button_ui->set_icon(get_theme_icon(SNAME("Control"), SNAME("EditorIcons")));
|
||||
button_ui->set_icon(get_editor_theme_icon(SNAME("Control")));
|
||||
button_ui->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_USER_INTERFACE, false));
|
||||
|
||||
favorite_node_shortcuts = memnew(VBoxContainer);
|
||||
@@ -1365,13 +1366,13 @@ void SceneTreeDock::_notification(int p_what) {
|
||||
button_custom = memnew(Button);
|
||||
node_shortcuts->add_child(button_custom);
|
||||
button_custom->set_text(TTR("Other Node"));
|
||||
button_custom->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
button_custom->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
button_custom->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false));
|
||||
|
||||
button_clipboard = memnew(Button);
|
||||
node_shortcuts->add_child(button_clipboard);
|
||||
button_clipboard->set_text(TTR("Paste From Clipboard"));
|
||||
button_clipboard->set_icon(get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons")));
|
||||
button_clipboard->set_icon(get_editor_theme_icon(SNAME("ActionPaste")));
|
||||
button_clipboard->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_PASTE, false));
|
||||
|
||||
_update_create_root_dialog();
|
||||
@@ -1391,37 +1392,37 @@ void SceneTreeDock::_notification(int p_what) {
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
button_instance->set_icon(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
button_create_script->set_icon(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons")));
|
||||
button_detach_script->set_icon(get_theme_icon(SNAME("ScriptRemove"), SNAME("EditorIcons")));
|
||||
button_tree_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
button_add->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
button_instance->set_icon(get_editor_theme_icon(SNAME("Instance")));
|
||||
button_create_script->set_icon(get_editor_theme_icon(SNAME("ScriptCreate")));
|
||||
button_detach_script->set_icon(get_editor_theme_icon(SNAME("ScriptRemove")));
|
||||
button_tree_menu->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
|
||||
|
||||
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
filter->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
||||
|
||||
PopupMenu *filter_menu = filter->get_menu();
|
||||
filter_menu->set_item_icon(filter_menu->get_item_idx_from_text(TTR("Filters")), get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_TYPE), get_theme_icon(SNAME("Node"), SNAME("EditorIcons")));
|
||||
filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_GROUP), get_theme_icon(SNAME("Groups"), SNAME("EditorIcons")));
|
||||
filter_menu->set_item_icon(filter_menu->get_item_idx_from_text(TTR("Filters")), get_editor_theme_icon(SNAME("Search")));
|
||||
filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_TYPE), get_editor_theme_icon(SNAME("Node")));
|
||||
filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_GROUP), get_editor_theme_icon(SNAME("Groups")));
|
||||
|
||||
// These buttons are created on READY, because reasons...
|
||||
if (button_2d) {
|
||||
button_2d->set_icon(get_theme_icon(SNAME("Node2D"), SNAME("EditorIcons")));
|
||||
button_2d->set_icon(get_editor_theme_icon(SNAME("Node2D")));
|
||||
}
|
||||
if (button_3d) {
|
||||
button_3d->set_icon(get_theme_icon(SNAME("Node3D"), SNAME("EditorIcons")));
|
||||
button_3d->set_icon(get_editor_theme_icon(SNAME("Node3D")));
|
||||
}
|
||||
if (button_ui) {
|
||||
button_ui->set_icon(get_theme_icon(SNAME("Control"), SNAME("EditorIcons")));
|
||||
button_ui->set_icon(get_editor_theme_icon(SNAME("Control")));
|
||||
}
|
||||
if (button_custom) {
|
||||
button_custom->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
button_custom->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
}
|
||||
if (button_clipboard) {
|
||||
button_clipboard->set_icon(get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons")));
|
||||
button_clipboard->set_icon(get_editor_theme_icon(SNAME("ActionPaste")));
|
||||
}
|
||||
|
||||
menu_subresources->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), SNAME("Editor")));
|
||||
menu_subresources->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_PROCESS: {
|
||||
@@ -2925,8 +2926,8 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
if (!EditorNode::get_singleton()->get_edited_scene()) {
|
||||
menu->clear();
|
||||
if (profile_allow_editing) {
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/instantiate_scene"), TOOL_INSTANTIATE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Add")), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Instance")), ED_GET_SHORTCUT("scene_tree/instantiate_scene"), TOOL_INSTANTIATE);
|
||||
}
|
||||
|
||||
menu->reset_size();
|
||||
@@ -2958,10 +2959,10 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
menu->add_separator();
|
||||
}
|
||||
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/instantiate_scene"), TOOL_INSTANTIATE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Add")), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Instance")), ED_GET_SHORTCUT("scene_tree/instantiate_scene"), TOOL_INSTANTIATE);
|
||||
}
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Collapse"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/expand_collapse_all"), TOOL_EXPAND_COLLAPSE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Collapse")), ED_GET_SHORTCUT("scene_tree/expand_collapse_all"), TOOL_EXPAND_COLLAPSE);
|
||||
menu->add_separator();
|
||||
|
||||
existing_script = selected->get_script();
|
||||
@@ -2972,11 +2973,11 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
}
|
||||
|
||||
if (profile_allow_editing) {
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ActionCut"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/cut_node"), TOOL_CUT);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/copy_node"), TOOL_COPY);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ActionCut")), ED_GET_SHORTCUT("scene_tree/cut_node"), TOOL_CUT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ActionCopy")), ED_GET_SHORTCUT("scene_tree/copy_node"), TOOL_COPY);
|
||||
if (selection.size() == 1 && !node_clipboard.is_empty()) {
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/paste_node"), TOOL_PASTE);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/paste_node_as_sibling"), TOOL_PASTE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ActionPaste")), ED_GET_SHORTCUT("scene_tree/paste_node"), TOOL_PASTE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ActionPaste")), ED_GET_SHORTCUT("scene_tree/paste_node_as_sibling"), TOOL_PASTE);
|
||||
}
|
||||
menu->add_separator();
|
||||
}
|
||||
@@ -2986,14 +2987,14 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
|
||||
if (full_selection.size() == 1) {
|
||||
add_separator = true;
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ScriptCreate")), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
|
||||
if (existing_script.is_valid()) {
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptExtend"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_EXTEND_SCRIPT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ScriptExtend")), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_EXTEND_SCRIPT);
|
||||
}
|
||||
}
|
||||
if (existing_script.is_valid() && existing_script_removable) {
|
||||
add_separator = true;
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptRemove"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ScriptRemove")), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
|
||||
} else if (full_selection.size() > 1) {
|
||||
bool script_exists = false;
|
||||
for (Node *E : full_selection) {
|
||||
@@ -3005,7 +3006,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
|
||||
if (script_exists) {
|
||||
add_separator = true;
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptRemove"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ScriptRemove")), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3019,7 +3020,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
|
||||
if (full_selection.size() == 1) {
|
||||
add_separator = true;
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Rename"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/rename"), TOOL_RENAME);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Rename")), ED_GET_SHORTCUT("scene_tree/rename"), TOOL_RENAME);
|
||||
}
|
||||
|
||||
bool can_replace = true;
|
||||
@@ -3032,32 +3033,32 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
|
||||
if (can_replace) {
|
||||
add_separator = true;
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/change_node_type"), TOOL_REPLACE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Reload")), ED_GET_SHORTCUT("scene_tree/change_node_type"), TOOL_REPLACE);
|
||||
}
|
||||
|
||||
if (scene_tree->get_selected() != edited_scene) {
|
||||
if (add_separator) {
|
||||
menu->add_separator();
|
||||
}
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/move_up"), TOOL_MOVE_UP);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/move_down"), TOOL_MOVE_DOWN);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Duplicate"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/duplicate"), TOOL_DUPLICATE);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Reparent"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/reparent"), TOOL_REPARENT);
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("ReparentToNewNode"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/reparent_to_new_node"), TOOL_REPARENT_TO_NEW_NODE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("MoveUp")), ED_GET_SHORTCUT("scene_tree/move_up"), TOOL_MOVE_UP);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("MoveDown")), ED_GET_SHORTCUT("scene_tree/move_down"), TOOL_MOVE_DOWN);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Duplicate")), ED_GET_SHORTCUT("scene_tree/duplicate"), TOOL_DUPLICATE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Reparent")), ED_GET_SHORTCUT("scene_tree/reparent"), TOOL_REPARENT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ReparentToNewNode")), ED_GET_SHORTCUT("scene_tree/reparent_to_new_node"), TOOL_REPARENT_TO_NEW_NODE);
|
||||
if (selection.size() == 1) {
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("NewRoot"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/make_root"), TOOL_MAKE_ROOT);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("NewRoot")), ED_GET_SHORTCUT("scene_tree/make_root"), TOOL_MAKE_ROOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selection.size() == 1) {
|
||||
if (profile_allow_editing) {
|
||||
menu->add_separator();
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("CreateNewSceneFrom"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("CreateNewSceneFrom")), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM);
|
||||
}
|
||||
|
||||
if (full_selection.size() == 1) {
|
||||
menu->add_separator();
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("CopyNodePath"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("CopyNodePath")), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3076,7 +3077,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
menu->add_separator();
|
||||
}
|
||||
Node *node = full_selection[0];
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("SceneUniqueName"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/toggle_unique_name"), TOOL_TOGGLE_SCENE_UNIQUE_NAME);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("SceneUniqueName")), ED_GET_SHORTCUT("scene_tree/toggle_unique_name"), TOOL_TOGGLE_SCENE_UNIQUE_NAME);
|
||||
menu->set_item_text(menu->get_item_index(TOOL_TOGGLE_SCENE_UNIQUE_NAME), node->is_unique_name_in_owner() ? TTR("Revoke Unique Name") : TTR("Access as Unique Name"));
|
||||
}
|
||||
}
|
||||
@@ -3091,7 +3092,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
if (profile_allow_editing) {
|
||||
menu->add_item(TTR("Clear Inheritance"), TOOL_SCENE_CLEAR_INHERITANCE);
|
||||
}
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open in Editor"), TOOL_SCENE_OPEN_INHERITED);
|
||||
menu->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTR("Open in Editor"), TOOL_SCENE_OPEN_INHERITED);
|
||||
} else if (!is_top_level) {
|
||||
menu->add_separator();
|
||||
bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(selection[0]);
|
||||
@@ -3101,7 +3102,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
menu->add_check_item(TTR("Load As Placeholder"), TOOL_SCENE_USE_PLACEHOLDER);
|
||||
menu->add_item(TTR("Make Local"), TOOL_SCENE_MAKE_LOCAL);
|
||||
}
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open in Editor"), TOOL_SCENE_OPEN);
|
||||
menu->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTR("Open in Editor"), TOOL_SCENE_OPEN);
|
||||
if (profile_allow_editing) {
|
||||
menu->set_item_checked(menu->get_item_idx_from_text(TTR("Editable Children")), editable);
|
||||
menu->set_item_checked(menu->get_item_idx_from_text(TTR("Load As Placeholder")), placeholder);
|
||||
@@ -3114,15 +3115,15 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
if (profile_allow_editing && selection.size() > 1) {
|
||||
//this is not a commonly used action, it makes no sense for it to be where it was nor always present.
|
||||
menu->add_separator();
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Rename"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/batch_rename"), TOOL_BATCH_RENAME);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Rename")), ED_GET_SHORTCUT("scene_tree/batch_rename"), TOOL_BATCH_RENAME);
|
||||
}
|
||||
#endif // MODULE_REGEX_ENABLED
|
||||
menu->add_separator();
|
||||
menu->add_icon_item(get_theme_icon(SNAME("Help"), SNAME("EditorIcons")), TTR("Open Documentation"), TOOL_OPEN_DOCUMENTATION);
|
||||
menu->add_icon_item(get_editor_theme_icon(SNAME("Help")), TTR("Open Documentation"), TOOL_OPEN_DOCUMENTATION);
|
||||
|
||||
if (profile_allow_editing) {
|
||||
menu->add_separator();
|
||||
menu->add_icon_shortcut(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ED_SHORTCUT("scene_tree/delete", TTR("Delete Node(s)"), Key::KEY_DELETE), TOOL_ERASE);
|
||||
menu->add_icon_shortcut(get_editor_theme_icon(SNAME("Remove")), ED_SHORTCUT("scene_tree/delete", TTR("Delete Node(s)"), Key::KEY_DELETE), TOOL_ERASE);
|
||||
}
|
||||
menu->reset_size();
|
||||
menu->set_position(p_menu_pos);
|
||||
@@ -3152,7 +3153,7 @@ void SceneTreeDock::_filter_changed(const String &p_filter) {
|
||||
|
||||
String warning = scene_tree->get_filter_term_warning();
|
||||
if (!warning.is_empty()) {
|
||||
filter->add_theme_icon_override(SNAME("clear"), get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
|
||||
filter->add_theme_icon_override(SNAME("clear"), get_editor_theme_icon(SNAME("NodeWarning")));
|
||||
filter->set_tooltip_text(warning);
|
||||
} else {
|
||||
filter->remove_theme_icon_override(SNAME("clear"));
|
||||
|
||||
Reference in New Issue
Block a user