mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #113269 from bruvzg/emb_headless
[Editor] Disable embedded mode, if `--headless` is in the main instance argument list.
This commit is contained in:
commit
d1b9e51e12
2 changed files with 13 additions and 0 deletions
|
|
@ -44,6 +44,7 @@
|
||||||
#include "editor/gui/window_wrapper.h"
|
#include "editor/gui/window_wrapper.h"
|
||||||
#include "editor/run/editor_run_bar.h"
|
#include "editor/run/editor_run_bar.h"
|
||||||
#include "editor/run/embedded_process.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_feature_profile.h"
|
||||||
#include "editor/settings/editor_settings.h"
|
#include "editor/settings/editor_settings.h"
|
||||||
#include "editor/themes/editor_scale.h"
|
#include "editor/themes/editor_scale.h"
|
||||||
|
|
@ -672,6 +673,14 @@ GameView::EmbedAvailability GameView::_get_embed_available() {
|
||||||
return EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER;
|
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();
|
EditorRun::WindowPlacement placement = EditorRun::get_window_placement();
|
||||||
if (placement.force_fullscreen) {
|
if (placement.force_fullscreen) {
|
||||||
return EMBED_NOT_AVAILABLE_FULLSCREEN;
|
return EMBED_NOT_AVAILABLE_FULLSCREEN;
|
||||||
|
|
@ -731,6 +740,9 @@ void GameView::_update_ui() {
|
||||||
case EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE:
|
case EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE:
|
||||||
state_label->set_text(TTRC("Game embedding not available in single window mode."));
|
state_label->set_text(TTRC("Game embedding not available in single window mode."));
|
||||||
break;
|
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) {
|
if (available == EMBED_AVAILABLE) {
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ class GameView : public VBoxContainer {
|
||||||
EMBED_NOT_AVAILABLE_FULLSCREEN,
|
EMBED_NOT_AVAILABLE_FULLSCREEN,
|
||||||
EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE,
|
EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE,
|
||||||
EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER,
|
EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER,
|
||||||
|
EMBED_NOT_AVAILABLE_HEADLESS,
|
||||||
};
|
};
|
||||||
|
|
||||||
inline static GameView *singleton = nullptr;
|
inline static GameView *singleton = nullptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue