[Scene] Add SceneStringNames::id_pressed

This commit is contained in:
A Thousand Ships 2024-05-14 14:13:31 +02:00
parent 505da68b26
commit 755a0efbb6
No known key found for this signature in database
GPG key ID: 2033189A662F8BD7
72 changed files with 163 additions and 161 deletions

View file

@ -1138,7 +1138,7 @@ TextShaderEditor::TextShaderEditor() {
context_menu = memnew(PopupMenu);
add_child(context_menu);
context_menu->connect("id_pressed", callable_mp(this, &TextShaderEditor::_menu_option));
context_menu->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
VBoxContainer *main_container = memnew(VBoxContainer);
HBoxContainer *hbc = memnew(HBoxContainer);
@ -1169,7 +1169,7 @@ TextShaderEditor::TextShaderEditor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_word_wrap"), EDIT_TOGGLE_WORD_WRAP);
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_text_completion_query"), EDIT_COMPLETE);
edit_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextShaderEditor::_menu_option));
edit_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
search_menu = memnew(MenuButton);
search_menu->set_shortcut_context(this);
@ -1180,13 +1180,13 @@ TextShaderEditor::TextShaderEditor() {
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT);
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV);
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE);
search_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextShaderEditor::_menu_option));
search_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
MenuButton *goto_menu = memnew(MenuButton);
goto_menu->set_shortcut_context(this);
goto_menu->set_text(TTR("Go To"));
goto_menu->set_switch_on_hover(true);
goto_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextShaderEditor::_menu_option));
goto_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE);
goto_menu->get_popup()->add_separator();
@ -1201,7 +1201,7 @@ TextShaderEditor::TextShaderEditor() {
help_menu->set_text(TTR("Help"));
help_menu->set_switch_on_hover(true);
help_menu->get_popup()->add_item(TTR("Online Docs"), HELP_DOCS);
help_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextShaderEditor::_menu_option));
help_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
add_child(main_container);
main_container->add_child(hbc);