From d5fee4d4868c4f0e4ea6a0f3539069caa263de12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=BCbner?= Date: Wed, 5 Mar 2025 08:04:19 +0100 Subject: [PATCH] Fix audio feature --- Cargo.toml | 1 + src/builder/builder.rs | 6 +++--- src/builder/snippet.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e18f9cf..46bf689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,3 +20,4 @@ ecs = { git = "https://gavania.de/hodasemi/ecs.git" } audio = { git = "https://gavania.de/hodasemi/audio.git", optional = true } [features] +default = ["audio"] diff --git a/src/builder/builder.rs b/src/builder/builder.rs index c80b624..4add342 100644 --- a/src/builder/builder.rs +++ b/src/builder/builder.rs @@ -26,7 +26,7 @@ impl GuiBuilder { pub fn new(world: &mut World, path: &AssetPath) -> Result> { let validator = Validator::new( #[cfg(feature = "audio")] - gui_handler, + world.resources.get::(), path, ) .with_context(|| format!("validator for {}", path.full_path()))?; @@ -39,7 +39,7 @@ impl GuiBuilder { pub fn from_str(world: &mut World, s: &str) -> Result> { let validator = Validator::from_str( #[cfg(feature = "audio")] - gui_handler, + world.resources.get::(), s, )?; @@ -62,7 +62,7 @@ impl GuiBuilder { for path in pathes.into_iter() { let validator = Validator::new( #[cfg(feature = "audio")] - gui_handler, + world.resources.get::(), path, )?; diff --git a/src/builder/snippet.rs b/src/builder/snippet.rs index e110224..5d6cbf4 100644 --- a/src/builder/snippet.rs +++ b/src/builder/snippet.rs @@ -21,7 +21,7 @@ impl GuiSnippet { pub fn new(world: &mut World, path: &AssetPath) -> Result> { let validator = Validator::new( #[cfg(feature = "audio")] - world, + world.resources.get::(), path, )?; @@ -31,7 +31,7 @@ impl GuiSnippet { pub fn from_str(world: &mut World, s: &str) -> Result> { let validator = Validator::from_str( #[cfg(feature = "audio")] - gui_handler, + world.resources.get::(), s, )?;