This commit is contained in:
2023-05-10 17:04:23 +02:00
parent 4b6c4e1af8
commit 25787c8b65
47 changed files with 234 additions and 2348 deletions

View File

@@ -25,7 +25,7 @@ impl Display for Error {
Error::InvalidData { info, context } => write!(
f,
"Invalid data: {}; {}",
info.unwrap_or("[no info]".to_string()),
info.clone().unwrap_or("[no info]".to_string()),
context
),
Error::Custom(error) => write!(f, "{}", error),

View File

@@ -55,12 +55,12 @@ impl Default for FadeMode {
impl UiTag {
pub fn post_process(mut self) -> Self {
if let UiTag::Menu(mut menu) = &self {
if let UiTag::Menu(menu) = &mut self {
let children: Vec<UiTag> = menu.children.drain(..).collect();
let mut area_stack: Vec<Vec<UiTag>> = vec![vec![]];
for mut child in children {
child.post_process();
for child in children {
let child = child.post_process();
if let UiTag::TextArea(mut area) = child {
let children = area_stack.pop().unwrap();
let opening_tag = area_stack.last_mut().map(|it| it.last_mut());