mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Remove ZuneInstallDir property from base Mod
This commit is contained in:
@@ -8,12 +8,8 @@ namespace ZuneModCore;
|
||||
|
||||
public abstract class Mod(ModMetadata metadata)
|
||||
{
|
||||
public static string DefaultZuneInstallDir { get; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Zune");
|
||||
|
||||
public ModMetadata Metadata { get; } = metadata;
|
||||
|
||||
public string ZuneInstallDir { get; set; } = DefaultZuneInstallDir;
|
||||
|
||||
public virtual AbstractUICollection? GetDefaultOptionsUI() => null;
|
||||
|
||||
public abstract Task<string?> Apply();
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Vestris.ResourceLib;
|
||||
using ZuneModCore.Services;
|
||||
using ZuneModCore.Win32;
|
||||
|
||||
namespace ZuneModCore.Mods;
|
||||
@@ -19,8 +20,10 @@ public class BackgroundImageModFactory : DIModFactoryBase<BackgroundImageMod>
|
||||
Description, Author, new(1, 0));
|
||||
}
|
||||
|
||||
public class BackgroundImageMod(ModMetadata metadata) : Mod(metadata)
|
||||
public class BackgroundImageMod(ModMetadata metadata, IModCoreConfig modConfig) : Mod(metadata)
|
||||
{
|
||||
public string ZuneInstallDir => modConfig.ZuneInstallDir;
|
||||
|
||||
public override AbstractUICollection? GetDefaultOptionsUI()
|
||||
{
|
||||
AbstractUICollection optionsUi = new(nameof(BackgroundImageMod))
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using ZuneModCore.Services;
|
||||
|
||||
namespace ZuneModCore.Mods;
|
||||
|
||||
@@ -17,8 +18,10 @@ public class VideoSyncModFactory : DIModFactoryBase<VideoSyncMod>
|
||||
Description, Author, new(2, 0));
|
||||
}
|
||||
|
||||
public class VideoSyncMod(ModMetadata metadata) : Mod(metadata)
|
||||
public class VideoSyncMod(ModMetadata metadata, IModCoreConfig modConfig) : Mod(metadata)
|
||||
{
|
||||
public string ZuneInstallDir => modConfig.ZuneInstallDir;
|
||||
|
||||
private const int ZUNEENCENG_WMVCORA_OFFSET = 0x161E;
|
||||
|
||||
public override async Task<string?> Apply()
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WebservicesModFactory : DIModFactoryBase<WebservicesMod>
|
||||
Description, Author, new(1, 1));
|
||||
}
|
||||
|
||||
public partial class WebservicesMod(ModMetadata metadata) : Mod(metadata), IAsyncInit
|
||||
public partial class WebservicesMod(ModMetadata metadata, IModCoreConfig modConfig) : Mod(metadata), IAsyncInit
|
||||
{
|
||||
private const int ZUNESERVICES_ENDPOINTS_BLOCK_OFFSET = 0x14D60;
|
||||
private const int ZUNESERVICES_ENDPOINTS_BLOCK_LENGTH = 0x884;
|
||||
@@ -68,6 +68,8 @@ public partial class WebservicesMod(ModMetadata metadata) : Mod(metadata), IAsyn
|
||||
private CancellationTokenSource _cts = new();
|
||||
private string _methodFile;
|
||||
|
||||
public string ZuneInstallDir => modConfig.ZuneInstallDir;
|
||||
|
||||
public override AbstractUICollection? GetDefaultOptionsUI()
|
||||
{
|
||||
AbstractUICollection optionsUi = new(nameof(FeaturesOverrideMod))
|
||||
|
||||
Reference in New Issue
Block a user