diff --git a/src/screen/background.rs b/src/screen/background.rs index 8eba6b8b..c64a0ecf 100644 --- a/src/screen/background.rs +++ b/src/screen/background.rs @@ -44,13 +44,11 @@ impl Screen for Background { let path = self.vars.get(BACKGROUND_IMAGE); self.last_path = (*path).clone(); let background = - if Renderer::get_texture_optional(renderer.get_textures_ref(), &format!("#{}", path)) - .is_some() - { + if Renderer::get_texture_optional(renderer.get_textures_ref(), &path).is_some() { Some( ui::ImageBuilder::new() .draw_index(i16::MIN as isize) - .texture(&*format!("#{}", self.vars.get(BACKGROUND_IMAGE))) + .texture(path.as_str()) .size( renderer.screen_data.read().safe_width as f64, renderer.screen_data.read().safe_height as f64, diff --git a/src/screen/launcher.rs b/src/screen/launcher.rs index 1cef6173..a411a686 100644 --- a/src/screen/launcher.rs +++ b/src/screen/launcher.rs @@ -181,7 +181,7 @@ impl super::Screen for Launcher { .pick_file(); if let Some(files) = files { let file_name = files.as_path().to_str().unwrap(); - game.vars.set(BACKGROUND_IMAGE, file_name.to_string()); + game.vars.set(BACKGROUND_IMAGE, format!("#{}", file_name)); } true })