summaryrefslogtreecommitdiff
path: root/src/gui/guiKeyChangeMenu.cpp
diff options
context:
space:
mode:
authorparadust7 <102263465+paradust7@users.noreply.github.com>2022-05-21 15:11:59 -0700
committerGitHub <noreply@github.com>2022-05-22 00:11:59 +0200
commit9f338f5a56e5adee3d11d59827f7e2b8a714e6c2 (patch)
treea16861160b117c68078c686a02cd5aca6385c66d /src/gui/guiKeyChangeMenu.cpp
parent2742fef458c3626476193c9e2d1b9231e042e420 (diff)
downloadminetest-9f338f5a56e5adee3d11d59827f7e2b8a714e6c2.tar.gz
minetest-9f338f5a56e5adee3d11d59827f7e2b8a714e6c2.tar.bz2
minetest-9f338f5a56e5adee3d11d59827f7e2b8a714e6c2.zip
Replace all uses of core::list with std::list (#12313)
Diffstat (limited to 'src/gui/guiKeyChangeMenu.cpp')
-rw-r--r--src/gui/guiKeyChangeMenu.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/gui/guiKeyChangeMenu.cpp b/src/gui/guiKeyChangeMenu.cpp
index ada6280f6..021f5f0a9 100644
--- a/src/gui/guiKeyChangeMenu.cpp
+++ b/src/gui/guiKeyChangeMenu.cpp
@@ -93,7 +93,8 @@ GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env,
GUIKeyChangeMenu::~GUIKeyChangeMenu()
{
- removeChildren();
+ removeAllChildren();
+ key_used_text = nullptr;
for (key_setting *ks : key_settings) {
delete[] ks->button_name;
@@ -102,23 +103,10 @@ GUIKeyChangeMenu::~GUIKeyChangeMenu()
key_settings.clear();
}
-void GUIKeyChangeMenu::removeChildren()
-{
- const core::list<gui::IGUIElement*> &children = getChildren();
- core::list<gui::IGUIElement*> children_copy;
- for (gui::IGUIElement*i : children) {
- children_copy.push_back(i);
- }
-
- for (gui::IGUIElement *i : children_copy) {
- i->remove();
- }
- key_used_text = nullptr;
-}
-
void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
{
- removeChildren();
+ removeAllChildren();
+ key_used_text = nullptr;
const float s = m_gui_scale;
DesiredRect = core::rect<s32>(