|
44 | 44 | #include "editor/gui/window_wrapper.h" |
45 | 45 | #include "editor/run/editor_run_bar.h" |
46 | 46 | #include "editor/run/embedded_process.h" |
| 47 | +#include "editor/run/run_instances_dialog.h" |
47 | 48 | #include "editor/settings/editor_feature_profile.h" |
48 | 49 | #include "editor/settings/editor_settings.h" |
49 | 50 | #include "editor/themes/editor_scale.h" |
@@ -672,6 +673,14 @@ GameView::EmbedAvailability GameView::_get_embed_available() { |
672 | 673 | return EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER; |
673 | 674 | } |
674 | 675 |
|
| 676 | + if (RunInstancesDialog::get_singleton()) { |
| 677 | + List<String> instance_args; |
| 678 | + RunInstancesDialog::get_singleton()->get_argument_list_for_instance(0, instance_args); |
| 679 | + if (instance_args.find("--headless")) { |
| 680 | + return EMBED_NOT_AVAILABLE_HEADLESS; |
| 681 | + } |
| 682 | + } |
| 683 | + |
675 | 684 | EditorRun::WindowPlacement placement = EditorRun::get_window_placement(); |
676 | 685 | if (placement.force_fullscreen) { |
677 | 686 | return EMBED_NOT_AVAILABLE_FULLSCREEN; |
@@ -731,6 +740,9 @@ void GameView::_update_ui() { |
731 | 740 | case EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE: |
732 | 741 | state_label->set_text(TTRC("Game embedding not available in single window mode.")); |
733 | 742 | break; |
| 743 | + case EMBED_NOT_AVAILABLE_HEADLESS: |
| 744 | + state_label->set_text(TTRC("Game embedding not available when the game starts in headless mode.")); |
| 745 | + break; |
734 | 746 | } |
735 | 747 |
|
736 | 748 | if (available == EMBED_AVAILABLE) { |
|
0 commit comments