1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Rename TouchScreenGUI -> TouchControls

to avoid confusion between touchscreen-related settings that affect GUIs
(formspecs) and touchscreen-related settings that affect the touch controls
(TouchControls / formerly TouchScreenGUI)
This commit is contained in:
Gregor Parzefall 2024-05-15 21:11:16 +02:00 committed by grorp
parent bf4d31227b
commit 1977517d7a
10 changed files with 83 additions and 83 deletions

View file

@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/numeric.h"
#include "inputhandler.h"
#include "gui/mainmenumanager.h"
#include "gui/touchscreengui.h"
#include "gui/touchcontrols.h"
#include "hud.h"
void KeyCache::populate_nonchanging()
@ -143,8 +143,8 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
// Let the menu handle events, if one is active.
if (isMenuActive()) {
if (g_touchscreengui)
g_touchscreengui->setVisible(false);
if (g_touchcontrols)
g_touchcontrols->setVisible(false);
return g_menumgr.preprocessEvent(event);
}
@ -168,9 +168,9 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
return true;
}
} else if (g_touchscreengui && event.EventType == irr::EET_TOUCH_INPUT_EVENT) {
// In case of touchscreengui, we have to handle different events
g_touchscreengui->translateEvent(event);
} else if (g_touchcontrols && event.EventType == irr::EET_TOUCH_INPUT_EVENT) {
// In case of touchcontrols, we have to handle different events
g_touchcontrols->translateEvent(event);
return true;
} else if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT) {
// joystick may be nullptr if game is launched with '--random-input' parameter
@ -237,8 +237,8 @@ float RealInputHandler::getMovementSpeed()
return 0.0f;
return 1.0f; // If there is a keyboard event, assume maximum speed
}
if (g_touchscreengui && g_touchscreengui->getMovementSpeed())
return g_touchscreengui->getMovementSpeed();
if (g_touchcontrols && g_touchcontrols->getMovementSpeed())
return g_touchcontrols->getMovementSpeed();
return joystick.getMovementSpeed();
}
@ -260,8 +260,8 @@ float RealInputHandler::getMovementDirection()
return std::atan2(x, z);
// `getMovementDirection() == 0` means forward, so we cannot use
// `getMovementDirection()` as a condition.
else if (g_touchscreengui && g_touchscreengui->getMovementSpeed())
return g_touchscreengui->getMovementDirection();
else if (g_touchcontrols && g_touchcontrols->getMovementSpeed())
return g_touchcontrols->getMovementDirection();
return joystick.getMovementDirection();
}