* Improve mouse grabbing.

This fixes a bug where the mouse would be restricted to the window after the level is loaded even if the window isn't focused.
This commit is contained in:
iProgramInCpp
2023-08-01 11:08:56 +03:00
parent 67d1fc4f44
commit af11c5281c
6 changed files with 30 additions and 2 deletions

View File

@@ -114,6 +114,10 @@ void AppPlatform::clearDiff()
}
void AppPlatform::updateFocused(bool focused)
{
}
bool AppPlatform::shiftPressed()
{
return false;

View File

@@ -47,6 +47,7 @@ public:
virtual void setMouseGrabbed(bool b);
virtual void getMouseDiff(int& x, int& y);
virtual void clearDiff();
virtual void updateFocused(bool focused);
// Also add this to allow proper text input within the game.
virtual bool shiftPressed();
#endif

View File

@@ -188,7 +188,7 @@ label_5:
pInv->setSelectionSlotItemId(0, item);
pInv->selectSlot(0);
// @TODO: SoundEngine
m_pMinecraft->m_pSoundEngine->play("random.click");
m_pMinecraft->setScreen(nullptr);
}