Make texture recompression optional via the settings pannel (defaults to on)

This commit is contained in:
Timothy Baldridge 2021-06-19 08:03:10 -06:00
parent a9c003fe34
commit 115f452d99
4 changed files with 36 additions and 1 deletions

View File

@ -39,6 +39,7 @@ namespace Wabbajack.Lib
public Dictionary<AbsolutePath, dynamic> ModInis { get; } = new Dictionary<AbsolutePath, dynamic>();
public HashSet<string> SelectedProfiles { get; set; } = new HashSet<string>();
public bool DisableTextureResizing { get; set; }
public static AbsolutePath GetTypicalDownloadsFolder(AbsolutePath mo2Folder)
{
@ -421,7 +422,7 @@ namespace Wabbajack.Lib
public override IEnumerable<ICompilationStep> MakeStack()
{
Utils.Log("Generating compilation stack");
return new List<ICompilationStep>
var steps = new List<ICompilationStep>
{
new IgnoreGameFilesIfGameFolderFilesExist(this),
new IncludePropertyFiles(this),
@ -487,6 +488,11 @@ namespace Wabbajack.Lib
new IgnoreExtension(this, new Extension(".CACHE")),
new DropAll(this)
};
if (DisableTextureResizing)
steps = steps.Where(s => !(s is MatchSimilarTextures)).ToList();
return steps;
}
}
}

View File

@ -145,6 +145,18 @@ namespace Wabbajack
}
}
private bool _disableTextureResizing;
public bool DisableTextureResizing
{
get => _disableTextureResizing;
set
{
RaiseAndSetIfChanged(ref _disableTextureResizing, value);
}
}
public void SetProcessorSettings(ABatchProcessor processor)
{
@ -152,6 +164,9 @@ namespace Wabbajack
processor.DiskThreads = DiskThreads;
processor.ReduceHDDThreads = ReduceHDDThreads;
processor.FavorPerfOverRam = FavorPerfOverRam;
if (processor is MO2Compiler mo2c)
mo2c.DisableTextureResizing = DisableTextureResizing;
}
}

View File

@ -28,6 +28,7 @@
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -99,6 +100,17 @@
VerticalAlignment="Center"
Foreground="White"
></CheckBox>
<TextBlock Grid.Row="8" Grid.Column="0"
x:Name="DisableTextureResizingLabel"
VerticalAlignment="Center"
Text="Disable Texture Resizing (during compilation)" />
<CheckBox Grid.Row="8" Grid.Column="2"
x:Name="DisableTextureResizing"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Foreground="White"
></CheckBox>
</Grid>
</Border>
</rxui:ReactiveUserControl>

View File

@ -45,6 +45,8 @@ namespace Wabbajack
.DisposeWith(disposable);
this.BindStrict(this.ViewModel, x => x.NetworkWorkaroundMode, x => x.UseNetworkWorkAround.IsChecked)
.DisposeWith(disposable);
this.BindStrict(this.ViewModel, x => x.DisableTextureResizing, x => x.DisableTextureResizing.IsChecked)
.DisposeWith(disposable);
});
}
}