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:
parent
3c5f05b284
commit
4952f17df4
15 changed files with 152 additions and 89 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue