wabbajack/Wabbajack.Lib/StatusMessages/ConfirmUpdateOfExistingInstall.cs

44 lines
1.3 KiB
C#
Raw Normal View History

2019-12-04 04:12:08 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wabbajack.Common.StatusFeed;
namespace Wabbajack.Lib.StatusMessages
{
public class ConfirmUpdateOfExistingInstall : AStatusMessage, IUserIntervention
{
public enum Choice
{
Continue,
Abort
}
public string OutputFolder { get; set; }
public string ModListName { get; set; }
public override string ShortDescription { get; } = "Do you want to overwrite existing files?";
private TaskCompletionSource<Choice> _source = new TaskCompletionSource<Choice>();
public Task<Choice> Task => _source.Task;
public override string ExtendedDescription
{
get =>
$@"There appears to be a modlist already installed in the output folder. If you continue with the install,
Any files that exist in {OutputFolder} will be changed to match the files found in the {ModListName} modlist. This means that save games will be removed, custom settings
will be reverted. Are you sure you wish to continue?";
}
public void Cancel()
{
_source.SetResult(Choice.Abort);
}
2019-12-05 05:14:40 +00:00
public void Confirm()
2019-12-04 04:12:08 +00:00
{
_source.SetResult(Choice.Continue);
}
}
}