From be295adc4ecaa7783ad778b5b85b7b05a3bcd1d7 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Sun, 28 May 2023 11:06:01 +0200 Subject: Prepend blank.png to modifier-only texmods --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index a5c95da..13ef518 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,13 +65,19 @@ impl Bot { } }; + fn print_texmod(tex: &String, print_texture: &mut impl FnMut(&String)) { + if !tex.is_empty() { + print_texture(&format!("blank.png{tex}")); + } + } + let print_obj_msg = |msg: &mt_net::ObjMsg| { use mt_net::ObjMsg::*; match msg { - TextureMod { texture_mod } => print_texture(texture_mod), + TextureMod { texture_mod } => print_texmod(texture_mod, &mut print_texture), Props(props) => { props.textures.iter().for_each(&mut print_texture); - print_texture(&props.dmg_texture_mod); + print_texmod(&props.dmg_texture_mod, &mut print_texture); } _ => {} } -- cgit v1.2.3