tastudio: pasting input beyond movie length extends it

This commit is contained in:
feos 2016-09-08 18:31:55 +03:00
parent d6d2e4c6f9
commit 7309957c11
1 changed files with 8 additions and 2 deletions

View File

@ -268,10 +268,15 @@ namespace BizHawk.Client.Common
public void CopyOverInput(int frame, IEnumerable<IController> inputStates)
{
ChangeLog.AddGeneralUndo(frame, frame + inputStates.Count() - 1, "Copy Over Input: " + frame);
ChangeLog.BeginNewBatch("Copy Over Input: " + frame);
var lg = LogGeneratorInstance();
var states = inputStates.ToList();
if (_log.Count < states.Count + frame)
ExtendMovieForEdit(states.Count + frame - _log.Count);
ChangeLog.AddGeneralUndo(frame, frame + inputStates.Count() - 1, "Copy Over Input: " + frame);
for (int i = 0; i < states.Count; i++)
{
if (_log.Count <= frame + i)
@ -280,6 +285,7 @@ namespace BizHawk.Client.Common
_log[frame + i] = lg.GenerateLogEntry();
}
ChangeLog.EndBatch();
Changes = true;
InvalidateAfter(frame);