TAStudio - when loading a movie, set to playback mode, implement auto-switching to record mode at the end of a movie

This commit is contained in:
adelikat 2013-12-14 20:32:00 +00:00
parent 415985cd2e
commit 5c9a604ae5
3 changed files with 18 additions and 4 deletions

View File

@ -17,8 +17,7 @@ namespace BizHawk.Client.Common
SetInput(buttons);
if (captureState)
{
Lagged = Global.Emulator.IsLagFrame;
_state = Global.Emulator.SaveStateBinary();
CaptureSate();
}
}
@ -49,6 +48,12 @@ namespace BizHawk.Client.Common
_boolButtons = buttons;
}
public void CaptureSate()
{
Lagged = Global.Emulator.IsLagFrame;
_state = Global.Emulator.SaveStateBinary();
}
public void ClearInput()
{
InputChanged(_boolButtons);

View File

@ -146,6 +146,10 @@ namespace BizHawk.Client.Common
{
if (frame >= 0)
{
if (!_records[frame].HasState)
{
_records[frame].CaptureSate();
}
return _mg.GenerateMnemonicString(_records[frame].Buttons);
}
else
@ -155,7 +159,11 @@ namespace BizHawk.Client.Common
}
else
{
_mode = Moviemode.Finished; // TODO: never do this in a TasMovie!
_mode = Moviemode.Record;
var buttons = _mg.ParseMnemonicString(_mg.EmptyMnemonic);
_records.Add(new MovieRecord(buttons, true));
return String.Empty;
}
}
@ -363,6 +371,8 @@ namespace BizHawk.Client.Common
catch (EndOfStreamException) { }
});
}
_mode = Moviemode.Play;
return true;
}

View File

@ -167,7 +167,6 @@ namespace BizHawk.Client.EmuHawk
else
{
EngageTasStudio();
}
_tas.ActivePlayers = new List<string> { "Player 1" }; // TODO