Tastudio - Integrate branches with the statusbar slot icons
This commit is contained in:
parent
fff85d917a
commit
35fdb5dbdd
|
@ -1,5 +1,4 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||||
|
|
||||||
namespace BizHawk.Client.Common
|
namespace BizHawk.Client.Common
|
||||||
|
@ -28,13 +27,20 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
var file = new FileInfo($"{PathManager.SaveStatePrefix(Global.Game)}.QuickSave{i}.State");
|
if (Global.MovieSession.Movie is TasMovie tasMovie)
|
||||||
if (file.Directory != null && file.Directory.Exists == false)
|
|
||||||
{
|
{
|
||||||
file.Directory.Create();
|
_slots[i] = i < tasMovie.Branches.Count;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var file = new FileInfo($"{PathManager.SaveStatePrefix(Global.Game)}.QuickSave{i}.State");
|
||||||
|
if (file.Directory != null && file.Directory.Exists == false)
|
||||||
|
{
|
||||||
|
file.Directory.Create();
|
||||||
|
}
|
||||||
|
|
||||||
_slots[i] = file.Exists;
|
_slots[i] = file.Exists;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +75,11 @@ namespace BizHawk.Client.Common
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Global.MovieSession.Movie is TasMovie tasMovie)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_redo[slot] ^= true;
|
_redo[slot] ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +90,11 @@ namespace BizHawk.Client.Common
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Global.MovieSession.Movie is TasMovie tasMovie)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return _redo[slot];
|
return _redo[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2500,7 +2500,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
: SystemColors.Control;
|
: SystemColors.Control;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateStatusSlots()
|
public void UpdateStatusSlots()
|
||||||
{
|
{
|
||||||
_stateSlots.Update();
|
_stateSlots.Update();
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private readonly ScreenshotForm _screenshot = new ScreenshotForm();
|
private readonly ScreenshotForm _screenshot = new ScreenshotForm();
|
||||||
|
|
||||||
private TasMovie Movie => Tastudio.CurrentTasMovie;
|
private TasMovie Movie => Tastudio.CurrentTasMovie;
|
||||||
|
private MainForm MainForm => GlobalWin.MainForm; // TODO: pass this in
|
||||||
private TasBranch _backupBranch;
|
private TasBranch _backupBranch;
|
||||||
private BranchUndo _branchUndo = BranchUndo.None;
|
private BranchUndo _branchUndo = BranchUndo.None;
|
||||||
|
|
||||||
|
@ -144,6 +145,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Select(Movie.CurrentBranch, true);
|
Select(Movie.CurrentBranch, true);
|
||||||
BranchView.Refresh();
|
BranchView.Refresh();
|
||||||
Tastudio.RefreshDialog();
|
Tastudio.RefreshDialog();
|
||||||
|
MainForm.UpdateStatusSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TasBranch SelectedBranch => BranchView.AnyRowsSelected
|
public TasBranch SelectedBranch => BranchView.AnyRowsSelected
|
||||||
|
@ -157,8 +159,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Frame = Tastudio.Emulator.Frame,
|
Frame = Tastudio.Emulator.Frame,
|
||||||
CoreData = (byte[])(Tastudio.StatableEmulator.SaveStateBinary().Clone()),
|
CoreData = (byte[])(Tastudio.StatableEmulator.SaveStateBinary().Clone()),
|
||||||
InputLog = Movie.CloneInput(),
|
InputLog = Movie.CloneInput(),
|
||||||
CoreFrameBuffer = GlobalWin.MainForm.MakeScreenshotImage(),
|
CoreFrameBuffer = MainForm.MakeScreenshotImage(),
|
||||||
OSDFrameBuffer = GlobalWin.MainForm.CaptureOSD(),
|
OSDFrameBuffer = MainForm.CaptureOSD(),
|
||||||
ChangeLog = new TasMovieChangeLog(Movie),
|
ChangeLog = new TasMovieChangeLog(Movie),
|
||||||
TimeStamp = DateTime.Now,
|
TimeStamp = DateTime.Now,
|
||||||
Markers = Movie.Markers.DeepClone(),
|
Markers = Movie.Markers.DeepClone(),
|
||||||
|
@ -183,7 +185,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)
|
if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)
|
||||||
Movie.Truncate(branch.Frame);
|
Movie.Truncate(branch.Frame);
|
||||||
|
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
MainForm.PauseOnFrame = null;
|
||||||
Tastudio.RefreshDialog();
|
Tastudio.RefreshDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,6 +345,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RemovedCallback?.Invoke(index);
|
RemovedCallback?.Invoke(index);
|
||||||
Tastudio.RefreshDialog();
|
Tastudio.RefreshDialog();
|
||||||
GlobalWin.OSD.AddMessage($"Removed branch {index}");
|
GlobalWin.OSD.AddMessage($"Removed branch {index}");
|
||||||
|
MainForm.UpdateStatusSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UndoBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
private void UndoBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
Loading…
Reference in New Issue