Introduce ModManager and IModFactory

This commit is contained in:
Yoshi Askharoun
2024-05-21 20:54:02 -05:00
parent 5e78ca81aa
commit 44d033786d
9 changed files with 108 additions and 60 deletions
+13 -9
View File
@@ -10,7 +10,19 @@ using static ZuneModCore.Mods.FeaturesOverrideMod;
namespace ZuneModCore.Mods;
public class WebservicesMod : Mod, IAsyncInit
public class WebservicesModFactory : DIModFactoryBase<WebservicesMod>
{
private const string Description = "Partially restores online features such as the Marketplace by patching the Zune desktop software " +
"to use the community's recreation of Microsoft's Zune servers at zunes.me (instead of zune.net).";
private const string Author = "Joshua \"Yoshi\" Askharoun";
public override ModMetadata Metadata => new(nameof(WebservicesMod), "Community Webservices",
Description, Author, new(1, 1));
}
public class WebservicesMod(ModMetadata metadata) : Mod(metadata), IAsyncInit
{
private const int ZUNESERVICES_ENDPOINTS_BLOCK_OFFSET = 0x14D60;
private const int ZUNESERVICES_ENDPOINTS_BLOCK_LENGTH = 0x884;
@@ -34,14 +46,6 @@ public class WebservicesMod : Mod, IAsyncInit
private HttpClient _client;
private CancellationTokenSource _cts = new();
private const string Description = "Partially restores online features such as the Marketplace by patching the Zune desktop software " +
"to use the community's recreation of Microsoft's Zune servers at zunes.me (instead of zune.net).";
private const string Author = "Joshua \"Yoshi\" Askharoun";
public override ModMetadata Metadata => new(nameof(WebservicesMod), "Community Webservices",
Description, Author, new(1, 1));
public override AbstractUICollection? GetDefaultOptionsUI()
{
AbstractUICollection optionsUi = new(nameof(FeaturesOverrideMod))