mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Updated packages
This commit is contained in:
@@ -4,7 +4,7 @@ using OwlCore.AbstractUI.Models;
|
|||||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A control that displays an <see cref="AbstractBooleanUIElement"/>.
|
/// A control that displays an <see cref="AbstractBoolean"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class AbstractBooleanPresenter : Control
|
public partial class AbstractBooleanPresenter : Control
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The data template used to display an <see cref="AbstractUIElementGroup"/>.
|
/// The data template used to display an <see cref="AbstractUICollection"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DataTemplate? ElementGroupTemplate { get; set; }
|
public DataTemplate? ElementGroupTemplate { get; set; }
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
public DataTemplate ButtonTemplate { get; set; }
|
public DataTemplate ButtonTemplate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The data template used to display an <see cref="AbstractBooleanUIElement"/>.
|
/// The data template used to display an <see cref="AbstractBoolean"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DataTemplate BooleanTemplate { get; set; }
|
public DataTemplate BooleanTemplate { get; set; }
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||||
{
|
{
|
||||||
if (!new Themes.AbstractUIGroupPresenterStyle().TryGetValue("DefaultAbstractUIElementGroupTemplate", out var elementGroupTemplate))
|
if (!new Themes.AbstractUIGroupPresenterStyle().TryGetValue("DefaultAbstractUICollectionTemplate", out var elementGroupTemplate))
|
||||||
ElementGroupTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(elementGroupTemplate));
|
ElementGroupTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(elementGroupTemplate));
|
||||||
|
|
||||||
ElementGroupTemplate = (DataTemplate)elementGroupTemplate;
|
ElementGroupTemplate = (DataTemplate)elementGroupTemplate;
|
||||||
@@ -103,10 +103,10 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
AbstractTextBoxViewModel => TextBoxTemplate,
|
AbstractTextBoxViewModel => TextBoxTemplate,
|
||||||
AbstractDataListViewModel => DataListTemplate,
|
AbstractDataListViewModel => DataListTemplate,
|
||||||
AbstractButtonViewModel => ButtonTemplate,
|
AbstractButtonViewModel => ButtonTemplate,
|
||||||
AbstractMultiChoiceUIElementViewModel => MultiChoiceTemplate,
|
AbstractMultiChoiceViewModel => MultiChoiceTemplate,
|
||||||
AbstractBooleanViewModel => BooleanTemplate,
|
AbstractBooleanViewModel => BooleanTemplate,
|
||||||
AbstractProgressUIElementViewModel => ProgressTemplate,
|
AbstractProgressIndicatorViewModel => ProgressTemplate,
|
||||||
AbstractUIElementGroupViewModel => ElementGroupTemplate,
|
AbstractUICollectionViewModel => ElementGroupTemplate,
|
||||||
_ => null!
|
_ => null!
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
/// Backing property for <see cref="ViewModel"/>.
|
/// Backing property for <see cref="ViewModel"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ViewModelProperty =
|
public static readonly DependencyProperty ViewModelProperty =
|
||||||
DependencyProperty.Register(nameof(ViewModel), typeof(AbstractUIElementGroupViewModel), typeof(AbstractUIGroupPresenter), new PropertyMetadata(null, (d, e) => ((AbstractUIGroupPresenter)d).OnViewModelChanged()));
|
DependencyProperty.Register(nameof(ViewModel), typeof(AbstractUICollectionViewModel), typeof(AbstractUIGroupPresenter), new PropertyMetadata(null, (d, e) => ((AbstractUIGroupPresenter)d).OnViewModelChanged()));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Backing property for <see cref="TemplateSelector"/>.
|
/// Backing property for <see cref="TemplateSelector"/>.
|
||||||
@@ -27,9 +27,9 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ViewModel for this UserControl.
|
/// The ViewModel for this UserControl.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AbstractUIElementGroupViewModel? ViewModel
|
public AbstractUICollectionViewModel? ViewModel
|
||||||
{
|
{
|
||||||
get => (AbstractUIElementGroupViewModel)GetValue(ViewModelProperty);
|
get => (AbstractUICollectionViewModel)GetValue(ViewModelProperty);
|
||||||
set => SetValue(ViewModelProperty, value);
|
set => SetValue(ViewModelProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,10 +71,10 @@ namespace OwlCore.Wpf.AbstractUI.Controls
|
|||||||
|
|
||||||
_dataContextBeingSet = true;
|
_dataContextBeingSet = true;
|
||||||
|
|
||||||
if (DataContext is AbstractUIElementGroup elementGroup)
|
if (DataContext is AbstractUICollection elementGroup)
|
||||||
ViewModel = new AbstractUIElementGroupViewModel(elementGroup);
|
ViewModel = new AbstractUICollectionViewModel(elementGroup);
|
||||||
|
|
||||||
if (DataContext is AbstractUIElementGroupViewModel elementGroupViewModel)
|
if (DataContext is AbstractUICollectionViewModel elementGroupViewModel)
|
||||||
ViewModel = elementGroupViewModel;
|
ViewModel = elementGroupViewModel;
|
||||||
|
|
||||||
_dataContextBeingSet = false;
|
_dataContextBeingSet = false;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<CheckBox ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
|
<CheckBox ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
|
||||||
Content="{Binding Label, Mode=OneWay}"
|
Content="{Binding Label, Mode=OneWay}"
|
||||||
IsChecked="{Binding IsToggled, Mode=TwoWay}">
|
IsChecked="{Binding IsToggled, Mode=OneWay}">
|
||||||
<behaviors:Interaction.Triggers>
|
<behaviors:Interaction.Triggers>
|
||||||
<behaviors:EventTrigger EventName="Checked">
|
<behaviors:EventTrigger EventName="Checked">
|
||||||
<behaviors:InvokeCommandAction Command="{Binding ToggledCommand}" />
|
<behaviors:InvokeCommandAction Command="{Binding ToggledCommand}" />
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace OwlCore.Wpf.AbstractUI.Themes
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||||
{
|
{
|
||||||
if (item is AbstractMultiChoiceUIElementViewModel viewModel)
|
if (item is AbstractMultiChoiceViewModel viewModel)
|
||||||
{
|
{
|
||||||
return viewModel.PreferredDisplayMode switch
|
return viewModel.PreferredDisplayMode switch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<DataTemplate x:Key="DefaultAbstractProgressUIElementTemplate" DataType="abstractUI:AbstractProgressUIElementViewModel">
|
<DataTemplate x:Key="DefaultAbstractProgressUIElementTemplate" DataType="abstractUI:AbstractProgressIndicatorViewModel">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUITitleFontSize}" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" />
|
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUITitleFontSize}" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" />
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="controls:AbstractButtonPresenter">
|
<ControlTemplate TargetType="controls:AbstractButtonPresenter">
|
||||||
<ContentControl ContentTemplate="{StaticResource DefaultAbstractBooleanUIElementTemplate}"
|
<ContentControl ContentTemplate="{StaticResource DefaultAbstractBooleanTemplate}"
|
||||||
Content="{Binding}"
|
Content="{Binding}"
|
||||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
@@ -40,13 +40,13 @@
|
|||||||
</controls:AbstractUIGroupItemTemplateSelector.DataListTemplate>
|
</controls:AbstractUIGroupItemTemplateSelector.DataListTemplate>
|
||||||
|
|
||||||
<controls:AbstractUIGroupItemTemplateSelector.MultiChoiceTemplate>
|
<controls:AbstractUIGroupItemTemplateSelector.MultiChoiceTemplate>
|
||||||
<DataTemplate DataType="abstractUIVm:AbstractMultiChoiceUIElementViewModel">
|
<DataTemplate DataType="abstractUIVm:AbstractMultiChoiceViewModel">
|
||||||
<controls:AbstractMultiChoicePresenter DataContext="{Binding}" />
|
<controls:AbstractMultiChoicePresenter DataContext="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</controls:AbstractUIGroupItemTemplateSelector.MultiChoiceTemplate>
|
</controls:AbstractUIGroupItemTemplateSelector.MultiChoiceTemplate>
|
||||||
|
|
||||||
<controls:AbstractUIGroupItemTemplateSelector.ProgressTemplate>
|
<controls:AbstractUIGroupItemTemplateSelector.ProgressTemplate>
|
||||||
<DataTemplate DataType="abstractUIVm:AbstractProgressUIElementViewModel">
|
<DataTemplate DataType="abstractUIVm:AbstractProgressIndicatorViewModel">
|
||||||
<controls:AbstractProgessUIElementPresenter DataContext="{Binding}" />
|
<controls:AbstractProgessUIElementPresenter DataContext="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</controls:AbstractUIGroupItemTemplateSelector.ProgressTemplate>
|
</controls:AbstractUIGroupItemTemplateSelector.ProgressTemplate>
|
||||||
@@ -58,13 +58,13 @@
|
|||||||
</controls:AbstractUIGroupItemTemplateSelector.TextBoxTemplate>
|
</controls:AbstractUIGroupItemTemplateSelector.TextBoxTemplate>
|
||||||
|
|
||||||
<controls:AbstractUIGroupItemTemplateSelector.ElementGroupTemplate>
|
<controls:AbstractUIGroupItemTemplateSelector.ElementGroupTemplate>
|
||||||
<DataTemplate DataType="abstractUIVm:AbstractUIElementGroupViewModel">
|
<DataTemplate DataType="abstractUIVm:AbstractUICollectionViewModel">
|
||||||
<controls:AbstractUIGroupPresenter DataContext="{Binding}" />
|
<controls:AbstractUIGroupPresenter DataContext="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</controls:AbstractUIGroupItemTemplateSelector.ElementGroupTemplate>
|
</controls:AbstractUIGroupItemTemplateSelector.ElementGroupTemplate>
|
||||||
</controls:AbstractUIGroupItemTemplateSelector>
|
</controls:AbstractUIGroupItemTemplateSelector>
|
||||||
|
|
||||||
<DataTemplate x:Key="DefaultAbstractUIElementGroupTemplate" DataType="abstractUIVm:AbstractUIElementGroupViewModel">
|
<DataTemplate x:Key="DefaultAbstractUICollectionTemplate" DataType="abstractUIVm:AbstractUICollectionViewModel">
|
||||||
<StackPanel Margin="10,20">
|
<StackPanel Margin="10,20">
|
||||||
|
|
||||||
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="30" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
|
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="30" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="controls:AbstractUIGroupPresenter">
|
<ControlTemplate TargetType="controls:AbstractUIGroupPresenter">
|
||||||
<ContentControl ContentTemplate="{StaticResource DefaultAbstractUIElementGroupTemplate}"
|
<ContentControl ContentTemplate="{StaticResource DefaultAbstractUICollectionTemplate}"
|
||||||
Content="{TemplateBinding ViewModel}"
|
Content="{TemplateBinding ViewModel}"
|
||||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CommunityToolkit.Diagnostics" Version="7.0.3" />
|
<PackageReference Include="CommunityToolkit.Diagnostics" Version="7.0.3" />
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
|
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.37" />
|
||||||
<PackageReference Include="OwlCore" Version="0.0.21" />
|
<PackageReference Include="OwlCore" Version="0.0.31" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
+3
-3
@@ -31,7 +31,7 @@ namespace ZuneModCore
|
|||||||
|
|
||||||
public abstract string Author { get; }
|
public abstract string Author { get; }
|
||||||
|
|
||||||
public virtual AbstractUIElementGroup? GetDefaultOptionsUI() => null;
|
public virtual AbstractUICollection? GetDefaultOptionsUI() => null;
|
||||||
|
|
||||||
public virtual Task Init() => Task.CompletedTask;
|
public virtual Task Init() => Task.CompletedTask;
|
||||||
|
|
||||||
@@ -39,8 +39,8 @@ namespace ZuneModCore
|
|||||||
|
|
||||||
public abstract Task<string?> Reset();
|
public abstract Task<string?> Reset();
|
||||||
|
|
||||||
private AbstractUIElementGroup? _OptionsUI;
|
private AbstractUICollection? _OptionsUI;
|
||||||
public AbstractUIElementGroup? OptionsUI
|
public AbstractUICollection? OptionsUI
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ namespace ZuneModCore.Mods
|
|||||||
|
|
||||||
public override string Author => "Joshua \"Yoshi\" Askharoun";
|
public override string Author => "Joshua \"Yoshi\" Askharoun";
|
||||||
|
|
||||||
public override AbstractUIElementGroup? GetDefaultOptionsUI()
|
public override AbstractUICollection? GetDefaultOptionsUI()
|
||||||
{
|
{
|
||||||
return new(nameof(BackgroundImageMod))
|
return new(nameof(BackgroundImageMod))
|
||||||
{
|
{
|
||||||
Title = "Select background image:",
|
Title = "Select background image:",
|
||||||
Items =
|
Items = new List<AbstractUIElement>
|
||||||
{
|
{
|
||||||
new AbstractTextBox("fileBox", Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)),
|
new AbstractTextBox("fileBox", Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,39 +19,39 @@ namespace ZuneModCore.Mods
|
|||||||
|
|
||||||
public override string Author => "Rafael Rivera";
|
public override string Author => "Rafael Rivera";
|
||||||
|
|
||||||
public override AbstractUIElementGroup? GetDefaultOptionsUI()
|
public override AbstractUICollection? GetDefaultOptionsUI()
|
||||||
{
|
{
|
||||||
return new(nameof(FeaturesOverrideMod))
|
return new(nameof(FeaturesOverrideMod))
|
||||||
{
|
{
|
||||||
Title = "Select features:",
|
Title = "Select features:",
|
||||||
Items =
|
Items = new List<AbstractUIElement>
|
||||||
{
|
{
|
||||||
// We don't know what some of these overrides do exactly, so hide them from the user.
|
// 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
|
// The ID is the name of the registry key, the label is the display name
|
||||||
|
|
||||||
new AbstractBooleanUIElement("Apps", "Apps"),
|
new AbstractBoolean("Apps", "Apps"),
|
||||||
new AbstractBooleanUIElement("Art", "Art"),
|
new AbstractBoolean("Art", "Art"),
|
||||||
new AbstractBooleanUIElement("Channels", "Channels"),
|
new AbstractBoolean("Channels", "Channels"),
|
||||||
new AbstractBooleanUIElement("FirstLaunchIntroVideo", "First Launch Intro Video"),
|
new AbstractBoolean("FirstLaunchIntroVideo", "First Launch Intro Video"),
|
||||||
new AbstractBooleanUIElement("Games", "Games"),
|
new AbstractBoolean("Games", "Games"),
|
||||||
new AbstractBooleanUIElement("Marketplace", "Marketplace"),
|
new AbstractBoolean("Marketplace", "Marketplace"),
|
||||||
new AbstractBooleanUIElement("MBRPreview", "[Marketplace] Media Preview"),
|
new AbstractBoolean("MBRPreview", "[Marketplace] Media Preview"),
|
||||||
new AbstractBooleanUIElement("MBRPurchase", "[Marketplace] Media Purchase"),
|
new AbstractBoolean("MBRPurchase", "[Marketplace] Media Purchase"),
|
||||||
new AbstractBooleanUIElement("MBRRental", "[Marketplace] Media Rental"),
|
new AbstractBoolean("MBRRental", "[Marketplace] Media Rental"),
|
||||||
new AbstractBooleanUIElement("Music", "Music"),
|
new AbstractBoolean("Music", "Music"),
|
||||||
new AbstractBooleanUIElement("MusicVideos", "Music Videos"),
|
new AbstractBoolean("MusicVideos", "Music Videos"),
|
||||||
new AbstractBooleanUIElement("Nowplaying", "Now Playing"),
|
new AbstractBoolean("Nowplaying", "Now Playing"),
|
||||||
new AbstractBooleanUIElement("NowplayingArt", "Now Playing Art"),
|
new AbstractBoolean("NowplayingArt", "Now Playing Art"),
|
||||||
new AbstractBooleanUIElement("Picks", "Picks"),
|
new AbstractBoolean("Picks", "Picks"),
|
||||||
new AbstractBooleanUIElement("Podcasts", "Podcasts"),
|
new AbstractBoolean("Podcasts", "Podcasts"),
|
||||||
new AbstractBooleanUIElement("QuickMixLocal", "Quick Mix (Local)"),
|
new AbstractBoolean("QuickMixLocal", "Quick Mix (Local)"),
|
||||||
new AbstractBooleanUIElement("QuickMixZMP", "Quick Mix (ZMP)"),
|
new AbstractBoolean("QuickMixZMP", "Quick Mix (ZMP)"),
|
||||||
new AbstractBooleanUIElement("Quickplay", "Quickplay"),
|
new AbstractBoolean("Quickplay", "Quickplay"),
|
||||||
new AbstractBooleanUIElement("Sign In Available", "Sign In"),
|
new AbstractBoolean("Sign In Available", "Sign In"),
|
||||||
new AbstractBooleanUIElement("Social", "Social"),
|
new AbstractBoolean("Social", "Social"),
|
||||||
new AbstractBooleanUIElement("SocialMarketplace", "Social Marketplace"),
|
new AbstractBoolean("SocialMarketplace", "Social Marketplace"),
|
||||||
new AbstractBooleanUIElement("SubscriptionFreeTracks", "Subscription Free Tracks"),
|
new AbstractBoolean("SubscriptionFreeTracks", "Subscription Free Tracks"),
|
||||||
new AbstractBooleanUIElement("Videos", "Videos"),
|
new AbstractBoolean("Videos", "Videos"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -62,10 +62,10 @@ namespace ZuneModCore.Mods
|
|||||||
{
|
{
|
||||||
foreach (AbstractUIElement uiElem in OptionsUI.Items)
|
foreach (AbstractUIElement uiElem in OptionsUI.Items)
|
||||||
{
|
{
|
||||||
if (uiElem is AbstractBooleanUIElement boolElem)
|
if (uiElem is AbstractBoolean boolElem)
|
||||||
{
|
{
|
||||||
bool? featureOverride = GetFeatureOverride(boolElem.Id);
|
bool? featureOverride = GetFeatureOverride(boolElem.Id);
|
||||||
boolElem.ChangeState(featureOverride ?? false);
|
boolElem.State = featureOverride ?? false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,9 +77,9 @@ namespace ZuneModCore.Mods
|
|||||||
public async Task<string?> Apply(bool applyAll = false)
|
public async Task<string?> Apply(bool applyAll = false)
|
||||||
{
|
{
|
||||||
// Use user choices from AbstractUI
|
// Use user choices from AbstractUI
|
||||||
foreach (AbstractUIElement uiElem in OptionsUI.Items)
|
foreach (AbstractUIElement uiElem in OptionsUI!.Items)
|
||||||
{
|
{
|
||||||
if (uiElem is AbstractBooleanUIElement boolElem && (boolElem.State || applyAll))
|
if (uiElem is AbstractBoolean boolElem && (boolElem.State || applyAll))
|
||||||
{
|
{
|
||||||
bool isSuccess = SetFeatureOverride(boolElem.Id, true);
|
bool isSuccess = SetFeatureOverride(boolElem.Id, true);
|
||||||
if (!isSuccess)
|
if (!isSuccess)
|
||||||
@@ -103,8 +103,8 @@ namespace ZuneModCore.Mods
|
|||||||
|
|
||||||
public override async Task<string?> Reset()
|
public override async Task<string?> Reset()
|
||||||
{
|
{
|
||||||
foreach (AbstractUIElement uiElem in OptionsUI.Items)
|
foreach (AbstractUIElement uiElem in OptionsUI!.Items)
|
||||||
if (uiElem is AbstractBooleanUIElement boolElem)
|
if (uiElem is AbstractBoolean boolElem)
|
||||||
ResetFeatureOverride(boolElem.Id);
|
ResetFeatureOverride(boolElem.Id);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -24,15 +24,15 @@ namespace ZuneModCore.Mods
|
|||||||
|
|
||||||
public override string Author => "Joshua \"Yoshi\" Askharoun";
|
public override string Author => "Joshua \"Yoshi\" Askharoun";
|
||||||
|
|
||||||
public override AbstractUIElementGroup? GetDefaultOptionsUI()
|
public override AbstractUICollection? GetDefaultOptionsUI()
|
||||||
{
|
{
|
||||||
return new(nameof(MbidLocatorMod))
|
return new(nameof(MbidLocatorMod))
|
||||||
{
|
{
|
||||||
Title = "Select music folder:",
|
Title = "Select music folder:",
|
||||||
Items =
|
Items = new List<AbstractUIElement>
|
||||||
{
|
{
|
||||||
new AbstractTextBox("folderBox", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)),
|
new AbstractTextBox("folderBox", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)),
|
||||||
new AbstractBooleanUIElement("recursiveBox", "Search recursively")
|
new AbstractBoolean("recursiveBox", "Search recursively")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -42,8 +42,8 @@ namespace ZuneModCore.Mods
|
|||||||
public override async Task<string?> Apply()
|
public override async Task<string?> Apply()
|
||||||
{
|
{
|
||||||
// Use user choices from AbstractUI
|
// Use user choices from AbstractUI
|
||||||
string folderPath = ((AbstractTextBox)OptionsUI.Items[0]).Value;
|
string folderPath = ((AbstractTextBox)OptionsUI!.Items[0]).Value;
|
||||||
bool recursive = ((AbstractBooleanUIElement)OptionsUI.Items[1]).State;
|
bool recursive = ((AbstractBoolean)OptionsUI.Items[1]).State;
|
||||||
string errorString = string.Empty;
|
string errorString = string.Empty;
|
||||||
|
|
||||||
// Verify that the folder exists
|
// Verify that the folder exists
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ namespace ZuneModCore.Mods
|
|||||||
|
|
||||||
public override string Author => "Joshua \"Yoshi\" Askharoun";
|
public override string Author => "Joshua \"Yoshi\" Askharoun";
|
||||||
|
|
||||||
public override AbstractUIElementGroup? GetDefaultOptionsUI()
|
public override AbstractUICollection? GetDefaultOptionsUI()
|
||||||
{
|
{
|
||||||
return new(nameof(FeaturesOverrideMod))
|
return new(nameof(FeaturesOverrideMod))
|
||||||
{
|
{
|
||||||
Title = string.Empty,
|
Title = string.Empty,
|
||||||
Items =
|
Items = new List<AbstractUIElement>
|
||||||
{
|
{
|
||||||
new AbstractTextBox("hostBox", "zunes.me", "zune.net")
|
new AbstractTextBox("hostBox", "zunes.me", "zune.net")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
||||||
<PackageReference Include="OwlCore" Version="0.0.21" />
|
<PackageReference Include="OwlCore" Version="0.0.31" />
|
||||||
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
|
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
|
||||||
<PackageReference Include="TagLibSharp" Version="2.2.0" />
|
<PackageReference Include="TagLibSharp" Version="2.2.0" />
|
||||||
<PackageReference Include="Vestris.ResourceLib" Version="2.1.0" />
|
<PackageReference Include="Vestris.ResourceLib" Version="2.1.0" />
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ namespace ZuneModdingHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class AbstractUIGroupDialog : MetroWindow
|
public partial class AbstractUIGroupDialog : MetroWindow
|
||||||
{
|
{
|
||||||
public AbstractUIGroupDialog(AbstractUIElementGroupViewModel viewModel)
|
public AbstractUIGroupDialog(AbstractUICollectionViewModel viewModel)
|
||||||
{
|
{
|
||||||
ViewModel = viewModel;
|
ViewModel = viewModel;
|
||||||
DataContext = ViewModel;
|
DataContext = ViewModel;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
public AbstractUIGroupDialog(AbstractUIElementGroup group) : this(new AbstractUIElementGroupViewModel(group))
|
public AbstractUIGroupDialog(AbstractUICollection group) : this(new AbstractUICollectionViewModel(group))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -32,12 +32,12 @@ namespace ZuneModdingHelper
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractUIElementGroupViewModel ViewModel
|
public AbstractUICollectionViewModel ViewModel
|
||||||
{
|
{
|
||||||
get => (AbstractUIElementGroupViewModel)GetValue(ViewModelProperty);
|
get => (AbstractUICollectionViewModel)GetValue(ViewModelProperty);
|
||||||
set => SetValue(ViewModelProperty, value);
|
set => SetValue(ViewModelProperty, value);
|
||||||
}
|
}
|
||||||
public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(
|
||||||
nameof(ViewModel), typeof(AbstractUIElementGroupViewModel), typeof(AbstractUIGroupDialog));
|
nameof(ViewModel), typeof(AbstractUICollectionViewModel), typeof(AbstractUIGroupDialog));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace ZuneModdingHelper
|
|||||||
await progDialog.CloseAsync();
|
await progDialog.CloseAsync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mod.OptionsUI = (AbstractUIElementGroup)optionsDialog.ViewModel.Model;
|
mod.OptionsUI = (AbstractUICollection)optionsDialog.ViewModel.Model;
|
||||||
}
|
}
|
||||||
progDialog.SetProgress(++numCompleted);
|
progDialog.SetProgress(++numCompleted);
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ namespace ZuneModdingHelper
|
|||||||
//if (mod.OptionsUI != null)
|
//if (mod.OptionsUI != null)
|
||||||
//{
|
//{
|
||||||
// var optionsDialog = new AbstractUIGroupDialog();
|
// var optionsDialog = new AbstractUIGroupDialog();
|
||||||
// optionsDialog.OptionsUIPresenter.ViewModel = new AbstractUIElementGroupViewModel(mod.OptionsUI);
|
// optionsDialog.OptionsUIPresenter.ViewModel = new AbstractUICollectionViewModel(mod.OptionsUI);
|
||||||
// optionsDialog.ShowDialog();
|
// optionsDialog.ShowDialog();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Flurl.Http" Version="3.2.0" />
|
<PackageReference Include="Flurl.Http" Version="3.2.0" />
|
||||||
<PackageReference Include="MahApps.Metro" Version="2.4.7" />
|
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
|
||||||
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.3.0" />
|
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.4.0" />
|
||||||
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.3.0" />
|
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" />
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
|
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.37" />
|
||||||
<PackageReference Include="OwlCore" Version="0.0.21" />
|
<PackageReference Include="OwlCore" Version="0.0.31" />
|
||||||
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
|
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user