Prevented UI resets when toggling HUD

This commit is contained in:
Joshua Barretto 2019-06-29 15:30:46 +01:00
parent b5648f736d
commit dd82fc24a8

View File

@ -311,11 +311,6 @@ impl Hud {
Err(_) => env!("CARGO_PKG_VERSION").to_owned(),
};
// Don't show anything if the UI is toggled off.
if !self.show.ui {
return events;
}
// Nametags and healthbars
if self.show.ingame {
let ecs = client.state().ecs();
@ -819,7 +814,10 @@ impl Hud {
}
pub fn render(&self, renderer: &mut Renderer, globals: &Consts<Globals>) {
self.ui.render(renderer, Some(globals));
// Don't show anything if the UI is toggled off.
if self.show.ui {
self.ui.render(renderer, Some(globals));
}
}
}