mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
TouchScreenGUI: Fix only 9 hotbar slots being usable (#13698)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
This commit is contained in:
parent
72ef90885d
commit
92b6ff4721
5 changed files with 63 additions and 45 deletions
|
@ -2168,6 +2168,14 @@ void Game::processItemSelection(u16 *new_playeritem)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_TOUCHSCREENGUI
|
||||
if (g_touchscreengui) {
|
||||
std::optional<u16> selection = g_touchscreengui->getHotbarSelection();
|
||||
if (selection)
|
||||
*new_playeritem = *selection;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Clamp selection again in case it wasn't changed but max_item was
|
||||
*new_playeritem = MYMIN(*new_playeritem, max_item);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue