mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Created new ModList gallery
This commit is contained in:
parent
ba8e423f26
commit
fa26d25e21
116
Wabbajack/Views/ModListGalleryView.xaml
Normal file
116
Wabbajack/Views/ModListGalleryView.xaml
Normal file
@ -0,0 +1,116 @@
|
||||
<UserControl x:Class="Wabbajack.Views.ModListGalleryView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
||||
xmlns:local="clr-namespace:Wabbajack"
|
||||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<Color x:Key="TextBackgroundFill">#92000000</Color>
|
||||
<SolidColorBrush x:Key="TextBackgroundFillBrush" Color="{StaticResource TextBackgroundFill}" />
|
||||
<Style x:Key="TileStyle" TargetType="{x:Type mahapps:Tile}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
<Style x:Key="BackgroundBlurStyle" TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Background" Value="{StaticResource TextBackgroundFillBrush}"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" Background="{x:Null}">
|
||||
<ScrollViewer.Resources>
|
||||
<system:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">8</system:Double>
|
||||
</ScrollViewer.Resources>
|
||||
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Margin="8,0,8,0">
|
||||
<!--<Image Name="Banner"/>
|
||||
<Button Width="60" HorizontalAlignment="Left" Command="{Binding BackCommand}"
|
||||
Margin="4,0,0,8">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<iconPacks:PackIconMaterial Width="20" Height="20" Kind="ArrowLeft" />
|
||||
<TextBlock FontSize="15" Text="Back" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Button>-->
|
||||
<WrapPanel HorizontalAlignment="Center">
|
||||
<ItemsControl
|
||||
Name="ItemsControlElement"
|
||||
Visibility="{Binding ItemsControlVisibility}"
|
||||
ItemsSource="{Binding ModLists}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<mahapps:Tile
|
||||
Style="{StaticResource TileStyle}"
|
||||
Click="Tile_OnClick"
|
||||
Width="590"
|
||||
Height="Auto">
|
||||
<Grid
|
||||
Width="590"
|
||||
Background="#222222">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Width="590"
|
||||
Height="Auto">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Viewbox Grid.Row="0" Stretch="Uniform">
|
||||
<Image Source="{Binding Links.ImageUri}"/>
|
||||
</Viewbox>
|
||||
<TextBlock FontSize="30" TextWrapping="Wrap" Text="{Binding Title}"
|
||||
Style="{StaticResource BackgroundBlurStyle}" Padding="4,0,4,0"
|
||||
Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
||||
FontWeight="Bold"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" Margin="4,0,2,4">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontSize="15" FontStyle="Italic" Grid.Row="0" TextWrapping="Wrap" Text="{Binding Game}"/>
|
||||
<TextBlock FontSize="15" Grid.Row="1" TextWrapping="Wrap" Text="{Binding Description}"/>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,0,4,4" HorizontalAlignment="Right">
|
||||
<Button Click="Info_OnClick" Margin="0,0,4,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--<TextBlock FontSize="13" TextWrapping="Wrap" Text="More Info" Margin="4,0,4,0"/>-->
|
||||
<iconPacks:PackIconMaterial Width="16" Height="16" Kind="InformationOutline" Margin="0,0,4,0"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Click="Download_OnClick">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--<TextBlock FontSize="13" TextWrapping="Wrap" Text="Download" Margin="4,0,4,0"/>-->
|
||||
<iconPacks:PackIconMaterial Width="16" Height="16" Kind="Download" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</mahapps:Tile>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</WrapPanel>
|
||||
<!--<Button Width="60" HorizontalAlignment="Left" Command="{Binding BackCommand}"
|
||||
Margin="4,0,12,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<iconPacks:PackIconMaterial Width="20" Height="20" Kind="ArrowLeft" />
|
||||
<TextBlock FontSize="15" Text="Back" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Button>-->
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
52
Wabbajack/Views/ModListGalleryView.xaml.cs
Normal file
52
Wabbajack/Views/ModListGalleryView.xaml.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using MahApps.Metro.Controls;
|
||||
using Wabbajack.Lib.ModListRegistry;
|
||||
|
||||
namespace Wabbajack.Views
|
||||
{
|
||||
public partial class ModListGalleryView : UserControl
|
||||
{
|
||||
public ModListGalleryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Info_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(sender is Button b)) return;
|
||||
if (!(b.DataContext is ModlistMetadata mm)) return;
|
||||
var link = mm.Links.MachineURL;
|
||||
Process.Start($"https://www.wabbajack.org/modlist/{link}");
|
||||
}
|
||||
|
||||
public void Download_OnClick(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
/* unsure about this since the downloader changed
|
||||
|
||||
|
||||
|
||||
if (!(sender is Button b)) return;
|
||||
if (!(b.DataContext is ModlistMetadata mm)) return;
|
||||
var link = mm.Links.Download;
|
||||
|
||||
if (!Directory.Exists(Consts.ModListDownloadFolder))
|
||||
Directory.CreateDirectory(Consts.ModListDownloadFolder);
|
||||
var dest = Path.Combine(Consts.ModListDownloadFolder, mm.Links.MachineURL + ExtensionManager.Extension);
|
||||
|
||||
var downloadWindow = new DownloadWindow(link, mm.Title, mm.,dest);
|
||||
downloadWindow.ShowDialog();*/
|
||||
}
|
||||
|
||||
private void Tile_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(sender is Tile t)) return;
|
||||
if (!t.IsFocused) return;
|
||||
if (!t.IsMouseOver) return;
|
||||
if (!(t.DataContext is ModlistMetadata mm)) return;
|
||||
var link = mm.Links.MachineURL;
|
||||
Process.Start($"https://www.wabbajack.org/modlist/{link}");
|
||||
}
|
||||
}
|
||||
}
|
@ -191,6 +191,9 @@
|
||||
<Compile Include="Converters\LeftMarginMultiplierConverter.cs" />
|
||||
<Compile Include="Util\TreeViewItemExtensions.cs" />
|
||||
<Compile Include="View Models\SlideShow.cs" />
|
||||
<Compile Include="Views\ModListGalleryView.xaml.cs">
|
||||
<DependentUpon>ModListGalleryView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\TextViewer.xaml.cs">
|
||||
<DependentUpon>TextViewer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -233,6 +236,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\ModListGalleryView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\TextViewer.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
Loading…
Reference in New Issue
Block a user