mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
* Fix the "selecting the '...' slot" bug
This commit is contained in:
@@ -536,6 +536,11 @@ int Gui::getNumSlots()
|
||||
return 9;
|
||||
}
|
||||
|
||||
int Gui::getNumUsableSlots()
|
||||
{
|
||||
return getNumSlots() - m_pMinecraft->isTouchscreen();
|
||||
}
|
||||
|
||||
RectangleArea Gui::getRectangleArea(bool b)
|
||||
{
|
||||
float centerX = Minecraft::width / 2;
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
void handleClick(int id, int mx, int my);
|
||||
void handleKeyPressed(int keyCode);
|
||||
void renderMessages(bool bShowAll);
|
||||
int getNumSlots();
|
||||
int getNumSlots(); // Gets the number of slots in the inventory. Includes the '...' if in touch mode.
|
||||
int getNumUsableSlots(); // Gets the number of usable slots in the inventory. Does not include the '...' if in touch mode.
|
||||
RectangleArea getRectangleArea(bool b);
|
||||
|
||||
public:
|
||||
|
||||
@@ -179,7 +179,7 @@ void IngameBlockSelectionScreen::selectSlotAndClose()
|
||||
{
|
||||
Inventory* pInv = getInventory();
|
||||
|
||||
pInv->selectItem(m_selectedSlot, m_pMinecraft->m_gui.getNumSlots());
|
||||
pInv->selectItem(m_selectedSlot, m_pMinecraft->m_gui.getNumUsableSlots());
|
||||
|
||||
m_pMinecraft->m_pSoundEngine->play("random.click");
|
||||
m_pMinecraft->setScreen(nullptr);
|
||||
|
||||
Reference in New Issue
Block a user