1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-21 18:11:11 +00:00

Auto-toggle TouchControls in-game when receiving touch/mouse input

This commit is contained in:
grorp 2024-09-28 11:23:09 +02:00 committed by grorp
parent 3c5f05b284
commit 4952f17df4
15 changed files with 152 additions and 89 deletions

View file

@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiFormSpecMenu.h"
#include "client/hud.h"
#include "client/client.h"
#include "client/renderingengine.h"
#include <IVideoDriver.h>
GUIInventoryList::GUIInventoryList(gui::IGUIEnvironment *env,
@ -154,7 +155,7 @@ void GUIInventoryList::draw()
// Add hovering tooltip
bool show_tooltip = !item.empty() && hovering && !selected_item;
// Make it possible to see item tooltips on touchscreens
if (m_fs_menu->getPointerType() == PointerType::Touch) {
if (RenderingEngine::getLastPointerType() == PointerType::Touch) {
show_tooltip |= hovering && selected && m_fs_menu->getSelectedAmount() != 0;
}
if (show_tooltip) {