Implement splash screen feature.

This commit is contained in:
2025-10-05 03:12:00 -07:00
parent 779a645dec
commit 3101829103
101 changed files with 30504 additions and 6 deletions

View File

@@ -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")