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, )?;