-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from Monitor221hz/plugin-loading
[Feature]: Rudimentary support for loading custom patcher plugins (injected into configuration selection menu on load)
- Loading branch information
Showing
56 changed files
with
647 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Pandora.API.Patch.IOManagers; | ||
|
||
public interface IMetaDataExporter<T> : IDataExporter<T> | ||
{ | ||
public void LoadMetaData(); | ||
public void SaveMetaData(IEnumerable<T> collection); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Pandora.API</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Pandora.API.Patch.Engine.Config; | ||
|
||
public interface IEngineConfiguration | ||
{ | ||
string Name { get; } | ||
|
||
string Description { get; } | ||
|
||
public IPatcher Patcher { get; } | ||
|
||
} |
10 changes: 6 additions & 4 deletions
10
...ne/Configs/IEngineConfigurationFactory.cs → ...ine.Config/IEngineConfigurationFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Pandora API/Patch.Engine.Config/IEngineConfigurationPlugin.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Pandora.API.Patch.Engine.Config; | ||
public interface IEngineConfigurationPlugin | ||
{ | ||
public enum OptionFlags | ||
{ | ||
None = 0, | ||
HidePatches = 1, | ||
} | ||
public string MenuPath { get; } | ||
public IEngineConfigurationFactory Factory { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| ||
namespace Pandora.API.Patch.Engine.Plugins; | ||
|
||
public interface IPluginInfo | ||
{ | ||
public const string FILE_HEADER = "plugin"; | ||
string Name { get; set; } | ||
string Author { get; set; } | ||
string Path { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Pandora.API.Patch.Engine.Plugins; | ||
using System.IO; | ||
using System.Reflection; | ||
|
||
namespace Pandora.Models.Patch.Engine.Plugins; | ||
public interface IPluginLoader | ||
{ | ||
Assembly LoadPlugin(DirectoryInfo directory, IPluginInfo pluginInfo); | ||
bool TryLoadMetadata(DirectoryInfo directory, out IPluginInfo? pluginInfo); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Pandora.API.Patch.Engine.Plugins; | ||
public class PluginInfo : IPluginInfo | ||
{ | ||
public string Name { get; set; } | ||
Check warning on line 10 in Pandora API/Patch.Engine.Plugins/PluginInfo.cs GitHub Actions / build (8.0.x)
|
||
public string Author { get; set; } | ||
Check warning on line 11 in Pandora API/Patch.Engine.Plugins/PluginInfo.cs GitHub Actions / build (8.0.x)
|
||
public string Path { get; set; } | ||
Check warning on line 12 in Pandora API/Patch.Engine.Plugins/PluginInfo.cs GitHub Actions / build (8.0.x)
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Pandora.API.Patch; | ||
|
||
/// <summary> | ||
/// Strongly recommended to implement GetHashCode() in addition to IEquatable. | ||
/// </summary> | ||
public interface IModInfo : IEquatable<IModInfo> | ||
{ | ||
public enum ModFormat | ||
{ | ||
FNIS, | ||
Nemesis, | ||
Pandora | ||
} | ||
|
||
public string Name { get; } | ||
|
||
public string Author { get; } | ||
|
||
public string URL { get; } | ||
|
||
public string Code { get; } | ||
|
||
public Version Version { get; } | ||
|
||
public DirectoryInfo Folder { get; } | ||
|
||
public ModFormat Format { get; } | ||
|
||
public bool Active { get; set; } | ||
|
||
public uint Priority { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
namespace Pandora.API.Patch; | ||
|
||
public interface IPatcher | ||
{ | ||
[Flags] | ||
public enum PatcherFlags | ||
{ | ||
None = 0, | ||
PreloadFailed = 1 << 1, | ||
UpdateFailed = 1 << 2, | ||
LaunchFailed = 1 << 3, | ||
Success = ~(PreloadFailed | UpdateFailed | LaunchFailed) | ||
} | ||
public PatcherFlags Flags { get; } | ||
public string GetVersionString(); | ||
public Version GetVersion(); | ||
public void SetTarget(List<IModInfo> mods); | ||
|
||
public Task PreloadAsync(); | ||
|
||
public void Update(); | ||
|
||
public void Run(); | ||
|
||
public string GetPostRunMessages(); | ||
|
||
public string GetFailureMessages(); | ||
|
||
public Task<bool> UpdateAsync(); | ||
|
||
public Task<bool> RunAsync(); | ||
|
||
public void SetOutputPath(DirectoryInfo directoryInfo); | ||
|
||
public void SetOutputPath(string outputPath) => SetOutputPath(new DirectoryInfo(outputPath)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
using Pandora.API.Patch; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
Pandora Behaviour Engine/Models/Patch/Engine/Configs/SkyrimConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.