mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 12:10:17 +00:00
Implement splash screen feature.
This commit is contained in:
@@ -4,6 +4,9 @@ use std::rc::Rc;
|
||||
pub mod chainload;
|
||||
pub mod print;
|
||||
|
||||
#[cfg(feature = "splash")]
|
||||
pub mod splash;
|
||||
|
||||
pub fn execute(context: Rc<Context>, name: impl AsRef<str>) {
|
||||
let Some(action) = context.root().actions().get(name.as_ref()) else {
|
||||
panic!("unknown action: {}", name.as_ref());
|
||||
@@ -11,10 +14,18 @@ pub fn execute(context: Rc<Context>, name: impl AsRef<str>) {
|
||||
let context = context.finalize().freeze();
|
||||
|
||||
if let Some(chainload) = &action.chainload {
|
||||
chainload::chainload(context, chainload);
|
||||
chainload::chainload(context.clone(), chainload);
|
||||
return;
|
||||
} else if let Some(print) = &action.print {
|
||||
print::print(context, print);
|
||||
} else {
|
||||
panic!("unknown action configuration");
|
||||
print::print(context.clone(), print);
|
||||
return;
|
||||
}
|
||||
|
||||
#[cfg(feature = "splash")]
|
||||
if let Some(splash) = &action.splash {
|
||||
splash::splash(context.clone(), splash);
|
||||
return;
|
||||
}
|
||||
|
||||
panic!("unknown action configuration");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user