#include <touchcontrols.h>
|
void | toggleOverflowMenu () |
|
void | updateVisibility () |
|
void | releaseAll () |
|
void | addButton (std::vector< button_info > &buttons, touch_gui_button_id id, const std::string &image, const recti &rect, bool visible=true) |
|
void | addToggleButton (std::vector< button_info > &buttons, touch_gui_button_id id, const std::string &image_1, const std::string &image_2, const recti &rect, bool visible=true) |
|
IGUIImage * | makeButtonDirect (touch_gui_button_id id, const recti &rect, bool visible) |
|
bool | isHotbarButton (const SEvent &event) |
|
void | handleReleaseEvent (size_t pointer_id) |
|
void | applyJoystickStatus () |
|
v2s32 | getPointerPos () |
|
void | emitMouseEvent (EMOUSE_INPUT_EVENT type) |
|
◆ TouchControls()
References addButton(), addToggleButton(), ARRLEN, aux1_id, button_image_names, button_titles, camera_id, chat_id, debug_id, drop_id, exit_id, fast_id, fly_id, g_settings, Settings::getBool(), RenderingEngine::getDisplayDensity(), Settings::getFloat(), Settings::getU16(), grab_gui_element(), id_to_keycode(), inventory_id, joystick_bg_id, joystick_center_id, joystick_off_id, jump_id, m_button_size, m_buttons, m_device, m_fixed_joystick, m_guienv, m_joystick_btn_bg, m_joystick_btn_center, m_joystick_btn_off, m_joystick_triggers_aux1, m_long_tap_delay, m_overflow_bg, m_overflow_btn, m_overflow_button_rects, m_overflow_button_titles, m_overflow_buttons, m_screensize, m_status_text, m_touchscreen_threshold, makeButtonDirect(), minimap_id, MYMIN, noclip_id, overflow_id, range_id, sneak_id, toggle_chat_id, wstrgettext(), and zoom_id.
◆ ~TouchControls()
TouchControls::~TouchControls |
( |
| ) |
|
◆ addButton()
void TouchControls::addButton |
( |
std::vector< button_info > & | buttons, |
|
|
touch_gui_button_id | id, |
|
|
const std::string & | image, |
|
|
const recti & | rect, |
|
|
bool | visible = true ) |
|
private |
◆ addToggleButton()
void TouchControls::addToggleButton |
( |
std::vector< button_info > & | buttons, |
|
|
touch_gui_button_id | id, |
|
|
const std::string & | image_1, |
|
|
const std::string & | image_2, |
|
|
const recti & | rect, |
|
|
bool | visible = true ) |
|
private |
◆ applyContextControls()
References emitMouseEvent(), porting::getTimeMs(), LongTap, m_dig_pressed, m_dig_pressed_until, m_last_mode, m_place_pressed, m_place_pressed_until, m_tap_state, None, sanity_check, SHORT_DIG_LONG_PLACE, ShortTap, SIMULATED_CLICK_DURATION_MS, and TouchInteractionMode_USER.
Referenced by Game::processPlayerInteraction().
◆ applyJoystickStatus()
void TouchControls::applyJoystickStatus |
( |
| ) |
|
|
private |
◆ DISABLE_CLASS_COPY()
◆ emitMouseEvent()
void TouchControls::emitMouseEvent |
( |
EMOUSE_INPUT_EVENT | type | ) |
|
|
private |
◆ getHotbarSelection()
std::optional< u16 > TouchControls::getHotbarSelection |
( |
| ) |
|
◆ getJoystickDirection()
float TouchControls::getJoystickDirection |
( |
| ) |
|
|
inline |
◆ getJoystickSpeed()
float TouchControls::getJoystickSpeed |
( |
| ) |
|
|
inline |
◆ getPitchChange()
double TouchControls::getPitchChange |
( |
| ) |
|
|
inline |
◆ getPointerPos()
v2s32 TouchControls::getPointerPos |
( |
| ) |
|
|
private |
◆ getShootline()
line3d< f32 > TouchControls::getShootline |
( |
| ) |
|
|
inline |
Returns a line which describes what the player is pointing at.
The starting point and looking direction are significant, the line should be scaled to match its length to the actual distance the player can reach. The line starts at the camera and ends on the camera's far plane. The coordinates do not contain the camera offset.
References m_shootline.
Referenced by Game::processPlayerInteraction().
◆ getStatusText()
IGUIStaticText * TouchControls::getStatusText |
( |
| ) |
|
|
inline |
◆ getYawChange()
double TouchControls::getYawChange |
( |
| ) |
|
|
inline |
◆ handleReleaseEvent()
void TouchControls::handleReleaseEvent |
( |
size_t | pointer_id | ) |
|
|
private |
References applyJoystickStatus(), buttons_handleRelease(), infostream, LongTap, m_buttons, m_device, m_has_joystick_id, m_has_move_id, m_joystick_direction, m_joystick_id, m_joystick_speed, m_joystick_status_aux1, m_move_has_really_moved, m_move_id, m_move_prevent_short_tap, m_overflow_buttons, m_pointer_downpos, m_pointer_pos, m_receiver, m_tap_state, m_texturesource, None, ShortTap, and updateVisibility().
Referenced by releaseAll(), and translateEvent().
◆ hide()
void TouchControls::hide |
( |
| ) |
|
◆ isHotbarButton()
bool TouchControls::isHotbarButton |
( |
const SEvent & | event | ) |
|
|
private |
◆ isStatusTextOverriden()
bool TouchControls::isStatusTextOverriden |
( |
| ) |
|
|
inline |
◆ makeButtonDirect()
IGUIImage * TouchControls::makeButtonDirect |
( |
touch_gui_button_id | id, |
|
|
const recti & | rect, |
|
|
bool | visible ) |
|
private |
◆ registerHotbarRect()
void TouchControls::registerHotbarRect |
( |
u16 | index, |
|
|
const recti & | rect ) |
◆ releaseAll()
void TouchControls::releaseAll |
( |
| ) |
|
|
private |
◆ resetHotbarRects()
void TouchControls::resetHotbarRects |
( |
| ) |
|
◆ setUseCrosshair()
void TouchControls::setUseCrosshair |
( |
bool | use_crosshair | ) |
|
|
inline |
◆ setVisible()
void TouchControls::setVisible |
( |
bool | visible | ) |
|
◆ show()
void TouchControls::show |
( |
| ) |
|
◆ step()
void TouchControls::step |
( |
float | dtime | ) |
|
References applyJoystickStatus(), buttons_step(), porting::getDeltaMs(), getPointerPos(), porting::getTimeMs(), LongTap, m_buttons, m_device, m_draw_crosshair, m_had_move_id, m_has_move_id, m_long_tap_delay, m_move_downtime, m_move_has_really_moved, m_overflow_buttons, m_receiver, m_shootline, m_tap_state, m_texturesource, and None.
Referenced by Game::processUserInput().
◆ toggleOverflowMenu()
void TouchControls::toggleOverflowMenu |
( |
| ) |
|
|
private |
◆ translateEvent()
void TouchControls::translateEvent |
( |
const SEvent & | event | ) |
|
References buttons_handlePress(), dir(), g_settings, RenderingEngine::getDisplayDensity(), Settings::getFloat(), porting::getTimeMs(), handleReleaseEvent(), infostream, isHotbarButton(), m_button_size, m_buttons, m_camera_pitch_change, m_camera_yaw_change, m_device, m_fixed_joystick, m_guienv, m_had_move_id, m_has_joystick_id, m_has_move_id, m_joystick_btn_bg, m_joystick_btn_center, m_joystick_direction, m_joystick_has_really_moved, m_joystick_id, m_joystick_speed, m_joystick_status_aux1, m_move_downtime, m_move_has_really_moved, m_move_id, m_move_pos, m_move_prevent_short_tap, m_overflow_btn, m_overflow_button_rects, m_overflow_buttons, m_overflow_open, m_pointer_downpos, m_pointer_pos, m_receiver, m_screensize, m_texturesource, m_touchscreen_threshold, m_visible, toggleOverflowMenu(), updateVisibility(), and verbosestream.
Referenced by MyEventReceiver::OnEvent().
◆ updateVisibility()
void TouchControls::updateVisibility |
( |
| ) |
|
|
private |
References m_buttons, m_has_joystick_id, m_joystick_btn_bg, m_joystick_btn_center, m_joystick_btn_off, m_overflow_bg, m_overflow_btn, m_overflow_button_titles, m_overflow_buttons, m_overflow_open, and m_visible.
Referenced by handleReleaseEvent(), setVisible(), toggleOverflowMenu(), and translateEvent().
◆ m_button_size
s32 TouchControls::m_button_size |
|
private |
◆ m_buttons
◆ m_camera_pitch_change
double TouchControls::m_camera_pitch_change = 0.0 |
|
private |
◆ m_camera_yaw_change
double TouchControls::m_camera_yaw_change = 0.0 |
|
private |
◆ m_device
IrrlichtDevice* TouchControls::m_device = nullptr |
|
private |
◆ m_dig_pressed
bool TouchControls::m_dig_pressed = false |
|
private |
◆ m_dig_pressed_until
u64 TouchControls::m_dig_pressed_until = 0 |
|
private |
◆ m_draw_crosshair
bool TouchControls::m_draw_crosshair = false |
|
private |
◆ m_fixed_joystick
bool TouchControls::m_fixed_joystick = false |
|
private |
◆ m_guienv
IGUIEnvironment* TouchControls::m_guienv = nullptr |
|
private |
◆ m_had_move_id
bool TouchControls::m_had_move_id = false |
|
private |
◆ m_has_joystick_id
bool TouchControls::m_has_joystick_id = false |
|
private |
◆ m_has_move_id
bool TouchControls::m_has_move_id = false |
|
private |
◆ m_hotbar_rects
std::unordered_map<u16, recti> TouchControls::m_hotbar_rects |
|
private |
◆ m_hotbar_selection
std::optional<u16> TouchControls::m_hotbar_selection = std::nullopt |
|
private |
◆ m_joystick_btn_bg
std::shared_ptr<IGUIImage> TouchControls::m_joystick_btn_bg |
|
private |
◆ m_joystick_btn_center
std::shared_ptr<IGUIImage> TouchControls::m_joystick_btn_center |
|
private |
◆ m_joystick_btn_off
std::shared_ptr<IGUIImage> TouchControls::m_joystick_btn_off |
|
private |
◆ m_joystick_direction
float TouchControls::m_joystick_direction = 0.0f |
|
private |
◆ m_joystick_has_really_moved
bool TouchControls::m_joystick_has_really_moved = false |
|
private |
◆ m_joystick_id
size_t TouchControls::m_joystick_id |
|
private |
◆ m_joystick_speed
float TouchControls::m_joystick_speed = 0.0f |
|
private |
◆ m_joystick_status_aux1
bool TouchControls::m_joystick_status_aux1 = false |
|
private |
◆ m_joystick_triggers_aux1
bool TouchControls::m_joystick_triggers_aux1 = false |
|
private |
◆ m_last_mode
◆ m_long_tap_delay
u16 TouchControls::m_long_tap_delay |
|
private |
◆ m_move_downtime
u64 TouchControls::m_move_downtime = 0 |
|
private |
◆ m_move_has_really_moved
bool TouchControls::m_move_has_really_moved = false |
|
private |
◆ m_move_id
size_t TouchControls::m_move_id |
|
private |
◆ m_move_pos
v2s32 TouchControls::m_move_pos |
|
private |
◆ m_move_prevent_short_tap
bool TouchControls::m_move_prevent_short_tap = false |
|
private |
◆ m_overflow_bg
std::shared_ptr<IGUIStaticText> TouchControls::m_overflow_bg |
|
private |
◆ m_overflow_btn
std::shared_ptr<IGUIImage> TouchControls::m_overflow_btn |
|
private |
◆ m_overflow_button_rects
std::vector<recti> TouchControls::m_overflow_button_rects |
|
private |
◆ m_overflow_button_titles
std::vector<std::shared_ptr<IGUIStaticText> > TouchControls::m_overflow_button_titles |
|
private |
◆ m_overflow_buttons
std::vector<button_info> TouchControls::m_overflow_buttons |
|
private |
◆ m_overflow_open
bool TouchControls::m_overflow_open = false |
|
private |
◆ m_place_pressed
bool TouchControls::m_place_pressed = false |
|
private |
◆ m_place_pressed_until
u64 TouchControls::m_place_pressed_until = 0 |
|
private |
◆ m_pointer_downpos
std::unordered_map<size_t, v2s32> TouchControls::m_pointer_downpos |
|
private |
◆ m_pointer_pos
std::unordered_map<size_t, v2s32> TouchControls::m_pointer_pos |
|
private |
◆ m_receiver
IEventReceiver* TouchControls::m_receiver = nullptr |
|
private |
◆ m_screensize
v2u32 TouchControls::m_screensize |
|
private |
◆ m_shootline
line3d<f32> TouchControls::m_shootline |
|
private |
A line starting at the camera and pointing towards the selected object.
The line ends on the camera's far plane. The coordinates do not contain the camera offset.
Referenced by getShootline(), and step().
◆ m_status_text
std::shared_ptr<IGUIStaticText> TouchControls::m_status_text |
|
private |
◆ m_tap_state
◆ m_texturesource
◆ m_touchscreen_threshold
double TouchControls::m_touchscreen_threshold |
|
private |
◆ m_visible
bool TouchControls::m_visible = true |
|
private |
The documentation for this class was generated from the following files: