TouchControls: touch_use_crosshair, dig/place simulation refactoring (#15800)
- get rid of simulated mouse events for digging/placing, use keyboard events
instead
- consistent with other simulated events, less code, no need for a
pointer position
- more correct: touch controls no longer break if you have custom
dig/place keybindings set
- move reading of "touch_use_crosshair" setting from Game to TouchControls
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
#include "IGUIStaticText.h"
|
||||
|
||||
const char *button_names[] = {
|
||||
"dig",
|
||||
"place",
|
||||
|
||||
"jump",
|
||||
"sneak",
|
||||
"zoom",
|
||||
@@ -41,6 +44,9 @@ const char *button_names[] = {
|
||||
|
||||
// compare with GUIKeyChangeMenu::init_keys
|
||||
const char *button_titles[] = {
|
||||
N_("Dig/punch/use"),
|
||||
N_("Place/use"),
|
||||
|
||||
N_("Jump"),
|
||||
N_("Sneak"),
|
||||
N_("Zoom"),
|
||||
@@ -67,6 +73,9 @@ const char *button_titles[] = {
|
||||
};
|
||||
|
||||
const char *button_image_names[] = {
|
||||
"",
|
||||
"",
|
||||
|
||||
"jump_btn.png",
|
||||
"down.png",
|
||||
"zoom.png",
|
||||
@@ -123,7 +132,8 @@ void ButtonMeta::setPos(v2s32 pos, v2u32 screensize, s32 button_size)
|
||||
|
||||
bool ButtonLayout::isButtonAllowed(touch_gui_button_id id)
|
||||
{
|
||||
return id != joystick_off_id && id != joystick_bg_id && id != joystick_center_id &&
|
||||
return id != dig_id && id != place_id &&
|
||||
id != joystick_off_id && id != joystick_bg_id && id != joystick_center_id &&
|
||||
id != touch_gui_button_id_END;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user