Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d2947f6
Add some tests for TasMovie, mostly undo/redo actions.
SuuperW Jun 29, 2025
793d1a7
Fix SetAxisStates even though it's not used anywhere except tests.
SuuperW Jul 2, 2025
9d178b4
Pass ExtendsMovie test, by using undo batching in relevant methods.
SuuperW Jul 4, 2025
1aedd82
Pass test AllOperationsRespectBatching.
SuuperW Jul 4, 2025
58cf4cc
Pass test UndoingMidBatchRetainsBatchState.
SuuperW Jul 4, 2025
c91d3bc
Pass test WorkWithFullUndoHistory. BeginNewBatch was not returning wh…
SuuperW Jul 4, 2025
1045fa4
If these two weird things were needed before, they don't seem to be n…
SuuperW Jul 4, 2025
1348e35
Fix: RemoveFrames(ICollection<int>) did multiple undo actions. There …
SuuperW Jul 4, 2025
91622bc
Pass test MarkersUnaffectedByMovieExtension
SuuperW Jul 4, 2025
2409044
Move documentation comments to the interface definitions, so that the…
SuuperW Jul 5, 2025
79e3fa1
Add documentation for GreenzoneInvalidated and update Lua's documenta…
SuuperW Jul 5, 2025
57257d3
Pass MovieUndo marker binding tests.
SuuperW Jul 5, 2025
7e0b6ca
Remove this check. It never made any sense, even in the commit that a…
SuuperW Jul 3, 2025
4d0e508
Remove redundant code and standardize order of operations. Passes All…
SuuperW Jul 5, 2025
c99680e
Introduce invalidation batching. Passes SingleInvalidation tests.
SuuperW Jul 5, 2025
8ff0226
Use undo and invalidation batching where appropriate.
SuuperW Jul 5, 2025
44dc5ed
Use the marker list collection changed event to drive TAStudio refres…
SuuperW Jul 5, 2025
66208b3
Remove unnecessary code and simplify.
SuuperW Jul 5, 2025
700e858
Include undo history form refreshing with TAStudio's refresh logic. F…
SuuperW Jul 6, 2025
7c18b85
Don't make multiple undo history forms.
SuuperW Jul 2, 2025
6c22ba3
Don't create undo history item for a paste that does nothing.
SuuperW Jul 6, 2025
2fdf78f
Fix: Recording at the end of the movie in TAStudio made two undo items.
SuuperW Jun 29, 2025
1579062
Fix: Undoing recording frame 0 then advancing 1 frame could display i…
SuuperW Jun 29, 2025
4d2c3c1
While I'm cleaning up stuff, make TAStudioLuaLibrary own this logic t…
SuuperW Jul 6, 2025
5b2e1d8
Make consecutive recorded frames while unpaused be a single undo action.
SuuperW Jul 27, 2025
4f59cbe
Fix typo and style violations.
SuuperW Jul 27, 2025
ab98875
Fix: Recording a frame while unpaused, immediately after an undo, cou…
SuuperW Aug 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/BizHawk.Client.Common/movie/bk2/StringLogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public static IStringLog MakeStringLog()
}
}

if (newLog.Count != currentLog.Count)
return Math.Min(newLog.Count, currentLog.Count);

return null;
}

Expand Down
22 changes: 21 additions & 1 deletion src/BizHawk.Client.Common/movie/interfaces/ITasMovie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public interface ITasMovie : IMovie, INotifyPropertyChanged, IDisposable
int LastEditedFrame { get; }
bool LastEditWasRecording { get; }

/// <summary>
/// Called whenever the movie is modified in a way that could invalidate savestates in the movie's state history.
/// Called regardless of whether any states were actually invalidated.
/// The parameter is the last frame number who's savestate (if it exists) is still valid. That is, the first of the modified frames.
/// </summary>
Action<int> GreenzoneInvalidated { get; set; }

string DisplayValue(int frame, string buttonName);
Expand All @@ -43,10 +48,16 @@ public interface ITasMovie : IMovie, INotifyPropertyChanged, IDisposable
void InsertInput(int frame, IEnumerable<IController> inputStates);

void InsertEmptyFrame(int frame, int count = 1);
int CopyOverInput(int frame, IEnumerable<IController> inputStates);
void CopyOverInput(int frame, IEnumerable<IController> inputStates);

void RemoveFrame(int frame);
void RemoveFrames(ICollection<int> frames);

/// <summary>
/// Remove all frames between removeStart and removeUpTo (excluding removeUpTo).
/// </summary>
/// <param name="removeStart">The first frame to remove.</param>
/// <param name="removeUpTo">The frame after the last frame to remove.</param>
void RemoveFrames(int removeStart, int removeUpTo);
void SetFrame(int frame, string source);

Expand All @@ -55,5 +66,14 @@ public interface ITasMovie : IMovie, INotifyPropertyChanged, IDisposable
void CopyVerificationLog(IEnumerable<string> log);

bool IsReserved(int frame);

/// <summary>
/// Sometimes we will be doing a whole bunch of small operations together. (e.g. large painting undo, large Lua edit)
/// This avoids using the greenzone invalidated callback for each one, making things run smoother.
/// Note that this is different from undo batching.
/// For one, we don't undo batch an undo itself.
/// For two, undo batches might span a significant amount of time during which users want to atually see edits or auto-restore in TAStudio.
/// </summary>
void SingleInvalidation(Action action);
}
}
Loading
Loading