4848#include " editor/settings/editor_settings.h"
4949#include " editor/themes/editor_scale.h"
5050#include " scene/gui/button.h"
51+ #include " scene/gui/flow_container.h"
5152#include " scene/gui/label.h"
5253#include " scene/gui/menu_button.h"
53- #include " scene/gui/panel.h"
5454#include " scene/gui/separator.h"
5555
5656void GameViewDebugger::_session_started (Ref<EditorDebuggerSession> p_session) {
@@ -602,19 +602,19 @@ void GameView::_embed_options_menu_menu_id_pressed(int p_id) {
602602 EditorSettings::get_singleton ()->set_project_metadata (" game_view" , " make_floating_on_play" , make_floating_on_play);
603603 }
604604 } break ;
605+ case SIZE_MODE_FIXED:
606+ case SIZE_MODE_KEEP_ASPECT:
607+ case SIZE_MODE_STRETCH: {
608+ embed_size_mode = (EmbedSizeMode)p_id;
609+ EditorSettings::get_singleton ()->set_project_metadata (" game_view" , " embed_size_mode" , p_id);
610+
611+ _update_embed_window_size ();
612+ } break ;
605613 }
606614 _update_embed_menu_options ();
607615 _update_ui ();
608616}
609617
610- void GameView::_size_mode_button_pressed (int size_mode) {
611- embed_size_mode = (EmbedSizeMode)size_mode;
612- EditorSettings::get_singleton ()->set_project_metadata (" game_view" , " embed_size_mode" , size_mode);
613-
614- _update_embed_menu_options ();
615- _update_embed_window_size ();
616- }
617-
618618void GameView::_reset_time_scales () {
619619 if (!is_visible_in_tree ()) {
620620 return ;
@@ -754,11 +754,11 @@ void GameView::_update_embed_menu_options() {
754754 menu->set_item_checked (menu->get_item_index (EMBED_RUN_GAME_EMBEDDED), embed_on_play);
755755 menu->set_item_checked (menu->get_item_index (EMBED_MAKE_FLOATING_ON_PLAY), make_floating_on_play && is_multi_window);
756756
757- menu->set_item_disabled (menu->get_item_index (EMBED_MAKE_FLOATING_ON_PLAY), !embed_on_play || !is_multi_window);
757+ menu->set_item_checked (menu->get_item_index (SIZE_MODE_FIXED), embed_size_mode == SIZE_MODE_FIXED);
758+ menu->set_item_checked (menu->get_item_index (SIZE_MODE_KEEP_ASPECT), embed_size_mode == SIZE_MODE_KEEP_ASPECT);
759+ menu->set_item_checked (menu->get_item_index (SIZE_MODE_STRETCH), embed_size_mode == SIZE_MODE_STRETCH);
758760
759- fixed_size_button->set_pressed (embed_size_mode == SIZE_MODE_FIXED);
760- keep_aspect_button->set_pressed (embed_size_mode == SIZE_MODE_KEEP_ASPECT);
761- stretch_button->set_pressed (embed_size_mode == SIZE_MODE_STRETCH);
761+ menu->set_item_disabled (menu->get_item_index (EMBED_MAKE_FLOATING_ON_PLAY), !embed_on_play || !is_multi_window);
762762}
763763
764764void GameView::_update_embed_window_size () {
@@ -863,10 +863,7 @@ void GameView::_notification(int p_what) {
863863 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_button_icon (get_editor_theme_icon (SNAME (" ListSelect" )));
864864
865865 hide_selection->set_button_icon (get_editor_theme_icon (hide_selection->is_pressed () ? SNAME (" GuiVisibilityHidden" ) : SNAME (" GuiVisibilityVisible" )));
866- fixed_size_button->set_button_icon (get_editor_theme_icon (SNAME (" FixedSize" )));
867- keep_aspect_button->set_button_icon (get_editor_theme_icon (SNAME (" KeepAspect" )));
868- stretch_button->set_button_icon (get_editor_theme_icon (SNAME (" Stretch" )));
869- embed_options_menu->set_button_icon (get_editor_theme_icon (SNAME (" GuiTabMenuHl" )));
866+ embed_options_menu->set_button_icon (get_editor_theme_icon (SNAME (" KeepAspect" )));
870867
871868 debug_mute_audio_button->set_button_icon (get_editor_theme_icon (debug_mute_audio ? SNAME (" AudioMute" ) : SNAME (" AudioStreamPlayer" )));
872869
@@ -900,7 +897,6 @@ void GameView::_notification(int p_what) {
900897 } break ;
901898 }
902899 embed_size_mode = (EmbedSizeMode)(int )EditorSettings::get_singleton ()->get_project_metadata (" game_view" , " embed_size_mode" , SIZE_MODE_FIXED);
903- keep_aspect_button->set_pressed (EditorSettings::get_singleton ()->get_project_metadata (" game_view" , " keep_aspect" , true ));
904900 _update_embed_menu_options ();
905901
906902 EditorRunBar::get_singleton ()->connect (" play_pressed" , callable_mp (this , &GameView::_play_pressed));
@@ -913,11 +909,7 @@ void GameView::_notification(int p_what) {
913909 EditorSettings::get_singleton ()->connect (" settings_changed" , callable_mp (this , &GameView::_editor_or_project_settings_changed));
914910 } else {
915911 // Embedding not available.
916- embedding_separator->hide ();
917- embed_options_menu->hide ();
918- fixed_size_button->hide ();
919- keep_aspect_button->hide ();
920- stretch_button->hide ();
912+ embedding_hb->hide ();
921913 }
922914
923915 _update_ui ();
@@ -1129,11 +1121,13 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
11291121 toolbar_margin->set_theme_type_variation (" MainToolBarMargin" );
11301122 add_child (toolbar_margin);
11311123
1132- HBoxContainer *main_menu_hbox = memnew (HBoxContainer );
1133- toolbar_margin->add_child (main_menu_hbox );
1124+ FlowContainer *main_menu_fc = memnew (FlowContainer );
1125+ toolbar_margin->add_child (main_menu_fc );
11341126
1127+ HBoxContainer *process_hb = memnew (HBoxContainer);
1128+ main_menu_fc->add_child (process_hb);
11351129 suspend_button = memnew (Button);
1136- main_menu_hbox ->add_child (suspend_button);
1130+ process_hb ->add_child (suspend_button);
11371131 suspend_button->set_toggle_mode (true );
11381132 suspend_button->set_theme_type_variation (SceneStringName (FlatButton));
11391133 suspend_button->connect (SceneStringName (toggled), callable_mp (this , &GameView::_suspend_button_toggled));
@@ -1142,14 +1136,14 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
11421136 suspend_button->set_tooltip_text (TTRC (" Force pause at SceneTree level. Stops all processing, but you can still interact with the project." ));
11431137
11441138 next_frame_button = memnew (Button);
1145- main_menu_hbox ->add_child (next_frame_button);
1139+ process_hb ->add_child (next_frame_button);
11461140 next_frame_button->set_theme_type_variation (SceneStringName (FlatButton));
11471141 next_frame_button->connect (SceneStringName (pressed), callable_mp (*debugger, &GameViewDebugger::next_frame));
11481142 next_frame_button->set_accessibility_name (TTRC (" Next Frame" ));
11491143 next_frame_button->set_shortcut (ED_GET_SHORTCUT (" editor/next_frame_embedded_project" ));
11501144
11511145 speed_state_button = memnew (MenuButton);
1152- main_menu_hbox ->add_child (speed_state_button);
1146+ process_hb ->add_child (speed_state_button);
11531147 speed_state_button->set_text (U" 1.0×" );
11541148 speed_state_button->set_theme_type_variation (SceneStringName (FlatButton));
11551149 speed_state_button->set_tooltip_text (TTRC (" Change the game speed." ));
@@ -1162,16 +1156,19 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
11621156 }
11631157
11641158 reset_speed_button = memnew (Button);
1165- main_menu_hbox ->add_child (reset_speed_button);
1159+ process_hb ->add_child (reset_speed_button);
11661160 reset_speed_button->set_theme_type_variation (SceneStringName (FlatButton));
11671161 reset_speed_button->set_tooltip_text (TTRC (" Reset the game speed." ));
11681162 reset_speed_button->set_accessibility_name (TTRC (" Reset Speed" ));
11691163 reset_speed_button->connect (SceneStringName (pressed), callable_mp (this , &GameView::_reset_time_scales));
11701164
1171- main_menu_hbox->add_child (memnew (VSeparator));
1165+ process_hb->add_child (memnew (VSeparator));
1166+
1167+ HBoxContainer *input_hb = memnew (HBoxContainer);
1168+ main_menu_fc->add_child (input_hb);
11721169
11731170 node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE] = memnew (Button);
1174- main_menu_hbox ->add_child (node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]);
1171+ input_hb ->add_child (node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]);
11751172 node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_text (TTRC (" Input" ));
11761173 node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_toggle_mode (true );
11771174 node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_pressed (true );
@@ -1180,35 +1177,28 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
11801177 node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_tooltip_text (TTRC (" Allow game input." ));
11811178
11821179 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D] = memnew (Button);
1183- main_menu_hbox ->add_child (node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]);
1180+ input_hb ->add_child (node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]);
11841181 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_text (TTRC (" 2D" ));
11851182 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_toggle_mode (true );
11861183 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_theme_type_variation (SceneStringName (FlatButton));
11871184 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->connect (SceneStringName (pressed), callable_mp (this , &GameView::_node_type_pressed).bind (RuntimeNodeSelect::NODE_TYPE_2D));
11881185 node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_tooltip_text (TTRC (" Disable game input and allow to select Node2Ds, Controls, and manipulate the 2D camera." ));
11891186
11901187 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D] = memnew (Button);
1191- main_menu_hbox ->add_child (node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]);
1188+ input_hb ->add_child (node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]);
11921189 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_text (TTRC (" 3D" ));
11931190 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_toggle_mode (true );
11941191 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_theme_type_variation (SceneStringName (FlatButton));
11951192 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->connect (SceneStringName (pressed), callable_mp (this , &GameView::_node_type_pressed).bind (RuntimeNodeSelect::NODE_TYPE_3D));
11961193 node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_tooltip_text (TTRC (" Disable game input and allow to select Node3Ds and manipulate the 3D camera." ));
11971194
1198- main_menu_hbox->add_child (memnew (VSeparator));
1199-
1200- hide_selection = memnew (Button);
1201- main_menu_hbox->add_child (hide_selection);
1202- hide_selection->set_toggle_mode (true );
1203- hide_selection->set_theme_type_variation (SceneStringName (FlatButton));
1204- hide_selection->connect (SceneStringName (toggled), callable_mp (this , &GameView::_hide_selection_toggled));
1205- hide_selection->set_tooltip_text (TTRC (" Toggle Selection Visibility" ));
1206- hide_selection->set_pressed (EditorSettings::get_singleton ()->get_project_metadata (" game_view" , " hide_selection" , false ));
1195+ input_hb->add_child (memnew (VSeparator));
12071196
1208- main_menu_hbox->add_child (memnew (VSeparator));
1197+ HBoxContainer *selection_hb = memnew (HBoxContainer);
1198+ main_menu_fc->add_child (selection_hb);
12091199
12101200 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE] = memnew (Button);
1211- main_menu_hbox ->add_child (select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]);
1201+ selection_hb ->add_child (select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]);
12121202 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_toggle_mode (true );
12131203 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_pressed (true );
12141204 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_theme_type_variation (SceneStringName (FlatButton));
@@ -1217,33 +1207,47 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
12171207 select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_shortcut_context (this );
12181208
12191209 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST] = memnew (Button);
1220- main_menu_hbox ->add_child (select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]);
1210+ selection_hb ->add_child (select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]);
12211211 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_toggle_mode (true );
12221212 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_theme_type_variation (SceneStringName (FlatButton));
12231213 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->connect (SceneStringName (pressed), callable_mp (this , &GameView::_select_mode_pressed).bind (RuntimeNodeSelect::SELECT_MODE_LIST));
12241214 select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_tooltip_text (TTRC (" Show list of selectable nodes at position clicked." ));
12251215
12261216 _select_mode_pressed (EditorSettings::get_singleton ()->get_project_metadata (" game_view" , " select_mode" , 0 ));
12271217
1228- main_menu_hbox->add_child (memnew (VSeparator));
1218+ hide_selection = memnew (Button);
1219+ selection_hb->add_child (hide_selection);
1220+ hide_selection->set_toggle_mode (true );
1221+ hide_selection->set_theme_type_variation (SceneStringName (FlatButton));
1222+ hide_selection->connect (SceneStringName (toggled), callable_mp (this , &GameView::_hide_selection_toggled));
1223+ hide_selection->set_tooltip_text (TTRC (" Toggle Selection Visibility" ));
1224+ hide_selection->set_pressed (EditorSettings::get_singleton ()->get_project_metadata (" game_view" , " hide_selection" , false ));
1225+
1226+ selection_hb->add_child (memnew (VSeparator));
1227+
1228+ HBoxContainer *audio_hb = memnew (HBoxContainer);
1229+ main_menu_fc->add_child (audio_hb);
12291230
12301231 debug_mute_audio_button = memnew (Button);
1231- main_menu_hbox ->add_child (debug_mute_audio_button);
1232+ audio_hb ->add_child (debug_mute_audio_button);
12321233 debug_mute_audio_button->set_theme_type_variation (" FlatButton" );
12331234 debug_mute_audio_button->connect (SceneStringName (pressed), callable_mp (this , &GameView::_debug_mute_audio_button_pressed));
12341235 debug_mute_audio_button->set_tooltip_text (debug_mute_audio ? TTRC (" Unmute game audio." ) : TTRC (" Mute game audio." ));
12351236
1236- main_menu_hbox->add_child (memnew (VSeparator));
1237+ audio_hb->add_child (memnew (VSeparator));
1238+
1239+ HBoxContainer *camera_hb = memnew (HBoxContainer);
1240+ main_menu_fc->add_child (camera_hb);
12371241
12381242 camera_override_button = memnew (Button);
1239- main_menu_hbox ->add_child (camera_override_button);
1243+ camera_hb ->add_child (camera_override_button);
12401244 camera_override_button->set_toggle_mode (true );
12411245 camera_override_button->set_theme_type_variation (SceneStringName (FlatButton));
12421246 camera_override_button->set_tooltip_text (TTRC (" Override the in-game camera." ));
12431247 camera_override_button->connect (SceneStringName (toggled), callable_mp (this , &GameView::_camera_override_button_toggled));
12441248
12451249 camera_override_menu = memnew (MenuButton);
1246- main_menu_hbox ->add_child (camera_override_menu);
1250+ camera_hb ->add_child (camera_override_menu);
12471251 camera_override_menu->set_flat (false );
12481252 camera_override_menu->set_theme_type_variation (" FlatMenuButton" );
12491253 camera_override_menu->set_h_size_flags (SIZE_SHRINK_END);
@@ -1259,33 +1263,14 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
12591263 menu->add_radio_check_item (TTRC (" Manipulate From Editors" ), CAMERA_MODE_EDITORS);
12601264 _camera_override_menu_id_pressed (EditorSettings::get_singleton ()->get_project_metadata (" game_view" , " camera_override_mode" , 0 ));
12611265
1262- embedding_separator = memnew (VSeparator);
1263- main_menu_hbox->add_child (embedding_separator);
1264-
1265- fixed_size_button = memnew (Button);
1266- main_menu_hbox->add_child (fixed_size_button);
1267- fixed_size_button->set_toggle_mode (true );
1268- fixed_size_button->set_theme_type_variation (" FlatButton" );
1269- fixed_size_button->set_tooltip_text (TTRC (" Embedded game size is based on project settings.\n The 'Keep Aspect' mode is used when the Game Workspace is smaller than the desired size." ));
1270- fixed_size_button->set_accessibility_name (TTRC (" Embedded game size is based on project settings." ));
1271- fixed_size_button->connect (SceneStringName (pressed), callable_mp (this , &GameView::_size_mode_button_pressed).bind (SIZE_MODE_FIXED));
1272-
1273- keep_aspect_button = memnew (Button);
1274- main_menu_hbox->add_child (keep_aspect_button);
1275- keep_aspect_button->set_toggle_mode (true );
1276- keep_aspect_button->set_theme_type_variation (" FlatButton" );
1277- keep_aspect_button->set_tooltip_text (TTRC (" Keep the aspect ratio of the embedded game." ));
1278- keep_aspect_button->connect (SceneStringName (pressed), callable_mp (this , &GameView::_size_mode_button_pressed).bind (SIZE_MODE_KEEP_ASPECT));
1279-
1280- stretch_button = memnew (Button);
1281- main_menu_hbox->add_child (stretch_button);
1282- stretch_button->set_toggle_mode (true );
1283- stretch_button->set_theme_type_variation (" FlatButton" );
1284- stretch_button->set_tooltip_text (TTRC (" Embedded game size stretches to fit the Game Workspace." ));
1285- stretch_button->connect (SceneStringName (pressed), callable_mp (this , &GameView::_size_mode_button_pressed).bind (SIZE_MODE_STRETCH));
1266+ camera_hb->add_child (memnew (VSeparator));
1267+
1268+ embedding_hb = memnew (HBoxContainer);
1269+ embedding_hb->set_h_size_flags (Control::SIZE_EXPAND_FILL);
1270+ main_menu_fc->add_child (embedding_hb);
12861271
12871272 embed_options_menu = memnew (MenuButton);
1288- main_menu_hbox ->add_child (embed_options_menu);
1273+ embedding_hb ->add_child (embed_options_menu);
12891274 embed_options_menu->set_flat (false );
12901275 embed_options_menu->set_theme_type_variation (" FlatMenuButton" );
12911276 embed_options_menu->set_h_size_flags (SIZE_SHRINK_END);
@@ -1295,22 +1280,32 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
12951280 menu->connect (SceneStringName (id_pressed), callable_mp (this , &GameView::_embed_options_menu_menu_id_pressed));
12961281 menu->add_check_item (TTRC (" Embed Game on Next Play" ), EMBED_RUN_GAME_EMBEDDED);
12971282 menu->add_check_item (TTRC (" Make Game Workspace Floating on Next Play" ), EMBED_MAKE_FLOATING_ON_PLAY);
1283+ menu->add_separator (TTRC (" Embedded Window Sizing" ));
12981284
1299- main_menu_hbox->add_spacer ();
1285+ menu->add_radio_check_item (TTRC (" Fixed Size" ), SIZE_MODE_FIXED);
1286+ menu->set_item_tooltip (menu->get_item_index (SIZE_MODE_FIXED), TTRC (" Embedded game size is based on project settings.\n The 'Keep Aspect' mode is used when the Game Workspace is smaller than the desired size." ));
1287+ menu->add_radio_check_item (TTRC (" Keep Aspect Ratio" ), SIZE_MODE_KEEP_ASPECT);
1288+ menu->set_item_tooltip (menu->get_item_index (SIZE_MODE_KEEP_ASPECT), TTRC (" Keep the aspect ratio of the embedded game." ));
1289+ menu->add_radio_check_item (TTRC (" Stretch to Fit" ), SIZE_MODE_STRETCH);
1290+ menu->set_item_tooltip (menu->get_item_index (SIZE_MODE_STRETCH), TTRC (" Embedded game size stretches to fit the Game Workspace." ));
13001291
13011292 game_size_label = memnew (Label ());
1302- main_menu_hbox ->add_child (game_size_label);
1293+ embedding_hb ->add_child (game_size_label);
13031294 game_size_label->hide ();
13041295 // Setting the minimum size prevents the game workspace from resizing indefinitely
13051296 // due to the label size oscillating by a few pixels when the game is in stretch mode
13061297 // and the game workspace is at its minimum size.
13071298 game_size_label->set_custom_minimum_size (Size2 (80 * EDSCALE, 0 ));
1299+ game_size_label->set_h_size_flags (SIZE_EXPAND_FILL);
13081300 game_size_label->set_horizontal_alignment (HorizontalAlignment::HORIZONTAL_ALIGNMENT_RIGHT);
13091301
1310- panel = memnew (Panel );
1302+ panel = memnew (PanelContainer );
13111303 add_child (panel);
13121304 panel->set_theme_type_variation (" GamePanel" );
13131305 panel->set_v_size_flags (SIZE_EXPAND_FILL);
1306+ #ifdef MACOS_ENABLED
1307+ panel->set_mouse_filter (Control::MOUSE_FILTER_IGNORE);
1308+ #endif
13141309
13151310 panel->add_child (embedded_process);
13161311 embedded_process->set_anchors_and_offsets_preset (PRESET_FULL_RECT);
@@ -1320,17 +1315,8 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, EmbeddedProcessBase *p_embe
13201315 embedded_process->connect (" embedded_process_focused" , callable_mp (this , &GameView::_embedded_process_focused));
13211316 embedded_process->set_custom_minimum_size (Size2i (100 , 100 ));
13221317
1323- MarginContainer *state_container = memnew (MarginContainer);
1324- state_container->add_theme_constant_override (" margin_left" , 8 * EDSCALE);
1325- state_container->add_theme_constant_override (" margin_right" , 8 * EDSCALE);
1326- state_container->set_anchors_and_offsets_preset (PRESET_FULL_RECT);
1327- #ifdef MACOS_ENABLED
1328- state_container->set_mouse_filter (Control::MOUSE_FILTER_IGNORE);
1329- #endif
1330- panel->add_child (state_container);
1331-
13321318 state_label = memnew (Label ());
1333- state_container ->add_child (state_label);
1319+ panel ->add_child (state_label);
13341320 state_label->set_horizontal_alignment (HORIZONTAL_ALIGNMENT_CENTER);
13351321 state_label->set_vertical_alignment (VERTICAL_ALIGNMENT_CENTER);
13361322 state_label->set_autowrap_mode (TextServer::AUTOWRAP_WORD);
0 commit comments