refactor: rename flatscreen to force flatscreen
This commit is contained in:
@@ -91,7 +91,7 @@ use bevy::prelude::*;
|
|||||||
struct CliArgs {
|
struct CliArgs {
|
||||||
/// Force flatscreen mode and use the mouse pointer as a 3D pointer
|
/// Force flatscreen mode and use the mouse pointer as a 3D pointer
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
flatscreen: bool,
|
force_flatscreen: bool,
|
||||||
|
|
||||||
/// Replaces the flatscreen mode with a first person spectator camera
|
/// Replaces the flatscreen mode with a first person spectator camera
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
@@ -326,7 +326,7 @@ fn bevy_loop(
|
|||||||
.async_compute
|
.async_compute
|
||||||
.on_thread_spawn = Some(enter_runtime_context.clone());
|
.on_thread_spawn = Some(enter_runtime_context.clone());
|
||||||
plugins = plugins.set(task_pool_plugin);
|
plugins = plugins.set(task_pool_plugin);
|
||||||
if args.flatscreen {
|
if std::env::var("DISPLAY").is_ok() || std::env::var("WAYLAND_DISPLAY").is_ok() {
|
||||||
let mut plugin = WinitPlugin::<WakeUp>::default();
|
let mut plugin = WinitPlugin::<WakeUp>::default();
|
||||||
plugin.run_on_any_thread = true;
|
plugin.run_on_any_thread = true;
|
||||||
plugins = plugins.add(plugin).disable::<ScheduleRunnerPlugin>();
|
plugins = plugins.add(plugin).disable::<ScheduleRunnerPlugin>();
|
||||||
@@ -336,7 +336,7 @@ fn bevy_loop(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
app.add_plugins(
|
app.add_plugins(
|
||||||
if !args.flatscreen {
|
if !args.force_flatscreen {
|
||||||
add_xr_plugins(plugins)
|
add_xr_plugins(plugins)
|
||||||
.set(OxrInitPlugin {
|
.set(OxrInitPlugin {
|
||||||
app_info: AppInfo {
|
app_info: AppInfo {
|
||||||
|
|||||||
Reference in New Issue
Block a user