Added reset button for each mod; Minor UI tweaks

This commit is contained in:
Joshua Askharoun
2021-04-26 17:02:21 -05:00
parent 8ffe681b4b
commit 7f2db257d1
5 changed files with 98 additions and 25 deletions
+10 -3
View File
@@ -46,10 +46,17 @@ namespace ZuneModCore.Mods
public override Task<string?> Reset()
{
// Copy backup to application folder
File.Copy(Path.Combine(StorageDirectory, "WMVCORE.original.dll"), WMVCORE_PATH, true);
try
{
// Copy backup to application folder
File.Copy(Path.Combine(StorageDirectory, "WMVCORE.original.dll"), WMVCORE_PATH, true);
return Task.FromResult<string?>(null);
return Task.FromResult<string?>(null);
}
catch (Exception ex)
{
return Task.FromResult(ex.Message)!;
}
}
public override IReadOnlyList<Type>? DependentMods => null;
+27 -15
View File
@@ -80,9 +80,9 @@ namespace ZuneModCore.Mods
return Task.FromResult<string?>(null);
}
catch (UnauthorizedAccessException)
catch (IOException)
{
return Task.FromResult<string?>($"Failed to open '{zsDllInfo.FullName}'. Verify that the Zune software is not running and try again.");
return Task.FromResult<string?>($"Unable to replace '{zsDllInfo.FullName}'. Verify that the Zune software is not running and try again.");
}
catch (Exception ex)
{
@@ -92,21 +92,33 @@ namespace ZuneModCore.Mods
public override Task<string?> Reset()
{
// Copy backup to application folder
File.Copy(Path.Combine(StorageDirectory, "ZuneService.original.dll"), Path.Combine(ZuneInstallDir, "ZuneService.dll"), true);
string zsDllPath = Path.Combine(ZuneInstallDir, "ZuneService.dll");
try
{
// Copy backup to application folder
File.Copy(Path.Combine(StorageDirectory, "ZuneService.original.dll"), zsDllPath, true);
// Disable all feature overrides affected by new servers
SetFeatureOverride("Apps", false);
SetFeatureOverride("Channels", false);
SetFeatureOverride("Games", false);
SetFeatureOverride("Marketplace", false);
SetFeatureOverride("Music", false);
SetFeatureOverride("MusicVideos", false);
SetFeatureOverride("Podcasts", false);
SetFeatureOverride("Social", false);
SetFeatureOverride("Videos", false);
// Disable all feature overrides affected by new servers
SetFeatureOverride("Apps", false);
SetFeatureOverride("Channels", false);
SetFeatureOverride("Games", false);
SetFeatureOverride("Marketplace", false);
SetFeatureOverride("Music", false);
SetFeatureOverride("MusicVideos", false);
SetFeatureOverride("Podcasts", false);
SetFeatureOverride("Social", false);
SetFeatureOverride("Videos", false);
return Task.FromResult<string?>(null);
return Task.FromResult<string?>(null);
}
catch (IOException)
{
return Task.FromResult<string?>($"Unable to replace '{zsDllPath}'. Verify that the Zune software is not running and try again.");
}
catch (Exception ex)
{
return Task.FromResult<string?>(ex.Message);
}
}
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ namespace ZuneModCore
if (regKey == null)
return;
regKey.DeleteValue(name);
regKey.DeleteValue(name, false);
}
}