Skip to content

Commit 50662f8

Browse files
committed
Handle max steps for branch changelogs.
1 parent 1c0c915 commit 50662f8

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public void Load(ZipStateLoader bl, ITasMovie movie)
194194
{
195195
var b = new TasBranch();
196196
b.ChangeLog = new TasMovieChangeLog(movie);
197+
b.ChangeLog.MaxSteps = movie.ChangeLog.MaxSteps;
197198

198199
if (!bl.GetLump(nheader, abort: false, tr =>
199200
{

src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public partial class BookmarksBranchesBox : UserControl, IDialogParent
2626
private TasBranch _backupBranch;
2727
private BranchUndo _branchUndo = BranchUndo.None;
2828

29+
public void SetBackupMaxSteps(int value)
30+
{
31+
if (_backupBranch != null) _backupBranch.ChangeLog.MaxSteps = value;
32+
}
33+
2934
private enum BranchUndo
3035
{
3136
Load,

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,22 @@ private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
703703

704704
if (val > 0)
705705
{
706-
Settings.MaxUndoSteps = CurrentTasMovie.ChangeLog.MaxSteps = val;
706+
UpdateChangeLogMaxSteps(val);
707707
}
708708
}
709709
}
710+
711+
public void UpdateChangeLogMaxSteps(int value)
712+
{
713+
Settings.MaxUndoSteps = value;
714+
CurrentTasMovie.ChangeLog.MaxSteps = value;
715+
BookMarkControl.SetBackupMaxSteps(value);
716+
foreach (TasBranch branch in CurrentTasMovie.Branches)
717+
{
718+
branch.ChangeLog.MaxSteps = value;
719+
}
720+
}
721+
710722
private void SetRewindStepFastMenuItem_Click(object sender, EventArgs e)
711723
{
712724
using var prompt = new InputPrompt

src/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private void ClearHistoryToHereMenuItem_Click(object sender, EventArgs e)
152152

153153
private void MaxStepsNum_ValueChanged(object sender, EventArgs e)
154154
{
155-
_tastudio.Settings.MaxUndoSteps = Log.MaxSteps = (int)MaxStepsNum.Value;
155+
_tastudio.UpdateChangeLogMaxSteps((int)MaxStepsNum.Value);
156156
}
157157
}
158158
}

0 commit comments

Comments
 (0)