|
|
|
|
@ -116,14 +116,25 @@ fn update_credits(
|
|
|
|
|
|
|
|
|
|
query.iter_mut().for_each(|mut text| {
|
|
|
|
|
let credits_text = tweak.get::<String>("credits_text").unwrap();
|
|
|
|
|
let title_font_size = tweak.get::<f32>("credits_title_font_size").unwrap();
|
|
|
|
|
let font_size = tweak.get::<f32>("credits_font_size").unwrap();
|
|
|
|
|
text.sections = {
|
|
|
|
|
credits_text
|
|
|
|
|
.split('\n')
|
|
|
|
|
.map(|l| TextSection {
|
|
|
|
|
value: format!("{}\n", l),
|
|
|
|
|
style: TextStyle { ..default() },
|
|
|
|
|
})
|
|
|
|
|
.collect()
|
|
|
|
|
.map(|line| {
|
|
|
|
|
match line.strip_prefix("# ") {
|
|
|
|
|
Some(title) => TextSection {
|
|
|
|
|
value: format!("{}\n", title),
|
|
|
|
|
style: TextStyle { font_size: title_font_size, ..default() },
|
|
|
|
|
},
|
|
|
|
|
None => {
|
|
|
|
|
TextSection {
|
|
|
|
|
value: format!("{}\n", line),
|
|
|
|
|
style: TextStyle { font_size, ..default() },
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).collect()
|
|
|
|
|
};
|
|
|
|
|
debug!("Text sections: {:?}", text.sections);
|
|
|
|
|
});
|
|
|
|
|
|