From b80af3c4ec8ebf6c1b2bed790e55a2e81e13cbae Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 5 Jun 2018 10:46:37 -0500 Subject: [PATCH] Load ZeroFormatter assemblies in scripts --- PqSave/Scripting.cs | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/PqSave/Scripting.cs b/PqSave/Scripting.cs index 9403433..34097b6 100644 --- a/PqSave/Scripting.cs +++ b/PqSave/Scripting.cs @@ -10,22 +10,6 @@ namespace PqSave { public static class Scripting { - public static void RufnScript(SerializeData save) - { - var items = save.itemStorage; - short count = 999; - - items.SetCount(Item.RedCommon, count); - items.SetCount(Item.RedUnCommon, count); - items.SetCount(Item.BlueCommon, count); - items.SetCount(Item.BlueUnCommon, count); - items.SetCount(Item.YellowCommon, count); - items.SetCount(Item.YellowUnCommon, count); - items.SetCount(Item.GreyCommon, count); - items.SetCount(Item.GreyUnCommon, count); - items.SetCount(Item.Rare, count); - items.SetCount(Item.Legend, count); - } public static void SetCount(this ItemStorage items, Item type, short count) { @@ -40,15 +24,15 @@ public static void SetCount(this ItemStorage items, Item type, short count) public static void RunScript(SerializeData save, string filename) { - RufnScript(save); Console.WriteLine(); Console.WriteLine($"Running {filename}..."); try { var script = File.ReadAllText(filename); - var scriptOptions = ScriptOptions.Default.AddReferences(Assembly.GetExecutingAssembly()) - .AddImports("System", "System.Linq", "PqSave") + var scriptOptions = ScriptOptions.Default + .AddReferences(Assembly.GetExecutingAssembly(), typeof(ZeroFormatter.DirtyTracker).Assembly, typeof(ZeroFormatter.IKeyTuple).Assembly) + .AddImports("System", "System.Linq", "PqSave", "ZeroFormatter") .WithSourceResolver(SourceFileResolver.Default) .WithMetadataResolver(ScriptMetadataResolver.Default) .WithEmitDebugInformation(true);