feat(worlds): add metadata cards and quick launch
This commit is contained in:
1 parent
4eed312c3d
commit
ea7478eb27
22 files changed
+585
-88
No files matched your search
@@ -29,6 +29,7 @@ pub struct TemplateContext<'a> {
|
||||
pub launcher_name: &'a str,
|
||||
pub launcher_version: &'a str,
|
||||
pub clientid: &'a str,
|
||||
pub quick_play_singleplayer: Option<&'a str>,
|
||||
}
|
||||
|
||||
pub fn substitute(input: &str, ctx: &TemplateContext) -> String {
|
||||
@@ -63,15 +64,6 @@ pub fn substitute(input: &str, ctx: &TemplateContext) -> String {
|
||||
out
|
||||
}
|
||||
|
||||
// quick-play templates (`${quickPlayPath}`, `${quickPlaySingleplayer}`,
|
||||
// `${quickPlayMultiplayer}`, `${quickPlayRealms}`) are intentionally not
|
||||
// listed here. they only appear in `arguments.game` entries gated on
|
||||
// `is_quick_play_*` feature flags; since rmcl never sets those flags
|
||||
// (FeatureSet defaults to None across the board), the surrounding
|
||||
// conditional argument is filtered out by the rule evaluator before
|
||||
// template substitution even runs. if we ever expose quick-play to users,
|
||||
// add the variables here AND set the corresponding feature flags in
|
||||
// RuleContext at launch.
|
||||
fn lookup(name: &str, ctx: &TemplateContext) -> Option<String> {
|
||||
Some(match name {
|
||||
"library_directory" => ctx.library_directory.display().to_string(),
|
||||
@@ -92,6 +84,7 @@ fn lookup(name: &str, ctx: &TemplateContext) -> Option<String> {
|
||||
"launcher_name" => ctx.launcher_name.to_string(),
|
||||
"launcher_version" => ctx.launcher_version.to_string(),
|
||||
"clientid" => ctx.clientid.to_string(),
|
||||
"quickPlaySingleplayer" => ctx.quick_play_singleplayer?.to_owned(),
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user