From f7f3aaf43c88179bafd255f3c67275f316cff91a Mon Sep 17 00:00:00 2001 From: Desour Date: Wed, 9 Aug 2023 01:26:42 +0200 Subject: [PATCH] Use our GUIButton in touchscreengui --- src/gui/touchscreengui.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/touchscreengui.cpp b/src/gui/touchscreengui.cpp index f0774bebd..3d676cebb 100644 --- a/src/gui/touchscreengui.cpp +++ b/src/gui/touchscreengui.cpp @@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/keycode.h" #include "client/renderingengine.h" #include "util/numeric.h" +#include "guiButton.h" #include #include @@ -153,8 +154,8 @@ void AutoHideButtonBar::init(ISimpleTextureSource *tsrc, rect starter_rect = rect(UpperLeft.X, UpperLeft.Y, LowerRight.X, LowerRight.Y); - IGUIButton *starter_gui_button = m_guienv->addButton(starter_rect, nullptr, - button_id, L"", nullptr); + IGUIButton *starter_gui_button = GUIButton::addButton(m_guienv, starter_rect, + m_texturesource, nullptr, button_id, L"", nullptr); m_starter.gui_button = starter_gui_button; m_starter.gui_button->grab(); @@ -238,8 +239,8 @@ void AutoHideButtonBar::addButton(touch_gui_button_id button_id, const wchar_t * current_button = rect(m_upper_left.X, y_start, m_lower_right.Y, y_end); } - IGUIButton *btn_gui_button = m_guienv->addButton(current_button, nullptr, button_id, - caption, nullptr); + IGUIButton *btn_gui_button = GUIButton::addButton(m_guienv, current_button, + m_texturesource, nullptr, button_id, caption, nullptr); std::shared_ptr btn(new button_info); btn->gui_button = btn_gui_button; @@ -413,7 +414,8 @@ TouchScreenGUI::TouchScreenGUI(IrrlichtDevice *device, IEventReceiver *receiver) void TouchScreenGUI::initButton(touch_gui_button_id id, const rect &button_rect, const std::wstring &caption, bool immediate_release, float repeat_delay) { - IGUIButton *btn_gui_button = m_guienv->addButton(button_rect, nullptr, id, caption.c_str()); + IGUIButton *btn_gui_button = GUIButton::addButton(m_guienv, button_rect, + m_texturesource, nullptr, id, caption.c_str()); button_info *btn = &m_buttons[id]; btn->gui_button = btn_gui_button;