fix: locked cursor in menu
This commit is contained in:
parent
b85e357ab2
commit
b72138cd15
@ -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…
x
Reference in New Issue
Block a user