mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Read/Write sort order to settings
Not written to disk atm.
This commit is contained in:
parent
ded54a6884
commit
ac51656527
|
@ -33,6 +33,8 @@ void Settings::setDefaults()
|
||||||
mBoolMap["WINDOWED"] = false;
|
mBoolMap["WINDOWED"] = false;
|
||||||
|
|
||||||
mIntMap["DIMTIME"] = 30*1000;
|
mIntMap["DIMTIME"] = 30*1000;
|
||||||
|
|
||||||
|
mIntMap["GameListSortIndex"] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename K, typename V>
|
template <typename K, typename V>
|
||||||
|
|
|
@ -30,7 +30,7 @@ GuiGameList::GuiGameList(Window* window) : GuiComponent(window),
|
||||||
mScreenshot(window),
|
mScreenshot(window),
|
||||||
mDescription(window),
|
mDescription(window),
|
||||||
mTransitionImage(window, 0, 0, "", Renderer::getScreenWidth(), Renderer::getScreenHeight(), true),
|
mTransitionImage(window, 0, 0, "", Renderer::getScreenWidth(), Renderer::getScreenHeight(), true),
|
||||||
sortStateIndex(0)
|
sortStateIndex(Settings::getInstance()->getInt("GameListSortIndex"))
|
||||||
{
|
{
|
||||||
//first object initializes the vector
|
//first object initializes the vector
|
||||||
if (sortStates.empty()) {
|
if (sortStates.empty()) {
|
||||||
|
@ -247,6 +247,8 @@ void GuiGameList::setSortIndex(size_t index)
|
||||||
sortStateIndex = index;
|
sortStateIndex = index;
|
||||||
sort(sortStates.at(sortStateIndex).comparisonFunction, sortStates.at(sortStateIndex).ascending);
|
sort(sortStates.at(sortStateIndex).comparisonFunction, sortStates.at(sortStateIndex).ascending);
|
||||||
}
|
}
|
||||||
|
//save new index to settings
|
||||||
|
Settings::getInstance()->setInt("GameListSortIndex", sortStateIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiGameList::setNextSortIndex()
|
void GuiGameList::setNextSortIndex()
|
||||||
|
|
Loading…
Reference in a new issue