tastudio: load projects without branch state info.
fix some other crashes, kill selection when loading a file.
This commit is contained in:
parent
87dd32eeac
commit
31e476a3cd
|
@ -82,8 +82,21 @@ namespace BizHawk.Client.Common
|
||||||
public bool BindMarkersToInput { get; set; }
|
public bool BindMarkersToInput { get; set; }
|
||||||
public bool UseInputCache { get; set; }
|
public bool UseInputCache { get; set; }
|
||||||
public int BranchCount { get { return Branches.Count; } }
|
public int BranchCount { get { return Branches.Count; } }
|
||||||
public TasBranch GetBranch(int index) { return Branches[index]; }
|
public TasBranch GetBranch(int index)
|
||||||
public int BranchHashByIndex(int index) { return Branches[index].UniqueIdentifier.GetHashCode(); }
|
{
|
||||||
|
if (index >= Branches.Count)
|
||||||
|
return null; // are we allowed?
|
||||||
|
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)
|
public int BranchIndexByHash(int hash)
|
||||||
{
|
{
|
||||||
|
|
|
@ -588,6 +588,9 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
if (br.PeekChar() == -1) // at least don't crash when loading an old project
|
||||||
|
return;
|
||||||
|
|
||||||
currentBranch = br.ReadInt32();
|
currentBranch = br.ReadInt32();
|
||||||
int c = br.ReadInt32();
|
int c = br.ReadInt32();
|
||||||
BranchStates = new SortedList<int, SortedList<int, StateManagerState>>(c);
|
BranchStates = new SortedList<int, SortedList<int, StateManagerState>>(c);
|
||||||
|
|
|
@ -98,8 +98,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
|
private void QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
|
||||||
{
|
{
|
||||||
var record = Tastudio.CurrentTasMovie[GetBranch(index).Frame];
|
TasBranch branch = GetBranch(index);
|
||||||
|
if (branch != null)
|
||||||
|
{
|
||||||
|
var record = Tastudio.CurrentTasMovie[branch.Frame];
|
||||||
if (index == CurrentBranch)
|
if (index == CurrentBranch)
|
||||||
color = TAStudio.CurrentFrame_InputLog; // SystemColors.HotTrack;
|
color = TAStudio.CurrentFrame_InputLog; // SystemColors.HotTrack;
|
||||||
else if (record.Lagged.HasValue)
|
else if (record.Lagged.HasValue)
|
||||||
|
@ -113,6 +115,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
color = TAStudio.GreenZone_InputLog;
|
color = TAStudio.GreenZone_InputLog;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Highlight the branch cell a little, if hovering over it
|
// Highlight the branch cell a little, if hovering over it
|
||||||
if (BranchView.CurrentCellIsDataCell &&
|
if (BranchView.CurrentCellIsDataCell &&
|
||||||
|
|
|
@ -433,7 +433,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (!HandleMovieLoadStuff(newMovie))
|
if (!HandleMovieLoadStuff(newMovie))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
BookMarkControl.UpdateValues();
|
// clear all selections
|
||||||
|
TasView.DeselectAll();
|
||||||
|
BookMarkControl.Restart();
|
||||||
|
MarkerControl.Restart();
|
||||||
|
|
||||||
RefreshDialog();
|
RefreshDialog();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue