You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-04 19:21:46 +00:00
[Editor] Disable embedded mode, if --headless is in the main instance argument list.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "editor/gui/window_wrapper.h"
|
||||
#include "editor/run/editor_run_bar.h"
|
||||
#include "editor/run/embedded_process.h"
|
||||
#include "editor/run/run_instances_dialog.h"
|
||||
#include "editor/settings/editor_feature_profile.h"
|
||||
#include "editor/settings/editor_settings.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
@@ -672,6 +673,14 @@ GameView::EmbedAvailability GameView::_get_embed_available() {
|
||||
return EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER;
|
||||
}
|
||||
|
||||
if (RunInstancesDialog::get_singleton()) {
|
||||
List<String> instance_args;
|
||||
RunInstancesDialog::get_singleton()->get_argument_list_for_instance(0, instance_args);
|
||||
if (instance_args.find("--headless")) {
|
||||
return EMBED_NOT_AVAILABLE_HEADLESS;
|
||||
}
|
||||
}
|
||||
|
||||
EditorRun::WindowPlacement placement = EditorRun::get_window_placement();
|
||||
if (placement.force_fullscreen) {
|
||||
return EMBED_NOT_AVAILABLE_FULLSCREEN;
|
||||
@@ -731,6 +740,9 @@ void GameView::_update_ui() {
|
||||
case EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE:
|
||||
state_label->set_text(TTRC("Game embedding not available in single window mode."));
|
||||
break;
|
||||
case EMBED_NOT_AVAILABLE_HEADLESS:
|
||||
state_label->set_text(TTRC("Game embedding not available when the game starts in headless mode."));
|
||||
break;
|
||||
}
|
||||
|
||||
if (available == EMBED_AVAILABLE) {
|
||||
|
||||
@@ -129,6 +129,7 @@ class GameView : public VBoxContainer {
|
||||
EMBED_NOT_AVAILABLE_FULLSCREEN,
|
||||
EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE,
|
||||
EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER,
|
||||
EMBED_NOT_AVAILABLE_HEADLESS,
|
||||
};
|
||||
|
||||
inline static GameView *singleton = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user