From 048d96ac20786d8b345ca79672cf658b0ae8ecb0 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 5 Oct 2017 16:01:16 -0700 Subject: [PATCH] Sort folder buttons based on folder existing Closes #1512 --- PKHeX.WinForms/Subforms/SAV_FolderList.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PKHeX.WinForms/Subforms/SAV_FolderList.cs b/PKHeX.WinForms/Subforms/SAV_FolderList.cs index e0933ce4e..cb921a505 100644 --- a/PKHeX.WinForms/Subforms/SAV_FolderList.cs +++ b/PKHeX.WinForms/Subforms/SAV_FolderList.cs @@ -23,8 +23,10 @@ public SAV_FolderList() locs.Add(new CustomFolderPath {Path = CyberGadgetUtil.GetCacheFolder(), DisplayText = "CGSE Cache"}); locs.Add(new CustomFolderPath {Path = CyberGadgetUtil.GetTempFolder(), DisplayText = "CGSE Temp"}); - foreach (var loc in locs.GroupBy(z => z.Path)) - AddButton(loc.First().DisplayText, loc.First().Path); + var paths = locs.GroupBy(z => z.Path).Select(z => z.First()) + .OrderByDescending(z => Directory.Exists(z.Path)); + foreach (var loc in paths) + AddButton(loc.DisplayText, loc.Path); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); }