Skip to content

Commit

Permalink
Merge pull request #7 from Th3C0D3R/dev
Browse files Browse the repository at this point in the history
V0.0.21
  • Loading branch information
Th3C0D3R authored Sep 15, 2023
2 parents b2e1415 + 7a5fc4a commit 37e8080
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ $RECYCLE.BIN/
.DS_Store

_NCrunch*
/GeForceNowWindowMover.csproj.user
18 changes: 0 additions & 18 deletions GeForceNowWindowMover.csproj.user

This file was deleted.

41 changes: 35 additions & 6 deletions Helper/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public static class Utils
#region Arguments
public static bool NoFixedWindow { get; set; } = false;
public static string ProcessName { get; set; } = string.Empty;
public static int PreDefHeight { get; set; } = 720;
public static int PreDefWidth { get; set; } = 1280;
#endregion

#region Settings Wrapped
Expand Down Expand Up @@ -118,7 +120,8 @@ public static Process GetProcessByName(string name)
public static void callResizeForm()
{
FrmMessure form = new FrmMessure();

form.Height = PreDefHeight;
form.Width = PreDefWidth;
DialogResult dlgRes = form.ShowDialog();

if (dlgRes != DialogResult.OK && Settings.Default.firstRun)
Expand Down Expand Up @@ -167,10 +170,17 @@ public static void PrintConsoleHelp()
{
Console.WriteLine($"");
Console.WriteLine($"Usage: ");
Console.WriteLine($" {Path.GetFileName(Assembly.GetEntryAssembly().Location)} (--nofixed | -n)");
Console.WriteLine($" {Path.GetFileName(Assembly.GetEntryAssembly().Location)} (--nofixed | -n) --process|-p <Processname>");
Console.WriteLine($" {Path.GetFileName(Assembly.GetEntryAssembly().Location)} (--fixed | -f)");
Console.WriteLine($" {Path.GetFileName(Assembly.GetEntryAssembly().Location)} (--fixed | -f) --process|-p <Processname>");
Console.WriteLine($" {Path.GetFileName(Assembly.GetEntryAssembly().Location)} [...Options]");
Console.WriteLine($"");
Console.WriteLine($"");
Console.WriteLine($"Options: ");
Console.WriteLine($" --nofixed | -n : Use wrapper window");
Console.WriteLine($" --process | -p <Processname> : Predefine process to use");
Console.WriteLine($" --fixed | -f : Use dummy window to define fixed size and position");
Console.WriteLine($" --resizeOnly | -r : Only run dummy window to define fixed size and position");
Console.WriteLine($" --height : Predefine Height (ex. 720 or 1080)");
Console.WriteLine($" --width : Predefine Width (ex. 1280 or 1920)");
Console.WriteLine($" --help | -h : Show this");
Console.WriteLine($"");
Console.WriteLine($"");
Console.WriteLine($"PROCESSNAME WITHOUT .EXE/EXTENSION (e.g: GeForceNOW instead of GeForceNOW.exe");
Expand Down Expand Up @@ -232,8 +242,27 @@ public static object ArgHelper(string[] args)
callResizeForm();
returnValue = false;
break;
case "height":
if (args[i + 1].Length > 0 && !args[i + 1].StartsWith("-"))
{
if(int.TryParse(args[i + 1].Trim(' '),out int height))
{
PreDefHeight = height;
}
returnValue = true;
}
break;
case "width":
if (args[i + 1].Length > 0 && !args[i + 1].StartsWith("-"))
{
if (int.TryParse(args[i + 1].Trim(' '), out int width))
{
PreDefWidth = width;
}
returnValue = true;
}
break;
default:
returnValue = false;
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void Main(string[] args)
Application.SetCompatibleTextRenderingDefault(false);
Console.SetWindowSize(113, 19);
Console.SetBufferSize(113, 3000);
if (Settings.Default.lastProcess.Length > 0 || Settings.Default.lastProcess != null)
if (Settings.Default.lastProcess.Length > 0 && Settings.Default.lastProcess != null)
{
lastProcess = Utils.GetProcessByName(Settings.Default.lastProcess);
}
Expand Down Expand Up @@ -67,7 +67,7 @@ private static void Menu()
Console.Clear();
Process proc = null;
int option = -1;
Console.WriteLine("If you want to resize the window (fixed position and size), enter '-1' into the next menu!!\n\n");
Console.WriteLine("If you want to resize/move the window (fixed position and size), enter '-1' into the next menu!!\n\n");
Console.WriteLine("Please select the method to modify the game window: ");
Console.WriteLine($"1 ) [BUGGY] Wrapper Form (the GeForce Now window will be wrapped inside a form which can be moved and resized)");
Console.WriteLine($"2 ) [RECOMMENDED] Fixed Position and Size (predefine a fixed position and size for the GeForce Now window)");
Expand Down

0 comments on commit 37e8080

Please sign in to comment.