Fix audio feature

This commit is contained in:
Michael Hübner 2025-03-05 08:04:19 +01:00
parent 10cb0a997f
commit d5fee4d486
3 changed files with 6 additions and 5 deletions

View file

@ -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"]

View file

@ -26,7 +26,7 @@ impl GuiBuilder {
pub fn new(world: &mut World, path: &AssetPath) -> Result<Arc<Self>> {
let validator = Validator::new(
#[cfg(feature = "audio")]
gui_handler,
world.resources.get::<GuiHandler>(),
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<Arc<Self>> {
let validator = Validator::from_str(
#[cfg(feature = "audio")]
gui_handler,
world.resources.get::<GuiHandler>(),
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::<GuiHandler>(),
path,
)?;

View file

@ -21,7 +21,7 @@ impl GuiSnippet {
pub fn new(world: &mut World, path: &AssetPath) -> Result<Arc<Self>> {
let validator = Validator::new(
#[cfg(feature = "audio")]
world,
world.resources.get::<GuiHandler>(),
path,
)?;
@ -31,7 +31,7 @@ impl GuiSnippet {
pub fn from_str(world: &mut World, s: &str) -> Result<Arc<Self>> {
let validator = Validator::from_str(
#[cfg(feature = "audio")]
gui_handler,
world.resources.get::<GuiHandler>(),
s,
)?;