cleaned some stuff

This commit is contained in:
4sval 2023-05-16 22:41:23 +02:00
parent 870e7adeb6
commit d774fb7664
8 changed files with 9 additions and 28 deletions

@ -1 +1 @@
Subproject commit a6f5517b7c44f0cac3817b1b1ea7f6ce6bc48666
Subproject commit 215f3dbe910992d65011676e47e395dd9bd189df

View File

@ -41,7 +41,6 @@ public partial class App
{
UserSettings.Default = JsonConvert.DeserializeObject<UserSettings>(
File.ReadAllText(UserSettings.FilePath), JsonNetSerializer.SerializerSettings);
ApplicationService.ApplicationView.CUE4Parse.Provider.ReadScriptData = UserSettings.Default.ReadScriptData;
}
catch
{

View File

@ -108,7 +108,7 @@ public class AesManagerViewModel : ViewModel
if (_cue4Parse.Game == FGame.Unknown && UserSettings.Default.ManualGames.ContainsKey(UserSettings.Default.GameDirectory))
UserSettings.Default.ManualGames[UserSettings.Default.GameDirectory].AesKeys = _keysFromSettings;
else UserSettings.Default.AesKeys[_cue4Parse.Game] = _keysFromSettings;
Log.Information("{@Json}", UserSettings.Default);
// Log.Information("{@Json}", UserSettings.Default);
}
private IEnumerable<FileItem> EnumerateAesKeys()

View File

@ -200,6 +200,7 @@ public class CUE4ParseViewModel : ViewModel
break;
}
}
Provider.ReadScriptData = UserSettings.Default.ReadScriptData;
GameDirectory = new GameDirectoryViewModel();
AssetsFolder = new AssetsFolderViewModel();
@ -399,7 +400,6 @@ public class CUE4ParseViewModel : ViewModel
}
else if (endpoint.IsValid)
{
if(string.IsNullOrEmpty(endpoint.Path)) return;
var mappingsFolder = Path.Combine(UserSettings.Default.OutputDirectory, ".data");
var mappings = _apiEndpointView.DynamicApi.GetMappings(default, endpoint.Url, endpoint.Path);
if (mappings is { Length: > 0 })

View File

@ -167,17 +167,6 @@ public class SettingsViewModel : ViewModel
set => SetProperty(ref _selectedTextureExportFormat, value);
}
private bool _selectedReadScriptData;
public bool SelectedReadScriptData
{
get => _selectedReadScriptData;
set
{
SetProperty(ref _selectedReadScriptData, value);
ApplicationService.ApplicationView.CUE4Parse.Provider.ReadScriptData = value;
}
}
public ReadOnlyObservableCollection<EUpdateMode> UpdateModes { get; private set; }
public ObservableCollection<string> Presets { get; private set; }
public ReadOnlyObservableCollection<EGame> UeGames { get; private set; }
@ -219,7 +208,6 @@ public class SettingsViewModel : ViewModel
private ELodFormat _lodExportFormatSnapshot;
private EMaterialFormat _materialExportFormatSnapshot;
private ETextureFormat _textureExportFormatSnapshot;
private bool _readScriptDataSnapshot;
private bool _mappingsUpdate = false;
@ -274,7 +262,6 @@ public class SettingsViewModel : ViewModel
_lodExportFormatSnapshot = UserSettings.Default.LodExportFormat;
_materialExportFormatSnapshot = UserSettings.Default.MaterialExportFormat;
_textureExportFormatSnapshot = UserSettings.Default.TextureExportFormat;
_readScriptDataSnapshot = UserSettings.Default.ReadScriptData;
SelectedUpdateMode = _updateModeSnapshot;
SelectedPreset = _presetSnapshot;
@ -291,7 +278,6 @@ public class SettingsViewModel : ViewModel
SelectedLodExportFormat = _lodExportFormatSnapshot;
SelectedMaterialExportFormat = _materialExportFormatSnapshot;
SelectedTextureExportFormat = _textureExportFormatSnapshot;
SelectedReadScriptData = _readScriptDataSnapshot;
SelectedAesReload = UserSettings.Default.AesReload;
SelectedDiscordRpc = UserSettings.Default.DiscordRpc;
@ -408,7 +394,6 @@ public class SettingsViewModel : ViewModel
UserSettings.Default.LodExportFormat = SelectedLodExportFormat;
UserSettings.Default.MaterialExportFormat = SelectedMaterialExportFormat;
UserSettings.Default.TextureExportFormat = SelectedTextureExportFormat;
UserSettings.Default.ReadScriptData = SelectedReadScriptData;
UserSettings.Default.AesReload = SelectedAesReload;
UserSettings.Default.DiscordRpc = SelectedDiscordRpc;

View File

@ -210,19 +210,15 @@
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="14" Grid.Column="0" Text="Serialize Script Bytecode" VerticalAlignment="Center" Margin="0 0 0 5"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}" />
<CheckBox Grid.Row="14" Grid.Column="2" Margin="0 5 0 10"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}"
Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
IsChecked="{Binding SettingsView.SelectedReadScriptData , Mode=TwoWay}" />
<TextBlock Grid.Row="14" Grid.Column="0" Text="Serialize Script Bytecode" VerticalAlignment="Center" Margin="0 0 0 5" />
<CheckBox Grid.Row="14" Grid.Column="2" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
IsChecked="{Binding ReadScriptData, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" Margin="0 5 0 10"/>
<TextBlock Grid.Row="15" Grid.Column="0" Text="Keep Directory Structure" VerticalAlignment="Center" Margin="0 0 0 5" ToolTip="Auto-save packages following their game directory" />
<CheckBox Grid.Row="15" Grid.Column="2" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
IsChecked="{Binding KeepDirectoryStructure, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" Margin="0 5 0 10"/>
<TextBlock Grid.Row="16" Grid.Column="0" Text="Local Mapping File" VerticalAlignment="Center" Margin="0 0 0 5"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}" />
<TextBlock Grid.Row="16" Grid.Column="0" Text="Local Mapping File" VerticalAlignment="Center" Margin="0 0 0 5" />
<CheckBox Grid.Row="16" Grid.Column="2" Margin="0 5 0 10"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}"
Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"

View File

@ -61,6 +61,8 @@ public partial class SettingsView
break;
}
}
_applicationView.CUE4Parse.Provider.ReadScriptData = UserSettings.Default.ReadScriptData;
}
private void OnBrowseOutput(object sender, RoutedEventArgs e)

1
NOTICE
View File

@ -18,7 +18,6 @@ This software includes material developed by the following third-party libraries
- Serilog (https://github.com/serilog/serilog/blob/dev/LICENSE) - Copyright 2013-2015 Serilog Contributors. Licensed under the Apache License 2.0.
- SixLabors.ImageSharp (https://github.com/SixLabors/ImageSharp/blob/main/LICENSE) - Copyright (c) Six Labors. Licensed under the Apache License 2.0.
- SkiaSharp (https://github.com/mono/SkiaSharp/blob/main/LICENSE.md) - Copyright (c) 2015-2016 Xamarin, Inc. & 2017-2018 Microsoft Corporation. Licensed under the MIT License.
- UAssetAPI (https://github.com/atenfyr/UAssetAPI/blob/master/LICENSE) - Copyright (c) 2023 Atenfyr. Licensed under the MIT License.
---------------------------------------------------------------------------