mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 15:50:18 +00:00
Implement splash screen feature.
This commit is contained in:
@@ -24,6 +24,9 @@ pub struct ActionDeclaration {
|
||||
pub chainload: Option<ChainloadConfiguration>,
|
||||
#[serde(default)]
|
||||
pub print: Option<PrintConfiguration>,
|
||||
#[serde(default)]
|
||||
#[cfg(feature = "splash")]
|
||||
pub splash: Option<SplashConfiguration>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Default, Clone)]
|
||||
@@ -76,6 +79,19 @@ pub struct PrintConfiguration {
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[cfg(feature = "splash")]
|
||||
#[derive(Serialize, Deserialize, Default, Clone)]
|
||||
pub struct SplashConfiguration {
|
||||
pub image: String,
|
||||
#[serde(default = "default_splash_time")]
|
||||
pub time: u32,
|
||||
}
|
||||
|
||||
#[cfg(feature = "splash")]
|
||||
pub fn default_splash_time() -> u32 {
|
||||
5
|
||||
}
|
||||
|
||||
pub fn load() -> RootConfiguration {
|
||||
let content = utils::read_file_contents("sprout.toml");
|
||||
toml::from_slice(&content).expect("unable to parse sprout.toml file")
|
||||
|
||||
Reference in New Issue
Block a user