MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _notification

Method _notification

editor/run/game_view_plugin.cpp:779–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779void GameView::_notification(int p_what) {
780 switch (p_what) {
781 case NOTIFICATION_TRANSLATION_CHANGED: {
782 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+RMB: Show list of all nodes at position clicked."));
783 _update_ui();
784 } break;
785
786 case NOTIFICATION_THEME_CHANGED: {
787 suspend_button->set_button_icon(get_editor_theme_icon(SNAME("Pause")));
788 next_frame_button->set_button_icon(get_editor_theme_icon(SNAME("NextFrame")));
789
790 node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_button_icon(get_editor_theme_icon(SNAME("InputEventJoypadMotion")));
791 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_button_icon(get_editor_theme_icon(SNAME("2DNodes")));
792 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_button_icon(get_editor_theme_icon(SNAME("Node3D")));
793
794 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_button_icon(get_editor_theme_icon(SNAME("ToolSelect")));
795 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_button_icon(get_editor_theme_icon(SNAME("ListSelect")));
796
797 hide_selection->set_button_icon(get_editor_theme_icon(hide_selection->is_pressed() ? SNAME("GuiVisibilityHidden") : SNAME("GuiVisibilityVisible")));
798 fixed_size_button->set_button_icon(get_editor_theme_icon(SNAME("FixedSize")));
799 keep_aspect_button->set_button_icon(get_editor_theme_icon(SNAME("KeepAspect")));
800 stretch_button->set_button_icon(get_editor_theme_icon(SNAME("Stretch")));
801 embed_options_menu->set_button_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
802
803 debug_mute_audio_button->set_button_icon(get_editor_theme_icon(debug_mute_audio ? SNAME("AudioMute") : SNAME("AudioStreamPlayer")));
804
805 camera_override_button->set_button_icon(get_editor_theme_icon(SNAME("Camera")));
806 camera_override_menu->set_button_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
807 } break;
808
809 case NOTIFICATION_READY: {
810 if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_EMBEDDING)) {
811 // Embedding available.
812 int game_mode = EDITOR_GET("run/window_placement/game_embed_mode");
813 switch (game_mode) {
814 case -1: { // Disabled.
815 embed_on_play = false;
816 make_floating_on_play = false;
817 } break;
818 case 1: { // Embed.
819 embed_on_play = true;
820 make_floating_on_play = false;
821 } break;
822 case 2: { // Floating.
823 embed_on_play = true;
824 make_floating_on_play = true;
825 } break;
826 default: {
827 embed_on_play = EditorSettings::get_singleton()->get_project_metadata("game_view", "embed_on_play", true);
828 make_floating_on_play = EditorSettings::get_singleton()->get_project_metadata("game_view", "make_floating_on_play", true);
829 } break;
830 }
831 embed_size_mode = (EmbedSizeMode)(int)EditorSettings::get_singleton()->get_project_metadata("game_view", "embed_size_mode", SIZE_MODE_FIXED);
832 keep_aspect_button->set_pressed(EditorSettings::get_singleton()->get_project_metadata("game_view", "keep_aspect", true));
833 _update_embed_menu_options();
834
835 EditorRunBar::get_singleton()->connect("play_pressed", callable_mp(this, &GameView::_play_pressed));
836 EditorRunBar::get_singleton()->connect("stop_pressed", callable_mp(this, &GameView::_stop_pressed));

Callers

nothing calls this directly

Calls 13

keycode_get_stringFunction · 0.85
TTRFunction · 0.85
vformatFunction · 0.85
set_button_iconMethod · 0.80
get_project_metadataMethod · 0.80
get_window_enabledMethod · 0.80
set_window_titleMethod · 0.80
connectMethod · 0.65
set_tooltip_textMethod · 0.45
is_pressedMethod · 0.45
has_featureMethod · 0.45
set_pressedMethod · 0.45

Tested by

no test coverage detected