Skip to content

Commit

Permalink
fix command line and start up path
Browse files Browse the repository at this point in the history
  • Loading branch information
34736384 committed Dec 29, 2023
1 parent 4a9833e commit d6b6a25
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion unlockfps_nc/AboutForm.Designer.cs

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

8 changes: 4 additions & 4 deletions unlockfps_nc/MainForm.Designer.cs

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

7 changes: 4 additions & 3 deletions unlockfps_nc/Service/ProcessService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ private async Task Worker()
{
STARTUPINFO si = new();
uint creationFlag = _config.SuspendLoad ? 4u : 0u;
var gameFolder = Path.GetDirectoryName(_config.GamePath);

if (!Native.CreateProcess(_config.GamePath, BuildCommandLine(), IntPtr.Zero, IntPtr.Zero, false, creationFlag, IntPtr.Zero, null, ref si, out var pi))
if (!Native.CreateProcess(_config.GamePath, BuildCommandLine(), IntPtr.Zero, IntPtr.Zero, false, creationFlag, IntPtr.Zero, gameFolder, ref si, out var pi))
{
MessageBox.Show(
$@"CreateProcess failed ({Marshal.GetLastWin32Error()}){Environment.NewLine} {Marshal.GetLastPInvokeErrorMessage()}",
Expand Down Expand Up @@ -178,10 +179,10 @@ private string BuildCommandLine()

commandLine += $"-screen-fullscreen {(_config.Fullscreen ? 1 : 0)} ";
if (_config.Fullscreen)
commandLine += $"-window-mode {(_config.IsExclusiveFullscreen ? "exclusive" : "borderless")}";
commandLine += $"-window-mode {(_config.IsExclusiveFullscreen ? "exclusive" : "borderless")} ";

if (_config.UseMobileUI)
commandLine += "use_mobile_platform -is_cloud 1 -platform_type CLOUD_THIRD_PARTY_MOBILE";
commandLine += "use_mobile_platform -is_cloud 1 -platform_type CLOUD_THIRD_PARTY_MOBILE ";

commandLine += $"-monitor {_config.MonitorNum} ";
return commandLine;
Expand Down
1 change: 1 addition & 0 deletions unlockfps_nc/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private void SetupBindings()
CBPopup.DataBindings.Add("Checked", _config, "PopupWindow", true, DataSourceUpdateMode.OnPropertyChanged);
CBFullscreen.DataBindings.Add("Checked", _config, "Fullscreen", true, DataSourceUpdateMode.OnPropertyChanged);
CBCustomRes.DataBindings.Add("Checked", _config, "UseCustomRes", true, DataSourceUpdateMode.OnPropertyChanged);
CBUseMobileUI.DataBindings.Add("Checked", _config, "UseMobileUI", true, DataSourceUpdateMode.OnPropertyChanged);
InputResX.DataBindings.Add("Value", _config, "CustomResX", true, DataSourceUpdateMode.OnPropertyChanged);
InputResY.DataBindings.Add("Value", _config, "CustomResY", true, DataSourceUpdateMode.OnPropertyChanged);
ComboFullscreenMode.DataBindings.Add("SelectedIndex", _config, "IsExclusiveFullscreen", true, DataSourceUpdateMode.OnPropertyChanged);
Expand Down

0 comments on commit d6b6a25

Please sign in to comment.