diff --git a/OWML.Common/IModBehaviour.cs b/OWML.Common/IModBehaviour.cs index 2623d27d3..c9e6bf20c 100644 --- a/OWML.Common/IModBehaviour.cs +++ b/OWML.Common/IModBehaviour.cs @@ -1,8 +1,12 @@ -namespace OWML.Common +using System.Collections.Generic; + +namespace OWML.Common { public interface IModBehaviour { IModHelper ModHelper { get; } void Configure(IModConfig config); + IList GetDependants(); + IList GetDependencies(); } } diff --git a/OWML.Common/IModHelper.cs b/OWML.Common/IModHelper.cs index d25e1c2f8..fa1f15bd8 100644 --- a/OWML.Common/IModHelper.cs +++ b/OWML.Common/IModHelper.cs @@ -14,5 +14,6 @@ public interface IModHelper IModManifest Manifest { get; } IModConfig Config { get; } IOwmlConfig OwmlConfig { get; } + IModInteraction Interaction { get; } } } diff --git a/OWML.Common/IModInteraction.cs b/OWML.Common/IModInteraction.cs new file mode 100644 index 000000000..03431a784 --- /dev/null +++ b/OWML.Common/IModInteraction.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace OWML.Common +{ + public interface IModInteraction + { + IList GetMods(); + IList GetDependants(string dependencyUniqueName); + IList GetDependencies(string uniqueName); + IModBehaviour GetMod(string uniqueName); + T GetMod(string uniqueName) where T : IModBehaviour; + bool ModExists(string uniqueName); + } +} diff --git a/OWML.Common/IModManifest.cs b/OWML.Common/IModManifest.cs index 976396b61..0a2c664e8 100644 --- a/OWML.Common/IModManifest.cs +++ b/OWML.Common/IModManifest.cs @@ -13,5 +13,7 @@ public interface IModManifest string UniqueName { get; } string ModFolderPath { get; set; } Dictionary AppIds { get; } + string[] Dependencies { get; } + bool PriorityLoad { get; } } } diff --git a/OWML.Common/OWML.Common.csproj b/OWML.Common/OWML.Common.csproj index c4ad68673..6269eed8c 100644 --- a/OWML.Common/OWML.Common.csproj +++ b/OWML.Common/OWML.Common.csproj @@ -33,32 +33,34 @@ - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll @@ -67,6 +69,7 @@ + diff --git a/OWML.Common/packages.config b/OWML.Common/packages.config index bfe552ebf..8288b7a49 100644 --- a/OWML.Common/packages.config +++ b/OWML.Common/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/OWML.Launcher/OWML.Manifest.json b/OWML.Launcher/OWML.Manifest.json index e3a167a6a..6e98989c8 100644 --- a/OWML.Launcher/OWML.Manifest.json +++ b/OWML.Launcher/OWML.Manifest.json @@ -2,6 +2,6 @@ "author": "Alek", "name": "OWML", "uniqueName": "Alek.OWML", - "version": "0.3.46", + "version": "0.3.47", "description": "The mod loader and mod framework for Outer Wilds" } \ No newline at end of file diff --git a/OWML.Launcher/packages.config b/OWML.Launcher/packages.config index eceb5e431..8ab0a407c 100644 --- a/OWML.Launcher/packages.config +++ b/OWML.Launcher/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/OWML.ModHelper.Assets/OWML.ModHelper.Assets.csproj b/OWML.ModHelper.Assets/OWML.ModHelper.Assets.csproj index 9b72e1ef9..7178b702e 100644 --- a/OWML.ModHelper.Assets/OWML.ModHelper.Assets.csproj +++ b/OWML.ModHelper.Assets/OWML.ModHelper.Assets.csproj @@ -34,35 +34,38 @@ - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll NAudio-Unity\NAudio-Unity.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll diff --git a/OWML.ModHelper.Assets/packages.config b/OWML.ModHelper.Assets/packages.config index bfe552ebf..8288b7a49 100644 --- a/OWML.ModHelper.Assets/packages.config +++ b/OWML.ModHelper.Assets/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/OWML.ModHelper.Events/OWML.ModHelper.Events.csproj b/OWML.ModHelper.Events/OWML.ModHelper.Events.csproj index 96642f4c9..aa6000d1b 100644 --- a/OWML.ModHelper.Events/OWML.ModHelper.Events.csproj +++ b/OWML.ModHelper.Events/OWML.ModHelper.Events.csproj @@ -36,32 +36,35 @@ ..\packages\Lib.Harmony.1.2.0.1\lib\net35\0Harmony.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll diff --git a/OWML.ModHelper.Events/TypeExtensions.cs b/OWML.ModHelper.Events/TypeExtensions.cs index b4684f378..73c108f1b 100644 --- a/OWML.ModHelper.Events/TypeExtensions.cs +++ b/OWML.ModHelper.Events/TypeExtensions.cs @@ -67,5 +67,11 @@ public static void Invoke(this object obj, string name, params object[] paramete method?.Invoke(obj, parameters); } + public static T Invoke(this object obj, string name, params object[] parameters) + { + var type = obj.GetType(); + var method = type.GetAnyMethod(name); + return (T)method?.Invoke(obj, parameters); + } } } \ No newline at end of file diff --git a/OWML.ModHelper.Events/packages.config b/OWML.ModHelper.Events/packages.config index f9b9c8a24..2dec3d558 100644 --- a/OWML.ModHelper.Events/packages.config +++ b/OWML.ModHelper.Events/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OWML.ModHelper.Interaction/ModInteraction.cs b/OWML.ModHelper.Interaction/ModInteraction.cs new file mode 100644 index 000000000..74971f0e0 --- /dev/null +++ b/OWML.ModHelper.Interaction/ModInteraction.cs @@ -0,0 +1,85 @@ +using OWML.Common; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace OWML.ModHelper.Interaction +{ + public class ModInteraction : IModInteraction + { + private readonly IList _modList; + private Dictionary> _dependantDict = new Dictionary>(); + private Dictionary> _dependencyDict = new Dictionary>(); + + public ModInteraction(IList list) + { + _modList = list; + + RegenDicts(); + } + + private void RegenDicts() + { + _dependantDict = new Dictionary>(); + _dependencyDict = new Dictionary>(); + foreach (var mod in _modList) + { + var dependants = new List(); + var dependencies = new List(); + foreach (var dependency in _modList) + { + if (dependency.ModHelper.Manifest.Dependencies.Contains(mod.ModHelper.Manifest.UniqueName)) + { + dependants.Add(dependency); + } + + if (mod.ModHelper.Manifest.Dependencies.Contains(dependency.ModHelper.Manifest.UniqueName)) + { + dependencies.Add(dependency); + } + } + _dependantDict[mod.ModHelper.Manifest.UniqueName] = dependants; + _dependencyDict[mod.ModHelper.Manifest.UniqueName] = dependencies; + } + } + + public IList GetDependants(string dependencyUniqueName) + { + if (_dependantDict.Count != _modList.Count) + { + RegenDicts(); + } + return _dependantDict[dependencyUniqueName]; + } + + public IList GetDependencies(string uniqueName) + { + if (_dependantDict.Count != _modList.Count) + { + RegenDicts(); + } + return _dependencyDict[uniqueName]; + } + + public IModBehaviour GetMod(string uniqueName) + { + return _modList.First(m => m.ModHelper.Manifest.UniqueName == uniqueName); + } + + public T GetMod(string uniqueName) where T : IModBehaviour + { + var mod = GetMod(uniqueName); + return (T)mod; + } + + public IList GetMods() + { + return _modList; + } + + public bool ModExists(string uniqueName) + { + return _modList.Any(m => m.ModHelper.Manifest.UniqueName == uniqueName); + } + } +} diff --git a/OWML.ModHelper.Interaction/OWML.ModHelper.Interaction.csproj b/OWML.ModHelper.Interaction/OWML.ModHelper.Interaction.csproj new file mode 100644 index 000000000..9bfbd1642 --- /dev/null +++ b/OWML.ModHelper.Interaction/OWML.ModHelper.Interaction.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {3212C570-D4C3-4083-A3DB-616F80BA5DAB} + Library + Properties + OWML.ModHelper.Interaction + OWML.ModHelper.Interaction + v3.5 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll + + + + + + + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + + + + + + + + + {3C00626F-B688-4F32-B493-5B7EC1C879A0} + OWML.Common + + + {B771615E-6B51-44F8-B862-D7543C12C0FF} + OWML.ModHelper.Events + + + {cb57bab8-d70e-4fce-9bf1-328a924173a7} + OWML.ModHelper + + + + + + + \ No newline at end of file diff --git a/OWML.ModHelper.Interaction/Properties/AssemblyInfo.cs b/OWML.ModHelper.Interaction/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..7fb177fa7 --- /dev/null +++ b/OWML.ModHelper.Interaction/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OWML.ModInteraction")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OWML.ModInteraction")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3212c570-d4c3-4083-a3db-616f80ba5dab")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OWML.ModHelper.Interaction/packages.config b/OWML.ModHelper.Interaction/packages.config new file mode 100644 index 000000000..8288b7a49 --- /dev/null +++ b/OWML.ModHelper.Interaction/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/OWML.ModHelper.Menus/OWML.ModHelper.Menus.csproj b/OWML.ModHelper.Menus/OWML.ModHelper.Menus.csproj index 944907bf3..8c33f2196 100644 --- a/OWML.ModHelper.Menus/OWML.ModHelper.Menus.csproj +++ b/OWML.ModHelper.Menus/OWML.ModHelper.Menus.csproj @@ -32,13 +32,13 @@ - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll ..\packages\Json.Net.Unity3D.9.0.1\lib\net35\Newtonsoft.Json.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll @@ -47,25 +47,28 @@ - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll diff --git a/OWML.ModHelper.Menus/packages.config b/OWML.ModHelper.Menus/packages.config index 9cdd28f36..074e374a8 100644 --- a/OWML.ModHelper.Menus/packages.config +++ b/OWML.ModHelper.Menus/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OWML.ModHelper/ModBehaviour.cs b/OWML.ModHelper/ModBehaviour.cs index e71d1f89c..7297860ac 100644 --- a/OWML.ModHelper/ModBehaviour.cs +++ b/OWML.ModHelper/ModBehaviour.cs @@ -1,4 +1,6 @@ using OWML.Common; +using OWML.ModHelper.Events; +using System.Collections.Generic; using UnityEngine; namespace OWML.ModHelper @@ -18,5 +20,14 @@ public virtual void Configure(IModConfig config) { } + public IList GetDependants() + { + return ModHelper.Interaction.GetDependants(ModHelper.Manifest.UniqueName); + } + + public IList GetDependencies() + { + return ModHelper.Interaction.GetDependencies(ModHelper.Manifest.UniqueName); + } } } diff --git a/OWML.ModHelper/ModHelper.cs b/OWML.ModHelper/ModHelper.cs index e36a9bd4f..8c89c2b1e 100644 --- a/OWML.ModHelper/ModHelper.cs +++ b/OWML.ModHelper/ModHelper.cs @@ -16,9 +16,10 @@ public class ModHelper : IModHelper public IModManifest Manifest { get; } public IModConfig Config { get; } public IOwmlConfig OwmlConfig { get; } + public IModInteraction Interaction { get; } public ModHelper(IModLogger logger, IModConsole console, IHarmonyHelper harmonyHelper, IModEvents events, - IModAssets assets, IModStorage storage, IModMenus menus, IModManifest manifest, IModConfig config, IOwmlConfig owmlConfig) + IModAssets assets, IModStorage storage, IModMenus menus, IModManifest manifest, IModConfig config, IOwmlConfig owmlConfig, IModInteraction interaction) { Logger = logger; Console = console; @@ -30,6 +31,7 @@ public ModHelper(IModLogger logger, IModConsole console, IHarmonyHelper harmonyH Manifest = manifest; Config = config; OwmlConfig = owmlConfig; + Interaction = interaction; } } diff --git a/OWML.ModHelper/ModManifest.cs b/OWML.ModHelper/ModManifest.cs index 955a4c3f7..9dbb840b0 100644 --- a/OWML.ModHelper/ModManifest.cs +++ b/OWML.ModHelper/ModManifest.cs @@ -24,6 +24,12 @@ public class ModManifest : IModManifest [JsonProperty("owmlVersion")] public string OWMLVersion { get; private set; } + [JsonProperty("dependencies")] + public string[] Dependencies { get; private set; } = new string[] { }; + + [JsonProperty("priorityLoad")] + public bool PriorityLoad { get; private set; } + [JsonIgnore] public string ModFolderPath { get; set; } diff --git a/OWML.ModHelper/OWML.ModHelper.csproj b/OWML.ModHelper/OWML.ModHelper.csproj index 97293f4ee..bf2f66a0f 100644 --- a/OWML.ModHelper/OWML.ModHelper.csproj +++ b/OWML.ModHelper/OWML.ModHelper.csproj @@ -33,35 +33,38 @@ - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll ..\packages\Json.Net.Unity3D.9.0.1\lib\net35\Newtonsoft.Json.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll diff --git a/OWML.ModHelper/packages.config b/OWML.ModHelper/packages.config index 9cdd28f36..074e374a8 100644 --- a/OWML.ModHelper/packages.config +++ b/OWML.ModHelper/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OWML.ModLoader/ModDependency.cs b/OWML.ModLoader/ModDependency.cs new file mode 100644 index 000000000..c3639d402 --- /dev/null +++ b/OWML.ModLoader/ModDependency.cs @@ -0,0 +1,23 @@ +using OWML.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace OWML.ModLoader +{ + public class ModDependency + { + public string Name { get; private set; } + public string[] Dependencies { get; private set; } + + public IModData Data { get; private set; } + + public ModDependency(string name, IModData data, params string[] dependencies) + { + Name = name; + Data = data; + Dependencies = dependencies; + } + } +} diff --git a/OWML.ModLoader/ModLoader.cs b/OWML.ModLoader/ModLoader.cs index 60951195e..e893a1c01 100644 --- a/OWML.ModLoader/ModLoader.cs +++ b/OWML.ModLoader/ModLoader.cs @@ -28,11 +28,12 @@ public static void LoadMods() logger.Log("Got config!"); var console = new ModConsole(owmlConfig, logger, owmlManifest); console.WriteLine("Mod loader has been initialized."); + var modSorter = new ModSorter(console); var modFinder = new ModFinder(owmlConfig, console); var harmonyHelper = new HarmonyHelper(logger, console); var events = new ModEvents(logger, console, harmonyHelper); var menus = new ModMenus(logger, console, events); - var owo = new Owo(modFinder, logger, console, owmlConfig, menus, harmonyHelper); + var owo = new Owo(modFinder, logger, console, owmlConfig, menus, harmonyHelper, modSorter); owo.LoadMods(); } diff --git a/OWML.ModLoader/ModSorter.cs b/OWML.ModLoader/ModSorter.cs new file mode 100644 index 000000000..f8712705a --- /dev/null +++ b/OWML.ModLoader/ModSorter.cs @@ -0,0 +1,115 @@ +using OWML.Common; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace OWML.ModLoader +{ + public class ModSorter + { + private readonly IModConsole _console; + + public ModSorter(IModConsole console) + { + _console = console; + } + + public IList SortMods(IList mods) + { + var modDict = new Dictionary(); + var modList = new List(); + var set = new HashSet(); + + foreach (var mod in mods) + { + modList.Add(mod.Manifest.UniqueName); + } + + foreach (var mod in mods) + { + modDict.Add(mod.Manifest.UniqueName, mod); + + foreach (var dependency in mod.Manifest.Dependencies) + { + if (mod.Manifest.PriorityLoad && !modList.Contains(dependency)) + { + _console.WriteLine($"Error! {mod.Manifest.UniqueName} (priority load) depends on a normal mod! Removing from load..."); + modDict.Remove(mod.Manifest.UniqueName); + modList.Remove(mod.Manifest.UniqueName); + } + else + { + set.Add(new Edge(mod.Manifest.UniqueName, dependency)); + } + } + } + + + var sortedList = TopologicalSort( + new HashSet(modList), + new HashSet(set) + ); + + if (sortedList == null) + { + // Sorting has failed, return the original mod list + _console.WriteLine("Error - Cyclic dependency found. Returning original load order..."); + return mods; + } + + sortedList.Reverse(); + + return sortedList.Select(mod => modDict[mod]).ToList(); + } + + // Thanks to https://gist.github.com/Sup3rc4l1fr4g1l1571c3xp14l1d0c10u5/3341dba6a53d7171fe3397d13d00ee3f + + static List TopologicalSort(HashSet nodes, HashSet edges) + { + var sortedList = new List(); + + var nodesWithNoEdges = new HashSet(nodes.Where(node => edges.All(edge => edge.Second.Equals(node) == false))); + + while (nodesWithNoEdges.Any()) + { + var firstNode = nodesWithNoEdges.First(); + nodesWithNoEdges.Remove(firstNode); + + sortedList.Add(firstNode); + + foreach (var edge in edges.Where(e => e.First.Equals(firstNode)).ToList()) + { + var secondNode = edge.Second; + + edges.Remove(edge); + + if (edges.All(mEdge => mEdge.Second.Equals(secondNode) == false)) + { + nodesWithNoEdges.Add(secondNode); + } + } + } + + if (edges.Any()) + { + // This will be caught and handled in the caller method + return null; + } + else + { + return sortedList; + } + } + } + + public class Edge + { + public string First { get; private set; } + public string Second { get; private set; } + internal Edge(string first, string second) + { + this.First = first; + this.Second = second; + } + } +} diff --git a/OWML.ModLoader/OWML.ModLoader.csproj b/OWML.ModLoader/OWML.ModLoader.csproj index b0db9c3d6..6bdbfb6e2 100644 --- a/OWML.ModLoader/OWML.ModLoader.csproj +++ b/OWML.ModLoader/OWML.ModLoader.csproj @@ -33,41 +33,46 @@ - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll ..\packages\Json.Net.Unity3D.9.0.1\lib\net35\Newtonsoft.Json.dll - - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + + @@ -84,6 +89,10 @@ {B771615E-6B51-44F8-B862-D7543C12C0FF} OWML.ModHelper.Events + + {3212C570-D4C3-4083-A3DB-616F80BA5DAB} + OWML.ModHelper.Interaction + {b874cc24-8340-4238-ac9d-1bfb41186bb5} OWML.ModHelper.Menus diff --git a/OWML.ModLoader/Owo.cs b/OWML.ModLoader/Owo.cs index 065bee814..1e2df086d 100644 --- a/OWML.ModLoader/Owo.cs +++ b/OWML.ModLoader/Owo.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Reflection; using OWML.Common; @@ -6,6 +7,7 @@ using OWML.ModHelper; using OWML.ModHelper.Assets; using OWML.ModHelper.Events; +using OWML.ModHelper.Interaction; using UnityEngine; namespace OWML.ModLoader @@ -18,9 +20,12 @@ internal class Owo private readonly IOwmlConfig _owmlConfig; private readonly IModMenus _menus; private readonly IHarmonyHelper _harmonyHelper; + private readonly ModSorter _sorter; + + List _modList = new List(); public Owo(IModFinder modFinder, IModLogger logger, IModConsole console, - IOwmlConfig owmlConfig, IModMenus menus, IHarmonyHelper harmonyHelper) + IOwmlConfig owmlConfig, IModMenus menus, IHarmonyHelper harmonyHelper, ModSorter sorter) { _modFinder = modFinder; _logger = logger; @@ -28,6 +33,7 @@ public Owo(IModFinder modFinder, IModLogger logger, IModConsole console, _owmlConfig = owmlConfig; _menus = menus; _harmonyHelper = harmonyHelper; + _sorter = sorter; } public void LoadMods() @@ -37,19 +43,36 @@ public void LoadMods() _console.WriteLine("Verbose mode is enabled"); Application.logMessageReceived += OnLogMessageReceived; } - var mods = _modFinder.GetMods(); - foreach (var modData in mods) + var normalMods = _modFinder.GetMods().Where(mod => !mod.Manifest.PriorityLoad).ToList(); + var sortedNormal = _sorter.SortMods(normalMods); + + var priorityMods = _modFinder.GetMods().Where(mod => mod.Manifest.PriorityLoad).ToList(); + var sortedPriority = _sorter.SortMods(priorityMods); + + var modNames = _modFinder.GetMods().Where(mod => mod.Config.Enabled).Select(mod => mod.Manifest.UniqueName); + + var sortedMods = Enumerable.Concat(sortedPriority, sortedNormal); + + foreach (var mod in sortedMods) { - var modType = LoadMod(modData); + foreach (var dependency in mod.Manifest.Dependencies) + { + if (!modNames.Contains(dependency)) + { + _console.WriteLine($"Error! {mod.Manifest.UniqueName} needs {dependency}, but it's disabled!"); + } + } + var modType = LoadMod(mod); if (modType == null) { _logger.Log("Mod type is null, skipping"); - _menus.ModsMenu.AddMod(modData, null); + _menus.ModsMenu.AddMod(mod, null); continue; } - var helper = CreateModHelper(modData); - var mod = InitializeMod(modType, helper); - _menus.ModsMenu.AddMod(modData, mod); + var helper = CreateModHelper(mod); + var initMod = InitializeMod(modType, helper); + _menus.ModsMenu.AddMod(mod, initMod); + _modList.Add(initMod); } } @@ -89,8 +112,9 @@ private IModHelper CreateModHelper(IModData modData) var assets = new ModAssets(console, modData.Manifest); var storage = new ModStorage(console, modData.Manifest); var events = new ModEvents(logger, console, _harmonyHelper); + var interaction = new ModInteraction(_modList); return new ModHelper.ModHelper(logger, console, _harmonyHelper, - events, assets, storage, _menus, modData.Manifest, modData.Config, _owmlConfig); + events, assets, storage, _menus, modData.Manifest, modData.Config, _owmlConfig, interaction); } private IModBehaviour InitializeMod(Type modType, IModHelper helper) diff --git a/OWML.ModLoader/packages.config b/OWML.ModLoader/packages.config index 9cdd28f36..074e374a8 100644 --- a/OWML.ModLoader/packages.config +++ b/OWML.ModLoader/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OWML.Nuget/OWML.Nuget.csproj b/OWML.Nuget/OWML.Nuget.csproj index 718cbad66..bef0fa152 100644 --- a/OWML.Nuget/OWML.Nuget.csproj +++ b/OWML.Nuget/OWML.Nuget.csproj @@ -58,6 +58,10 @@ {b771615e-6b51-44f8-b862-d7543c12c0ff} OWML.ModHelper.Events + + {3212c570-d4c3-4083-a3db-616f80ba5dab} + OWML.ModHelper.Interaction + {b874cc24-8340-4238-ac9d-1bfb41186bb5} OWML.ModHelper.Menus diff --git a/OWML.Nuget/OWML.Nuget.nuspec b/OWML.Nuget/OWML.Nuget.nuspec index a55fa9d0f..fa2943c00 100644 --- a/OWML.Nuget/OWML.Nuget.nuspec +++ b/OWML.Nuget/OWML.Nuget.nuspec @@ -25,6 +25,7 @@ + diff --git a/OWML.Patcher/OWPatcher.cs b/OWML.Patcher/OWPatcher.cs index b8f631127..a4b55daed 100644 --- a/OWML.Patcher/OWPatcher.cs +++ b/OWML.Patcher/OWPatcher.cs @@ -34,7 +34,7 @@ private void CopyFiles() var filesToCopy = new[] { "OWML.ModLoader.dll", "OWML.Common.dll", "OWML.ModHelper.dll", "OWML.ModHelper.Events.dll", "OWML.ModHelper.Assets.dll", "OWML.ModHelper.Menus.dll", "Newtonsoft.Json.dll", "System.Runtime.Serialization.dll", "0Harmony.dll", "NAudio-Unity.dll", - "OWML.Manifest.json" }; + "OWML.Manifest.json", "OWML.ModHelper.Interaction.dll" }; foreach (var filename in filesToCopy) { File.Copy(filename, $"{_owmlConfig.ManagedPath}/{filename}", true); diff --git a/OWML.SampleMods/OWML.EnableDebugMode/OWML.EnableDebugMode.csproj b/OWML.SampleMods/OWML.EnableDebugMode/OWML.EnableDebugMode.csproj index 2c260c025..5dc3f8726 100644 --- a/OWML.SampleMods/OWML.EnableDebugMode/OWML.EnableDebugMode.csproj +++ b/OWML.SampleMods/OWML.EnableDebugMode/OWML.EnableDebugMode.csproj @@ -32,32 +32,35 @@ - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll - - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll diff --git a/OWML.SampleMods/OWML.EnableDebugMode/manifest.json b/OWML.SampleMods/OWML.EnableDebugMode/manifest.json index 825827758..310addc8b 100644 --- a/OWML.SampleMods/OWML.EnableDebugMode/manifest.json +++ b/OWML.SampleMods/OWML.EnableDebugMode/manifest.json @@ -4,6 +4,6 @@ "name": "EnableDebugMode", "uniqueName": "Alek.EnableDebugMode", "version": "0.2", - "owmlVersion": "0.3.46", + "owmlVersion": "0.3.47", "description": "Enables the debug mode in Outer Wilds" } \ No newline at end of file diff --git a/OWML.SampleMods/OWML.EnableDebugMode/packages.config b/OWML.SampleMods/OWML.EnableDebugMode/packages.config index bfe552ebf..8288b7a49 100644 --- a/OWML.SampleMods/OWML.EnableDebugMode/packages.config +++ b/OWML.SampleMods/OWML.EnableDebugMode/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/OWML.SampleMods/OWML.LoadCustomAssets/OWML.LoadCustomAssets.csproj b/OWML.SampleMods/OWML.LoadCustomAssets/OWML.LoadCustomAssets.csproj index c3fae5bbe..3e65f717f 100644 --- a/OWML.SampleMods/OWML.LoadCustomAssets/OWML.LoadCustomAssets.csproj +++ b/OWML.SampleMods/OWML.LoadCustomAssets/OWML.LoadCustomAssets.csproj @@ -32,35 +32,38 @@ - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\Assembly-CSharp.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\Assembly-CSharp.dll ..\..\packages\Json.Net.Unity3D.9.0.1\lib\net35\Newtonsoft.Json.dll - - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\OW.Unity.Dlls.dll + + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\OW.Unity.Dlls.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.AudioModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.AudioModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.CoreModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.CoreModule.dll + + + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.IMGUIModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.PhysicsModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.PhysicsModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UI.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UI.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UIModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UIModule.dll - ..\..\packages\OW.Unity.Dlls.1.0.2\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\packages\OW.Unity.Dlls.1.0.4\lib\net35\UnityEngine.UnityWebRequestWWWModule.dll diff --git a/OWML.SampleMods/OWML.LoadCustomAssets/manifest.json b/OWML.SampleMods/OWML.LoadCustomAssets/manifest.json index 53694b1c6..b49be46d7 100644 --- a/OWML.SampleMods/OWML.LoadCustomAssets/manifest.json +++ b/OWML.SampleMods/OWML.LoadCustomAssets/manifest.json @@ -4,6 +4,6 @@ "name": "LoadCustomAssets", "uniqueName": "Alek.LoadCustomAssets", "version": "0.5", - "owmlVersion": "0.3.46", + "owmlVersion": "0.3.47", "description": "A mod for testing loading of custom assets" } \ No newline at end of file diff --git a/OWML.SampleMods/OWML.LoadCustomAssets/packages.config b/OWML.SampleMods/OWML.LoadCustomAssets/packages.config index 9cdd28f36..074e374a8 100644 --- a/OWML.SampleMods/OWML.LoadCustomAssets/packages.config +++ b/OWML.SampleMods/OWML.LoadCustomAssets/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OWML.sln b/OWML.sln index 54f169daf..eae2490e5 100644 --- a/OWML.sln +++ b/OWML.sln @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OWML.Nuget", "OWML.Nuget\OW EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OWML.ModHelper.Menus", "OWML.ModHelper.Menus\OWML.ModHelper.Menus.csproj", "{B874CC24-8340-4238-AC9D-1BFB41186BB5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OWML.ModHelper.Interaction", "OWML.ModHelper.Interaction\OWML.ModHelper.Interaction.csproj", "{3212C570-D4C3-4083-A3DB-616F80BA5DAB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -77,6 +79,10 @@ Global {B874CC24-8340-4238-AC9D-1BFB41186BB5}.Debug|Any CPU.Build.0 = Debug|Any CPU {B874CC24-8340-4238-AC9D-1BFB41186BB5}.Release|Any CPU.ActiveCfg = Release|Any CPU {B874CC24-8340-4238-AC9D-1BFB41186BB5}.Release|Any CPU.Build.0 = Release|Any CPU + {3212C570-D4C3-4083-A3DB-616F80BA5DAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3212C570-D4C3-4083-A3DB-616F80BA5DAB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3212C570-D4C3-4083-A3DB-616F80BA5DAB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3212C570-D4C3-4083-A3DB-616F80BA5DAB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Readme.md b/Readme.md index 512a1f6ce..106ef63dd 100644 --- a/Readme.md +++ b/Readme.md @@ -69,6 +69,7 @@ Each mod is defined in a manifest.json file: |uniqueName|Usually {author}.{uniqueName}.| |version|The version number.| |owmlVersion|The version of OWML the mod was built for.| +|dependencies|Array of dependency names. Make sure to use the unique name.| Each mod can be configured with an **optional** config.json file: diff --git a/createrelease.bat b/createrelease.bat index b12d30015..8782db912 100644 --- a/createrelease.bat +++ b/createrelease.bat @@ -21,6 +21,7 @@ copy "OWML.Nuget\bin\Debug\OWML.Common.dll" "Release\OWML.Common.dll" copy "OWML.Nuget\bin\Debug\OWML.ModHelper.dll" "Release\OWML.ModHelper.dll" copy "OWML.Nuget\bin\Debug\OWML.ModHelper.Events.dll" "Release\OWML.ModHelper.Events.dll" copy "OWML.Nuget\bin\Debug\OWML.ModHelper.Assets.dll" "Release\OWML.ModHelper.Assets.dll" +copy "OWML.Nuget\bin\Debug\OWML.ModHelper.Interaction.dll" "Release\OWML.ModHelper.Interaction.dll" copy "OWML.Nuget\bin\Debug\OWML.ModHelper.Menus.dll" "Release\OWML.ModHelper.Menus.dll" copy "OWML.Nuget\bin\Debug\0Harmony.dll" "Release\0Harmony.dll" copy "OWML.Nuget\bin\Debug\Newtonsoft.Json.dll" "Release\Newtonsoft.Json.dll"