Play/Reocrd movie dialogs - pass in mainform
This commit is contained in:
parent
35ff30cc01
commit
5fe25d03ad
|
@ -489,13 +489,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// Inaccurate core but allow the user to continue anyway
|
// Inaccurate core but allow the user to continue anyway
|
||||||
}
|
}
|
||||||
|
|
||||||
using var form = new RecordMovie(Emulator);
|
using var form = new RecordMovie(this, Emulator);
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlayMovieMenuItem_Click(object sender, EventArgs e)
|
private void PlayMovieMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var form = new PlayMovie();
|
using var form = new PlayMovie(this);
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class PlayMovie : Form
|
public partial class PlayMovie : Form
|
||||||
{
|
{
|
||||||
|
private readonly MainForm _mainForm;
|
||||||
private readonly PlatformFrameRates _platformFrameRates = new PlatformFrameRates();
|
private readonly PlatformFrameRates _platformFrameRates = new PlatformFrameRates();
|
||||||
|
|
||||||
private List<IMovie> _movieList = new List<IMovie>();
|
private List<IMovie> _movieList = new List<IMovie>();
|
||||||
|
@ -24,8 +25,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private bool _sortDetailsReverse;
|
private bool _sortDetailsReverse;
|
||||||
private string _sortedDetailsCol;
|
private string _sortedDetailsCol;
|
||||||
|
|
||||||
public PlayMovie()
|
public PlayMovie(MainForm mainForm)
|
||||||
{
|
{
|
||||||
|
_mainForm = mainForm;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
MovieView.RetrieveVirtualItem += MovieView_QueryItemText;
|
MovieView.RetrieveVirtualItem += MovieView_QueryItemText;
|
||||||
MovieView.VirtualMode = true;
|
MovieView.VirtualMode = true;
|
||||||
|
@ -59,7 +61,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var indices = MovieView.SelectedIndices;
|
var indices = MovieView.SelectedIndices;
|
||||||
if (indices.Count > 0) // Import file if necessary
|
if (indices.Count > 0) // Import file if necessary
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.StartNewMovie(_movieList[MovieView.SelectedIndices[0]], false);
|
_mainForm.StartNewMovie(_movieList[MovieView.SelectedIndices[0]], false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,7 +609,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (StopOnFrameCheckbox.Checked &&
|
if (StopOnFrameCheckbox.Checked &&
|
||||||
(StopOnFrameTextBox.ToRawInt().HasValue || LastFrameCheckbox.Checked))
|
(StopOnFrameTextBox.ToRawInt().HasValue || LastFrameCheckbox.Checked))
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.PauseOnFrame = LastFrameCheckbox.Checked
|
_mainForm.PauseOnFrame = LastFrameCheckbox.Checked
|
||||||
? Global.MovieSession.Movie.InputLogLength
|
? Global.MovieSession.Movie.InputLogLength
|
||||||
: StopOnFrameTextBox.ToRawInt();
|
: StopOnFrameTextBox.ToRawInt();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,17 @@ using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
// TODO - Allow relative paths in record textbox
|
// TODO - Allow relative paths in record TextBox
|
||||||
public partial class RecordMovie : Form
|
public partial class RecordMovie : Form
|
||||||
{
|
{
|
||||||
|
private readonly MainForm _mainForm;
|
||||||
private readonly IEmulator _emulator;
|
private readonly IEmulator _emulator;
|
||||||
|
|
||||||
public RecordMovie(IEmulator core)
|
public RecordMovie(MainForm mainForm, IEmulator core)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
_mainForm = mainForm;
|
||||||
|
|
||||||
_emulator = core;
|
_emulator = core;
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
if (!_emulator.HasSavestates())
|
if (!_emulator.HasSavestates())
|
||||||
{
|
{
|
||||||
|
@ -126,7 +127,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
movieToRecord.PopulateWithDefaultHeaderValues(AuthorBox.Text);
|
movieToRecord.PopulateWithDefaultHeaderValues(AuthorBox.Text);
|
||||||
movieToRecord.Save();
|
movieToRecord.Save();
|
||||||
GlobalWin.MainForm.StartNewMovie(movieToRecord, true);
|
_mainForm.StartNewMovie(movieToRecord, true);
|
||||||
|
|
||||||
Global.Config.UseDefaultAuthor = DefaultAuthorCheckBox.Checked;
|
Global.Config.UseDefaultAuthor = DefaultAuthorCheckBox.Checked;
|
||||||
if (DefaultAuthorCheckBox.Checked)
|
if (DefaultAuthorCheckBox.Checked)
|
||||||
|
|
Loading…
Reference in New Issue