Fix audio feature
This commit is contained in:
parent
f384959fc6
commit
bffec81ad3
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
//! `Audible` is a property to play a sound
|
||||
|
||||
use crate::prelude::*;
|
||||
use anyhow::Result;
|
||||
use anyhow::{Result, anyhow};
|
||||
use assetpath::AssetPath;
|
||||
|
||||
// #[cfg(feature = "audio")]
|
||||
|
@ -18,7 +18,12 @@ pub struct Audible {
|
|||
impl Audible {
|
||||
pub fn new(gui_handler: Arc<GuiHandler>, mut path: AssetPath) -> Result<Arc<Self>> {
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue