mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
commit
dbd130c974
@ -44,7 +44,7 @@ namespace Wabbajack.Common
|
||||
{
|
||||
var per_step = 1.0f / _internalMaxStep;
|
||||
var macro = _internalCurrentStep * per_step;
|
||||
return Percent.FactoryPutInRange(macro + (per_step * sub_status));
|
||||
return Percent.FactoryPutInRange(macro + (per_step * sub_status.Value));
|
||||
}
|
||||
|
||||
public void MakeUpdate(Percent progress)
|
||||
|
@ -70,7 +70,37 @@ namespace Wabbajack.Common
|
||||
return new Percent(c1.Value / c2.Value);
|
||||
}
|
||||
|
||||
public static implicit operator double(Percent c1)
|
||||
public static bool operator ==(Percent c1, Percent c2)
|
||||
{
|
||||
return c1.Value == c2.Value;
|
||||
}
|
||||
|
||||
public static bool operator !=(Percent c1, Percent c2)
|
||||
{
|
||||
return c1.Value != c2.Value;
|
||||
}
|
||||
|
||||
public static bool operator >(Percent c1, Percent c2)
|
||||
{
|
||||
return c1.Value > c2.Value;
|
||||
}
|
||||
|
||||
public static bool operator <(Percent c1, Percent c2)
|
||||
{
|
||||
return c1.Value < c2.Value;
|
||||
}
|
||||
|
||||
public static bool operator >=(Percent c1, Percent c2)
|
||||
{
|
||||
return c1.Value >= c2.Value;
|
||||
}
|
||||
|
||||
public static bool operator <=(Percent c1, Percent c2)
|
||||
{
|
||||
return c1.Value <= c2.Value;
|
||||
}
|
||||
|
||||
public static explicit operator double(Percent c1)
|
||||
{
|
||||
return c1.Value;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ namespace Wabbajack.Lib
|
||||
ManualCoreLimit,
|
||||
MaxCores,
|
||||
TargetUsagePercent,
|
||||
(manual, max, target) => CalculateThreadsToUse(recommendedCount, manual, max, target));
|
||||
(manual, max, target) => CalculateThreadsToUse(recommendedCount, manual, max, target.Value));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -122,7 +122,6 @@ namespace Wabbajack
|
||||
.BindToStrict(this, x => x.LogView.ProgressPercent)
|
||||
.DisposeWith(dispose);
|
||||
this.WhenAny(x => x.ViewModel.PercentCompleted)
|
||||
.Select(f => (double)f)
|
||||
.BindToStrict(this, x => x.CpuView.ProgressPercent)
|
||||
.DisposeWith(dispose);
|
||||
this.WhenAny(x => x.ViewModel.MWVM.Settings)
|
||||
|
@ -134,7 +134,6 @@ namespace Wabbajack
|
||||
.BindToStrict(this, x => x.LogView.ProgressPercent)
|
||||
.DisposeWith(dispose);
|
||||
this.WhenAny(x => x.ViewModel.PercentCompleted)
|
||||
.Select(f => (double)f)
|
||||
.BindToStrict(this, x => x.CpuView.ProgressPercent)
|
||||
.DisposeWith(dispose);
|
||||
this.WhenAny(x => x.ViewModel.MWVM.Settings)
|
||||
|
@ -15,6 +15,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using ReactiveUI;
|
||||
using Wabbajack.Common;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
@ -28,7 +29,7 @@ namespace Wabbajack
|
||||
InitializeComponent();
|
||||
this.WhenActivated(dispose =>
|
||||
{
|
||||
this.MarkAsNeeded<ModListTileView, ModListMetadataVM, double>(this.ViewModel, x => x.ProgressPercent);
|
||||
this.MarkAsNeeded<ModListTileView, ModListMetadataVM, Percent>(this.ViewModel, x => x.ProgressPercent);
|
||||
this.MarkAsNeeded<ModListTileView, ModListMetadataVM, bool>(this.ViewModel, x => x.IsBroken);
|
||||
this.MarkAsNeeded<ModListTileView, ModListMetadataVM, bool>(this.ViewModel, x => x.Exists);
|
||||
this.MarkAsNeeded<ModListTileView, ModListMetadataVM, string>(this.ViewModel, x => x.Metadata.Links.ImageUri);
|
||||
|
@ -64,7 +64,7 @@ namespace Wabbajack
|
||||
vmToViewConverter: x => x,
|
||||
viewToVmConverter: x => (byte)(x ?? 0))
|
||||
.DisposeWith(disposable);
|
||||
this.BindStrict(this.ViewModel, x => x.TargetUsage, x => x.TargetUsageSpinner.Value)
|
||||
this.Bind(this.ViewModel, x => x.TargetUsage, x => x.TargetUsageSpinner.Value)
|
||||
.DisposeWith(disposable);
|
||||
this.Bind(this.ViewModel, x => x.TargetUsage, x => x.TargetUsageSlider.Value)
|
||||
.DisposeWith(disposable);
|
||||
|
Loading…
Reference in New Issue
Block a user