diff --git a/src/BizHawk.Client.Common/lua/LuaFileList.cs b/src/BizHawk.Client.Common/lua/LuaFileList.cs index bfd0dccf86..daea20c2a0 100644 --- a/src/BizHawk.Client.Common/lua/LuaFileList.cs +++ b/src/BizHawk.Client.Common/lua/LuaFileList.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BizHawk.Common.PathExtensions; namespace BizHawk.Client.Common { @@ -111,7 +110,7 @@ namespace BizHawk.Client.Common sb .Append(file.Enabled ? "1" : "0") .Append(' ') - .Append(Global.Config.PathEntries.AbsolutePathFor(file.Path, "").MakeRelativeTo(Path.GetDirectoryName(path))) + .Append(path) .AppendLine(); } } @@ -119,7 +118,6 @@ namespace BizHawk.Client.Common sw.Write(sb.ToString()); Filename = path; - Global.Config.RecentLuaSession.Add(path); Changes = false; } } diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 9270cff640..00c4d1d8a1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -657,7 +657,12 @@ namespace BizHawk.Client.EmuHawk var file = GetSaveFileFromUser(); if (file != null) { - LuaImp.ScriptList.SaveSession(file.FullName); + var path = Config.PathEntries + .AbsolutePathFor(file.FullName, "") + .MakeRelativeTo(Path.GetDirectoryName(file.FullName)); + LuaImp.ScriptList.SaveSession(path); + + Config.RecentLuaSession.Add(file.FullName); // TODO: should path be used here? OutputMessages.Text = $"{Path.GetFileName(LuaImp.ScriptList.Filename)} saved."; } } @@ -723,6 +728,7 @@ namespace BizHawk.Client.EmuHawk if (!string.IsNullOrWhiteSpace(LuaImp.ScriptList.Filename)) { LuaImp.ScriptList.SaveSession(LuaImp.ScriptList.Filename); + Config.RecentLuaSession.Add(LuaImp.ScriptList.Filename); } else {