Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CUE4Parse
10 changes: 9 additions & 1 deletion FModel/Settings/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public static bool IsEndpointValid(EEndpointType type, out EndpointSettings endp
Platform = Default.CurrentDir.TexturePlatform,
ExportMorphTargets = Default.SaveMorphTargets,
ExportMaterials = Default.SaveEmbeddedMaterials,
ExportHdrTexturesAsHdr = Default.SaveHdrTexturesAsHdr
ExportHdrTexturesAsHdr = Default.SaveHdrTexturesAsHdr,
TextureQuality = Default.TextureQuality
};

private bool _showChangelog = true;
Expand Down Expand Up @@ -562,6 +563,13 @@ public bool SaveHdrTexturesAsHdr
set => SetProperty(ref _saveHdrTexturesAsHdr, value);
}

private int _textureQuality = 100;
public int TextureQuality
{
get => _textureQuality;
set => SetProperty(ref _textureQuality, value);
}

private bool _featurePreviewNewAssetExplorer = true;
public bool FeaturePreviewNewAssetExplorer
{
Expand Down
4 changes: 4 additions & 0 deletions FModel/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public string UnluacOpcodeMap
private ENaniteMeshFormat _naniteMeshExportFormatSnapshot;
private EMaterialFormat _materialExportFormatSnapshot;
private ETextureFormat _textureExportFormatSnapshot;
private int _textureQualitySnapshot;

private bool _mappingsUpdate = false;

Expand Down Expand Up @@ -264,6 +265,7 @@ public void Initialize()
_naniteMeshExportFormatSnapshot = UserSettings.Default.NaniteMeshExportFormat;
_materialExportFormatSnapshot = UserSettings.Default.MaterialExportFormat;
_textureExportFormatSnapshot = UserSettings.Default.TextureExportFormat;
_textureQualitySnapshot = UserSettings.Default.TextureQuality;

SelectedUePlatform = _uePlatformSnapshot;
SelectedUeGame = _ueGameSnapshot;
Expand Down Expand Up @@ -337,6 +339,8 @@ public bool Save(out List<SettingsOut> whatShouldIDo)
UserSettings.Default.TextureExportFormat = SelectedTextureExportFormat;
UserSettings.Default.AesReload = SelectedAesReload;
UserSettings.Default.DiscordRpc = SelectedDiscordRpc;
if (_textureQualitySnapshot != UserSettings.Default.TextureQuality)
restart = false;

if (SelectedDiscordRpc == EDiscordRpc.Never)
_discordHandler.Shutdown();
Expand Down
2 changes: 1 addition & 1 deletion FModel/ViewModels/TabControlViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private void SetImage(CTexture bitmap)

if (PixelFormatUtils.IsHDR(bitmap.PixelFormat) || (UserSettings.Default.TextureExportFormat != ETextureFormat.Jpeg && UserSettings.Default.TextureExportFormat != ETextureFormat.Png))
{
ImageBuffer = bitmap.Encode(UserSettings.Default.TextureExportFormat, UserSettings.Default.SaveHdrTexturesAsHdr, out var ext);
ImageBuffer = bitmap.Encode(UserSettings.Default.TextureExportFormat, UserSettings.Default.SaveHdrTexturesAsHdr, out var ext, UserSettings.Default.TextureQuality);
ExportName += "." + ext;
}
else
Expand Down
10 changes: 8 additions & 2 deletions FModel/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
Expand Down Expand Up @@ -541,8 +542,13 @@
</ComboBox.ItemTemplate>
</ComboBox>

<TextBlock Grid.Row="20" Grid.Column="0" Text="Save HDR Textures as Radiance .hdr" VerticalAlignment="Center" />
<CheckBox Grid.Row="20" Grid.Column="2" Grid.ColumnSpan="3" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
<TextBlock Grid.Row="20" Grid.Column="0" Text="Texture Quality" VerticalAlignment="Center" Margin="0 0 0 5" />
<TextBox Grid.Row="20" Grid.Column="2" Grid.ColumnSpan="3" Margin="0 0 0 5"
Text="{Binding TextureQuality, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />


<TextBlock Grid.Row="21" Grid.Column="0" Text="Save HDR Textures as Radiance .hdr" VerticalAlignment="Center" />
<CheckBox Grid.Row="21" Grid.Column="2" Grid.ColumnSpan="3" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
IsChecked="{Binding SaveHdrTexturesAsHdr, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}"
Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}" Margin="0 5 0 5"/>
</Grid>
Expand Down