@@ -404,34 +404,34 @@ void ShaderEditorPlugin::_shader_list_clicked(int p_item, Vector2 p_local_mouse_
404404
405405void ShaderEditorPlugin::_setup_popup_menu (PopupMenuType p_type, PopupMenu *p_menu) {
406406 if (p_type == FILE) {
407- p_menu->add_shortcut (ED_SHORTCUT (" shader_editor/new" , TTRC ( " New Shader... " ), KeyModifierMask::CMD_OR_CTRL | Key::N ), FILE_MENU_NEW);
408- p_menu->add_shortcut (ED_SHORTCUT (" shader_editor/new_include" , TTRC ( " New Shader Include... " ), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::N ), FILE_MENU_NEW_INCLUDE);
407+ p_menu->add_shortcut (ED_GET_SHORTCUT (" shader_editor/new" ), FILE_MENU_NEW);
408+ p_menu->add_shortcut (ED_GET_SHORTCUT (" shader_editor/new_include" ), FILE_MENU_NEW_INCLUDE);
409409 p_menu->add_separator ();
410- p_menu->add_shortcut (ED_SHORTCUT (" shader_editor/open" , TTRC ( " Load Shader File... " ), KeyModifierMask::CMD_OR_CTRL | Key::O ), FILE_MENU_OPEN);
411- p_menu->add_shortcut (ED_SHORTCUT (" shader_editor/open_include" , TTRC ( " Load Shader Include File... " ), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::O ), FILE_MENU_OPEN_INCLUDE);
410+ p_menu->add_shortcut (ED_GET_SHORTCUT (" shader_editor/open" ), FILE_MENU_OPEN);
411+ p_menu->add_shortcut (ED_GET_SHORTCUT (" shader_editor/open_include" ), FILE_MENU_OPEN_INCLUDE);
412412 }
413413
414414 if (p_type == FILE || p_type == CONTEXT_VALID_ITEM) {
415- p_menu->add_shortcut (ED_SHORTCUT ( " shader_editor /save" , TTRC ( " Save File " ), KeyModifierMask::ALT | KeyModifierMask::CMD_OR_CTRL | Key::S ), FILE_MENU_SAVE);
416- p_menu->add_shortcut (ED_SHORTCUT ( " shader_editor /save_as" , TTRC ( " Save File As... " ) ), FILE_MENU_SAVE_AS);
415+ p_menu->add_shortcut (ED_GET_SHORTCUT ( " script_editor /save" ), FILE_MENU_SAVE);
416+ p_menu->add_shortcut (ED_GET_SHORTCUT ( " script_editor /save_as" ), FILE_MENU_SAVE_AS);
417417 }
418418
419419 if (p_type == FILE) {
420420 p_menu->add_separator ();
421- p_menu->add_item ( TTR ( " Open File in Inspector " ), FILE_MENU_INSPECT);
422- p_menu->add_item ( TTR ( " Inspect Native Shader Code... " ), FILE_MENU_INSPECT_NATIVE_SHADER_CODE);
421+ p_menu->add_shortcut ( ED_GET_SHORTCUT ( " shader_editor/open_in_inspector " ), FILE_MENU_INSPECT);
422+ p_menu->add_shortcut ( ED_GET_SHORTCUT ( " shader_editor/inspect_native_code " ), FILE_MENU_INSPECT_NATIVE_SHADER_CODE);
423423 p_menu->add_separator ();
424- p_menu->add_shortcut (ED_SHORTCUT ( " shader_editor /close_file" , TTRC ( " Close File " ), KeyModifierMask::CMD_OR_CTRL | Key::W ), FILE_MENU_CLOSE);
424+ p_menu->add_shortcut (ED_GET_SHORTCUT ( " script_editor /close_file" ), FILE_MENU_CLOSE);
425425 p_menu->add_separator ();
426426 p_menu->add_shortcut (ED_GET_SHORTCUT (" script_editor/toggle_files_panel" ), FILE_MENU_TOGGLE_FILES_PANEL);
427427 } else {
428- p_menu->add_shortcut (ED_SHORTCUT ( " shader_editor /close_file" , TTRC ( " Close File " ), KeyModifierMask::CMD_OR_CTRL | Key::W ), FILE_MENU_CLOSE);
429- p_menu->add_item ( TTR ( " Close All " ), FILE_MENU_CLOSE_ALL);
430- p_menu->add_item ( TTR ( " Close Other Tabs " ), FILE_MENU_CLOSE_OTHER_TABS);
428+ p_menu->add_shortcut (ED_GET_SHORTCUT ( " script_editor /close_file" ), FILE_MENU_CLOSE);
429+ p_menu->add_shortcut ( ED_GET_SHORTCUT ( " script_editor/close_all " ), FILE_MENU_CLOSE_ALL);
430+ p_menu->add_shortcut ( ED_GET_SHORTCUT ( " script_editor/close_other_tabs " ), FILE_MENU_CLOSE_OTHER_TABS);
431431 if (p_type == CONTEXT_VALID_ITEM) {
432432 p_menu->add_separator ();
433- p_menu->add_item ( TTR ( " Copy Script Path " ), FILE_MENU_COPY_PATH);
434- p_menu->add_item ( TTR ( " Show in FileSystem " ), FILE_MENU_SHOW_IN_FILE_SYSTEM);
433+ p_menu->add_shortcut ( ED_GET_SHORTCUT ( " shader_editor/copy_path " ), FILE_MENU_COPY_PATH);
434+ p_menu->add_shortcut ( ED_GET_SHORTCUT ( " script_editor/show_in_file_system " ), FILE_MENU_SHOW_IN_FILE_SYSTEM);
435435 }
436436 }
437437}
@@ -890,6 +890,14 @@ void ShaderEditorPlugin::_notification(int p_what) {
890890}
891891
892892ShaderEditorPlugin::ShaderEditorPlugin () {
893+ ED_SHORTCUT (" shader_editor/new" , TTRC (" New Shader..." ), KeyModifierMask::CMD_OR_CTRL | Key::N);
894+ ED_SHORTCUT (" shader_editor/new_include" , TTRC (" New Shader Include..." ), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::N);
895+ ED_SHORTCUT (" shader_editor/open" , TTRC (" Load Shader File..." ), KeyModifierMask::CMD_OR_CTRL | Key::O);
896+ ED_SHORTCUT (" shader_editor/open_include" , TTRC (" Load Shader Include File..." ), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::O);
897+ ED_SHORTCUT (" shader_editor/open_in_inspector" , TTRC (" Open File in Inspector" ));
898+ ED_SHORTCUT (" shader_editor/inspect_native_code" , TTRC (" Inspect Native Shader Code..." ));
899+ ED_SHORTCUT (" shader_editor/copy_path" , TTRC (" Copy Shader Path" ));
900+
893901 window_wrapper = memnew (WindowWrapper);
894902 window_wrapper->set_window_title (vformat (TTR (" %s - Godot Engine" ), TTR (" Shader Editor" )));
895903 window_wrapper->set_margins_enabled (true );
0 commit comments