diff options
author | Chris Hutchinson <chutchinson@dynics.com> | 2023-02-11 23:10:50 -0500 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-30 19:28:57 +0200 |
commit | 4323c8b78ba03c8fef6dfc580c1aa1010ed3096d (patch) | |
tree | 1b8f65ae0f2cd380641097ffbb82333bb8638da9 /modules | |
parent | 1e948814845864ca5796d5ebddb985f509a33c8c (diff) |
Replaced operating system alert dialog with a warning log message,
toggled by a project setting.
Fixes #73141
(cherry picked from commit cb8e91924399948888d80d20c6112df473897183)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/openxr/register_types.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/openxr/register_types.cpp b/modules/openxr/register_types.cpp index c39e49387a..b7d239fc73 100644 --- a/modules/openxr/register_types.cpp +++ b/modules/openxr/register_types.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "register_types.h" +#include "core/config/project_settings.h" #include "main/main.h" #include "openxr_interface.h" @@ -113,10 +114,19 @@ void initialize_openxr_module(ModuleInitializationLevel p_level) { ERR_FAIL_NULL(openxr_api); if (!openxr_api->initialize(Main::get_rendering_driver_name())) { - OS::get_singleton()->alert("OpenXR was requested but failed to start.\n" - "Please check if your HMD is connected.\n" - "When using Windows MR please note that WMR only has DirectX support, make sure SteamVR is your default OpenXR runtime.\n" - "Godot will start in normal mode.\n"); + const char *init_error_message = + "OpenXR was requested but failed to start.\n" + "Please check if your HMD is connected.\n" + "When using Windows MR please note that WMR only has DirectX support, make sure SteamVR is your default OpenXR runtime.\n" + "Godot will start in normal mode.\n"; + + WARN_PRINT(init_error_message); + + bool init_show_startup_alert = GLOBAL_GET("xr/openxr/startup_alert"); + if (init_show_startup_alert) { + OS::get_singleton()->alert(init_error_message); + } + memdelete(openxr_api); openxr_api = nullptr; return; |