Fix audio feature

This commit is contained in:
hodasemi 2025-02-28 06:50:08 +01:00
parent f384959fc6
commit bffec81ad3

View file

@ -1,7 +1,7 @@
//! `Audible` is a property to play a sound //! `Audible` is a property to play a sound
use crate::prelude::*; use crate::prelude::*;
use anyhow::Result; use anyhow::{Result, anyhow};
use assetpath::AssetPath; use assetpath::AssetPath;
// #[cfg(feature = "audio")] // #[cfg(feature = "audio")]
@ -18,7 +18,12 @@ pub struct Audible {
impl Audible { impl Audible {
pub fn new(gui_handler: Arc<GuiHandler>, mut path: AssetPath) -> Result<Arc<Self>> { pub fn new(gui_handler: Arc<GuiHandler>, mut path: AssetPath) -> Result<Arc<Self>> {
if !path.has_prefix() { if !path.has_prefix() {
path.set_prefix(&gui_handler.resource_base_path().full_path()); path.set_prefix(
&gui_handler
.resource_base_path()
.ok_or(anyhow!("resource base path not set!"))?
.full_path(),
);
} }
// TODO: // TODO: