simplify LuaFileList more
This commit is contained in:
parent
4be160a71f
commit
4b696e64fa
|
@ -98,28 +98,26 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public void SaveSession(string path)
|
||||
{
|
||||
using (var sw = new StreamWriter(path))
|
||||
using var sw = new StreamWriter(path);
|
||||
var sb = new StringBuilder();
|
||||
foreach (var file in this)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var file in this)
|
||||
if (file.IsSeparator)
|
||||
{
|
||||
if (file.IsSeparator)
|
||||
{
|
||||
sb.AppendLine("---");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb
|
||||
.Append(file.Enabled ? "1" : "0")
|
||||
.Append(' ')
|
||||
.Append(Global.Config.PathEntries.AbsolutePathFor(file.Path, "").MakeRelativeTo(Path.GetDirectoryName(path)))
|
||||
.AppendLine();
|
||||
}
|
||||
sb.AppendLine("---");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb
|
||||
.Append(file.Enabled ? "1" : "0")
|
||||
.Append(' ')
|
||||
.Append(Global.Config.PathEntries.AbsolutePathFor(file.Path, "").MakeRelativeTo(Path.GetDirectoryName(path)))
|
||||
.AppendLine();
|
||||
}
|
||||
|
||||
sw.Write(sb.ToString());
|
||||
}
|
||||
|
||||
sw.Write(sb.ToString());
|
||||
|
||||
Filename = path;
|
||||
Global.Config.RecentLuaSession.Add(path);
|
||||
Changes = false;
|
||||
|
|
Loading…
Reference in New Issue