mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
hidden hud mode fix
This commit is contained in:
parent
5c23b4125d
commit
55f855849e
1 changed files with 11 additions and 4 deletions
|
|
@ -374,10 +374,15 @@ void Hud::update(bool visible) {
|
|||
}
|
||||
}
|
||||
|
||||
for (auto& element : elements) {
|
||||
element.getNode()->setVisible(visible);
|
||||
}
|
||||
|
||||
glm::vec2 invSize = contentAccessPanel->getSize();
|
||||
contentAccessPanel->setVisible(inventoryOpen);
|
||||
contentAccessPanel->setSize(glm::vec2(invSize.x, Window::height));
|
||||
contentAccess->setMinSize(glm::vec2(1, Window::height));
|
||||
hotbarView->setVisible(visible);
|
||||
|
||||
for (int i = keycode::NUM_1; i <= keycode::NUM_9; i++) {
|
||||
if (Events::jpressed(i)) {
|
||||
|
|
@ -396,10 +401,12 @@ void Hud::update(bool visible) {
|
|||
player->setChosenSlot(slot);
|
||||
}
|
||||
|
||||
for (auto& element : elements) {
|
||||
element.update(pause, inventoryOpen, player->debug);
|
||||
if (element.isRemoved()) {
|
||||
remove(element);
|
||||
if (visible) {
|
||||
for (auto& element : elements) {
|
||||
element.update(pause, inventoryOpen, player->debug);
|
||||
if (element.isRemoved()) {
|
||||
remove(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue