From 9d62abbe46410da37b4e8b55b48989bb882c7798 Mon Sep 17 00:00:00 2001 From: Desour Date: Wed, 9 Aug 2023 00:06:38 +0200 Subject: [PATCH] Replace any uses of CGUIScrollBar and IGUIScrollBar with GUIScrollBar --- src/gui/guiTable.cpp | 2 +- src/gui/guiVolumeChange.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/guiTable.cpp b/src/gui/guiTable.cpp index 3929d678b..3e5f1bfc2 100644 --- a/src/gui/guiTable.cpp +++ b/src/gui/guiTable.cpp @@ -901,7 +901,7 @@ bool GUITable::OnEvent(const SEvent &event) setToolTipText(cell ? m_strings[cell->tooltip_index].c_str() : L""); // Fix for #1567/#1806: - // IGUIScrollBar passes double click events to its parent, + // GUIScrollBar passes double click events to its parent, // which we don't want. Detect this case and discard the event if (event.MouseInput.Event != EMIE_MOUSE_MOVED && m_scrollbar->isVisible() && diff --git a/src/gui/guiVolumeChange.cpp b/src/gui/guiVolumeChange.cpp index aec24f590..9f35c852b 100644 --- a/src/gui/guiVolumeChange.cpp +++ b/src/gui/guiVolumeChange.cpp @@ -20,11 +20,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "guiVolumeChange.h" #include "debug.h" #include "guiButton.h" +#include "guiScrollBar.h" #include "serialization.h" #include #include #include -#include #include #include #include "settings.h" @@ -85,8 +85,8 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 300 * s, 20 * s); rect = rect + v2s32(size.X / 2 - 150 * s, size.Y / 2); - gui::IGUIScrollBar *e = Environment->addScrollBar(true, - rect, this, ID_soundSlider); + auto e = make_irr(Environment, this, + ID_soundSlider, rect, true, false); e->setMax(100); e->setPos(volume); } @@ -151,7 +151,7 @@ bool GUIVolumeChange::OnEvent(const SEvent& event) } if (event.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED) { if (event.GUIEvent.Caller->getID() == ID_soundSlider) { - s32 pos = ((gui::IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); + s32 pos = static_cast(event.GUIEvent.Caller)->getPos(); g_settings->setFloat("sound_volume", (float) pos / 100); gui::IGUIElement *e = getElementFromId(ID_soundText);