diff --git a/Release/CppExplorer.dll b/Release/CppExplorer.dll index fe475900..f695f357 100644 Binary files a/Release/CppExplorer.dll and b/Release/CppExplorer.dll differ diff --git a/Release/CppExplorer.zip b/Release/CppExplorer.zip new file mode 100644 index 00000000..df5bb809 Binary files /dev/null and b/Release/CppExplorer.zip differ diff --git a/Release/mcs.dll b/Release/mcs.dll new file mode 100644 index 00000000..ab68b7d8 Binary files /dev/null and b/Release/mcs.dll differ diff --git a/src/CppExplorer.cs b/src/CppExplorer.cs index 4379e39a..f00aec94 100644 --- a/src/CppExplorer.cs +++ b/src/CppExplorer.cs @@ -65,32 +65,31 @@ public override void OnApplicationStart() Instance = this; + LoadMCS(); + new MainMenu(); new WindowManager(); - //LoadMCS(); - - //// init debugging hooks - //var harmony = HarmonyInstance.Create(ID); - //harmony.PatchAll(); + var harmony = HarmonyInstance.Create(ID); + harmony.PatchAll(); // done init ShowMenu = true; } - //private void LoadMCS() - //{ - // var mcsPath = @"Mods\mcs.dll"; - // if (File.Exists(mcsPath)) - // { - // Assembly.Load(File.ReadAllBytes(mcsPath)); - // MelonLogger.Log("Loaded mcs.dll"); - // } - // else - // { - // MelonLogger.LogError("Could not find mcs.dll!"); - // } - //} + private void LoadMCS() + { + var mcsPath = @"Mods\mcs.dll"; + if (File.Exists(mcsPath)) + { + Assembly.Load(File.ReadAllBytes(mcsPath)); + MelonLogger.Log("Loaded mcs.dll"); + } + else + { + MelonLogger.LogError("Could not find mcs.dll!"); + } + } public override void OnLevelWasLoaded(int level) { diff --git a/src/CppExplorer.csproj b/src/CppExplorer.csproj index e207b8bb..c93c3f9c 100644 --- a/src/CppExplorer.csproj +++ b/src/CppExplorer.csproj @@ -44,6 +44,11 @@ ..\..\..\..\..\Steam\steamapps\common\Hellpoint\MelonLoader\Managed\Il2CppSystem.Core.dll False + + False + ..\Release\mcs.dll + False + ..\..\..\..\..\Steam\steamapps\common\Hellpoint\MelonLoader\MelonLoader.ModHandler.dll False @@ -114,16 +119,16 @@ - - - + + + - - - - - - + + + + + + diff --git a/src/Menu/Inspectors/GameObjectWindow.cs b/src/Inspectors/GameObjectWindow.cs similarity index 100% rename from src/Menu/Inspectors/GameObjectWindow.cs rename to src/Inspectors/GameObjectWindow.cs diff --git a/src/Menu/Inspectors/ReflectionWindow.cs b/src/Inspectors/ReflectionWindow.cs similarity index 100% rename from src/Menu/Inspectors/ReflectionWindow.cs rename to src/Inspectors/ReflectionWindow.cs diff --git a/src/Menu/MainMenu.cs b/src/MainMenu/MainMenu.cs similarity index 98% rename from src/Menu/MainMenu.cs rename to src/MainMenu/MainMenu.cs index b6558663..7488cef2 100644 --- a/src/Menu/MainMenu.cs +++ b/src/MainMenu/MainMenu.cs @@ -19,7 +19,7 @@ public MainMenu() Pages.Add(new ScenePage()); Pages.Add(new SearchPage()); - //Pages.Add(new ConsolePage()); + Pages.Add(new ConsolePage()); foreach (var page in Pages) { diff --git a/src/MainMenu/Pages/Console/REPL.cs b/src/MainMenu/Pages/Console/REPL.cs new file mode 100644 index 00000000..97ab6781 --- /dev/null +++ b/src/MainMenu/Pages/Console/REPL.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using Mono.CSharp; +using UnityEngine; +using Attribute = System.Attribute; +using Object = UnityEngine.Object; + +namespace Explorer +{ + public class REPL : InteractiveBase + { + static REPL() + { + var go = new GameObject("UnityREPL"); + GameObject.DontDestroyOnLoad(go); + //go.transform.parent = HPExplorer.Instance.transform; + MB = go.AddComponent(); + } + + [Documentation("MB - A dummy MonoBehaviour for accessing Unity.")] + public static ReplHelper MB { get; } + + [Documentation("find() - find a UnityEngine.Object of type T.")] + public static T find() where T : Object + { + return MB.Find(); + } + + [Documentation("findAll() - find all UnityEngine.Object of type T.")] + public static T[] findAll() where T : Object + { + return MB.FindAll(); + } + + [Documentation("runCoroutine(enumerator) - runs an IEnumerator as a Unity coroutine.")] + public static object runCoroutine(IEnumerator i) + { + return MB.RunCoroutine(i); + } + + [Documentation("endCoroutine(co) - ends a Unity coroutine.")] + public static void endCoroutine(Coroutine c) + { + MB.EndCoroutine(c); + } + + ////[Documentation("type() - obtain type info about a type T. Provides some Reflection helpers.")] + ////public static TypeHelper type() + ////{ + //// return new TypeHelper(typeof(T)); + ////} + + ////[Documentation("type(obj) - obtain type info about object obj. Provides some Reflection helpers.")] + ////public static TypeHelper type(object instance) + ////{ + //// return new TypeHelper(instance); + ////} + + //[Documentation("dir(obj) - lists all available methods and fiels of a given obj.")] + //public static string dir(object instance) + //{ + // return type(instance).info(); + //} + + //[Documentation("dir() - lists all available methods and fields of type T.")] + //public static string dir() + //{ + // return type().info(); + //} + + //[Documentation("findrefs(obj) - find references to the object in currently loaded components.")] + //public static Component[] findrefs(object obj) + //{ + // if (obj == null) throw new ArgumentNullException(nameof(obj)); + + // var results = new List(); + // foreach (var component in Object.FindObjectsOfType()) + // { + // var type = component.GetType(); + + // var nameBlacklist = new[] { "parent", "parentInternal", "root", "transform", "gameObject" }; + // var typeBlacklist = new[] { typeof(bool) }; + + // foreach (var prop in type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + // .Where(x => x.CanRead && !nameBlacklist.Contains(x.Name) && !typeBlacklist.Contains(x.PropertyType))) + // { + // try + // { + // if (Equals(prop.GetValue(component, null), obj)) + // { + // results.Add(component); + // goto finish; + // } + // } + // catch { } + // } + // foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + // .Where(x => !nameBlacklist.Contains(x.Name) && !typeBlacklist.Contains(x.FieldType))) + // { + // try + // { + // if (Equals(field.GetValue(component), obj)) + // { + // results.Add(component); + // goto finish; + // } + // } + // catch { } + // } + // finish:; + // } + + // return results.ToArray(); + //} + + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] + private class DocumentationAttribute : Attribute + { + public DocumentationAttribute(string doc) + { + Docs = doc; + } + + public string Docs { get; } + } + } +} \ No newline at end of file diff --git a/src/MainMenu/Pages/Console/REPLHelper.cs b/src/MainMenu/Pages/Console/REPLHelper.cs new file mode 100644 index 00000000..d2287617 --- /dev/null +++ b/src/MainMenu/Pages/Console/REPLHelper.cs @@ -0,0 +1,34 @@ +using System.Collections; +//using Il2CppSystem; +using MelonLoader; +using UnityEngine; +using System; +using Object = UnityEngine.Object; + +namespace Explorer +{ + public class ReplHelper : MonoBehaviour + { + public ReplHelper(IntPtr intPtr) : base(intPtr) { } + + public T Find() where T : Object + { + return FindObjectOfType(); + } + + public T[] FindAll() where T : Object + { + return FindObjectsOfType(); + } + + public object RunCoroutine(IEnumerator enumerator) + { + return MelonCoroutines.Start(enumerator); + } + + public void EndCoroutine(Coroutine c) + { + StopCoroutine(c); + } + } +} \ No newline at end of file diff --git a/src/MainMenu/Pages/ConsolePage.cs b/src/MainMenu/Pages/ConsolePage.cs new file mode 100644 index 00000000..ac583ed0 --- /dev/null +++ b/src/MainMenu/Pages/ConsolePage.cs @@ -0,0 +1,227 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using System.Reflection; +using Mono.CSharp; +using System.IO; +using MelonLoader; + +namespace Explorer +{ + public class ConsolePage : MainMenu.WindowPage + { + public override string Name { get => "Console"; set => base.Name = value; } + + private ScriptEvaluator _evaluator; + private readonly StringBuilder _sb = new StringBuilder(); + + private string MethodInput = ""; + private string UsingInput = ""; + + public static List UsingDirectives; + + private static readonly string[] m_defaultUsing = new string[] + { + "System", + "UnityEngine", + "System.Linq", + "System.Collections", + "System.Collections.Generic", + "System.Reflection", + "MelonLoader" + }; + + public override void Init() + { + UnhollowerRuntimeLib.ClassInjector.RegisterTypeInIl2Cpp(); + + try + { + MethodInput = @"// This is a basic REPL console used to execute a method. +// Some common directives are added by default, you can add more below. +// If you want to return some output, MelonLogger.Log() it. + +MelonLogger.Log(""hello world"");"; + + ResetConsole(); + } + catch (Exception e) + { + MelonLogger.Log($"Error setting up console!\r\nMessage: {e.Message}\r\nStack: {e.StackTrace}"); + } + } + + public void ResetConsole() + { + if (_evaluator != null) + { + _evaluator.Dispose(); + } + + _evaluator = new ScriptEvaluator(new StringWriter(_sb)) { InteractiveBaseClass = typeof(REPL) }; + + UsingDirectives = new List(); + UsingDirectives.AddRange(m_defaultUsing); + foreach (string asm in UsingDirectives) + { + Evaluate(AsmToUsing(asm)); + } + } + + public string AsmToUsing(string asm, bool richtext = false) + { + if (richtext) + { + return $"using {asm};"; + } + return $"using {asm};"; + } + + public void AddUsing(string asm) + { + if (!UsingDirectives.Contains(asm)) + { + UsingDirectives.Add(asm); + Evaluate(AsmToUsing(asm)); + } + } + + public object Evaluate(string str) + { + object ret = VoidType.Value; + + _evaluator.Compile(str, out var compiled); + + try + { + compiled?.Invoke(ref ret); + } + catch (Exception e) + { + MelonLogger.LogWarning(e.ToString()); + } + + return ret; + } + + + public override void DrawWindow() + { + GUILayout.Label("REPL Console", null); + + GUILayout.Label("Method:", null); + MethodInput = GUILayout.TextArea(MethodInput, new GUILayoutOption[] { GUILayout.Height(300) }); + + if (GUILayout.Button("Execute", null)) + { + try + { + MethodInput = MethodInput.Trim(); + + if (!string.IsNullOrEmpty(MethodInput)) + { + var result = Evaluate(MethodInput); + + if (result != null && !Equals(result, VoidType.Value)) + { + MelonLogger.Log("[Console Output]\r\n" + result.ToString()); + } + } + } + catch (Exception e) + { + MelonLogger.LogError("Exception compiling!\r\nMessage: " + e.Message + "\r\nStack: " + e.StackTrace); + } + } + + GUILayout.Label("Using directives:", null); + foreach (var asm in UsingDirectives) + { + GUILayout.Label(AsmToUsing(asm, true), null); + } + GUILayout.BeginHorizontal(null); + GUILayout.Label("Add namespace:", new GUILayoutOption[] { GUILayout.Width(110) }); + UsingInput = GUILayout.TextField(UsingInput, new GUILayoutOption[] { GUILayout.Width(150) }); + if (GUILayout.Button("Add", new GUILayoutOption[] { GUILayout.Width(50) })) + { + AddUsing(UsingInput); + } + if (GUILayout.Button("Reset", null)) + { + ResetConsole(); + } + GUILayout.EndHorizontal(); + } + + public override void Update() { } + + private class VoidType + { + public static readonly VoidType Value = new VoidType(); + private VoidType() { } + } + + } + + internal class ScriptEvaluator : Evaluator, IDisposable + { + private static readonly HashSet StdLib = + new HashSet(StringComparer.InvariantCultureIgnoreCase) { "mscorlib", "System.Core", "System", "System.Xml" }; + + private readonly TextWriter _logger; + + public ScriptEvaluator(TextWriter logger) : base(BuildContext(logger)) + { + _logger = logger; + + ImportAppdomainAssemblies(ReferenceAssembly); + AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoad; + } + + public void Dispose() + { + AppDomain.CurrentDomain.AssemblyLoad -= OnAssemblyLoad; + _logger.Dispose(); + } + + private void OnAssemblyLoad(object sender, AssemblyLoadEventArgs args) + { + string name = args.LoadedAssembly.GetName().Name; + if (StdLib.Contains(name)) + return; + ReferenceAssembly(args.LoadedAssembly); + } + + private static CompilerContext BuildContext(TextWriter tw) + { + var reporter = new StreamReportPrinter(tw); + + var settings = new CompilerSettings + { + Version = LanguageVersion.Experimental, + GenerateDebugInfo = false, + StdLib = true, + Target = Target.Library, + WarningLevel = 0, + EnhancedWarnings = false + }; + + return new CompilerContext(settings, reporter); + } + + private static void ImportAppdomainAssemblies(Action import) + { + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + string name = assembly.GetName().Name; + if (StdLib.Contains(name)) + continue; + import(assembly); + } + } + } +} diff --git a/src/Menu/MainMenu/ScenePage.cs b/src/MainMenu/Pages/ScenePage.cs similarity index 100% rename from src/Menu/MainMenu/ScenePage.cs rename to src/MainMenu/Pages/ScenePage.cs diff --git a/src/Menu/MainMenu/SearchPage.cs b/src/MainMenu/Pages/SearchPage.cs similarity index 100% rename from src/Menu/MainMenu/SearchPage.cs rename to src/MainMenu/Pages/SearchPage.cs diff --git a/src/Menu/MainMenu/Console/REPL.cs b/src/Menu/MainMenu/Console/REPL.cs deleted file mode 100644 index 37e25e4f..00000000 --- a/src/Menu/MainMenu/Console/REPL.cs +++ /dev/null @@ -1,131 +0,0 @@ -//using System; -//using System.Collections; -//using System.Collections.Generic; -//using System.Linq; -//using System.Reflection; -//using System.Text; -//using Mono.CSharp; -//using UnityEngine; -//using Attribute = System.Attribute; -//using Object = UnityEngine.Object; - -//namespace Explorer -//{ -// public class REPL : InteractiveBase -// { -// static REPL() -// { -// var go = new GameObject("UnityREPL"); -// GameObject.DontDestroyOnLoad(go); -// //go.transform.parent = HPExplorer.Instance.transform; -// MB = go.AddComponent(); -// } - -// [Documentation("MB - A dummy MonoBehaviour for accessing Unity.")] -// public static ReplHelper MB { get; } - -// [Documentation("find() - find a UnityEngine.Object of type T.")] -// public static T find() where T : Object -// { -// return MB.Find(); -// } - -// [Documentation("findAll() - find all UnityEngine.Object of type T.")] -// public static T[] findAll() where T : Object -// { -// return MB.FindAll(); -// } - -// [Documentation("runCoroutine(enumerator) - runs an IEnumerator as a Unity coroutine.")] -// public static object runCoroutine(IEnumerator i) -// { -// return MB.RunCoroutine(i); -// } - -// [Documentation("endCoroutine(co) - ends a Unity coroutine.")] -// public static void endCoroutine(Coroutine c) -// { -// MB.EndCoroutine(c); -// } - -// ////[Documentation("type() - obtain type info about a type T. Provides some Reflection helpers.")] -// ////public static TypeHelper type() -// ////{ -// //// return new TypeHelper(typeof(T)); -// ////} - -// ////[Documentation("type(obj) - obtain type info about object obj. Provides some Reflection helpers.")] -// ////public static TypeHelper type(object instance) -// ////{ -// //// return new TypeHelper(instance); -// ////} - -// //[Documentation("dir(obj) - lists all available methods and fiels of a given obj.")] -// //public static string dir(object instance) -// //{ -// // return type(instance).info(); -// //} - -// //[Documentation("dir() - lists all available methods and fields of type T.")] -// //public static string dir() -// //{ -// // return type().info(); -// //} - -// //[Documentation("findrefs(obj) - find references to the object in currently loaded components.")] -// //public static Component[] findrefs(object obj) -// //{ -// // if (obj == null) throw new ArgumentNullException(nameof(obj)); - -// // var results = new List(); -// // foreach (var component in Object.FindObjectsOfType()) -// // { -// // var type = component.GetType(); - -// // var nameBlacklist = new[] { "parent", "parentInternal", "root", "transform", "gameObject" }; -// // var typeBlacklist = new[] { typeof(bool) }; - -// // foreach (var prop in type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) -// // .Where(x => x.CanRead && !nameBlacklist.Contains(x.Name) && !typeBlacklist.Contains(x.PropertyType))) -// // { -// // try -// // { -// // if (Equals(prop.GetValue(component, null), obj)) -// // { -// // results.Add(component); -// // goto finish; -// // } -// // } -// // catch { } -// // } -// // foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) -// // .Where(x => !nameBlacklist.Contains(x.Name) && !typeBlacklist.Contains(x.FieldType))) -// // { -// // try -// // { -// // if (Equals(field.GetValue(component), obj)) -// // { -// // results.Add(component); -// // goto finish; -// // } -// // } -// // catch { } -// // } -// // finish:; -// // } - -// // return results.ToArray(); -// //} - -// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] -// private class DocumentationAttribute : Attribute -// { -// public DocumentationAttribute(string doc) -// { -// Docs = doc; -// } - -// public string Docs { get; } -// } -// } -//} \ No newline at end of file diff --git a/src/Menu/MainMenu/Console/REPLHelper.cs b/src/Menu/MainMenu/Console/REPLHelper.cs deleted file mode 100644 index fe97c458..00000000 --- a/src/Menu/MainMenu/Console/REPLHelper.cs +++ /dev/null @@ -1,29 +0,0 @@ -//using System.Collections; -//using MelonLoader; -//using UnityEngine; - -//namespace Explorer -//{ -// public class ReplHelper : MonoBehaviour -// { -// public T Find() where T : Object -// { -// return FindObjectOfType(); -// } - -// public T[] FindAll() where T : Object -// { -// return FindObjectsOfType(); -// } - -// public object RunCoroutine(IEnumerator enumerator) -// { -// return MelonCoroutines.Start(enumerator); -// } - -// public void EndCoroutine(Coroutine c) -// { -// StopCoroutine(c); -// } -// } -//} \ No newline at end of file diff --git a/src/Menu/MainMenu/ConsolePage.cs b/src/Menu/MainMenu/ConsolePage.cs deleted file mode 100644 index 12d939e8..00000000 --- a/src/Menu/MainMenu/ConsolePage.cs +++ /dev/null @@ -1,224 +0,0 @@ -//using System; -//using System.Collections; -//using System.Collections.Generic; -//using System.Linq; -//using System.Text; -//using System.Threading.Tasks; -//using UnityEngine; -//using System.Reflection; -//using Mono.CSharp; -//using System.IO; -//using MelonLoader; - -//namespace Explorer -//{ -// public class ConsolePage : MainMenu.WindowPage -// { -// public override string Name { get => "Console"; set => base.Name = value; } - -// private ScriptEvaluator _evaluator; -// private readonly StringBuilder _sb = new StringBuilder(); - -// private string MethodInput = ""; -// private string UsingInput = ""; - -// public static List UsingDirectives; - -// private static readonly string[] m_defaultUsing = new string[] -// { -// "System", -// "UnityEngine", -// "System.Linq", -// "System.Collections", -// "System.Collections.Generic", -// "System.Reflection" -// }; - -// public override void Init() -// { -// try -// { -// MethodInput = @"// This is a basic REPL console used to execute a method. -//// Some common directives are added by default, you can add more below. -//// If you want to return some output, Debug.Log() it. - -//Debug.Log(""hello world"");"; - -// ResetConsole(); -// } -// catch (Exception e) -// { -// MelonLogger.Log($"Error setting up console!\r\nMessage: {e.Message}\r\nStack: {e.StackTrace}"); -// } -// } - -// public void ResetConsole() -// { -// if (_evaluator != null) -// { -// _evaluator.Dispose(); -// } - -// _evaluator = new ScriptEvaluator(new StringWriter(_sb)) { InteractiveBaseClass = typeof(REPL) }; - -// UsingDirectives = new List(); -// UsingDirectives.AddRange(m_defaultUsing); -// foreach (string asm in UsingDirectives) -// { -// Evaluate(AsmToUsing(asm)); -// } -// } - -// public string AsmToUsing(string asm, bool richtext = false) -// { -// if (richtext) -// { -// return $"using {asm};"; -// } -// return $"using {asm};"; -// } - -// public void AddUsing(string asm) -// { -// if (!UsingDirectives.Contains(asm)) -// { -// UsingDirectives.Add(asm); -// Evaluate(AsmToUsing(asm)); -// } -// } - -// public object Evaluate(string str) -// { -// object ret = VoidType.Value; - -// _evaluator.Compile(str, out var compiled); - -// try -// { -// compiled?.Invoke(ref ret); -// } -// catch (Exception e) -// { -// MelonLogger.LogWarning(e.ToString()); -// } - -// return ret; -// } - - -// public override void DrawWindow() -// { -// GUILayout.Label("REPL Console", null); - -// GUILayout.Label("Method:", null); -// MethodInput = GUILayout.TextArea(MethodInput, new GUILayoutOption[] { GUILayout.Height(300) }); - -// if (GUILayout.Button("Execute", null)) -// { -// try -// { -// MethodInput = MethodInput.Trim(); - -// if (!string.IsNullOrEmpty(MethodInput)) -// { -// var result = Evaluate(MethodInput); - -// if (result != null && !Equals(result, VoidType.Value)) -// { -// MelonLogger.Log("[Console Output]\r\n" + result.ToString()); -// } -// } -// } -// catch (Exception e) -// { -// MelonLogger.LogError("Exception compiling!\r\nMessage: " + e.Message + "\r\nStack: " + e.StackTrace); -// } -// } - -// GUILayout.Label("Using directives:", null); -// foreach (var asm in UsingDirectives) -// { -// GUILayout.Label(AsmToUsing(asm, true), null); -// } -// GUILayout.BeginHorizontal(null); -// GUILayout.Label("Add namespace:", new GUILayoutOption[] { GUILayout.Width(110) }); -// UsingInput = GUILayout.TextField(UsingInput, new GUILayoutOption[] { GUILayout.Width(150) }); -// if (GUILayout.Button("Add", new GUILayoutOption[] { GUILayout.Width(50) })) -// { -// AddUsing(UsingInput); -// } -// if (GUILayout.Button("Reset", null)) -// { -// ResetConsole(); -// } -// GUILayout.EndHorizontal(); -// } - -// public override void Update() { } - -// private class VoidType -// { -// public static readonly VoidType Value = new VoidType(); -// private VoidType() { } -// } - -// } - -// internal class ScriptEvaluator : Evaluator, IDisposable -// { -// private static readonly HashSet StdLib = -// new HashSet(StringComparer.InvariantCultureIgnoreCase) { "mscorlib", "System.Core", "System", "System.Xml" }; - -// private readonly TextWriter _logger; - -// public ScriptEvaluator(TextWriter logger) : base(BuildContext(logger)) -// { -// _logger = logger; - -// ImportAppdomainAssemblies(ReferenceAssembly); -// AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoad; -// } - -// public void Dispose() -// { -// AppDomain.CurrentDomain.AssemblyLoad -= OnAssemblyLoad; -// _logger.Dispose(); -// } - -// private void OnAssemblyLoad(object sender, AssemblyLoadEventArgs args) -// { -// string name = args.LoadedAssembly.GetName().Name; -// if (StdLib.Contains(name)) -// return; -// ReferenceAssembly(args.LoadedAssembly); -// } - -// private static CompilerContext BuildContext(TextWriter tw) -// { -// var reporter = new StreamReportPrinter(tw); - -// var settings = new CompilerSettings -// { -// Version = LanguageVersion.Experimental, -// GenerateDebugInfo = false, -// StdLib = true, -// Target = Target.Library, -// WarningLevel = 0, -// EnhancedWarnings = false -// }; - -// return new CompilerContext(settings, reporter); -// } - -// private static void ImportAppdomainAssemblies(Action import) -// { -// foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) -// { -// string name = assembly.GetName().Name; -// if (StdLib.Contains(name)) -// continue; -// import(assembly); -// } -// } -// } -//} diff --git a/src/Menu/UIStyles.cs b/src/UIStyles.cs similarity index 100% rename from src/Menu/UIStyles.cs rename to src/UIStyles.cs