Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
touchcontrols.cpp File Reference
#include "touchcontrols.h"
#include "gettime.h"
#include "irr_v2d.h"
#include "log.h"
#include "porting.h"
#include "settings.h"
#include "client/guiscalingfilter.h"
#include "client/keycode.h"
#include "client/renderingengine.h"
#include "util/numeric.h"
#include "gettext.h"
#include "IGUIStaticText.h"
#include "IGUIFont.h"
#include <IrrlichtDevice.h>
#include <ISceneCollisionManager.h>
#include <iostream>
#include <algorithm>
+ Include dependency graph for touchcontrols.cpp:

Functions

static void load_button_texture (IGUIImage *gui_button, const std::string &path, const recti &button_rect, ISimpleTextureSource *tsrc, video::IVideoDriver *driver)
 
static bool buttons_handlePress (std::vector< button_info > &buttons, size_t pointer_id, IGUIElement *element, video::IVideoDriver *driver, IEventReceiver *receiver, ISimpleTextureSource *tsrc)
 
static bool buttons_handleRelease (std::vector< button_info > &buttons, size_t pointer_id, video::IVideoDriver *driver, IEventReceiver *receiver, ISimpleTextureSource *tsrc)
 
static bool buttons_step (std::vector< button_info > &buttons, float dtime, video::IVideoDriver *driver, IEventReceiver *receiver, ISimpleTextureSource *tsrc)
 
static EKEY_CODE id_to_keycode (touch_gui_button_id id)
 

Variables

TouchControlsg_touchcontrols
 
static const char * button_image_names []
 
static const char * button_titles []
 

Function Documentation

◆ buttons_handlePress()

static bool buttons_handlePress ( std::vector< button_info > & buttons,
size_t pointer_id,
IGUIElement * element,
video::IVideoDriver * driver,
IEventReceiver * receiver,
ISimpleTextureSource * tsrc )
static

References BUTTON_REPEAT_DELAY.

Referenced by TouchControls::translateEvent().

+ Here is the caller graph for this function:

◆ buttons_handleRelease()

static bool buttons_handleRelease ( std::vector< button_info > & buttons,
size_t pointer_id,
video::IVideoDriver * driver,
IEventReceiver * receiver,
ISimpleTextureSource * tsrc )
static

Referenced by TouchControls::handleReleaseEvent().

+ Here is the caller graph for this function:

◆ buttons_step()

static bool buttons_step ( std::vector< button_info > & buttons,
float dtime,
video::IVideoDriver * driver,
IEventReceiver * receiver,
ISimpleTextureSource * tsrc )
static

References BUTTON_REPEAT_INTERVAL.

Referenced by TouchControls::step().

+ Here is the caller graph for this function:

◆ id_to_keycode()

static EKEY_CODE id_to_keycode ( touch_gui_button_id id)
static

References aux1_id, camera_id, chat_id, debug_id, drop_id, exit_id, fast_id, fly_id, g_settings, Settings::get(), inventory_id, jump_id, keyname_to_keycode(), minimap_id, noclip_id, range_id, sneak_id, toggle_chat_id, warningstream, and zoom_id.

Referenced by TouchControls::TouchControls(), TouchControls::addButton(), and TouchControls::applyJoystickStatus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_button_texture()

static void load_button_texture ( IGUIImage * gui_button,
const std::string & path,
const recti & button_rect,
ISimpleTextureSource * tsrc,
video::IVideoDriver * driver )
static

References ISimpleTextureSource::getTexture(), and guiScalingImageButton().

Referenced by TouchControls::addButton(), button_info::emitAction(), and TouchControls::makeButtonDirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ button_image_names

const char* button_image_names[]
static
Initial value:
= {
"jump_btn.png",
"down.png",
"zoom.png",
"aux1_btn.png",
"overflow_btn.png",
"fly_btn.png",
"noclip_btn.png",
"fast_btn.png",
"debug_btn.png",
"camera_btn.png",
"rangeview_btn.png",
"minimap_btn.png",
"",
"chat_btn.png",
"inventory_btn.png",
"drop_btn.png",
"exit_btn.png",
"joystick_off.png",
"joystick_bg.png",
"joystick_center.png",
}

Referenced by TouchControls::TouchControls(), and TouchControls::makeButtonDirect().

◆ button_titles

const char* button_titles[]
static
Initial value:
= {
N_("Jump"),
N_("Sneak"),
N_("Zoom"),
N_("Aux1"),
N_("Overflow menu"),
N_("Toggle fly"),
N_("Toggle noclip"),
N_("Toggle fast"),
N_("Toggle debug"),
N_("Change camera"),
N_("Range select"),
N_("Toggle minimap"),
N_("Toggle chat log"),
N_("Chat"),
N_("Inventory"),
N_("Drop"),
N_("Exit"),
N_("Joystick"),
N_("Joystick"),
N_("Joystick"),
}
#define N_(text)
Definition keycode.cpp:46

Referenced by TouchControls::TouchControls().

◆ g_touchcontrols