feat(main): better overlay control

This commit is contained in:
Nova
2022-09-27 15:21:22 -04:00
parent ba865a1af5
commit a67583a22c

View File

@@ -25,12 +25,12 @@ use tokio::{runtime::Handle, sync::oneshot};
#[clap(author, version, about, long_about = None)] #[clap(author, version, about, long_about = None)]
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, action)] #[clap(short, long, action)]
flatscreen: bool, flatscreen: bool,
/// Run Stardust XR as an overlay /// Run Stardust XR as an overlay with given priority
#[clap(short, action)] #[clap(id = "PRIORITY", short = 'o', long = "overlay", action)]
overlay: bool, overlay_priority: Option<u32>,
} }
fn main() -> Result<()> { fn main() -> Result<()> {
@@ -41,8 +41,8 @@ fn main() -> Result<()> {
let mut stereokit = Settings::default() let mut stereokit = Settings::default()
.app_name("Stardust XR") .app_name("Stardust XR")
.overlay_app(cli_args.overlay) .overlay_app(cli_args.overlay_priority.is_some())
.overlay_priority(u32::MAX) .overlay_priority(cli_args.overlay_priority.unwrap_or(u32::MAX))
.disable_desktop_input_window(true) .disable_desktop_input_window(true)
.display_preference(if cli_args.flatscreen { .display_preference(if cli_args.flatscreen {
DisplayMode::Flatscreen DisplayMode::Flatscreen