mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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() {
|
||||
if (input.isCursorLocked()) {
|
||||
input.toggleCursor();
|
||||
}
|
||||
// removing all controlled ui
|
||||
for (auto& element : elements) {
|
||||
onRemove(element);
|
||||
|
|
@ -339,7 +342,7 @@ void Hud::update(bool visible) {
|
|||
if (!gui.isFocusCaught()) {
|
||||
processInput(visible);
|
||||
}
|
||||
if ((isMenuOpen || inventoryOpen) == input.getCursor().locked) {
|
||||
if ((isMenuOpen || inventoryOpen) == input.isCursorLocked()) {
|
||||
input.toggleCursor();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue