diff --git a/src/guihandler/guihandler.rs b/src/guihandler/guihandler.rs index 256eb96..3bdf293 100644 --- a/src/guihandler/guihandler.rs +++ b/src/guihandler/guihandler.rs @@ -28,7 +28,13 @@ pub enum Font<'a> { Bytes(&'a [u8]), } -#[derive(Deserialize, Serialize, Clone, Debug)] +impl Default for Font<'_> { + fn default() -> Self { + Self::Path(AssetPath::default()) + } +} + +#[derive(Deserialize, Serialize, Clone, Debug, Default)] pub struct GuiHandlerCreateInfo<'a> { // default button textures pub menu_button: AssetPath, @@ -49,23 +55,23 @@ pub struct GuiHandlerCreateInfo<'a> { } impl<'a> GuiHandlerCreateInfo<'a> { - pub const fn default() -> Self { + pub const fn new() -> Self { GuiHandlerCreateInfo { // default button textures - menu_button: AssetPath::default(), - menu_button_selected: AssetPath::default(), + menu_button: AssetPath::new(), + menu_button_selected: AssetPath::new(), // path to the alphabet image - font: Font::Path(AssetPath::default()), + font: Font::Path(AssetPath::new()), // sound info #[cfg(feature = "audio")] - click_sound: AssetPath::default(), + click_sound: AssetPath::new(), #[cfg(feature = "audio")] - hover_sound: AssetPath::default(), + hover_sound: AssetPath::new(), // resource base directory - resource_directory: AssetPath::default(), + resource_directory: AssetPath::new(), } } }