mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Exclude parent item from directory sort in FiosGetFileList
This commit is contained in:
parent
d13b28c34c
commit
7eddb72585
@ -358,7 +358,7 @@ static void FiosGetFileList(SaveLoadOperation fop, bool show_dirs, fios_getlist_
|
||||
struct dirent *dirent;
|
||||
DIR *dir;
|
||||
FiosItem *fios;
|
||||
size_t sort_start;
|
||||
size_t sort_start = 0;
|
||||
|
||||
file_list.clear();
|
||||
|
||||
@ -372,6 +372,7 @@ static void FiosGetFileList(SaveLoadOperation fop, bool show_dirs, fios_getlist_
|
||||
fios->name = "..";
|
||||
SetDParamStr(0, "..");
|
||||
fios->title = GetString(STR_SAVELOAD_PARENT_DIRECTORY);
|
||||
sort_start = file_list.size();
|
||||
}
|
||||
|
||||
/* Show subdirectories */
|
||||
@ -398,7 +399,7 @@ static void FiosGetFileList(SaveLoadOperation fop, bool show_dirs, fios_getlist_
|
||||
if (show_dirs) {
|
||||
SortingBits order = _savegame_sort_order;
|
||||
_savegame_sort_order = SORT_BY_NAME | SORT_ASCENDING;
|
||||
std::sort(file_list.begin(), file_list.end());
|
||||
std::sort(file_list.begin() + sort_start, file_list.end());
|
||||
_savegame_sort_order = order;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user