mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Add files via upload
This commit is contained in:
parent
3ef6b63dac
commit
994592d01f
|
|
@ -1513,15 +1513,21 @@ void Minecraft::run_middle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CHANGED FROM IsKeyPressed SO YOU CAN HOLD TO DROP (after 0.3 sec delay).
|
|
||||||
|
|
||||||
static bool wasDown = false;
|
static bool wasDown = false;
|
||||||
static std::chrono::steady_clock::time_point pressTime;
|
static std::chrono::steady_clock::time_point pressTime;
|
||||||
|
|
||||||
bool down = g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_DROP);
|
bool down = g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_DROP);
|
||||||
|
|
||||||
if (down)
|
if (g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_DROP) && g_KBMInput.IsKeyDown(VK_CONTROL))
|
||||||
|
// TO DROP A STACK
|
||||||
|
{
|
||||||
|
localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROPALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (down)
|
||||||
|
// CHANGED FROM IsKeyPressed SO YOU CAN HOLD TO DROP (after 0.3 sec delay).
|
||||||
{
|
{
|
||||||
auto now = std::chrono::steady_clock::now();
|
auto now = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
|
|
@ -1536,18 +1542,14 @@ void Minecraft::run_middle()
|
||||||
float held = std::chrono::duration<float>(now - pressTime).count();
|
float held = std::chrono::duration<float>(now - pressTime).count();
|
||||||
|
|
||||||
if (held > 0.3f)
|
if (held > 0.3f)
|
||||||
|
{
|
||||||
localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROP;
|
localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wasDown = down;
|
wasDown = down;
|
||||||
|
|
||||||
// TO DROP A STACK
|
|
||||||
|
|
||||||
if (g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_DROP) && g_KBMInput.IsKeyDown(VK_CONTROL))
|
|
||||||
{
|
|
||||||
localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROPALL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING) || g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING_ALT))
|
if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING) || g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING_ALT))
|
||||||
{
|
{
|
||||||
|
|
@ -1561,12 +1563,17 @@ void Minecraft::run_middle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int slot = 0; slot < 9; slot++)
|
// PREVENTS SWITCHING HOTBAR SLOTS WHEN IN MENUS
|
||||||
|
|
||||||
|
if (!ui.GetMenuDisplayed(0))
|
||||||
{
|
{
|
||||||
if (g_KBMInput.IsKeyPressed('1' + slot))
|
for (int slot = 0; slot < 9; slot++)
|
||||||
{
|
{
|
||||||
if (localplayers[i]->inventory)
|
if (g_KBMInput.IsKeyPressed('1' + slot))
|
||||||
localplayers[i]->inventory->selected = slot;
|
{
|
||||||
|
if (localplayers[i]->inventory)
|
||||||
|
localplayers[i]->inventory->selected = slot;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue