Skip to content

Commit

Permalink
feat(movie): optional custom hlae parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
akiver committed Jul 12, 2022
1 parent b6ff8ec commit e95da19
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Manager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@
IsEnabled="{Binding Source={StaticResource Locator}, Path=Settings.IsHlaeCustomLocationEnabled}"
Command="{Binding Source={StaticResource Locator}, Path=Settings.ResetCustomHlaeLocationCommand}" />
</StackPanel>
<Label Target="{Binding ElementName=HlaeParametersTextBox}"
Content="{x:Static properties:Resources.AdditionalsParametersLabel}" />
<TextBox x:Name="HlaeParametersTextBox"
Text="{Binding Source={StaticResource Locator}, Path=Settings.HlaeParameters}" />
</StackPanel>

<StackPanel Orientation="Horizontal">
Expand Down
11 changes: 11 additions & 0 deletions Manager/ViewModel/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ public bool IsHlaeCustomLocationEnabled
set { Set(() => IsHlaeCustomLocationEnabled, ref _isHlaeCustomLocationEnabled, value); }
}

private string _hlaeParameters = ServicesSettings.Default.HlaeParameters;
public string HlaeParameters
{
get { return _hlaeParameters; }
set
{
ServicesSettings.Default.HlaeParameters = value;
Set(() => HlaeParameters, ref _hlaeParameters, value);
}
}

private bool _isFfmpegCustomLocationEnabled = ServicesSettings.Default.IsFfmpegCustomLocationEnabled;
public bool IsFfmpegCustomLocationEnabled
{
Expand Down
5 changes: 5 additions & 0 deletions Services/Concrete/GameLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public async Task StartGame()
argList.Add($"-mmcfg \"{_config.HlaeConfigParentFolderPath}\"");
}

if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.HlaeParameters))
{
argList.Add(Properties.Settings.Default.HlaeParameters);
}

string args = string.Join(ARGUMENT_SEPARATOR, argList.ToArray());
ProcessStartInfo psi = new ProcessStartInfo
{
Expand Down
12 changes: 12 additions & 0 deletions Services/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Services/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
<Setting Name="FfmpegExecutableLocation" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="HlaeParameters" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
3 changes: 3 additions & 0 deletions Services/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<setting name="FfmpegExecutableLocation" serializeAs="String">
<value />
</setting>
<setting name="HlaeParameters" serializeAs="String">
<value />
</setting>
</Services.Properties.Settings>
</userSettings>
</configuration>

0 comments on commit e95da19

Please sign in to comment.