Add const default to create info

This commit is contained in:
hodasemi 2023-01-17 07:24:20 +01:00
parent e12d65dec6
commit e78e361fba

View file

@ -22,7 +22,7 @@ use std::{ops::Deref, sync::Weak};
use paste::paste; use paste::paste;
#[derive(Deserialize, Serialize, Clone, Default, Debug)] #[derive(Deserialize, Serialize, Clone, Debug)]
pub struct GuiHandlerCreateInfo { pub struct GuiHandlerCreateInfo {
// default button textures // default button textures
pub menu_button: AssetPath, pub menu_button: AssetPath,
@ -41,6 +41,28 @@ pub struct GuiHandlerCreateInfo {
pub resource_directory: AssetPath, pub resource_directory: AssetPath,
} }
impl GuiHandlerCreateInfo {
pub const fn default() -> Self {
GuiHandlerCreateInfo {
// default button textures
menu_button: AssetPath::default(),
menu_button_selected: AssetPath::default(),
// path to the alphabet image
font_path: AssetPath::default(),
// sound info
#[cfg(feature = "audio")]
click_sound: AssetPath::default(),
#[cfg(feature = "audio")]
hover_sound: AssetPath::default(),
// resource base directory
resource_directory: AssetPath::default(),
}
}
}
struct GuiSeparator { struct GuiSeparator {
_descriptor_layout: Arc<DescriptorSetLayout>, _descriptor_layout: Arc<DescriptorSetLayout>,
_pipeline_layout: Arc<PipelineLayout>, _pipeline_layout: Arc<PipelineLayout>,