mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 23:11:49 +00:00
fix: locked cursor in menu
This commit is contained in:
parent
b85e357ab2
commit
b72138cd15
1 changed files with 4 additions and 1 deletions
|
|
@ -207,6 +207,9 @@ Hud::Hud(Engine& engine, LevelFrontend& frontend, Player& player)
|
||||||
}
|
}
|
||||||
|
|
||||||
Hud::~Hud() {
|
Hud::~Hud() {
|
||||||
|
if (input.isCursorLocked()) {
|
||||||
|
input.toggleCursor();
|
||||||
|
}
|
||||||
// removing all controlled ui
|
// removing all controlled ui
|
||||||
for (auto& element : elements) {
|
for (auto& element : elements) {
|
||||||
onRemove(element);
|
onRemove(element);
|
||||||
|
|
@ -339,7 +342,7 @@ void Hud::update(bool visible) {
|
||||||
if (!gui.isFocusCaught()) {
|
if (!gui.isFocusCaught()) {
|
||||||
processInput(visible);
|
processInput(visible);
|
||||||
}
|
}
|
||||||
if ((isMenuOpen || inventoryOpen) == input.getCursor().locked) {
|
if ((isMenuOpen || inventoryOpen) == input.isCursorLocked()) {
|
||||||
input.toggleCursor();
|
input.toggleCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue