diff --git a/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs b/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs index 20836631..14196df9 100644 --- a/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs +++ b/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs @@ -32,7 +32,8 @@ namespace BetterGenshinImpact.Core.Script { string content = await File.ReadAllTextAsync(targetPath); string processedCode = RewriteScriptCode(content, targetPath); - return new StringDocument(new DocumentInfo(targetPath) { Category = ModuleCategory.Standard }, processedCode); + var documentInfo = new DocumentInfo(new Uri(targetPath)) { Category = ModuleCategory.Standard }; + return new StringDocument(documentInfo, processedCode); } return await Default.LoadDocumentAsync(settings, sourceInfo, specifier, category, contextCallback); diff --git a/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs b/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs index f114f364..99206a26 100644 --- a/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs +++ b/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs @@ -122,7 +122,8 @@ public class ScriptProject string mainScriptPath = Path.Combine(ProjectPath, Manifest.Main); string runtimeCode = loader.RewriteScriptCode(code, mainScriptPath); - var evaluation = engine.Evaluate(new DocumentInfo(mainScriptPath) { Category = ModuleCategory.Standard }, runtimeCode); + var documentInfo = new DocumentInfo(new Uri(mainScriptPath)) { Category = ModuleCategory.Standard }; + var evaluation = engine.Evaluate(documentInfo, runtimeCode); if (evaluation is Task task) await task; } else