Make script paths in .luases relative to .luases path

Restore behavior before 99dc0e03df
This commit is contained in:
kalimag 2022-12-07 09:15:31 +01:00 committed by YoshiRulz
parent df4df517b8
commit 01ab9416b5
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using BizHawk.Common.PathExtensions;
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
{ {
@ -107,6 +108,7 @@ namespace BizHawk.Client.Common
{ {
using var sw = new StreamWriter(path); using var sw = new StreamWriter(path);
var sb = new StringBuilder(); var sb = new StringBuilder();
var saveDirectory = Path.GetDirectoryName(Path.GetFullPath(path));
foreach (var file in this) foreach (var file in this)
{ {
if (file.IsSeparator) if (file.IsSeparator)
@ -118,7 +120,7 @@ namespace BizHawk.Client.Common
sb sb
.Append(file.Enabled ? "1" : "0") .Append(file.Enabled ? "1" : "0")
.Append(' ') .Append(' ')
.Append(file.Path) .Append(file.Path.MakeRelativeTo(saveDirectory))
.AppendLine(); .AppendLine();
} }
} }