From fa26d25e210a50a17e0404d31785b6d0bc44ec33 Mon Sep 17 00:00:00 2001 From: erri120 Date: Sat, 9 Nov 2019 14:30:36 +0100 Subject: [PATCH] Created new ModList gallery --- Wabbajack/Views/ModListGalleryView.xaml | 116 +++++++++++++++++++++ Wabbajack/Views/ModListGalleryView.xaml.cs | 52 +++++++++ Wabbajack/Wabbajack.csproj | 7 ++ 3 files changed, 175 insertions(+) create mode 100644 Wabbajack/Views/ModListGalleryView.xaml create mode 100644 Wabbajack/Views/ModListGalleryView.xaml.cs diff --git a/Wabbajack/Views/ModListGalleryView.xaml b/Wabbajack/Views/ModListGalleryView.xaml new file mode 100644 index 00000000..e27e7e25 --- /dev/null +++ b/Wabbajack/Views/ModListGalleryView.xaml @@ -0,0 +1,116 @@ + + + #92000000 + + + + + + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wabbajack/Views/ModListGalleryView.xaml.cs b/Wabbajack/Views/ModListGalleryView.xaml.cs new file mode 100644 index 00000000..59a19b97 --- /dev/null +++ b/Wabbajack/Views/ModListGalleryView.xaml.cs @@ -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}"); + } + } +} diff --git a/Wabbajack/Wabbajack.csproj b/Wabbajack/Wabbajack.csproj index c65221a0..fa421632 100644 --- a/Wabbajack/Wabbajack.csproj +++ b/Wabbajack/Wabbajack.csproj @@ -191,6 +191,9 @@ + + ModListGalleryView.xaml + TextViewer.xaml @@ -233,6 +236,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer