LuaFileList - remove pathing concerns to the calling code
This commit is contained in:
parent
4b696e64fa
commit
99dc0e03df
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue