fix hud toggling when starting the game with disabled hud
This commit is contained in:
parent
377c2a4f0b
commit
20e17e8faa
15
src/hud.rs
15
src/hud.rs
|
@ -442,6 +442,7 @@ pub fn setup(
|
||||||
},
|
},
|
||||||
gauge.clone(),
|
gauge.clone(),
|
||||||
GaugeLength(bar_length),
|
GaugeLength(bar_length),
|
||||||
|
ToggleableHudElement,
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -465,7 +466,8 @@ pub fn setup(
|
||||||
))
|
))
|
||||||
.with_children(|builder| {
|
.with_children(|builder| {
|
||||||
// The gauge symbol
|
// The gauge symbol
|
||||||
builder.spawn((ImageBundle {
|
builder.spawn((
|
||||||
|
ImageBundle {
|
||||||
image: UiImage::new(asset_server.load(sprite.to_string())),
|
image: UiImage::new(asset_server.load(sprite.to_string())),
|
||||||
style: Style {
|
style: Style {
|
||||||
width: Val::Px(icon_size),
|
width: Val::Px(icon_size),
|
||||||
|
@ -474,9 +476,12 @@ pub fn setup(
|
||||||
},
|
},
|
||||||
visibility,
|
visibility,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},));
|
},
|
||||||
|
ToggleableHudElement,
|
||||||
|
));
|
||||||
// The gauge bar border
|
// The gauge bar border
|
||||||
builder.spawn((ImageBundle {
|
builder.spawn((
|
||||||
|
ImageBundle {
|
||||||
image: UiImage::new(gauges_handle.clone()),
|
image: UiImage::new(gauges_handle.clone()),
|
||||||
style: Style {
|
style: Style {
|
||||||
width: Val::Px(bar_length),
|
width: Val::Px(bar_length),
|
||||||
|
@ -487,7 +492,9 @@ pub fn setup(
|
||||||
},
|
},
|
||||||
visibility,
|
visibility,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},));
|
},
|
||||||
|
ToggleableHudElement,
|
||||||
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue