mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55: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;
|
||||
|
||||
mIntMap["DIMTIME"] = 30*1000;
|
||||
|
||||
mIntMap["GameListSortIndex"] = 0;
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
|
|
|
@ -30,7 +30,7 @@ GuiGameList::GuiGameList(Window* window) : GuiComponent(window),
|
|||
mScreenshot(window),
|
||||
mDescription(window),
|
||||
mTransitionImage(window, 0, 0, "", Renderer::getScreenWidth(), Renderer::getScreenHeight(), true),
|
||||
sortStateIndex(0)
|
||||
sortStateIndex(Settings::getInstance()->getInt("GameListSortIndex"))
|
||||
{
|
||||
//first object initializes the vector
|
||||
if (sortStates.empty()) {
|
||||
|
@ -247,6 +247,8 @@ void GuiGameList::setSortIndex(size_t index)
|
|||
sortStateIndex = index;
|
||||
sort(sortStates.at(sortStateIndex).comparisonFunction, sortStates.at(sortStateIndex).ascending);
|
||||
}
|
||||
//save new index to settings
|
||||
Settings::getInstance()->setInt("GameListSortIndex", sortStateIndex);
|
||||
}
|
||||
|
||||
void GuiGameList::setNextSortIndex()
|
||||
|
|
Loading…
Reference in a new issue