mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
added modlist tags component
This commit is contained in:
parent
906da5bc84
commit
05886b574f
@ -29,6 +29,9 @@ namespace Wabbajack.Lib.ModListRegistry
|
|||||||
[JsonProperty("official")]
|
[JsonProperty("official")]
|
||||||
public bool Official { get; set; }
|
public bool Official { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("tags")]
|
||||||
|
public List<string> tags { get; set; } = new List<string>();
|
||||||
|
|
||||||
[JsonProperty("nsfw")]
|
[JsonProperty("nsfw")]
|
||||||
public bool NSFW { get; set; }
|
public bool NSFW { get; set; }
|
||||||
|
|
||||||
|
@ -20,6 +20,17 @@ using Wabbajack.Lib.ModListRegistry;
|
|||||||
|
|
||||||
namespace Wabbajack
|
namespace Wabbajack
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public struct ModListTag
|
||||||
|
{
|
||||||
|
public ModListTag(string name)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; }
|
||||||
|
}
|
||||||
|
|
||||||
public class ModListMetadataVM : ViewModel
|
public class ModListMetadataVM : ViewModel
|
||||||
{
|
{
|
||||||
public ModlistMetadata Metadata { get; }
|
public ModlistMetadata Metadata { get; }
|
||||||
@ -33,6 +44,9 @@ namespace Wabbajack
|
|||||||
|
|
||||||
public AbsolutePath Location { get; }
|
public AbsolutePath Location { get; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public List<ModListTag> ModListTagList { get; private set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public Percent ProgressPercent { get; private set; }
|
public Percent ProgressPercent { get; private set; }
|
||||||
|
|
||||||
@ -59,6 +73,11 @@ namespace Wabbajack
|
|||||||
_parent = parent;
|
_parent = parent;
|
||||||
Metadata = metadata;
|
Metadata = metadata;
|
||||||
Location = Consts.ModListDownloadFolder.Combine(Metadata.Links.MachineURL + (string)Consts.ModListExtension);
|
Location = Consts.ModListDownloadFolder.Combine(Metadata.Links.MachineURL + (string)Consts.ModListExtension);
|
||||||
|
ModListTagList = new List<ModListTag>();
|
||||||
|
Metadata.tags.ForEach(tag =>
|
||||||
|
{
|
||||||
|
ModListTagList.Add(new ModListTag(tag));
|
||||||
|
});
|
||||||
DownloadSizeText = "Download size : " + UIUtils.FormatBytes(Metadata.DownloadMetadata.SizeOfArchives);
|
DownloadSizeText = "Download size : " + UIUtils.FormatBytes(Metadata.DownloadMetadata.SizeOfArchives);
|
||||||
InstallSizeText = "Installation size : " + UIUtils.FormatBytes(Metadata.DownloadMetadata.SizeOfInstalledFiles);
|
InstallSizeText = "Installation size : " + UIUtils.FormatBytes(Metadata.DownloadMetadata.SizeOfInstalledFiles);
|
||||||
IsBroken = metadata.ValidationSummary.HasFailures;
|
IsBroken = metadata.ValidationSummary.HasFailures;
|
||||||
|
@ -146,10 +146,34 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Ellipse.Style>
|
</Ellipse.Style>
|
||||||
</Ellipse>
|
</Ellipse>
|
||||||
|
<ItemsControl ItemsSource="{Binding ModListTagList}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border
|
||||||
|
BorderThickness="1"
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
CornerRadius="7,7,7,7"
|
||||||
|
Opacity="0.90"
|
||||||
|
Background="{StaticResource Analogous1Brush}"
|
||||||
|
Margin="10,5,0,5">
|
||||||
|
<TextBlock
|
||||||
|
Margin="5,5,5,5"
|
||||||
|
FontSize="15"
|
||||||
|
Text="{Binding Name}"/>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
<Label
|
<Label
|
||||||
Content="{Binding DownloadSizeText}"
|
Content="{Binding DownloadSizeText}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,289,0,0"
|
Margin="10,257,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Opacity="0" >
|
Opacity="0" >
|
||||||
<Label.Style>
|
<Label.Style>
|
||||||
@ -184,7 +208,7 @@
|
|||||||
<Label
|
<Label
|
||||||
Content="{Binding InstallSizeText}"
|
Content="{Binding InstallSizeText}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,305,0,0"
|
Margin="10,272,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Opacity="0" >
|
Opacity="0" >
|
||||||
<Label.Style>
|
<Label.Style>
|
||||||
|
Loading…
Reference in New Issue
Block a user