Update packages

This commit is contained in:
Yoshi Askharoun
2024-03-12 17:06:06 -05:00
parent dafecd86da
commit f1d3b58682
19 changed files with 101 additions and 113 deletions
+5 -8
View File
@@ -3,7 +3,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Vestris.ResourceLib;
using ZuneModCore.Win32;
@@ -22,21 +21,19 @@ namespace ZuneModCore.Mods
public override AbstractUICollection? GetDefaultOptionsUI()
{
return new(nameof(BackgroundImageMod))
AbstractUICollection optionsUi = new(nameof(BackgroundImageMod))
{
Title = "Select background image:",
Items = new List<AbstractUIElement>
{
new AbstractTextBox("fileBox", Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)),
}
new AbstractTextBox("fileBox", Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)),
};
optionsUi.Title = "Select background image:";
return optionsUi;
}
public override IReadOnlyList<Type>? DependentMods => null;
public override async Task<string?> Apply()
{
string bgimgPath = ((AbstractTextBox)OptionsUI!.Items[0]).Value;
string bgimgPath = ((AbstractTextBox)OptionsUI![0]).Value;
FileInfo bgimgInfo = new(bgimgPath);
if (!bgimgInfo.Exists)
{
+30 -32
View File
@@ -21,46 +21,44 @@ namespace ZuneModCore.Mods
public override AbstractUICollection? GetDefaultOptionsUI()
{
return new(nameof(FeaturesOverrideMod))
AbstractUICollection optionsUi = new(nameof(FeaturesOverrideMod))
{
Title = "Select features:",
Items = new List<AbstractUIElement>
{
// We don't know what some of these overrides do exactly, so hide them from the user.
// The ID is the name of the registry key, the label is the display name
// We don't know what some of these overrides do exactly, so hide them from the user.
// The ID is the name of the registry key, the label is the display name
new AbstractBoolean("Apps", "Apps"),
new AbstractBoolean("Art", "Art"),
new AbstractBoolean("Channels", "Channels"),
new AbstractBoolean("FirstLaunchIntroVideo", "First Launch Intro Video"),
new AbstractBoolean("Games", "Games"),
new AbstractBoolean("Marketplace", "Marketplace"),
new AbstractBoolean("MBRPreview", "[Marketplace] Media Preview"),
new AbstractBoolean("MBRPurchase", "[Marketplace] Media Purchase"),
new AbstractBoolean("MBRRental", "[Marketplace] Media Rental"),
new AbstractBoolean("Music", "Music"),
new AbstractBoolean("MusicVideos", "Music Videos"),
new AbstractBoolean("Nowplaying", "Now Playing"),
new AbstractBoolean("NowplayingArt", "Now Playing Art"),
new AbstractBoolean("Picks", "Picks"),
new AbstractBoolean("Podcasts", "Podcasts"),
new AbstractBoolean("QuickMixLocal", "Quick Mix (Local)"),
new AbstractBoolean("QuickMixZMP", "Quick Mix (ZMP)"),
new AbstractBoolean("Quickplay", "Quickplay"),
new AbstractBoolean("Sign In Available", "Sign In"),
new AbstractBoolean("Social", "Social"),
new AbstractBoolean("SocialMarketplace", "Social Marketplace"),
new AbstractBoolean("SubscriptionFreeTracks", "Subscription Free Tracks"),
new AbstractBoolean("Videos", "Videos"),
}
new AbstractBoolean("Apps", "Apps"),
new AbstractBoolean("Art", "Art"),
new AbstractBoolean("Channels", "Channels"),
new AbstractBoolean("FirstLaunchIntroVideo", "First Launch Intro Video"),
new AbstractBoolean("Games", "Games"),
new AbstractBoolean("Marketplace", "Marketplace"),
new AbstractBoolean("MBRPreview", "[Marketplace] Media Preview"),
new AbstractBoolean("MBRPurchase", "[Marketplace] Media Purchase"),
new AbstractBoolean("MBRRental", "[Marketplace] Media Rental"),
new AbstractBoolean("Music", "Music"),
new AbstractBoolean("MusicVideos", "Music Videos"),
new AbstractBoolean("Nowplaying", "Now Playing"),
new AbstractBoolean("NowplayingArt", "Now Playing Art"),
new AbstractBoolean("Picks", "Picks"),
new AbstractBoolean("Podcasts", "Podcasts"),
new AbstractBoolean("QuickMixLocal", "Quick Mix (Local)"),
new AbstractBoolean("QuickMixZMP", "Quick Mix (ZMP)"),
new AbstractBoolean("Quickplay", "Quickplay"),
new AbstractBoolean("Sign In Available", "Sign In"),
new AbstractBoolean("Social", "Social"),
new AbstractBoolean("SocialMarketplace", "Social Marketplace"),
new AbstractBoolean("SubscriptionFreeTracks", "Subscription Free Tracks"),
new AbstractBoolean("Videos", "Videos"),
};
optionsUi.Title = "Select features:";
return optionsUi;
}
public override IReadOnlyList<Type>? DependentMods => null;
public override Task Init()
{
foreach (AbstractUIElement uiElem in OptionsUI.Items)
foreach (AbstractUIElement uiElem in OptionsUI!)
{
if (uiElem is AbstractBoolean boolElem)
{
@@ -77,7 +75,7 @@ namespace ZuneModCore.Mods
public async Task<string?> Apply(bool applyAll = false)
{
// Use user choices from AbstractUI
foreach (AbstractUIElement uiElem in OptionsUI!.Items)
foreach (AbstractUIElement uiElem in OptionsUI!)
{
if (uiElem is AbstractBoolean boolElem && (boolElem.State || applyAll))
{
+7 -9
View File
@@ -31,15 +31,13 @@ namespace ZuneModCore.Mods
public override AbstractUICollection? GetDefaultOptionsUI()
{
return new(nameof(MbidLocatorMod))
AbstractUICollection optionsUi = new(nameof(MbidLocatorMod))
{
Title = "Select music folder:",
Items = new List<AbstractUIElement>
{
new AbstractTextBox("folderBox", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)),
new AbstractBoolean("recursiveBox", "Search recursively")
}
new AbstractTextBox("folderBox", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)),
new AbstractBoolean("recursiveBox", "Search recursively")
};
optionsUi.Title = "Select music folder:";
return optionsUi;
}
public override IReadOnlyList<Type>? DependentMods => null;
@@ -47,8 +45,8 @@ namespace ZuneModCore.Mods
public override async Task<string?> Apply()
{
// Use user choices from AbstractUI
string folderPath = ((AbstractTextBox)OptionsUI!.Items[0]).Value;
bool recursive = ((AbstractBoolean)OptionsUI.Items[1]).State;
string folderPath = ((AbstractTextBox)OptionsUI![0]).Value;
bool recursive = ((AbstractBoolean)OptionsUI[1]).State;
string errorString = string.Empty;
// Verify that the folder exists
+29 -32
View File
@@ -1,5 +1,4 @@
using OwlCore;
using OwlCore.AbstractUI.Models;
using OwlCore.AbstractUI.Models;
using System;
using System.Collections.Generic;
using System.IO;
@@ -32,39 +31,37 @@ namespace ZuneModCore.Mods
public override AbstractUICollection? GetDefaultOptionsUI()
{
return new(nameof(FeaturesOverrideMod))
AbstractUICollection optionsUi = new(nameof(FeaturesOverrideMod))
{
Title = string.Empty,
Items = new List<AbstractUIElement>
new AbstractTextBox("hostBox", string.Empty, "zune.net")
{
new AbstractTextBox("hostBox", string.Empty, "zune.net")
Title = "Host",
TooltipText = "The host where the replacement servers are located. Must be the same length as \"zune.net\"."
},
new AbstractDataList("hostsTest", new List<AbstractUIMetadata>()
{
Title = "Host",
TooltipText = "The host where the replacement servers are located. Must be the same length as \"zune.net\"."
},
new AbstractDataList("hostsTest", new List<AbstractUIMetadata>()
{
GetWebserviceAvailabilityUI("Main website", "www"),
GetWebserviceAvailabilityUI("Social website", "social"),
GetWebserviceAvailabilityUI("Catalog", "catalog"),
GetWebserviceAvailabilityUI("Image catalog", "image.catalog"),
GetWebserviceAvailabilityUI("Social", "socialapi"),
GetWebserviceAvailabilityUI("Social [Comments]", "comments"),
GetWebserviceAvailabilityUI("Social [Inbox]", "inbox"),
GetWebserviceAvailabilityUI("Commerce [Sign in]", "commerce"),
GetWebserviceAvailabilityUI("Mix", "mix"),
GetWebserviceAvailabilityUI("Resources [Firmware]", "resources"),
GetWebserviceAvailabilityUI("Statistics", "stats"),
}
)
{
Title = "Availability",
Subtitle = "Tests availability of each known web service on the new host.",
IsUserEditingEnabled = false,
PreferredDisplayMode = AbstractDataListPreferredDisplayMode.Grid,
GetWebserviceAvailabilityUI("Main website", "www"),
GetWebserviceAvailabilityUI("Social website", "social"),
GetWebserviceAvailabilityUI("Catalog", "catalog"),
GetWebserviceAvailabilityUI("Image catalog", "image.catalog"),
GetWebserviceAvailabilityUI("Social", "socialapi"),
GetWebserviceAvailabilityUI("Social [Comments]", "comments"),
GetWebserviceAvailabilityUI("Social [Inbox]", "inbox"),
GetWebserviceAvailabilityUI("Commerce [Sign in]", "commerce"),
GetWebserviceAvailabilityUI("Mix", "mix"),
GetWebserviceAvailabilityUI("Resources [Firmware]", "resources"),
GetWebserviceAvailabilityUI("Statistics", "stats"),
}
)
{
Title = "Availability",
Subtitle = "Tests availability of each known web service on the new host.",
IsUserEditingEnabled = false,
PreferredDisplayMode = AbstractDataListPreferredDisplayMode.Grid,
}
};
optionsUi.Title = string.Empty;
return optionsUi;
}
private static AbstractUIMetadata GetWebserviceAvailabilityUI(string name, string subDomain)
@@ -80,7 +77,7 @@ namespace ZuneModCore.Mods
public override Task Init()
{
AbstractTextBox newHostBox = (AbstractTextBox)OptionsUI!.Items[0];
AbstractTextBox newHostBox = (AbstractTextBox)OptionsUI![0];
newHostBox.ValueChanged += OnHostChanged;
newHostBox.Value = "zunes.me";
@@ -120,7 +117,7 @@ namespace ZuneModCore.Mods
// Get and validate replacement host
string oldHost = "zune.net";
string newHost = ((AbstractTextBox)OptionsUI!.Items[0]).Value;
string newHost = ((AbstractTextBox)OptionsUI![0]).Value;
if (newHost.Length != oldHost.Length)
{
return $"The new host (\"{newHost}\") must have the same length as \"{oldHost}\".";
@@ -225,7 +222,7 @@ namespace ZuneModCore.Mods
async void OnHostChanged(object? sender, string newHost)
{
AbstractDataList list = (AbstractDataList)OptionsUI!.Items[1];
AbstractDataList list = (AbstractDataList)OptionsUI![1];
// Reset all statuses
foreach (AbstractUIMetadata metadata in list.Items)
+5 -4
View File
@@ -10,11 +10,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="OwlCore" Version="0.0.43" />
<PackageReference Include="OwlCore" Version="0.4.1" />
<PackageReference Include="OwlCore.AbstractUI" Version="0.0.0" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageReference Include="TagLibSharp" Version="2.2.0" />
<PackageReference Include="Vanara.PInvoke.Kernel32" Version="3.4.6" />
<PackageReference Include="Vanara.PInvoke.Security" Version="3.4.6" />
<PackageReference Include="TagLibSharp" Version="2.3.0" />
<PackageReference Include="Vanara.PInvoke.Kernel32" Version="3.4.17" />
<PackageReference Include="Vanara.PInvoke.Security" Version="3.4.17" />
<PackageReference Include="Vestris.ResourceLib" Version="2.1.0" />
</ItemGroup>