Remove AbstractUI implementation (for now)

This commit is contained in:
Joshua Askharoun
2021-04-25 23:55:04 -05:00
parent bd946f2700
commit c8cf308cc3
42 changed files with 50 additions and 1536 deletions
+2 -2
View File
@@ -63,9 +63,9 @@ namespace ZuneModCore.Mods
public override Task<bool> Apply()
{
return Task.FromResult(true);
// TODO: Use user choices from AbstractUI
foreach (AbstractUIElement uiElem in OptionsUI.Items)
if (uiElem is AbstractBooleanUIElement boolElem && boolElem.State)
if (uiElem is AbstractBooleanUIElement boolElem)// && boolElem.State)
SetFeatureOverride(boolElem.Id, true);
return Task.FromResult(true);
+5 -5
View File
@@ -31,12 +31,12 @@ namespace ZuneModCore.Mods
public override IReadOnlyList<Type>? DependentMods => null;
public override async Task<bool> Apply()
public override Task<bool> Apply()
{
// Open ZuneServices.dll
FileInfo zsDllInfo = new(Path.Combine(ZuneInstallDir, "ZuneService.dll"));
if (!zsDllInfo.Exists)
return false;
return Task.FromResult(true);
using FileStream zsDll = zsDllInfo.Open(FileMode.Open);
using BinaryWriter zsDllWriter = new(zsDll);
using BinaryReader zsDllReader = new(zsDll);
@@ -45,7 +45,7 @@ namespace ZuneModCore.Mods
zsDllReader.BaseStream.Position = 0x12C824;
var versionBytes = zsDllReader.ReadBytes(ZUNE_4_8_VERSION_BYTES.Length * 2);
if (versionBytes[0] != '4' || versionBytes[2] != '.' || versionBytes[4] != '8')
return false;
return Task.FromResult(true);
// Patch ZuneServices.dll to use zunes.tk instead of zune.net
zsDllReader.BaseStream.Position = ZUNESERVICES_ENDPOINTS_BLOCK_OFFSET;
@@ -53,7 +53,7 @@ namespace ZuneModCore.Mods
endpointBlock = endpointBlock.Replace("zune.net", "zunes.tk");
byte[] endpointBytes = System.Text.Encoding.Unicode.GetBytes(endpointBlock);
if (endpointBytes.Length != ZUNESERVICES_ENDPOINTS_BLOCK_LENGTH)
return false;
return Task.FromResult(false);
zsDllWriter.Seek(ZUNESERVICES_ENDPOINTS_BLOCK_OFFSET, SeekOrigin.Begin);
zsDllWriter.Write(endpointBytes);
@@ -69,7 +69,7 @@ namespace ZuneModCore.Mods
SetFeatureOverride("Social", true);
SetFeatureOverride("Videos", true);
return true;
return Task.FromResult(true);
}
public override Task<bool> Reset()