@@ -108,10 +108,6 @@ void GameViewDebugger::_session_stopped() {
108108 emit_signal (SNAME (" session_stopped" ));
109109}
110110
111- void GameViewDebugger::set_is_feature_enabled (bool p_enabled) {
112- is_feature_enabled = p_enabled;
113- }
114-
115111void GameViewDebugger::set_suspend (bool p_enabled) {
116112 Array message;
117113 message.append (p_enabled);
@@ -213,11 +209,20 @@ void GameViewDebugger::setup_session(int p_session_id) {
213209 session->connect (" stopped" , callable_mp (this , &GameViewDebugger::_session_stopped));
214210}
215211
212+ void GameViewDebugger::_feature_profile_changed () {
213+ Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton ()->get_current_profile ();
214+ is_feature_enabled = profile.is_null () || !profile->is_feature_disabled (EditorFeatureProfile::FEATURE_GAME);
215+ }
216+
216217void GameViewDebugger::_bind_methods () {
217218 ADD_SIGNAL (MethodInfo (" session_started" ));
218219 ADD_SIGNAL (MethodInfo (" session_stopped" ));
219220}
220221
222+ GameViewDebugger::GameViewDebugger () {
223+ EditorFeatureProfileManager::get_singleton ()->connect (" current_feature_profile_changed" , callable_mp (this , &GameViewDebugger::_feature_profile_changed));
224+ }
225+
221226// /////
222227
223228void GameView::_sessions_changed () {
@@ -248,6 +253,7 @@ void GameView::_instance_starting(int p_idx, List<String> &r_arguments) {
248253 if (!is_feature_enabled) {
249254 return ;
250255 }
256+
251257 if (p_idx == 0 && embed_on_play && make_floating_on_play && window_wrapper->is_window_available () && !window_wrapper->get_window_enabled () && _get_embed_available () == EMBED_AVAILABLE) {
252258 // Set the Floating Window default title. Always considered in DEBUG mode, same as in Window::set_title.
253259 String appname = GLOBAL_GET (" application/config/name" );
@@ -429,6 +435,10 @@ void GameView::_node_type_pressed(int p_option) {
429435
430436void GameView::_select_mode_pressed (int p_option) {
431437 RuntimeNodeSelect::SelectMode mode = (RuntimeNodeSelect::SelectMode)p_option;
438+ if (!select_mode_button[mode]->is_visible ()) {
439+ return ;
440+ }
441+
432442 for (int i = 0 ; i < RuntimeNodeSelect::SELECT_MODE_MAX; i++) {
433443 select_mode_button[i]->set_pressed_no_signal (i == mode);
434444 }
@@ -723,10 +733,6 @@ void GameView::_notification(int p_what) {
723733 }
724734}
725735
726- void GameView::set_is_feature_enabled (bool p_enabled) {
727- is_feature_enabled = p_enabled;
728- }
729-
730736void GameView::set_window_layout (Ref<ConfigFile> p_layout) {
731737 floating_window_rect = p_layout->get_value (" GameView" , " floating_window_rect" , Rect2i ());
732738 floating_window_screen = p_layout->get_value (" GameView" , " floating_window_screen" , -1 );
@@ -884,6 +890,19 @@ void GameView::_debugger_breaked(bool p_breaked, bool p_can_debug) {
884890 _update_embed_window_size ();
885891}
886892
893+ void GameView::_feature_profile_changed () {
894+ Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton ()->get_current_profile ();
895+ bool is_profile_null = profile.is_null ();
896+
897+ is_feature_enabled = is_profile_null || !profile->is_feature_disabled (EditorFeatureProfile::FEATURE_GAME);
898+
899+ bool is_3d_enabled = is_profile_null || !profile->is_feature_disabled (EditorFeatureProfile::FEATURE_3D);
900+ if (!is_3d_enabled && node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->is_pressed ()) {
901+ _node_type_pressed (RuntimeNodeSelect::NODE_TYPE_NONE);
902+ }
903+ node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_visible (is_3d_enabled);
904+ }
905+
887906GameView::GameView (Ref<GameViewDebugger> p_debugger, WindowWrapper *p_wrapper) {
888907 singleton = this ;
889908
@@ -1090,6 +1109,8 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, WindowWrapper *p_wrapper) {
10901109 p_wrapper->connect (" window_size_changed" , callable_mp (this , &GameView::_update_floating_window_settings));
10911110
10921111 EditorDebuggerNode::get_singleton ()->connect (" breaked" , callable_mp (this , &GameView::_debugger_breaked));
1112+
1113+ EditorFeatureProfileManager::get_singleton ()->connect (" current_feature_profile_changed" , callable_mp (this , &GameView::_feature_profile_changed));
10931114}
10941115
10951116// /////
@@ -1136,24 +1157,6 @@ void GameViewPlugin::_notification(int p_what) {
11361157 }
11371158}
11381159
1139- void GameViewPlugin::_feature_profile_changed () {
1140- bool is_feature_enabled = true ;
1141- Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton ()->get_current_profile ();
1142- if (profile.is_valid ()) {
1143- is_feature_enabled = !profile->is_feature_disabled (EditorFeatureProfile::FEATURE_GAME);
1144- }
1145-
1146- if (debugger.is_valid ()) {
1147- debugger->set_is_feature_enabled (is_feature_enabled);
1148- }
1149-
1150- #ifndef ANDROID_ENABLED
1151- if (game_view) {
1152- game_view->set_is_feature_enabled (is_feature_enabled);
1153- }
1154- #endif // ANDROID_ENABLED
1155- }
1156-
11571160void GameViewPlugin::_save_last_editor (const String &p_editor) {
11581161 if (p_editor != get_plugin_name ()) {
11591162 last_editor = p_editor;
@@ -1196,6 +1199,4 @@ GameViewPlugin::GameViewPlugin() {
11961199 window_wrapper->hide ();
11971200 window_wrapper->connect (" window_visibility_changed" , callable_mp (this , &GameViewPlugin::_focus_another_editor).unbind (1 ));
11981201#endif // ANDROID_ENABLED
1199-
1200- EditorFeatureProfileManager::get_singleton ()->connect (" current_feature_profile_changed" , callable_mp (this , &GameViewPlugin::_feature_profile_changed));
12011202}
0 commit comments