Fix place bug
There are spaces (not buttons) inside the control pad area now. Ignore any tap events if they are within the control pad rectangle so that blocks are not accidentally placed
This commit is contained in:
parent
0179bbcc0b
commit
46096017ae
@ -193,6 +193,7 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc, float density)
|
|||||||
m_control_pad_rect = rect<s32>(
|
m_control_pad_rect = rect<s32>(
|
||||||
spacing, m_screensize.Y - control_pad_size - spacing,
|
spacing, m_screensize.Y - control_pad_size - spacing,
|
||||||
spacing + control_pad_size, m_screensize.Y - spacing);
|
spacing + control_pad_size, m_screensize.Y - spacing);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
draw control pad
|
draw control pad
|
||||||
0 3 6
|
0 3 6
|
||||||
@ -482,6 +483,8 @@ void TouchScreenGUI::translateEvent(const SEvent &event)
|
|||||||
else if (isHUDButton(event))
|
else if (isHUDButton(event))
|
||||||
{
|
{
|
||||||
/* already handled in isHUDButton() */
|
/* already handled in isHUDButton() */
|
||||||
|
} else if (m_control_pad_rect.isPointInside(v2s32(toadd.X, toadd.Y))) {
|
||||||
|
// ignore events inside the control pad not already handled
|
||||||
}
|
}
|
||||||
/* handle non button events */
|
/* handle non button events */
|
||||||
else {
|
else {
|
||||||
@ -527,6 +530,8 @@ void TouchScreenGUI::translateEvent(const SEvent &event)
|
|||||||
translated->MouseInput.Event = EMIE_LMOUSE_LEFT_UP;
|
translated->MouseInput.Event = EMIE_LMOUSE_LEFT_UP;
|
||||||
m_receiver->OnEvent(*translated);
|
m_receiver->OnEvent(*translated);
|
||||||
delete translated;
|
delete translated;
|
||||||
|
} else if (m_control_pad_rect.isPointInside(v2s32(m_move_downlocation.X, m_move_downlocation.Y))) {
|
||||||
|
// ignore events inside the control pad not already handled
|
||||||
} else if (!m_move_has_really_moved) {
|
} else if (!m_move_has_really_moved) {
|
||||||
SEvent* translated = new SEvent;
|
SEvent* translated = new SEvent;
|
||||||
memset(translated,0,sizeof(SEvent));
|
memset(translated,0,sizeof(SEvent));
|
||||||
|
@ -94,6 +94,8 @@ private:
|
|||||||
std::map<int,irr::EKEY_CODE> m_hud_ids;
|
std::map<int,irr::EKEY_CODE> m_hud_ids;
|
||||||
bool m_visible; // is the gui visible
|
bool m_visible; // is the gui visible
|
||||||
|
|
||||||
|
rect<s32> controlpadarea;
|
||||||
|
|
||||||
/* value in degree */
|
/* value in degree */
|
||||||
double m_camera_yaw;
|
double m_camera_yaw;
|
||||||
double m_camera_pitch;
|
double m_camera_pitch;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user