Files
ZuneModdingHelper/ZuneModCore/Mod.cs
T

68 lines
1.9 KiB
C#
Raw Normal View History

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-10-26 14:48:45 -05:00
new BackgroundImageMod(),
2021-05-26 14:45:17 -05:00
new MbidLocatorMod(),
2021-04-25 22:59:36 -05:00
}.AsReadOnly();
2021-08-04 20:35:45 -05:00
public static string ZuneInstallDir { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Zune");
2021-04-25 22:59:36 -05:00
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-08-05 20:45:26 -05:00
public virtual AbstractUIElementGroup? GetDefaultOptionsUI() => null;
2021-04-25 22:59:36 -05:00
public virtual Task Init() => Task.CompletedTask;
public abstract Task<string?> Apply();
2021-04-25 22:59:36 -05:00
public abstract Task<string?> Reset();
2021-04-25 22:59:36 -05:00
2021-08-05 20:45:26 -05:00
private AbstractUIElementGroup? _OptionsUI;
public AbstractUIElementGroup? OptionsUI
{
get
{
if (_OptionsUI == null)
_OptionsUI = GetDefaultOptionsUI();
return _OptionsUI;
}
set => _OptionsUI = value;
}
2021-04-25 22:59:36 -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; }
}
}