Merge pull request #925 from Ashafix/updated_argparse

Added missing commandline arguments
This commit is contained in:
adelikat 2017-07-17 10:44:32 -05:00 committed by GitHub
commit 63b644d30c
3 changed files with 18 additions and 23 deletions

View File

@ -20,6 +20,7 @@ namespace BizHawk.Client.EmuHawk
public HashSet<int> _currAviWriterFrameList; public HashSet<int> _currAviWriterFrameList;
public int _autoDumpLength; public int _autoDumpLength;
public bool _autoCloseOnDump = false; public bool _autoCloseOnDump = false;
// chrome is never shown, even in windowed mode
public bool _chromeless = false; public bool _chromeless = false;
public bool startFullscreen = false; public bool startFullscreen = false;
public string luaScript = null; public string luaScript = null;

View File

@ -2430,7 +2430,7 @@ namespace BizHawk.Client.EmuHawk
showMenuVisible = true; // need to always be able to restore this as an emergency measure showMenuVisible = true; // need to always be able to restore this as an emergency measure
} }
if (_chromeless) if (argParse._chromeless)
{ {
showMenuVisible = true; // I decided this was always possible in chromeless mode, we'll see what they think showMenuVisible = true; // I decided this was always possible in chromeless mode, we'll see what they think
} }

View File

@ -153,7 +153,6 @@ namespace BizHawk.Client.EmuHawk
} }
}; };
ArgParser argParse = new ArgParser();
argParse.parseArguments(args); argParse.parseArguments(args);
Database.LoadDatabase(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "gamedb.txt")); Database.LoadDatabase(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "gamedb.txt"));
@ -299,9 +298,9 @@ namespace BizHawk.Client.EmuHawk
Global.MovieSession.ReadOnly = true; Global.MovieSession.ReadOnly = true;
// if user is dumping and didnt supply dump length, make it as long as the loaded movie // if user is dumping and didnt supply dump length, make it as long as the loaded movie
if (_autoDumpLength == 0) if (argParse._autoDumpLength == 0)
{ {
_autoDumpLength = movie.InputLogLength; argParse._autoDumpLength = movie.InputLogLength;
} }
// Copy pasta from drag & drop // Copy pasta from drag & drop
@ -1022,15 +1021,15 @@ namespace BizHawk.Client.EmuHawk
{ {
// TODO - maybe apply a hack tracked during fullscreen here to override it // TODO - maybe apply a hack tracked during fullscreen here to override it
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
MainMenuStrip.Visible = Global.Config.DispChrome_MenuFullscreen && !_chromeless; MainMenuStrip.Visible = Global.Config.DispChrome_MenuFullscreen && !argParse._chromeless;
MainStatusBar.Visible = Global.Config.DispChrome_StatusBarFullscreen && !_chromeless; MainStatusBar.Visible = Global.Config.DispChrome_StatusBarFullscreen && !argParse._chromeless;
} }
else else
{ {
MainStatusBar.Visible = Global.Config.DispChrome_StatusBarWindowed && !_chromeless; MainStatusBar.Visible = Global.Config.DispChrome_StatusBarWindowed && !argParse._chromeless;
MainMenuStrip.Visible = Global.Config.DispChrome_MenuWindowed && !_chromeless; MainMenuStrip.Visible = Global.Config.DispChrome_MenuWindowed && !argParse._chromeless;
MaximizeBox = MinimizeBox = Global.Config.DispChrome_CaptionWindowed && !_chromeless; MaximizeBox = MinimizeBox = Global.Config.DispChrome_CaptionWindowed && !argParse._chromeless;
if (Global.Config.DispChrome_FrameWindowed == 0 || _chromeless) if (Global.Config.DispChrome_FrameWindowed == 0 || argParse._chromeless)
{ {
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
} }
@ -1356,7 +1355,6 @@ namespace BizHawk.Client.EmuHawk
// AVI/WAV state // AVI/WAV state
private IVideoWriter _currAviWriter; private IVideoWriter _currAviWriter;
private readonly HashSet<int> _currAviWriterFrameList;
private AutofireController _autofireNullControls; private AutofireController _autofireNullControls;
@ -1399,13 +1397,9 @@ namespace BizHawk.Client.EmuHawk
private Point _windowedLocation; private Point _windowedLocation;
private bool _needsFullscreenOnLoad; private bool _needsFullscreenOnLoad;
private int _autoDumpLength;
private readonly bool _autoCloseOnDump;
private int _lastOpenRomFilter; private int _lastOpenRomFilter;
// chrome is never shown, even in windowed mode private ArgParser argParse = new ArgParser();
private readonly bool _chromeless;
// Resources // Resources
private Bitmap _statusBarDiskLightOnImage; private Bitmap _statusBarDiskLightOnImage;
private Bitmap _statusBarDiskLightOffImage; private Bitmap _statusBarDiskLightOffImage;
@ -1472,7 +1466,7 @@ namespace BizHawk.Client.EmuHawk
} }
} }
if (!Global.Config.DispChrome_CaptionWindowed || _chromeless) if (!Global.Config.DispChrome_CaptionWindowed || argParse._chromeless)
{ {
str = ""; str = "";
} }
@ -3272,9 +3266,9 @@ namespace BizHawk.Client.EmuHawk
try try
{ {
// is this the best time to handle this? or deeper inside? // is this the best time to handle this? or deeper inside?
if (_currAviWriterFrameList != null) if (argParse._currAviWriterFrameList != null)
{ {
if (!_currAviWriterFrameList.Contains(Emulator.Frame)) if (!argParse._currAviWriterFrameList.Contains(Emulator.Frame))
{ {
goto HANDLE_AUTODUMP; goto HANDLE_AUTODUMP;
} }
@ -3357,13 +3351,13 @@ namespace BizHawk.Client.EmuHawk
} }
HANDLE_AUTODUMP: HANDLE_AUTODUMP:
if (_autoDumpLength > 0) if (argParse._autoDumpLength > 0)
{ {
_autoDumpLength--; argParse._autoDumpLength--;
if (_autoDumpLength == 0) // finish if (argParse._autoDumpLength == 0) // finish
{ {
StopAv(); StopAv();
if (_autoCloseOnDump) if (argParse._autoCloseOnDump)
{ {
_exit = true; _exit = true;
} }