Skip to content

Commit db9c2d7

Browse files
committed
Added saving of last used sort method
1 parent d69248c commit db9c2d7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fheroes2/dialog/dialog_selectfile.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ namespace
316316

317317
listbox.SetAreaItems( { listRoi.x, listRoi.y + 3, listRoi.width - listAreaOffsetY, listRoi.height - listAreaHeightDeduction } );
318318

319-
const bool isEvilInterface = Settings::Get().isEvilInterfaceEnabled();
319+
Settings & settings = Settings::Get();
320+
const bool isEvilInterface = settings.isEvilInterfaceEnabled();
320321

321322
int32_t scrollbarOffsetX = dialogArea.x + dialogArea.width - 35;
322323
background.renderScrollbarBackground( { scrollbarOffsetX, listRoi.y, listRoi.width, listRoi.height }, isEvilInterface );
@@ -482,7 +483,8 @@ namespace
482483
}
483484
}
484485
else if ( le.MouseClickLeft( buttonSort.area() ) ) {
485-
Settings::Get().CycleSaveFileSortType();
486+
settings.CycleSaveFileSortType();
487+
(void)settings.Save( Settings::configFileName );
486488
sortMapInfos( lists );
487489
listUpdated = true;
488490
}

0 commit comments

Comments
 (0)