From ca48a1ac6905d18d807c23a495d8f575a6bfc153 Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 1 Jun 2021 11:05:54 +0000 Subject: [PATCH] CGUIListBox now serializes the state of 'Selected'. Feature wish by chronologicaldot (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=52719) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6218 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 1 + source/Irrlicht/CGUIListBox.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/changes.txt b/changes.txt index 7407b2d9..f6bcfa7d 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ -------------------------- Changes in 1.9 (not yet released) +- CGUIListBox now serializes the state of "Selected". Feature wish by chronologicaldot (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=52719) - Bugfix: Changing focus with tab-keys now also work when elements are inside a modal screen. - COBJMeshFileLoader using a bit more exact color conversion for 0-1 to 0-255 range (same now as SColorf::toSColor uses). - Speedup for COBJMeshWriter diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp index 6e37266e..a4ebe60f 100644 --- a/source/Irrlicht/CGUIListBox.cpp +++ b/source/Irrlicht/CGUIListBox.cpp @@ -724,6 +724,7 @@ void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWr } } } + out->addInt("Selected", Selected); } @@ -763,6 +764,8 @@ void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadW } } } + Selected = in->getAttributeAsInt("Selected", Selected); + recalculateScrollPos(); }