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)
|
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();
|
if (file.IsSeparator)
|
||||||
foreach (var file in this)
|
|
||||||
{
|
{
|
||||||
if (file.IsSeparator)
|
sb.AppendLine("---");
|
||||||
{
|
}
|
||||||
sb.AppendLine("---");
|
else
|
||||||
}
|
{
|
||||||
else
|
sb
|
||||||
{
|
.Append(file.Enabled ? "1" : "0")
|
||||||
sb
|
.Append(' ')
|
||||||
.Append(file.Enabled ? "1" : "0")
|
.Append(Global.Config.PathEntries.AbsolutePathFor(file.Path, "").MakeRelativeTo(Path.GetDirectoryName(path)))
|
||||||
.Append(' ')
|
.AppendLine();
|
||||||
.Append(Global.Config.PathEntries.AbsolutePathFor(file.Path, "").MakeRelativeTo(Path.GetDirectoryName(path)))
|
|
||||||
.AppendLine();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sw.Write(sb.ToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sw.Write(sb.ToString());
|
||||||
|
|
||||||
Filename = path;
|
Filename = path;
|
||||||
Global.Config.RecentLuaSession.Add(path);
|
Global.Config.RecentLuaSession.Add(path);
|
||||||
Changes = false;
|
Changes = false;
|
||||||
|
|
Loading…
Reference in New Issue