TouchScreenGUI: minor fixes
This commit is contained in:
parent
a25ed78f6c
commit
9cf737dde1
@ -168,12 +168,12 @@ void GUIModalMenu::quitMenu()
|
||||
Environment->forceUpdateHoveredElement();
|
||||
#endif
|
||||
|
||||
this->drop();
|
||||
|
||||
#ifdef HAVE_TOUCHSCREENGUI
|
||||
if (g_touchscreengui && g_touchscreengui->isActive() && m_touchscreen_visible)
|
||||
g_touchscreengui->show();
|
||||
#endif
|
||||
|
||||
this->drop();
|
||||
}
|
||||
|
||||
void GUIModalMenu::removeChildren()
|
||||
|
@ -598,7 +598,6 @@ void TouchScreenGUI::init(ISimpleTextureSource *tsrc)
|
||||
{
|
||||
assert(tsrc);
|
||||
|
||||
m_visible = true;
|
||||
m_texturesource = tsrc;
|
||||
|
||||
/* Init joystick display "button"
|
||||
@ -1095,10 +1094,10 @@ void TouchScreenGUI::handleChangedButton(const SEvent &event)
|
||||
for (auto iter = m_buttons[i].ids.begin();
|
||||
iter != m_buttons[i].ids.end(); ++iter) {
|
||||
if (event.TouchInput.ID == *iter) {
|
||||
s32 current_button_id =
|
||||
touch_gui_button_id current_button_id =
|
||||
getButtonID(event.TouchInput.X, event.TouchInput.Y);
|
||||
|
||||
if (current_button_id == i)
|
||||
if (current_button_id == (touch_gui_button_id) i)
|
||||
continue;
|
||||
|
||||
// remove old button
|
||||
@ -1113,7 +1112,8 @@ void TouchScreenGUI::handleChangedButton(const SEvent &event)
|
||||
}
|
||||
}
|
||||
|
||||
s32 current_button_id = getButtonID(event.TouchInput.X, event.TouchInput.Y);
|
||||
touch_gui_button_id current_button_id = getButtonID(event.TouchInput.X,
|
||||
event.TouchInput.Y);
|
||||
|
||||
if (current_button_id == after_last_element_id)
|
||||
return;
|
||||
@ -1289,6 +1289,10 @@ void TouchScreenGUI::registerHudItem(s32 index, const rect<s32> &rect)
|
||||
void TouchScreenGUI::Toggle(bool visible)
|
||||
{
|
||||
m_visible = visible;
|
||||
|
||||
if (!m_buttons_initialized)
|
||||
return;
|
||||
|
||||
for (auto &button : m_buttons) {
|
||||
if (button.guibutton)
|
||||
button.guibutton->setVisible(visible);
|
||||
|
@ -225,7 +225,7 @@ private:
|
||||
double m_touch_sensitivity;
|
||||
std::map<int, rect<s32>> m_hud_rects;
|
||||
std::map<size_t, irr::EKEY_CODE> m_hud_ids;
|
||||
bool m_visible; // is the gui visible
|
||||
bool m_visible = true; // is the gui visible
|
||||
bool m_buttons_initialized = false;
|
||||
|
||||
// value in degree
|
||||
|
Loading…
x
Reference in New Issue
Block a user