mirror of
https://github.com/4sval/FModel.git
synced 2026-03-23 02:04:26 -05:00
Allow game forcing (#289)
* Allow game forcing
Allow users to over-write the auto-detected game set by FModel.
* Fix game forcing for net7
Fix the game forcing feature for the net7 update
* update to match latest fmodel source tree
* Revert "update to match latest fmodel source tree"
This reverts commit f7dfe654fa.
This commit is contained in:
parent
c8b96b54fb
commit
6bc02bfb13
|
|
@ -102,6 +102,22 @@ namespace FModel.Settings
|
|||
set => SetProperty(ref _overwriteMapping, value);
|
||||
}
|
||||
|
||||
private bool _forceGame;
|
||||
|
||||
public bool ForceGame
|
||||
{
|
||||
get => _forceGame;
|
||||
set => SetProperty(ref _forceGame, value);
|
||||
}
|
||||
|
||||
private FGame _gameToForce;
|
||||
|
||||
public FGame GameToForce
|
||||
{
|
||||
get => _gameToForce;
|
||||
set => SetProperty(ref _gameToForce, value);
|
||||
}
|
||||
|
||||
private string _mappingFilePath;
|
||||
public string MappingFilePath
|
||||
{
|
||||
|
|
|
|||
|
|
@ -103,7 +103,15 @@ public class CUE4ParseViewModel : ViewModel
|
|||
}
|
||||
default:
|
||||
{
|
||||
Game = gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\").ToEnum(FGame.Unknown);
|
||||
if (UserSettings.Default.ForceGame == true)
|
||||
{
|
||||
Game = UserSettings.Default.GameToForce;
|
||||
}
|
||||
else
|
||||
{
|
||||
Game = gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\").ToEnum(FGame.Unknown);
|
||||
}
|
||||
|
||||
var versions = new VersionContainer(UserSettings.Default.OverridedGame[Game], UserSettings.Default.OverridedPlatform,
|
||||
customVersions: UserSettings.Default.OverridedCustomVersions[Game],
|
||||
optionOverrides: UserSettings.Default.OverridedOptions[Game]);
|
||||
|
|
|
|||
|
|
@ -83,12 +83,20 @@ public class SettingsViewModel : ViewModel
|
|||
}
|
||||
|
||||
private EDiscordRpc _selectedDiscordRpc;
|
||||
|
||||
public EDiscordRpc SelectedDiscordRpc
|
||||
{
|
||||
get => _selectedDiscordRpc;
|
||||
set => SetProperty(ref _selectedDiscordRpc, value);
|
||||
}
|
||||
|
||||
private FGame _selectedForceGame;
|
||||
public FGame SelectedForceGame
|
||||
{
|
||||
get => _selectedForceGame;
|
||||
set => SetProperty(ref _selectedForceGame, value);
|
||||
}
|
||||
|
||||
private ECompressedAudio _selectedCompressedAudio;
|
||||
public ECompressedAudio SelectedCompressedAudio
|
||||
{
|
||||
|
|
@ -126,6 +134,7 @@ public class SettingsViewModel : ViewModel
|
|||
|
||||
public ReadOnlyObservableCollection<EUpdateMode> UpdateModes { get; private set; }
|
||||
public ObservableCollection<string> Presets { get; private set; }
|
||||
public ReadOnlyObservableCollection<FGame> GameTypes { get; private set; }
|
||||
public ReadOnlyObservableCollection<EGame> UeGames { get; private set; }
|
||||
public ReadOnlyObservableCollection<ELanguage> AssetLanguages { get; private set; }
|
||||
public ReadOnlyObservableCollection<EAesReload> AesReloads { get; private set; }
|
||||
|
|
@ -212,10 +221,12 @@ public class SettingsViewModel : ViewModel
|
|||
SelectedTextureExportFormat = _textureExportFormatSnapshot;
|
||||
SelectedAesReload = UserSettings.Default.AesReload;
|
||||
SelectedDiscordRpc = UserSettings.Default.DiscordRpc;
|
||||
SelectedForceGame = UserSettings.Default.GameToForce;
|
||||
|
||||
UpdateModes = new ReadOnlyObservableCollection<EUpdateMode>(new ObservableCollection<EUpdateMode>(EnumerateUpdateModes()));
|
||||
Presets = new ObservableCollection<string>(EnumeratePresets());
|
||||
UeGames = new ReadOnlyObservableCollection<EGame>(new ObservableCollection<EGame>(EnumerateUeGames()));
|
||||
GameTypes = new ReadOnlyObservableCollection<FGame>(new ObservableCollection<FGame>(EnumerateGameTypes()));
|
||||
AssetLanguages = new ReadOnlyObservableCollection<ELanguage>(new ObservableCollection<ELanguage>(EnumerateAssetLanguages()));
|
||||
AesReloads = new ReadOnlyObservableCollection<EAesReload>(new ObservableCollection<EAesReload>(EnumerateAesReloads()));
|
||||
DiscordRpcs = new ReadOnlyObservableCollection<EDiscordRpc>(new ObservableCollection<EDiscordRpc>(EnumerateDiscordRpcs()));
|
||||
|
|
@ -325,6 +336,7 @@ public class SettingsViewModel : ViewModel
|
|||
yield return Constants._NO_PRESET_TRIGGER;
|
||||
}
|
||||
private IEnumerable<EGame> EnumerateUeGames() => Enum.GetValues<EGame>();
|
||||
private IEnumerable<FGame> EnumerateGameTypes() => Enum.GetValues<FGame>();
|
||||
private IEnumerable<ELanguage> EnumerateAssetLanguages() => Enum.GetValues<ELanguage>();
|
||||
private IEnumerable<EAesReload> EnumerateAesReloads() => Enum.GetValues<EAesReload>();
|
||||
private IEnumerable<EDiscordRpc> EnumerateDiscordRpcs() => Enum.GetValues<EDiscordRpc>();
|
||||
|
|
@ -334,4 +346,4 @@ public class SettingsViewModel : ViewModel
|
|||
private IEnumerable<ELodFormat> EnumerateLodExportFormat() => Enum.GetValues<ELodFormat>();
|
||||
private IEnumerable<ETextureFormat> EnumerateTextureExportFormat() => Enum.GetValues<ETextureFormat>();
|
||||
private IEnumerable<ETexturePlatform> EnumerateUePlatforms() => Enum.GetValues<ETexturePlatform>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@
|
|||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
|
@ -244,6 +246,44 @@
|
|||
Visibility="{Binding OverwriteMapping, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
<Button Grid.Row="15" Grid.Column="6" Content="..." HorizontalAlignment="Right" Click="OnBrowseMappings" Margin="0 0 0 5"
|
||||
Visibility="{Binding OverwriteMapping, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="16" Grid.Column="0" Text="Force Game Type" VerticalAlignment="Center" Margin="0 0 0 5"
|
||||
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<CheckBox Grid.Row="16" Grid.Column="2" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
|
||||
IsChecked="{Binding ForceGame, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" Margin="0 5 0 10"
|
||||
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}">
|
||||
<CheckBox.Style>
|
||||
<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</Style>
|
||||
</CheckBox.Style>
|
||||
</CheckBox>
|
||||
|
||||
<TextBlock Grid.Row="17" Grid.Column="0" Text="Game Type" VerticalAlignment="Center" Margin="0 0 0 5"
|
||||
Visibility="{Binding ForceGame, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
|
||||
<ComboBox Grid.Row="17" Grid.Column="2" Grid.ColumnSpan="5" ItemsSource="{Binding SettingsView.GameTypes}" SelectedItem="{Binding SettingsView.SelectedForceGame, Mode=TwoWay}"
|
||||
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}"
|
||||
SelectedValue="{Binding GameToForce, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" Margin="0 5 0 10">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={x:Static converters:EnumToStringConverter.Instance}}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
<ComboBox.Style>
|
||||
<Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Visibility" Value="{Binding ForceGame, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</ComboBox.Style>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="CreatorTemplate">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user