From 58bcb383152d58d27802ff45b587e20eff06b4f9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 29 Mar 2020 17:13:03 -0500 Subject: [PATCH] Lua Console - fix Path column sorting, and simplify sort logic --- BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 85f7abad36..66da5a1f16 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -11,6 +11,7 @@ using System.Windows.Forms; using BizHawk.Client.Common; using BizHawk.Client.EmuHawk.ToolExtensions; using BizHawk.Common; +using BizHawk.Common.CollectionExtensions; using BizHawk.Common.PathExtensions; using BizHawk.Emulation.Common; @@ -1325,14 +1326,16 @@ namespace BizHawk.Client.EmuHawk switch (columnToSort) { case "Script": - luaListTemp = _sortReverse - ? luaListTemp.OrderByDescending(lf => lf.Name).ThenBy(lf => lf.Path).ToList() - : luaListTemp.OrderBy(lf => lf.Name).ThenBy(lf => lf.Path).ToList(); + luaListTemp = luaListTemp + .OrderBy(lf => lf.Name, _sortReverse) + .ThenBy(lf => lf.Path) + .ToList(); break; - case "Path": - luaListTemp = _sortReverse - ? luaListTemp.OrderByDescending(lf => lf.Path).ThenBy(lf => lf.Name).ToList() - : luaListTemp.OrderBy(lf => lf.Path).ThenBy(lf => lf.Name).ToList(); + case "PathName": + luaListTemp = luaListTemp + .OrderBy(lf => lf.Path, _sortReverse) + .ThenBy(lf => lf.Name) + .ToList(); break; }