2021-04-25 22:59:36 -05:00
|
|
|
using OwlCore.AbstractUI.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using ZuneModCore.Mods;
|
|
|
|
|
|
|
|
|
|
namespace ZuneModCore
|
|
|
|
|
{
|
|
|
|
|
public abstract class Mod
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A list of all available mods
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static readonly IReadOnlyList<Mod> AvailableMods = new List<Mod>
|
|
|
|
|
{
|
|
|
|
|
new FeaturesOverrideMod(),
|
|
|
|
|
new VideoSyncMod(),
|
|
|
|
|
new WebservicesMod(),
|
2021-05-26 14:45:17 -05:00
|
|
|
new MbidLocatorMod(),
|
2021-04-25 22:59:36 -05:00
|
|
|
}.AsReadOnly();
|
|
|
|
|
|
|
|
|
|
public static string ZuneInstallDir { get; set; } = @"C:\Program Files\Zune\";
|
|
|
|
|
|
|
|
|
|
public abstract string Id { get; }
|
|
|
|
|
|
|
|
|
|
public abstract string Title { get; }
|
|
|
|
|
|
|
|
|
|
public abstract string Description { get; }
|
|
|
|
|
|
2021-04-26 18:05:19 -05:00
|
|
|
public abstract string Author { get; }
|
|
|
|
|
|
2021-04-25 22:59:36 -05:00
|
|
|
public virtual Task Init() => Task.CompletedTask;
|
|
|
|
|
|
2021-04-26 04:28:43 -05:00
|
|
|
public abstract Task<string?> Apply();
|
2021-04-25 22:59:36 -05:00
|
|
|
|
2021-04-26 04:28:43 -05:00
|
|
|
public abstract Task<string?> Reset();
|
2021-04-25 22:59:36 -05:00
|
|
|
|
|
|
|
|
public abstract AbstractUIElementGroup? OptionsUI { get; }
|
|
|
|
|
|
2021-04-26 04:28:43 -05:00
|
|
|
public string StorageDirectory
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
string dir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ZuneModCore", Id);
|
|
|
|
|
// Create the directory just in case the consumer assumes the folder exists already
|
|
|
|
|
Directory.CreateDirectory(dir);
|
|
|
|
|
return dir;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-25 22:59:36 -05:00
|
|
|
|
|
|
|
|
public abstract IReadOnlyList<Type>? DependentMods { get; }
|
|
|
|
|
}
|
|
|
|
|
}
|