diff --git a/Branding/PNGs/Logo_Dark.png b/Branding/PNGs/Logo_Dark.png deleted file mode 100644 index d780a1ee..00000000 Binary files a/Branding/PNGs/Logo_Dark.png and /dev/null differ diff --git a/Branding/PNGs/Wabba_Mouth_No_Text.png b/Branding/PNGs/Wabba_Mouth_No_Text.png new file mode 100644 index 00000000..398f93a4 Binary files /dev/null and b/Branding/PNGs/Wabba_Mouth_No_Text.png differ diff --git a/Wabbajack.Common/Utils.cs b/Wabbajack.Common/Utils.cs index aa553d94..3c916f35 100644 --- a/Wabbajack.Common/Utils.cs +++ b/Wabbajack.Common/Utils.cs @@ -719,7 +719,7 @@ namespace Wabbajack.Common throw new Exception(msg); } - public static Stream GetResourceStream(string name) + public static Stream GetEmbeddedResourceStream(string name) { return (from assembly in AppDomain.CurrentDomain.GetAssemblies() where !assembly.IsDynamic diff --git a/Wabbajack.Lib/ACompiler.cs b/Wabbajack.Lib/ACompiler.cs index ee166b94..95cd7f4d 100644 --- a/Wabbajack.Lib/ACompiler.cs +++ b/Wabbajack.Lib/ACompiler.cs @@ -134,7 +134,7 @@ namespace Wabbajack.Lib public void GenerateReport() { string css; - using (var cssStream = Utils.GetResourceStream("Wabbajack.Lib.css-min.css")) + using (var cssStream = Utils.GetEmbeddedResourceStream("Wabbajack.Lib.css-min.css")) { using (var reader = new StreamReader(cssStream)) { diff --git a/Wabbajack.Lib/UI/UIUtils.cs b/Wabbajack.Lib/UI/UIUtils.cs index 49f542f4..78e80b28 100644 --- a/Wabbajack.Lib/UI/UIUtils.cs +++ b/Wabbajack.Lib/UI/UIUtils.cs @@ -60,7 +60,7 @@ namespace Wabbajack.Lib return null; } - public static BitmapImage BitmapImageFromResource(string name) => BitmapImageFromStream(Utils.GetResourceStream(name)); + public static BitmapImage BitmapImageFromResource(string name) => BitmapImageFromStream(System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/Wabbajack;component/" + name)).Stream); public static BitmapImage BitmapImageFromStream(Stream stream) { diff --git a/Wabbajack/App.xaml.cs b/Wabbajack/App.xaml.cs index b69397e4..f8dc7a0b 100644 --- a/Wabbajack/App.xaml.cs +++ b/Wabbajack/App.xaml.cs @@ -1,6 +1,8 @@ using System; +using System.Linq; using System.Reflection; using System.Windows; +using MahApps.Metro; using Wabbajack.Common; namespace Wabbajack diff --git a/Wabbajack/Converters/IsNotNullVisibilityConverter.cs b/Wabbajack/Converters/IsNotNullVisibilityConverter.cs index cd613047..9ba9f3bb 100644 --- a/Wabbajack/Converters/IsNotNullVisibilityConverter.cs +++ b/Wabbajack/Converters/IsNotNullVisibilityConverter.cs @@ -25,7 +25,8 @@ namespace Wabbajack { compareTo = false; } - return value != null ? Visibility.Visible : Visibility.Collapsed; + bool isNull = value != null; + return isNull == compareTo ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Wabbajack/Resources/Wabba_Mouth_No_Text.png b/Wabbajack/Resources/Wabba_Mouth_No_Text.png new file mode 100644 index 00000000..398f93a4 Binary files /dev/null and b/Wabbajack/Resources/Wabba_Mouth_No_Text.png differ diff --git a/Wabbajack/Themes/Styles.xaml b/Wabbajack/Themes/Styles.xaml index 6a96e4a8..5eb76514 100644 --- a/Wabbajack/Themes/Styles.xaml +++ b/Wabbajack/Themes/Styles.xaml @@ -1,4 +1,4 @@ - @@ -17,14 +18,16 @@ #121212 - #292929 - #414141 - #3D3D3D + #222222 + #424242 + #323232 #424242 #394140 #666666 + #362675 #EFEFEF + #CCCCCC #BDBDBD #525252 @@ -34,15 +37,61 @@ #52b545 #BB86FC + #00BB86FC #3700B3 + #1b0059 #03DAC6 #0e8f83 + #095952 + #cef0ed + #8cede5 + #00ffe7 #C7FC86 + #abf74d #868CFC #F686FC #FC86C7 #FCBB86 + + #FF3700B3 + + #CC868CFC + + #99868CFC + + #66868CFC + + #33868CFC + + + + + + + + @@ -54,14 +103,23 @@ + + + + + + + + + @@ -1462,9 +1520,31 @@ BasedOn="{StaticResource MahApps.Metro.Styles.MetroCircleButtonStyle}" TargetType="ButtonBase"> + + + + + + + diff --git a/Wabbajack/View Models/Compilers/CompilerVM.cs b/Wabbajack/View Models/Compilers/CompilerVM.cs index da8d43db..b5986757 100644 --- a/Wabbajack/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack/View Models/Compilers/CompilerVM.cs @@ -96,7 +96,7 @@ namespace Wabbajack .DistinctUntilChanged() .Select(path => { - if (string.IsNullOrWhiteSpace(path)) return UIUtils.BitmapImageFromResource("Wabbajack.Resources.Wabba_Mouth.png"); + if (string.IsNullOrWhiteSpace(path)) return UIUtils.BitmapImageFromResource("Resources/Wabba_Mouth_No_Text.png"); if (UIUtils.TryGetBitmapImageFromFile(path, out var image)) { return image; diff --git a/Wabbajack/View Models/InstallerVM.cs b/Wabbajack/View Models/InstallerVM.cs index 313df402..14d6a099 100644 --- a/Wabbajack/View Models/InstallerVM.cs +++ b/Wabbajack/View Models/InstallerVM.cs @@ -26,7 +26,7 @@ namespace Wabbajack public MainWindowVM MWVM { get; } - public BitmapImage WabbajackLogo { get; } = UIUtils.BitmapImageFromResource("Wabbajack.Resources.Wabba_Mouth.png"); + public BitmapImage WabbajackLogo { get; } = UIUtils.BitmapImageFromStream(Application.GetResourceStream(new Uri("pack://application:,,,/Wabbajack;component/Resources/Wabba_Mouth_No_Text.png")).Stream); private readonly ObservableAsPropertyHelper _modList; public ModListVM ModList => _modList.Value; diff --git a/Wabbajack/View Models/MainWindowVM.cs b/Wabbajack/View Models/MainWindowVM.cs index a46ba005..4b142a2b 100644 --- a/Wabbajack/View Models/MainWindowVM.cs +++ b/Wabbajack/View Models/MainWindowVM.cs @@ -28,6 +28,7 @@ namespace Wabbajack public readonly Lazy Compiler; public readonly Lazy Installer; + public readonly Lazy Gallery; public readonly ModeSelectionVM ModeSelectionVM; public MainWindowVM(MainWindow mainWindow, MainSettings settings) @@ -36,6 +37,7 @@ namespace Wabbajack Settings = settings; Installer = new Lazy(() => new InstallerVM(this)); Compiler = new Lazy(() => new CompilerVM(this)); + Gallery = new Lazy(() => new ModListGalleryVM(this)); ModeSelectionVM = new ModeSelectionVM(this); // Set up logging @@ -74,5 +76,14 @@ namespace Wabbajack modlistPath = args[2]; return true; } + + public void OpenInstaller(string path) + { + if (path == null) return; + var installer = Installer.Value; + Settings.Installer.LastInstalledListLocation = path; + ActivePane = installer; + installer.ModListPath.TargetPath = path; + } } } diff --git a/Wabbajack/View Models/ModListGalleryVM.cs b/Wabbajack/View Models/ModListGalleryVM.cs new file mode 100644 index 00000000..53b0371f --- /dev/null +++ b/Wabbajack/View Models/ModListGalleryVM.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reactive; +using System.Reactive.Disposables; +using System.Reactive.Linq; +using System.Text; +using System.Threading.Tasks; +using DynamicData; +using DynamicData.Binding; +using ReactiveUI; +using Wabbajack.Lib; +using Wabbajack.Lib.ModListRegistry; + +namespace Wabbajack +{ + public class ModListGalleryVM : ViewModel + { + public MainWindowVM MWVM { get; } + + public ObservableCollectionExtended ModLists { get; } = new ObservableCollectionExtended(); + + public IReactiveCommand BackCommand { get; } + public IReactiveCommand RefreshCommand { get; } + + private int missingHashFallbackCounter; + + public ModListGalleryVM(MainWindowVM mainWindowVM) + { + MWVM = mainWindowVM; + BackCommand = ReactiveCommand.Create( + execute: () => mainWindowVM.ActivePane = mainWindowVM.ModeSelectionVM); + RefreshCommand = ReactiveCommand.Create(() => { }); + + RefreshCommand.StartingExecution() + .StartWith(Unit.Default) + .ObserveOn(RxApp.TaskpoolScheduler) + .Select(_ => + { + return ModlistMetadata.LoadFromGithub() + .AsObservableChangeSet(x => x.DownloadMetadata?.Hash ?? $"Fallback{missingHashFallbackCounter++}"); + }) + .Switch() + .ObserveOnGuiThread() + .Transform(m => new ModListMetadataVM(this, m)) + .Bind(ModLists) + .Subscribe() + .DisposeWith(CompositeDisposable); + } + } +} diff --git a/Wabbajack/View Models/ModListMetadataVM.cs b/Wabbajack/View Models/ModListMetadataVM.cs index 3b47d536..523df97c 100644 --- a/Wabbajack/View Models/ModListMetadataVM.cs +++ b/Wabbajack/View Models/ModListMetadataVM.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Net; +using System.Reactive; using System.Reactive.Linq; using System.Text; using System.Threading.Tasks; @@ -9,133 +11,87 @@ using System.Windows; using System.Windows.Input; using Alphaleonis.Win32.Filesystem; using ReactiveUI; +using ReactiveUI.Fody.Helpers; using Wabbajack.Common; using Wabbajack.Lib; using Wabbajack.Lib.Downloaders; using Wabbajack.Lib.ModListRegistry; -namespace Wabbajack.View_Models +namespace Wabbajack { - public enum DownloadStatus - { - NotDownloaded, - Downloading, - Downloaded - } public class ModListMetadataVM : ViewModel { - - public ModlistMetadata Metadata { get; } - private ModeSelectionVM _parent; + private ModListGalleryVM _parent; + public ICommand OpenWebsiteCommand { get; } + public ICommand ExecuteCommand { get; } - public ModListMetadataVM(ModeSelectionVM parent, ModlistMetadata metadata) + private readonly ObservableAsPropertyHelper _Exists; + public bool Exists => _Exists.Value; + + public string Location => Path.Combine(Consts.ModListDownloadFolder, Metadata.Links.MachineURL + ExtensionManager.Extension); + + [Reactive] + public double ProgressPercent { get; private set; } + + public ModListMetadataVM(ModListGalleryVM parent, ModlistMetadata metadata) { _parent = parent; Metadata = metadata; - Click = ReactiveCommand.Create(() => this.DoClick()); + OpenWebsiteCommand = ReactiveCommand.Create(() => Process.Start($"https://www.wabbajack.org/modlist/{Metadata.Links.MachineURL}")); + ExecuteCommand = ReactiveCommand.CreateFromObservable((unit) => + Observable.Return(unit) + .WithLatestFrom( + this.WhenAny(x => x.Exists), + (_, e) => e) + // Do any download work on background thread + .ObserveOn(RxApp.TaskpoolScheduler) + .SelectTask(async (exists) => + { + if (!exists) + { + await Download(); + // Return an updated check on exists + return File.Exists(Location); + } + return exists; + }) + // Do any install page swap over on GUI thread + .ObserveOnGuiThread() + .Do(exists => + { + if (exists) + { + _parent.MWVM.OpenInstaller(Path.GetFullPath(Location)); + } + })); + + _Exists = Observable.Interval(TimeSpan.FromSeconds(0.5)) + .Unit() + .StartWith(Unit.Default) + .Select(_ => File.Exists(Location)) + .ToProperty(this, nameof(Exists)); } - private void DoClick() + private Task Download() { - switch (Status) - { - case DownloadStatus.NotDownloaded: - Download(); - break; - case DownloadStatus.Downloading: - break; - case DownloadStatus.Downloaded: - Install(); - break; - default: - throw new ArgumentOutOfRangeException(); - } - } - - private void Install() - { - _parent.OpenInstaller(Location); - } - - private void Download() - { - IsDownloading = true; - + ProgressPercent = 0d; var queue = new WorkQueue(1); - DownloadStatusText = "Downloading"; - var sub = queue.Status.Select(i => i.ProgressPercent).Subscribe(v => DownloadProgress = v); + var sub = queue.Status.Select(i => i.ProgressPercent) + .Subscribe(percent => ProgressPercent = percent); + TaskCompletionSource tcs = new TaskCompletionSource(); queue.QueueTask(() => { var downloader = DownloadDispatcher.ResolveArchive(Metadata.Links.Download); downloader.Download(new Archive{ Name = Metadata.Title, Size = Metadata.DownloadMetadata?.Size ?? 0}, Location); DownloadStatusText = "Hashing"; Location.FileHashCached(); - IsDownloading = false; sub.Dispose(); + tcs.SetResult(true); }); + + return tcs.Task; } - - private void UpdateDownloadStatuses() - { - this.RaisePropertyChanged("Status"); - this.RaisePropertyChanged("DownloadButtonVisibility"); - this.RaisePropertyChanged("DownloadProgressVisibility"); - this.RaisePropertyChanged("InstallButtonVisibility"); - } - - public string Location => Path.Combine(Consts.ModListDownloadFolder, Metadata.Links.MachineURL + ExtensionManager.Extension); - - private bool _isDownloading = false; - public bool IsDownloading - { - get => _isDownloading; - private set - { - RaiseAndSetIfChanged(ref _isDownloading, value); - UpdateDownloadStatuses(); - } - } - - - private float _downloadProgress; - - public float DownloadProgress - { - get => _downloadProgress; - private set - { - RaiseAndSetIfChanged(ref _downloadProgress, value); - } - } - - private string _downloadStatusText; - public string DownloadStatusText - { - get => _downloadStatusText; - private set - { - RaiseAndSetIfChanged(ref _downloadStatusText, value); - } - } - - public DownloadStatus Status - { - - get - { - if (IsDownloading) return DownloadStatus.Downloading; - if (!File.Exists(Location)) return DownloadStatus.NotDownloaded; - return Metadata.NeedsDownload(Location) ? DownloadStatus.NotDownloaded : DownloadStatus.Downloaded; - } - } - - public Visibility DownloadButtonVisibility => Status == DownloadStatus.NotDownloaded ? Visibility.Visible : Visibility.Collapsed; - public Visibility DownloadProgressVisibility => Status == DownloadStatus.Downloading ? Visibility.Visible : Visibility.Collapsed; - public Visibility InstallButtonVisibility => Status == DownloadStatus.Downloaded ? Visibility.Visible : Visibility.Collapsed; - - public ICommand Click { get; } - } } diff --git a/Wabbajack/View Models/ModeSelectionVM.cs b/Wabbajack/View Models/ModeSelectionVM.cs index 7e52dbd4..de1a4ae7 100644 --- a/Wabbajack/View Models/ModeSelectionVM.cs +++ b/Wabbajack/View Models/ModeSelectionVM.cs @@ -1,23 +1,18 @@ using Alphaleonis.Win32.Filesystem; using ReactiveUI; using ReactiveUI.Fody.Helpers; -using System.Collections.ObjectModel; using System.Linq; using System.Reactive.Linq; using System.Windows.Input; using Wabbajack.Common; using Wabbajack.Lib; -using Wabbajack.Lib.ModListRegistry; -using Wabbajack.View_Models; namespace Wabbajack { public class ModeSelectionVM : ViewModel { - public ObservableCollection ModLists { get; } - private MainWindowVM _mainVM; - public ICommand DownloadAndInstallCommand { get; } + public ICommand BrowseCommand { get; } public ICommand InstallCommand { get; } public ICommand CompileCommand { get; } @@ -25,8 +20,6 @@ namespace Wabbajack { _mainVM = mainVM; - ModLists = new ObservableCollection(ModlistMetadata.LoadFromGithub().Select(m => new ModListMetadataVM(this, m))); - InstallCommand = ReactiveCommand.Create( execute: () => { @@ -36,23 +29,11 @@ namespace Wabbajack { path = UIUtils.OpenFileDialog($"*{ExtensionManager.Extension}|*{ExtensionManager.Extension}"); } - OpenInstaller(path); + _mainVM.OpenInstaller(path); }); - CompileCommand = ReactiveCommand.Create( - execute: () => - { - mainVM.ActivePane = mainVM.Compiler.Value; - }); - } - - internal void OpenInstaller(string path) - { - if (path == null) return; - var installer = _mainVM.Installer.Value; - _mainVM.Settings.Installer.LastInstalledListLocation = path; - _mainVM.ActivePane = installer; - installer.ModListPath.TargetPath = path; + CompileCommand = ReactiveCommand.Create(() => mainVM.ActivePane = mainVM.Compiler.Value); + BrowseCommand = ReactiveCommand.Create(() => mainVM.ActivePane = mainVM.Gallery.Value); } } } diff --git a/Wabbajack/Views/Common/BeginButton.xaml b/Wabbajack/Views/Common/BeginButton.xaml index cf03b3cc..7ecb0cec 100644 --- a/Wabbajack/Views/Common/BeginButton.xaml +++ b/Wabbajack/Views/Common/BeginButton.xaml @@ -56,7 +56,7 @@ - + @@ -65,11 +65,9 @@ - - + + + + + + + + + @@ -18,7 +19,6 @@ @@ -28,6 +28,15 @@ + + + - - - - - @@ -69,22 +62,36 @@ - + Opacity="{Binding ProgressOpacityPercent, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" + Value="{Binding ProgressPercent, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"> + + + + + + + + + + + + + + + + TextAlignment="Right" + Visibility="{Binding StatePrefixTitle, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Converter={StaticResource IsNotNullVisibilityConverter}}" /> + + + + + + + + + + + - + diff --git a/Wabbajack/Views/Common/TopProgressView.xaml.cs b/Wabbajack/Views/Common/TopProgressView.xaml.cs index edb51e99..79cc9640 100644 --- a/Wabbajack/Views/Common/TopProgressView.xaml.cs +++ b/Wabbajack/Views/Common/TopProgressView.xaml.cs @@ -1,12 +1,14 @@ -using System.Windows; +using System.Reactive.Linq; +using System.Windows; using System.Windows.Controls; +using ReactiveUI; namespace Wabbajack { /// /// Interaction logic for TopProgressView.xaml /// - public partial class TopProgressView : UserControl + public partial class TopProgressView : UserControlRx { public double ProgressPercent { @@ -14,7 +16,7 @@ namespace Wabbajack set => SetValue(ProgressPercentProperty, value); } public static readonly DependencyProperty ProgressPercentProperty = DependencyProperty.Register(nameof(ProgressPercent), typeof(double), typeof(TopProgressView), - new FrameworkPropertyMetadata(default(double))); + new FrameworkPropertyMetadata(default(double), WireNotifyPropertyChanged)); public string Title { @@ -40,9 +42,26 @@ namespace Wabbajack public static readonly DependencyProperty OverhangShadowProperty = DependencyProperty.Register(nameof(OverhangShadow), typeof(bool), typeof(TopProgressView), new FrameworkPropertyMetadata(true)); + public bool ShadowMargin + { + get => (bool)GetValue(ShadowMarginProperty); + set => SetValue(ShadowMarginProperty, value); + } + public static readonly DependencyProperty ShadowMarginProperty = DependencyProperty.Register(nameof(ShadowMargin), typeof(bool), typeof(TopProgressView), + new FrameworkPropertyMetadata(true)); + + private readonly ObservableAsPropertyHelper _ProgressOpacityPercent; + public double ProgressOpacityPercent => _ProgressOpacityPercent.Value; + public TopProgressView() { InitializeComponent(); + _ProgressOpacityPercent = this.WhenAny(x => x.ProgressPercent) + .Select(x => + { + return 0.3 + x * 0.7; + }) + .ToProperty(this, nameof(ProgressOpacityPercent)); } } } diff --git a/Wabbajack/Views/Compilers/CompilerView.xaml b/Wabbajack/Views/Compilers/CompilerView.xaml index ec410035..2513966e 100644 --- a/Wabbajack/Views/Compilers/CompilerView.xaml +++ b/Wabbajack/Views/Compilers/CompilerView.xaml @@ -14,41 +14,59 @@ mc:Ignorable="d"> - + - + - + - + + + + + + + + - + - + BorderBrush="{StaticResource BorderInterestBrush}" + BorderThickness="1,0,1,1"> + + @@ -140,31 +157,18 @@ ToolTip="Path to a readme file." /> - + Margin="5" + Background="{StaticResource WindowBackgroundBrush}" /> - - - - - - + diff --git a/Wabbajack/Views/InstallationView.xaml b/Wabbajack/Views/InstallationView.xaml index a8aa0897..d634de56 100644 --- a/Wabbajack/Views/InstallationView.xaml +++ b/Wabbajack/Views/InstallationView.xaml @@ -5,7 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:local="clr-namespace:Wabbajack" - xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DataContext="{d:DesignInstance local:InstallerVM}" d:DesignHeight="500" @@ -23,7 +22,7 @@ - + @@ -38,11 +37,15 @@ + - + @@ -274,16 +276,6 @@ x:Name="InstallationConfigurationView" Grid.Column="2" Background="{StaticResource WindowBackgroundBrush}"> - - - - - - - + diff --git a/Wabbajack/Views/MainWindow.xaml b/Wabbajack/Views/MainWindow.xaml index bfd044d6..4a16ff9e 100644 --- a/Wabbajack/Views/MainWindow.xaml +++ b/Wabbajack/Views/MainWindow.xaml @@ -1,9 +1,10 @@ - @@ -29,6 +30,9 @@ + + + - + diff --git a/Wabbajack/Views/MainWindow.xaml.cs b/Wabbajack/Views/MainWindow.xaml.cs index 241bc101..4d7c124e 100644 --- a/Wabbajack/Views/MainWindow.xaml.cs +++ b/Wabbajack/Views/MainWindow.xaml.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using System.Windows; +using MahApps.Metro.Controls; using Wabbajack.Common; using Application = System.Windows.Application; @@ -9,7 +10,7 @@ namespace Wabbajack /// /// Interaction logic for MainWindow.xaml /// - public partial class MainWindow : Window + public partial class MainWindow : MetroWindow { private MainWindowVM _mwvm; private MainSettings _settings; @@ -17,9 +18,17 @@ namespace Wabbajack public MainWindow() { _settings = MainSettings.LoadSettings(); + Left = _settings.PosX; + Top = _settings.PosY; _mwvm = new MainWindowVM(this, _settings); DataContext = _mwvm; - Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}"); + Wabbajack.Common.Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}"); + + this.Loaded += (sender, e) => + { + Width = _settings.Width; + Height = _settings.Height; + }; } internal bool ExitWhenClosing = true; @@ -27,6 +36,10 @@ namespace Wabbajack private void Window_Closing(object sender, CancelEventArgs e) { _mwvm.Dispose(); + _settings.PosX = Left; + _settings.PosY = Top; + _settings.Width = Width; + _settings.Height = Height; MainSettings.SaveSettings(_settings); if (ExitWhenClosing) { diff --git a/Wabbajack/Views/ModListGalleryView.xaml b/Wabbajack/Views/ModListGalleryView.xaml index e27e7e25..9d0db6f2 100644 --- a/Wabbajack/Views/ModListGalleryView.xaml +++ b/Wabbajack/Views/ModListGalleryView.xaml @@ -1,116 +1,325 @@ - + #92000000 - - - - - 8 - - - - + + + + + + + + + + + + + + + ItemsSource="{Binding ModLists}"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + diff --git a/Wabbajack/Views/ModListGalleryView.xaml.cs b/Wabbajack/Views/ModListGalleryView.xaml.cs index 59a19b97..fa844542 100644 --- a/Wabbajack/Views/ModListGalleryView.xaml.cs +++ b/Wabbajack/Views/ModListGalleryView.xaml.cs @@ -4,7 +4,7 @@ using System.Windows.Controls; using MahApps.Metro.Controls; using Wabbajack.Lib.ModListRegistry; -namespace Wabbajack.Views +namespace Wabbajack { public partial class ModListGalleryView : UserControl { @@ -12,41 +12,5 @@ namespace Wabbajack.Views { 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/Views/ModeSelectionView.xaml b/Wabbajack/Views/ModeSelectionView.xaml index a7617625..faf0d7c7 100644 --- a/Wabbajack/Views/ModeSelectionView.xaml +++ b/Wabbajack/Views/ModeSelectionView.xaml @@ -3,138 +3,507 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:local="clr-namespace:Wabbajack" - xmlns:ms="clr-namespace:Wabbajack.View_Models" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" d:DataContext="{d:DesignInstance local:ModeSelectionVM}" - d:DesignHeight="450" - d:DesignWidth="800" + d:DesignHeight="700" + d:DesignWidth="1000" mc:Ignorable="d"> - + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Grid.RowSpan="3" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Stretch="UniformToFill"> + + + + + + + + + + + + + + + + + + + + diff --git a/Wabbajack/Wabbajack.csproj b/Wabbajack/Wabbajack.csproj index 69412d7f..ae806dcd 100644 --- a/Wabbajack/Wabbajack.csproj +++ b/Wabbajack/Wabbajack.csproj @@ -169,7 +169,11 @@ Designer + + + HeatedBackgroundView.xaml + LinksView.xaml @@ -184,9 +188,6 @@ - - BorderFadeDownView.xaml - @@ -240,6 +241,10 @@ VortexCompilerConfigView.xaml + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -252,10 +257,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -475,7 +476,7 @@ - + @@ -489,5 +490,8 @@ + + + \ No newline at end of file