diff options
| author | Adem Kurt <138557116+Adem-Kurt@users.noreply.github.com> | 2026-03-07 04:02:42 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 19:02:42 -0600 |
| commit | 8f2ae54b3af76aa9691fdd44316d2957c9adebac (patch) | |
| tree | e0697e689b6fd9a16d480c1722d7c76fd6afcc9a /Minecraft.Client | |
| parent | 8dee53a5650eea7c79c5739ff5b6014cb60bdc6f (diff) | |
Add toggle inventory/crafting with E and C/R keys (#593)
Diffstat (limited to 'Minecraft.Client')
| -rw-r--r-- | Minecraft.Client/Minecraft.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 7577eacb..f268ec50 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1480,13 +1480,31 @@ void Minecraft::run_middle() localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_USE; if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_INVENTORY)) - localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_INVENTORY; + { + if(ui.IsSceneInStack(i, eUIScene_InventoryMenu)) + { + ui.CloseUIScenes(i); + } + else + { + localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_INVENTORY; + } + } if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_DROP)) localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_DROP; if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING) || g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING_ALT)) + { + if(ui.IsSceneInStack(i, eUIScene_Crafting2x2Menu) || ui.IsSceneInStack(i, eUIScene_Crafting3x3Menu) || ui.IsSceneInStack(i, eUIScene_CreativeMenu)) + { + ui.CloseUIScenes(i); + } + else + { localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_CRAFTING; + } + } for (int slot = 0; slot < 9; slot++) { |
