mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Replace any uses of CGUIScrollBar and IGUIScrollBar with GUIScrollBar
This commit is contained in:
parent
124d064015
commit
9d62abbe46
@ -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() &&
|
||||
|
@ -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 <string>
|
||||
#include <IGUICheckBox.h>
|
||||
#include <IGUIButton.h>
|
||||
#include <IGUIScrollBar.h>
|
||||
#include <IGUIStaticText.h>
|
||||
#include <IGUIFont.h>
|
||||
#include "settings.h"
|
||||
@ -85,8 +85,8 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
|
||||
{
|
||||
core::rect<s32> 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<GUIScrollBar>(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<GUIScrollBar *>(event.GUIEvent.Caller)->getPos();
|
||||
g_settings->setFloat("sound_volume", (float) pos / 100);
|
||||
|
||||
gui::IGUIElement *e = getElementFromId(ID_soundText);
|
||||
|
Loading…
Reference in New Issue
Block a user