feat: add spectator camera flag

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-09-06 23:36:12 +02:00
parent ae68d0e135
commit 9e8f09fe97
2 changed files with 50 additions and 4 deletions

View File

@@ -5,12 +5,14 @@ mod core;
mod nodes;
mod objects;
mod session;
mod spectator_cam;
pub mod tracking_offset;
#[cfg(feature = "wayland")]
mod wayland;
use crate::nodes::drawable::sky::SkyPlugin;
use crate::nodes::input;
use crate::spectator_cam::SpectatorCameraPlugin;
use bevy::MinimalPlugins;
use bevy::a11y::AccessibilityPlugin;
@@ -89,6 +91,10 @@ struct CliArgs {
#[clap(short, long, action)]
flatscreen: bool,
/// Replaces the flatscreen mode with a first person spectator camera
#[clap(short, long, action)]
spectator: bool,
/// Creates a transparent window fot the flatscreen mode
#[clap(short, long, action)]
transparent_flatscreen: bool,
@@ -326,10 +332,11 @@ fn bevy_loop(
{
let mut plugin = WinitPlugin::<WakeUp>::default();
plugin.run_on_any_thread = true;
plugins = plugins
.add(plugin)
.disable::<ScheduleRunnerPlugin>()
.add(FlatscreenInputPlugin);
plugins = plugins.add(plugin).disable::<ScheduleRunnerPlugin>();
plugins = match args.spectator {
true => plugins.add(SpectatorCameraPlugin),
false => plugins.add(FlatscreenInputPlugin),
};
}
app.add_plugins(
if !args.flatscreen {