mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Open Readme enabled when installing
This commit is contained in:
parent
b20d1a3118
commit
123c7c8b7b
@ -1,4 +1,4 @@
|
|||||||
using Syroot.Windows.IO;
|
using Syroot.Windows.IO;
|
||||||
using System;
|
using System;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -92,11 +92,8 @@ namespace Wabbajack
|
|||||||
this.OpenModListPropertiesCommand = ReactiveCommand.Create(OpenModListProperties);
|
this.OpenModListPropertiesCommand = ReactiveCommand.Create(OpenModListProperties);
|
||||||
this.OpenReadmeCommand = ReactiveCommand.Create(
|
this.OpenReadmeCommand = ReactiveCommand.Create(
|
||||||
execute: this.OpenReadmeWindow,
|
execute: this.OpenReadmeWindow,
|
||||||
canExecute: Observable.CombineLatest(
|
canExecute: this.WhenAny(x => x.ModList)
|
||||||
this.WhenAny(x => x.ModList)
|
.Select(modList => !string.IsNullOrEmpty(modList?.Readme))
|
||||||
.Select(modList => !string.IsNullOrEmpty(modList?.Readme)),
|
|
||||||
this.WhenAny(x => x.UIReady),
|
|
||||||
resultSelector: (modListExists, uiReady) => modListExists && uiReady)
|
|
||||||
.ObserveOnGuiThread());
|
.ObserveOnGuiThread());
|
||||||
this.BeginCommand = ReactiveCommand.Create(
|
this.BeginCommand = ReactiveCommand.Create(
|
||||||
execute: this.ExecuteBegin,
|
execute: this.ExecuteBegin,
|
||||||
@ -217,7 +214,7 @@ namespace Wabbajack
|
|||||||
|
|
||||||
private void OpenReadmeWindow()
|
private void OpenReadmeWindow()
|
||||||
{
|
{
|
||||||
if (!UIReady || string.IsNullOrEmpty(this.ModList.Readme)) return;
|
if (string.IsNullOrEmpty(this.ModList.Readme)) return;
|
||||||
var text = "";
|
var text = "";
|
||||||
using (var fs = new FileStream(this.ModListPath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
using (var fs = new FileStream(this.ModListPath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||||
using (var ar = new ZipArchive(fs, ZipArchiveMode.Read))
|
using (var ar = new ZipArchive(fs, ZipArchiveMode.Read))
|
||||||
|
Loading…
Reference in New Issue
Block a user