tastudio: add branch undo feature
the fact that it's separated from changelog is because there's no way to extend the latter, but *also* it's intended, as we want branches to be independent from changelog manipulations todo: figure out branch text edits
This commit is contained in:
parent
c6d1aad25f
commit
d254ad01d8
|
@ -14,26 +14,35 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public sealed partial class TasMovie : Bk2Movie, INotifyPropertyChanged
|
public sealed partial class TasMovie : Bk2Movie, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
public new const string Extension = "tasproj";
|
||||||
public const string DefaultProjectName = "default";
|
public const string DefaultProjectName = "default";
|
||||||
|
public BackgroundWorker _progressReportWorker = null;
|
||||||
private readonly Bk2MnemonicConstants Mnemonics = new Bk2MnemonicConstants();
|
public bool LastPositionStable = true;
|
||||||
private readonly TasStateManager StateManager;
|
public string NewBranchText = "";
|
||||||
public readonly TasSession Session;
|
|
||||||
private readonly TasLagLog LagLog = new TasLagLog();
|
|
||||||
private readonly Dictionary<int, IController> InputStateCache = new Dictionary<int, IController>();
|
|
||||||
public readonly IStringLog VerificationLog = StringLogUtil.MakeStringLog(); // For movies that do not begin with power-on, this is the input required to get into the initial state
|
public readonly IStringLog VerificationLog = StringLogUtil.MakeStringLog(); // For movies that do not begin with power-on, this is the input required to get into the initial state
|
||||||
public readonly TasBranchCollection Branches = new TasBranchCollection();
|
public readonly TasBranchCollection Branches = new TasBranchCollection();
|
||||||
|
public readonly TasSession Session;
|
||||||
public BackgroundWorker _progressReportWorker = null;
|
private readonly Bk2MnemonicConstants Mnemonics = new Bk2MnemonicConstants();
|
||||||
public void NewBGWorker(BackgroundWorker newWorker)
|
private readonly TasStateManager StateManager;
|
||||||
{
|
private readonly TasLagLog LagLog = new TasLagLog();
|
||||||
_progressReportWorker = newWorker;
|
private readonly Dictionary<int, IController> InputStateCache = new Dictionary<int, IController>();
|
||||||
}
|
public TasLagLog TasLagLog { get { return LagLog; } }
|
||||||
|
public IStringLog InputLog { get { return _log; } }
|
||||||
public int LastValidFrame
|
public TasMovieMarkerList Markers { get; set; }
|
||||||
{
|
public bool BindMarkersToInput { get; set; }
|
||||||
get { return LagLog.LastValidFrame; }
|
public bool UseInputCache { get; set; }
|
||||||
}
|
public int CurrentBranch { get; set; }
|
||||||
|
public int BranchCount { get { return Branches.Count; } }
|
||||||
|
public int LastValidFrame { get { return LagLog.LastValidFrame; } }
|
||||||
|
public override string PreferredExtension { get { return Extension; } }
|
||||||
|
public TasStateManager TasStateManager { get { return StateManager; } }
|
||||||
|
public TasMovieRecord this[int index] { get { return new TasMovieRecord {
|
||||||
|
// State = StateManager[index],
|
||||||
|
HasState = StateManager.HasState(index),
|
||||||
|
LogEntry = GetInputLogEntry(index),
|
||||||
|
Lagged = LagLog[index + 1],
|
||||||
|
WasLagged = LagLog.History(index + 1)
|
||||||
|
}; } }
|
||||||
|
|
||||||
public TasMovie(string path, bool startsFromSavestate = false, BackgroundWorker progressReportWorker = null)
|
public TasMovie(string path, bool startsFromSavestate = false, BackgroundWorker progressReportWorker = null)
|
||||||
: base(path)
|
: base(path)
|
||||||
|
@ -46,14 +55,12 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeLog = new TasMovieChangeLog(this);
|
ChangeLog = new TasMovieChangeLog(this);
|
||||||
|
|
||||||
StateManager = new TasStateManager(this);
|
StateManager = new TasStateManager(this);
|
||||||
Session = new TasSession(this);
|
Session = new TasSession(this);
|
||||||
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
|
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
|
||||||
Markers = new TasMovieMarkerList(this);
|
Markers = new TasMovieMarkerList(this);
|
||||||
Markers.CollectionChanged += Markers_CollectionChanged;
|
Markers.CollectionChanged += Markers_CollectionChanged;
|
||||||
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
||||||
|
|
||||||
BindMarkersToInput = true;
|
BindMarkersToInput = true;
|
||||||
CurrentBranch = -1;
|
CurrentBranch = -1;
|
||||||
}
|
}
|
||||||
|
@ -68,86 +75,19 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeLog = new TasMovieChangeLog(this);
|
ChangeLog = new TasMovieChangeLog(this);
|
||||||
|
|
||||||
StateManager = new TasStateManager(this);
|
StateManager = new TasStateManager(this);
|
||||||
Session = new TasSession(this);
|
Session = new TasSession(this);
|
||||||
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
|
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
|
||||||
Markers = new TasMovieMarkerList(this);
|
Markers = new TasMovieMarkerList(this);
|
||||||
Markers.CollectionChanged += Markers_CollectionChanged;
|
Markers.CollectionChanged += Markers_CollectionChanged;
|
||||||
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
||||||
|
|
||||||
BindMarkersToInput = true;
|
BindMarkersToInput = true;
|
||||||
CurrentBranch = -1;
|
CurrentBranch = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TasLagLog TasLagLog { get { return LagLog; } }
|
public void NewBGWorker(BackgroundWorker newWorker)
|
||||||
public IStringLog InputLog { get { return _log; } }
|
|
||||||
public TasMovieMarkerList Markers { get; set; }
|
|
||||||
public bool BindMarkersToInput { get; set; }
|
|
||||||
public bool UseInputCache { get; set; }
|
|
||||||
public bool LastPositionStable = true;
|
|
||||||
public string NewBranchText = "";
|
|
||||||
public int CurrentBranch { get; set; }
|
|
||||||
public int BranchCount { get { return Branches.Count; } }
|
|
||||||
|
|
||||||
public TasBranch GetBranch(int index)
|
|
||||||
{
|
{
|
||||||
if (index >= Branches.Count || index < 0)
|
_progressReportWorker = newWorker;
|
||||||
return null;
|
|
||||||
else
|
|
||||||
return Branches[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public int BranchHashByIndex(int index)
|
|
||||||
{
|
|
||||||
if (index >= Branches.Count)
|
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
return Branches[index].UniqueIdentifier.GetHashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int BranchIndexByHash(int hash)
|
|
||||||
{
|
|
||||||
TasBranch branch = Branches.Where(b => b.UniqueIdentifier.GetHashCode() == hash).SingleOrDefault();
|
|
||||||
if (branch == null)
|
|
||||||
return -1;
|
|
||||||
return Branches.IndexOf(branch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int BranchIndexByFrame(int frame)
|
|
||||||
{
|
|
||||||
TasBranch branch = Branches.Where(b => b.Frame == frame)
|
|
||||||
.OrderByDescending(b => b.TimeStamp).FirstOrDefault();
|
|
||||||
if (branch == null)
|
|
||||||
return -1;
|
|
||||||
return Branches.IndexOf(branch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string PreferredExtension
|
|
||||||
{
|
|
||||||
get { return Extension; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public TasStateManager TasStateManager
|
|
||||||
{
|
|
||||||
get { return StateManager; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public new const string Extension = "tasproj";
|
|
||||||
|
|
||||||
public TasMovieRecord this[int index]
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new TasMovieRecord
|
|
||||||
{
|
|
||||||
// State = StateManager[index],
|
|
||||||
HasState = StateManager.HasState(index),
|
|
||||||
LogEntry = GetInputLogEntry(index),
|
|
||||||
Lagged = LagLog[index + 1],
|
|
||||||
WasLagged = LagLog.History(index + 1)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReportProgress(double percent)
|
public void ReportProgress(double percent)
|
||||||
|
@ -160,49 +100,24 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Events and Handlers
|
// TODO: use LogGenerators rather than string comparisons
|
||||||
|
private int? DivergentPoint(IStringLog currentLog, IStringLog newLog)
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
|
|
||||||
private bool _changes;
|
|
||||||
public override bool Changes
|
|
||||||
{
|
{
|
||||||
get { return _changes; }
|
int max = newLog.Count;
|
||||||
protected set
|
if (currentLog.Count < newLog.Count)
|
||||||
{
|
{
|
||||||
if (_changes != value)
|
max = currentLog.Count;
|
||||||
{
|
|
||||||
_changes = value;
|
|
||||||
OnPropertyChanged("Changes");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This event is Raised only when Changes is TOGGLED.
|
for (int i = 0; i < max; i++)
|
||||||
private void OnPropertyChanged(string propertyName)
|
|
||||||
{
|
{
|
||||||
if (PropertyChanged != null)
|
if (newLog[i] != currentLog[i])
|
||||||
{
|
{
|
||||||
// Raising the event when FirstName or LastName property value changed
|
return i;
|
||||||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Markers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
return null;
|
||||||
{
|
|
||||||
Changes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public void ClearChanges()
|
|
||||||
{
|
|
||||||
Changes = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FlagChanges()
|
|
||||||
{
|
|
||||||
Changes = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void StartNewRecording()
|
public override void StartNewRecording()
|
||||||
|
@ -520,6 +435,64 @@ namespace BizHawk.Client.Common
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Branches
|
||||||
|
|
||||||
|
public TasBranch GetBranch(int index)
|
||||||
|
{
|
||||||
|
if (index >= Branches.Count || index < 0)
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
return Branches[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
public TasBranch GetBranch(Guid id)
|
||||||
|
{
|
||||||
|
TasBranch branch = Branches.Where(b => b.UniqueIdentifier == id).SingleOrDefault();
|
||||||
|
if (branch != null)
|
||||||
|
return branch;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int BranchHashByIndex(int index)
|
||||||
|
{
|
||||||
|
if (index >= Branches.Count)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return Branches[index].UniqueIdentifier.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int BranchIndexByHash(int hash)
|
||||||
|
{
|
||||||
|
TasBranch branch = Branches.Where(b => b.UniqueIdentifier.GetHashCode() == hash).SingleOrDefault();
|
||||||
|
if (branch == null)
|
||||||
|
return -1;
|
||||||
|
return Branches.IndexOf(branch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int BranchIndexByFrame(int frame)
|
||||||
|
{
|
||||||
|
TasBranch branch = Branches.Where(b => b.Frame == frame)
|
||||||
|
.OrderByDescending(b => b.TimeStamp).FirstOrDefault();
|
||||||
|
if (branch == null)
|
||||||
|
return -1;
|
||||||
|
return Branches.IndexOf(branch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddBranch(TasBranch branch)
|
||||||
|
{
|
||||||
|
Branches.Add(branch);
|
||||||
|
TasStateManager.AddBranch();
|
||||||
|
Changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveBranch(TasBranch branch)
|
||||||
|
{
|
||||||
|
TasStateManager.RemoveBranch(Branches.IndexOf(branch));
|
||||||
|
Branches.Remove(branch);
|
||||||
|
Changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadBranch(TasBranch branch)
|
public void LoadBranch(TasBranch branch)
|
||||||
{
|
{
|
||||||
int? divergentPoint = DivergentPoint(_log, branch.InputLog);
|
int? divergentPoint = DivergentPoint(_log, branch.InputLog);
|
||||||
|
@ -539,7 +512,6 @@ namespace BizHawk.Client.Common
|
||||||
StateManager.Invalidate(branch.InputLog.Count);
|
StateManager.Invalidate(branch.InputLog.Count);
|
||||||
|
|
||||||
StateManager.LoadBranch(Branches.IndexOf(branch));
|
StateManager.LoadBranch(Branches.IndexOf(branch));
|
||||||
|
|
||||||
StateManager.SetState(branch.Frame, branch.CoreData);
|
StateManager.SetState(branch.Frame, branch.CoreData);
|
||||||
|
|
||||||
//ChangeLog = branch.ChangeLog;
|
//ChangeLog = branch.ChangeLog;
|
||||||
|
@ -549,40 +521,6 @@ namespace BizHawk.Client.Common
|
||||||
Changes = true;
|
Changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use LogGenerators rather than string comparisons
|
|
||||||
private int? DivergentPoint(IStringLog currentLog, IStringLog newLog)
|
|
||||||
{
|
|
||||||
int max = newLog.Count;
|
|
||||||
if (currentLog.Count < newLog.Count)
|
|
||||||
{
|
|
||||||
max = currentLog.Count;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < max; i++)
|
|
||||||
{
|
|
||||||
if (newLog[i] != currentLog[i])
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddBranch(TasBranch branch)
|
|
||||||
{
|
|
||||||
Branches.Add(branch);
|
|
||||||
TasStateManager.AddBranch();
|
|
||||||
Changes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveBranch(TasBranch branch)
|
|
||||||
{
|
|
||||||
TasStateManager.RemoveBranch(Branches.IndexOf(branch));
|
|
||||||
Branches.Remove(branch);
|
|
||||||
Changes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateBranch(TasBranch old, TasBranch newBranch)
|
public void UpdateBranch(TasBranch old, TasBranch newBranch)
|
||||||
{
|
{
|
||||||
int index = Branches.IndexOf(old);
|
int index = Branches.IndexOf(old);
|
||||||
|
@ -605,5 +543,52 @@ namespace BizHawk.Client.Common
|
||||||
Branches.Insert(b2, branch);
|
Branches.Insert(b2, branch);
|
||||||
Changes = true;
|
Changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Events and Handlers
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
private bool _changes;
|
||||||
|
public override bool Changes
|
||||||
|
{
|
||||||
|
get { return _changes; }
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
if (_changes != value)
|
||||||
|
{
|
||||||
|
_changes = value;
|
||||||
|
OnPropertyChanged("Changes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This event is Raised only when Changes is TOGGLED.
|
||||||
|
private void OnPropertyChanged(string propertyName)
|
||||||
|
{
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
{
|
||||||
|
// Raising the event when FirstName or LastName property value changed
|
||||||
|
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Markers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
Changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearChanges()
|
||||||
|
{
|
||||||
|
Changes = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FlagChanges()
|
||||||
|
{
|
||||||
|
Changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -857,6 +857,9 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void UpdateBranch(int index)
|
public void UpdateBranch(int index)
|
||||||
{
|
{
|
||||||
|
if (index == -1) // backup branch is outsider
|
||||||
|
return;
|
||||||
|
|
||||||
int branchHash = _movie.BranchHashByIndex(index);
|
int branchHash = _movie.BranchHashByIndex(index);
|
||||||
|
|
||||||
// RemoveBranch
|
// RemoveBranch
|
||||||
|
@ -899,6 +902,9 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void LoadBranch(int index)
|
public void LoadBranch(int index)
|
||||||
{
|
{
|
||||||
|
if (index == -1) // backup branch is outsider
|
||||||
|
return;
|
||||||
|
|
||||||
int branchHash = _movie.BranchHashByIndex(index);
|
int branchHash = _movie.BranchHashByIndex(index);
|
||||||
|
|
||||||
//Invalidate(0); // Not a good way of doing it?
|
//Invalidate(0); // Not a good way of doing it?
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
this.BookmarksBranchesGroupBox = new System.Windows.Forms.GroupBox();
|
this.BookmarksBranchesGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.UndoBranchButton = new System.Windows.Forms.Button();
|
||||||
this.JumpToBranchButton = new System.Windows.Forms.Button();
|
this.JumpToBranchButton = new System.Windows.Forms.Button();
|
||||||
this.EditBranchTextButton = new System.Windows.Forms.Button();
|
|
||||||
this.UpdateBranchButton = new System.Windows.Forms.Button();
|
this.UpdateBranchButton = new System.Windows.Forms.Button();
|
||||||
this.AddWithTextBranchButton = new System.Windows.Forms.Button();
|
this.AddWithTextBranchButton = new System.Windows.Forms.Button();
|
||||||
this.AddBranchButton = new System.Windows.Forms.Button();
|
this.AddBranchButton = new System.Windows.Forms.Button();
|
||||||
|
@ -43,10 +43,11 @@
|
||||||
this.LoadBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.LoadBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.UpdateBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.UpdateBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.EditBranchTextContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.EditBranchTextContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.JumpToBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.UndoBranchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.RemoveBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.RemoveBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||||
this.JumpToBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.BookmarksBranchesGroupBox.SuspendLayout();
|
this.BookmarksBranchesGroupBox.SuspendLayout();
|
||||||
this.BranchesContextMenu.SuspendLayout();
|
this.BranchesContextMenu.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
@ -56,8 +57,8 @@
|
||||||
this.BookmarksBranchesGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
this.BookmarksBranchesGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
| System.Windows.Forms.AnchorStyles.Left)
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.BookmarksBranchesGroupBox.Controls.Add(this.UndoBranchButton);
|
||||||
this.BookmarksBranchesGroupBox.Controls.Add(this.JumpToBranchButton);
|
this.BookmarksBranchesGroupBox.Controls.Add(this.JumpToBranchButton);
|
||||||
this.BookmarksBranchesGroupBox.Controls.Add(this.EditBranchTextButton);
|
|
||||||
this.BookmarksBranchesGroupBox.Controls.Add(this.UpdateBranchButton);
|
this.BookmarksBranchesGroupBox.Controls.Add(this.UpdateBranchButton);
|
||||||
this.BookmarksBranchesGroupBox.Controls.Add(this.AddWithTextBranchButton);
|
this.BookmarksBranchesGroupBox.Controls.Add(this.AddWithTextBranchButton);
|
||||||
this.BookmarksBranchesGroupBox.Controls.Add(this.AddBranchButton);
|
this.BookmarksBranchesGroupBox.Controls.Add(this.AddBranchButton);
|
||||||
|
@ -70,12 +71,24 @@
|
||||||
this.BookmarksBranchesGroupBox.TabStop = false;
|
this.BookmarksBranchesGroupBox.TabStop = false;
|
||||||
this.BookmarksBranchesGroupBox.Text = "Branches";
|
this.BookmarksBranchesGroupBox.Text = "Branches";
|
||||||
//
|
//
|
||||||
|
// UndoBranchButton
|
||||||
|
//
|
||||||
|
this.UndoBranchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.UndoBranchButton.Enabled = false;
|
||||||
|
this.UndoBranchButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.undo;
|
||||||
|
this.UndoBranchButton.Location = new System.Drawing.Point(159, 249);
|
||||||
|
this.UndoBranchButton.Name = "UndoBranchButton";
|
||||||
|
this.UndoBranchButton.Size = new System.Drawing.Size(23, 23);
|
||||||
|
this.UndoBranchButton.TabIndex = 10;
|
||||||
|
this.UndoBranchButton.UseVisualStyleBackColor = true;
|
||||||
|
this.UndoBranchButton.Click += new System.EventHandler(this.UndoBranchToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// JumpToBranchButton
|
// JumpToBranchButton
|
||||||
//
|
//
|
||||||
this.JumpToBranchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.JumpToBranchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.JumpToBranchButton.Enabled = false;
|
this.JumpToBranchButton.Enabled = false;
|
||||||
this.JumpToBranchButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.JumpTo;
|
this.JumpToBranchButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.JumpTo;
|
||||||
this.JumpToBranchButton.Location = new System.Drawing.Point(161, 249);
|
this.JumpToBranchButton.Location = new System.Drawing.Point(130, 249);
|
||||||
this.JumpToBranchButton.Name = "JumpToBranchButton";
|
this.JumpToBranchButton.Name = "JumpToBranchButton";
|
||||||
this.JumpToBranchButton.Size = new System.Drawing.Size(23, 23);
|
this.JumpToBranchButton.Size = new System.Drawing.Size(23, 23);
|
||||||
this.JumpToBranchButton.TabIndex = 9;
|
this.JumpToBranchButton.TabIndex = 9;
|
||||||
|
@ -83,19 +96,6 @@
|
||||||
this.JumpToBranchButton.UseVisualStyleBackColor = true;
|
this.JumpToBranchButton.UseVisualStyleBackColor = true;
|
||||||
this.JumpToBranchButton.Click += new System.EventHandler(this.JumpToBranchToolStripMenuItem_Click);
|
this.JumpToBranchButton.Click += new System.EventHandler(this.JumpToBranchToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// EditBranchTextButton
|
|
||||||
//
|
|
||||||
this.EditBranchTextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
|
||||||
this.EditBranchTextButton.Enabled = false;
|
|
||||||
this.EditBranchTextButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.pencil;
|
|
||||||
this.EditBranchTextButton.Location = new System.Drawing.Point(130, 249);
|
|
||||||
this.EditBranchTextButton.Name = "EditBranchTextButton";
|
|
||||||
this.EditBranchTextButton.Size = new System.Drawing.Size(25, 23);
|
|
||||||
this.EditBranchTextButton.TabIndex = 5;
|
|
||||||
this.toolTip1.SetToolTip(this.EditBranchTextButton, "Edit Branch Text");
|
|
||||||
this.EditBranchTextButton.UseVisualStyleBackColor = true;
|
|
||||||
this.EditBranchTextButton.Click += new System.EventHandler(this.EditBranchTextToolStripMenuItem_Click);
|
|
||||||
//
|
|
||||||
// UpdateBranchButton
|
// UpdateBranchButton
|
||||||
//
|
//
|
||||||
this.UpdateBranchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.UpdateBranchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
@ -172,7 +172,7 @@
|
||||||
this.BranchView.Size = new System.Drawing.Size(186, 224);
|
this.BranchView.Size = new System.Drawing.Size(186, 224);
|
||||||
this.BranchView.suspendHotkeys = false;
|
this.BranchView.suspendHotkeys = false;
|
||||||
this.BranchView.TabIndex = 0;
|
this.BranchView.TabIndex = 0;
|
||||||
this.BranchView.CellHovered += new BizHawk.Client.EmuHawk.InputRoll.HoverEventHandler(this.BranchView_CellHovered);
|
this.BranchView.PointedCellChanged += new BizHawk.Client.EmuHawk.InputRoll.CellChangeEventHandler(this.BranchView_PointedCellChanged);
|
||||||
this.BranchView.CellDropped += new BizHawk.Client.EmuHawk.InputRoll.CellDroppedEvent(this.BranchView_CellDropped);
|
this.BranchView.CellDropped += new BizHawk.Client.EmuHawk.InputRoll.CellDroppedEvent(this.BranchView_CellDropped);
|
||||||
this.BranchView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.BranchView_MouseDoubleClick);
|
this.BranchView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.BranchView_MouseDoubleClick);
|
||||||
this.BranchView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.BranchView_MouseDown);
|
this.BranchView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.BranchView_MouseDown);
|
||||||
|
@ -189,10 +189,11 @@
|
||||||
this.UpdateBranchContextMenuItem,
|
this.UpdateBranchContextMenuItem,
|
||||||
this.EditBranchTextContextMenuItem,
|
this.EditBranchTextContextMenuItem,
|
||||||
this.JumpToBranchContextMenuItem,
|
this.JumpToBranchContextMenuItem,
|
||||||
|
this.UndoBranchToolStripMenuItem,
|
||||||
this.toolStripSeparator2,
|
this.toolStripSeparator2,
|
||||||
this.RemoveBranchContextMenuItem});
|
this.RemoveBranchContextMenuItem});
|
||||||
this.BranchesContextMenu.Name = "BranchesContextMenu";
|
this.BranchesContextMenu.Name = "BranchesContextMenu";
|
||||||
this.BranchesContextMenu.Size = new System.Drawing.Size(153, 186);
|
this.BranchesContextMenu.Size = new System.Drawing.Size(153, 208);
|
||||||
this.BranchesContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.BranchesContextMenu_Opening);
|
this.BranchesContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.BranchesContextMenu_Opening);
|
||||||
//
|
//
|
||||||
// AddBranchContextMenu
|
// AddBranchContextMenu
|
||||||
|
@ -235,6 +236,23 @@
|
||||||
this.EditBranchTextContextMenuItem.Text = "Edit Text";
|
this.EditBranchTextContextMenuItem.Text = "Edit Text";
|
||||||
this.EditBranchTextContextMenuItem.Click += new System.EventHandler(this.EditBranchTextToolStripMenuItem_Click);
|
this.EditBranchTextContextMenuItem.Click += new System.EventHandler(this.EditBranchTextToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// JumpToBranchContextMenuItem
|
||||||
|
//
|
||||||
|
this.JumpToBranchContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.JumpTo;
|
||||||
|
this.JumpToBranchContextMenuItem.Name = "JumpToBranchContextMenuItem";
|
||||||
|
this.JumpToBranchContextMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||||
|
this.JumpToBranchContextMenuItem.Text = "Jump To";
|
||||||
|
this.JumpToBranchContextMenuItem.Click += new System.EventHandler(this.JumpToBranchToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// UndoBranchToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.UndoBranchToolStripMenuItem.Enabled = false;
|
||||||
|
this.UndoBranchToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.undo;
|
||||||
|
this.UndoBranchToolStripMenuItem.Name = "UndoBranchToolStripMenuItem";
|
||||||
|
this.UndoBranchToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||||
|
this.UndoBranchToolStripMenuItem.Text = "Undo";
|
||||||
|
this.UndoBranchToolStripMenuItem.Click += new System.EventHandler(this.UndoBranchToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// toolStripSeparator2
|
// toolStripSeparator2
|
||||||
//
|
//
|
||||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||||
|
@ -248,14 +266,6 @@
|
||||||
this.RemoveBranchContextMenuItem.Text = "Remove";
|
this.RemoveBranchContextMenuItem.Text = "Remove";
|
||||||
this.RemoveBranchContextMenuItem.Click += new System.EventHandler(this.RemoveBranchToolStripMenuItem_Click);
|
this.RemoveBranchContextMenuItem.Click += new System.EventHandler(this.RemoveBranchToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// JumpToBranchContextMenuItem
|
|
||||||
//
|
|
||||||
this.JumpToBranchContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.JumpTo;
|
|
||||||
this.JumpToBranchContextMenuItem.Name = "JumpToBranchToolStripMenuItem";
|
|
||||||
this.JumpToBranchContextMenuItem.Size = new System.Drawing.Size(152, 22);
|
|
||||||
this.JumpToBranchContextMenuItem.Text = "Jump To";
|
|
||||||
this.JumpToBranchContextMenuItem.Click += new System.EventHandler(this.JumpToBranchToolStripMenuItem_Click);
|
|
||||||
//
|
|
||||||
// BookmarksBranchesBox
|
// BookmarksBranchesBox
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||||
|
@ -279,7 +289,6 @@
|
||||||
private System.Windows.Forms.ToolStripMenuItem UpdateBranchContextMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem UpdateBranchContextMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem EditBranchTextContextMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem EditBranchTextContextMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem AddBranchWithTextContextMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem AddBranchWithTextContextMenuItem;
|
||||||
private System.Windows.Forms.Button EditBranchTextButton;
|
|
||||||
private System.Windows.Forms.Button UpdateBranchButton;
|
private System.Windows.Forms.Button UpdateBranchButton;
|
||||||
private System.Windows.Forms.Button AddWithTextBranchButton;
|
private System.Windows.Forms.Button AddWithTextBranchButton;
|
||||||
private System.Windows.Forms.Button AddBranchButton;
|
private System.Windows.Forms.Button AddBranchButton;
|
||||||
|
@ -288,5 +297,7 @@
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||||
private System.Windows.Forms.Button JumpToBranchButton;
|
private System.Windows.Forms.Button JumpToBranchButton;
|
||||||
private System.Windows.Forms.ToolStripMenuItem JumpToBranchContextMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem JumpToBranchContextMenuItem;
|
||||||
|
private System.Windows.Forms.Button UndoBranchButton;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem UndoBranchToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,24 +16,21 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class BookmarksBranchesBox : UserControl
|
public partial class BookmarksBranchesBox : UserControl
|
||||||
{
|
{
|
||||||
|
public TAStudio Tastudio { get; set; }
|
||||||
private const string BranchNumberColumnName = "BranchNumberColumn";
|
private const string BranchNumberColumnName = "BranchNumberColumn";
|
||||||
private const string FrameColumnName = "FrameColumn";
|
private const string FrameColumnName = "FrameColumn";
|
||||||
private const string UserTextColumnName = "TextColumn";
|
private const string UserTextColumnName = "TextColumn";
|
||||||
private readonly PlatformFrameRates FrameRates = new PlatformFrameRates();
|
private readonly PlatformFrameRates FrameRates = new PlatformFrameRates();
|
||||||
private ScreenshotForm Screenshot = new ScreenshotForm();
|
private ScreenshotForm Screenshot = new ScreenshotForm();
|
||||||
private TasMovie Movie { get { return Tastudio.CurrentTasMovie; } }
|
private TasMovie Movie { get { return Tastudio.CurrentTasMovie; } }
|
||||||
public TAStudio Tastudio { get; set; }
|
public TasBranch BackupBranch;
|
||||||
|
private enum BranchUndo { Load, Update, Text, Remove, None }
|
||||||
|
private BranchUndo _branchUndo = BranchUndo.None;
|
||||||
public int HoverInterval {
|
public int HoverInterval {
|
||||||
get { return BranchView.HoverInterval; }
|
get { return BranchView.HoverInterval; }
|
||||||
set { BranchView.HoverInterval = value; }
|
set { BranchView.HoverInterval = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private TasBranch GetBranch(int id)
|
|
||||||
{
|
|
||||||
return Tastudio.CurrentTasMovie.GetBranch(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BookmarksBranchesBox()
|
public BookmarksBranchesBox()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -125,6 +122,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
#region Actions
|
#region Actions
|
||||||
|
|
||||||
|
private TasBranch GetBranch(int index)
|
||||||
|
{
|
||||||
|
return Tastudio.CurrentTasMovie.GetBranch(index);
|
||||||
|
}
|
||||||
|
|
||||||
public void Branch()
|
public void Branch()
|
||||||
{
|
{
|
||||||
TasBranch branch = CreateBranch();
|
TasBranch branch = CreateBranch();
|
||||||
|
@ -221,6 +223,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void LoadBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
private void LoadBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
BackupBranch = CreateBranch();
|
||||||
|
|
||||||
|
var currentHashes = Movie.Branches.Select(b => b.UniqueIdentifier.GetHashCode()).ToList();
|
||||||
|
do BackupBranch.UniqueIdentifier = Guid.NewGuid();
|
||||||
|
while (currentHashes.Contains(BackupBranch.UniqueIdentifier.GetHashCode()));
|
||||||
|
|
||||||
|
UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
|
||||||
|
UndoBranchToolStripMenuItem.Text = "Undo Branch Load";
|
||||||
|
toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Load");
|
||||||
|
_branchUndo = BranchUndo.Load;
|
||||||
|
|
||||||
LoadSelectedBranch();
|
LoadSelectedBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,6 +242,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (SelectedBranch != null)
|
if (SelectedBranch != null)
|
||||||
{
|
{
|
||||||
Movie.CurrentBranch = BranchView.SelectedRows.First();
|
Movie.CurrentBranch = BranchView.SelectedRows.First();
|
||||||
|
|
||||||
|
BackupBranch = SelectedBranch;
|
||||||
|
UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
|
||||||
|
UndoBranchToolStripMenuItem.Text = "Undo Branch Update";
|
||||||
|
toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Update");
|
||||||
|
_branchUndo = BranchUndo.Update;
|
||||||
|
|
||||||
UpdateBranch(SelectedBranch);
|
UpdateBranch(SelectedBranch);
|
||||||
GlobalWin.OSD.AddMessage("Saved branch " + Movie.CurrentBranch.ToString());
|
GlobalWin.OSD.AddMessage("Saved branch " + Movie.CurrentBranch.ToString());
|
||||||
}
|
}
|
||||||
|
@ -239,6 +259,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (SelectedBranch != null)
|
if (SelectedBranch != null)
|
||||||
{
|
{
|
||||||
int index = BranchView.SelectedRows.First();
|
int index = BranchView.SelectedRows.First();
|
||||||
|
|
||||||
|
BackupBranch = SelectedBranch;
|
||||||
|
UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
|
||||||
|
UndoBranchToolStripMenuItem.Text = "Undo Branch Text Edit";
|
||||||
|
toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Text Edit");
|
||||||
|
_branchUndo = BranchUndo.Text;
|
||||||
|
|
||||||
EditBranchTextPopUp(index);
|
EditBranchTextPopUp(index);
|
||||||
GlobalWin.OSD.AddMessage("Edited branch " + index.ToString());
|
GlobalWin.OSD.AddMessage("Edited branch " + index.ToString());
|
||||||
}
|
}
|
||||||
|
@ -268,6 +295,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Movie.CurrentBranch--;
|
Movie.CurrentBranch--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BackupBranch = SelectedBranch;
|
||||||
|
UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
|
||||||
|
UndoBranchToolStripMenuItem.Text = "Undo Branch Removal";
|
||||||
|
toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Removal");
|
||||||
|
_branchUndo = BranchUndo.Remove;
|
||||||
|
|
||||||
Movie.RemoveBranch(SelectedBranch);
|
Movie.RemoveBranch(SelectedBranch);
|
||||||
BranchView.RowCount = Movie.BranchCount;
|
BranchView.RowCount = Movie.BranchCount;
|
||||||
|
|
||||||
|
@ -283,6 +316,33 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UndoBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_branchUndo == BranchUndo.Load)
|
||||||
|
{
|
||||||
|
LoadBranch(BackupBranch);
|
||||||
|
GlobalWin.OSD.AddMessage("Branch Load canceled");
|
||||||
|
}
|
||||||
|
else if (_branchUndo == BranchUndo.Update)
|
||||||
|
{
|
||||||
|
Movie.UpdateBranch(Movie.GetBranch(BackupBranch.UniqueIdentifier), BackupBranch);
|
||||||
|
GlobalWin.OSD.AddMessage("Branch Update canceled");
|
||||||
|
}
|
||||||
|
else if (_branchUndo == BranchUndo.Text)
|
||||||
|
{
|
||||||
|
Movie.GetBranch(BackupBranch.UniqueIdentifier).UserText = BackupBranch.UserText;
|
||||||
|
}
|
||||||
|
else if (_branchUndo == BranchUndo.Remove)
|
||||||
|
{
|
||||||
|
Movie.AddBranch(BackupBranch);
|
||||||
|
BranchView.RowCount = Movie.BranchCount;
|
||||||
|
GlobalWin.OSD.AddMessage("Branch Removal canceled");
|
||||||
|
}
|
||||||
|
UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = false;
|
||||||
|
BranchView.Refresh();
|
||||||
|
Tastudio.RefreshDialog();
|
||||||
|
}
|
||||||
|
|
||||||
public void AddBranchExternal()
|
public void AddBranchExternal()
|
||||||
{
|
{
|
||||||
AddBranchToolStripMenuItem_Click(null, null);
|
AddBranchToolStripMenuItem_Click(null, null);
|
||||||
|
@ -430,7 +490,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
UpdateBranchButton.Enabled =
|
UpdateBranchButton.Enabled =
|
||||||
LoadBranchButton.Enabled =
|
LoadBranchButton.Enabled =
|
||||||
EditBranchTextButton.Enabled =
|
|
||||||
JumpToBranchButton.Enabled =
|
JumpToBranchButton.Enabled =
|
||||||
SelectedBranch != null;
|
SelectedBranch != null;
|
||||||
|
|
||||||
|
@ -456,7 +515,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void BranchView_MouseDoubleClick(object sender, MouseEventArgs e)
|
private void BranchView_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
LoadSelectedBranch();
|
LoadBranchToolStripMenuItem_Click(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BranchView_MouseMove(object sender, MouseEventArgs e)
|
private void BranchView_MouseMove(object sender, MouseEventArgs e)
|
||||||
|
@ -476,7 +535,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Screenshot.FadeOut();
|
Screenshot.FadeOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BranchView_CellHovered(object sender, InputRoll.CellEventArgs e)
|
private void BranchView_CellDropped(object sender, InputRoll.CellEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.NewCell != null && e.NewCell.IsDataCell && e.OldCell.RowIndex.Value < Movie.BranchCount)
|
||||||
|
{
|
||||||
|
Movie.SwapBranches(e.OldCell.RowIndex.Value, e.NewCell.RowIndex.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BranchView_PointedCellChanged(object sender, InputRoll.CellEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.NewCell != null && e.NewCell.RowIndex.HasValue && e.NewCell.Column != null && e.NewCell.RowIndex < Movie.BranchCount)
|
if (e.NewCell != null && e.NewCell.RowIndex.HasValue && e.NewCell.Column != null && e.NewCell.RowIndex < Movie.BranchCount)
|
||||||
{
|
{
|
||||||
|
@ -507,14 +574,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BranchView_CellDropped(object sender, InputRoll.CellEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.NewCell != null && e.NewCell.IsDataCell && e.OldCell.RowIndex.Value < Movie.BranchCount)
|
|
||||||
{
|
|
||||||
Movie.SwapBranches(e.OldCell.RowIndex.Value, e.NewCell.RowIndex.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,4 @@
|
||||||
<metadata name="BranchesContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="BranchesContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>23, 17</value>
|
<value>23, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>185, 17</value>
|
|
||||||
</metadata>
|
|
||||||
</root>
|
</root>
|
Loading…
Reference in New Issue