Bugfix: TasProjects without states loaded without a power on state.
Bugfix: There were several ways to edit movie in TAStudio without rewinding to edited frame. Smarter state management.
This commit is contained in:
parent
10dbd9bafb
commit
1a0476892f
|
@ -46,8 +46,10 @@ namespace BizHawk.Client.Common
|
|||
return; // Nothing to do
|
||||
}
|
||||
|
||||
if (frame == LagLog.Count)
|
||||
LagLog.Add(value.Value);
|
||||
if (frame >= LagLog.Count)
|
||||
{
|
||||
do { LagLog.Add(value.Value); } while (frame >= LagLog.Count);
|
||||
}
|
||||
else
|
||||
LagLog[frame] = value.Value;
|
||||
|
||||
|
|
|
@ -209,6 +209,11 @@ namespace BizHawk.Client.Common
|
|||
StateManager.Load(br);
|
||||
});
|
||||
}
|
||||
else
|
||||
{ // Movie should always have a state at frame 0.
|
||||
if (!this.StartsFromSavestate)
|
||||
StateManager.Capture();
|
||||
}
|
||||
|
||||
bl.GetLump(BinaryStateLump.Markers, false, delegate(TextReader tr)
|
||||
{
|
||||
|
|
|
@ -166,8 +166,9 @@ namespace BizHawk.Client.Common
|
|||
int shouldRemove = -1;
|
||||
if (Used >= Settings.Cap)
|
||||
shouldRemove = _movie.StartsFromSavestate ? 0 : 1;
|
||||
if (shouldRemove != -1) // Which one to remove?
|
||||
{
|
||||
if (shouldRemove != -1)
|
||||
{ // Which one to remove?
|
||||
// No need to have two savestates with only lag frames between them.
|
||||
for (int i = shouldRemove; i < States.Count - 1; i++)
|
||||
{
|
||||
if (AllLag(States.ElementAt(i).Key, States.ElementAt(i + 1).Key))
|
||||
|
@ -176,10 +177,16 @@ namespace BizHawk.Client.Common
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldRemove != -1)
|
||||
{
|
||||
// Keep cap/2 (3?) marker saves
|
||||
int maxMarkers = Settings.Cap / 2;
|
||||
shouldRemove--;
|
||||
do
|
||||
{
|
||||
shouldRemove++;
|
||||
} while (_movie.Markers.IsMarker(States.ElementAt(shouldRemove).Key));
|
||||
|
||||
// Remove
|
||||
Used -= States.ElementAt(shouldRemove).Value.Length;
|
||||
States.RemoveAt(shouldRemove);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SetZoneButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (StartNum.Value >= CurrentTasMovie.InputLogLength || EndNum.Value > CurrentTasMovie.InputLogLength)
|
||||
if (StartNum.Value >= CurrentTasMovie.InputLogLength || EndNum.Value >= CurrentTasMovie.InputLogLength)
|
||||
{
|
||||
MessageBox.Show("Start and end frames must be inside the movie.");
|
||||
return;
|
||||
|
|
|
@ -321,6 +321,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
_floatEditYPos = e.Y;
|
||||
_floatPaintState = CurrentTasMovie.GetFloatState(frame, buttonName);
|
||||
_triggerAutoRestore = true;
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -358,6 +360,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshDialog();
|
||||
}
|
||||
|
||||
_triggerAutoRestore = true;
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
|
||||
_floatPaintState = CurrentTasMovie.GetFloatState(frame, buttonName);
|
||||
|
||||
if (e.Clicks != 2)
|
||||
|
@ -405,6 +410,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
_rightClickFrame = frame;
|
||||
}
|
||||
_rightClickLastFrame = -1;
|
||||
|
||||
_triggerAutoRestore = true;
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
// TODO: Turn off ChangeLog.IsRecording and handle the GeneralUndo here.
|
||||
CurrentTasMovie.ChangeLog.BeginNewBatch("Right-Click Edit");
|
||||
}
|
||||
|
@ -568,6 +576,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
for (int i = startVal; i <= endVal; i++)
|
||||
CurrentTasMovie.SetFrame(i, _rightClickInput[(_rightClickFrame - i) % _rightClickInput.Length]);
|
||||
if (startVal < _triggerAutoRestoreFromFrame)
|
||||
_triggerAutoRestoreFromFrame = startVal;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -608,6 +618,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
CurrentTasMovie.SetFrame(frame + i, _rightClickInput[i]);
|
||||
_rightClickFrame = frame;
|
||||
}
|
||||
|
||||
if (frame < _triggerAutoRestoreFromFrame)
|
||||
_triggerAutoRestoreFromFrame = frame;
|
||||
}
|
||||
RefreshTasView();
|
||||
}
|
||||
|
@ -619,8 +632,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
for (var i = startVal; i <= endVal; i++) // SuuperW: <= so that it will edit the cell you are hovering over. (Inclusive)
|
||||
{
|
||||
CurrentTasMovie.SetBoolState(i, _startBoolDrawColumn, _boolPaintState); // Notice it uses new row, old column, you can only paint across a single column
|
||||
_triggerAutoRestore = true;
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
if (TasView.CurrentCell.RowIndex.Value < _triggerAutoRestoreFromFrame)
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
}
|
||||
|
||||
RefreshTasView();
|
||||
|
@ -636,8 +649,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (i < CurrentTasMovie.InputLogLength)
|
||||
{
|
||||
CurrentTasMovie.SetFloatState(i, _startFloatDrawColumn, _floatPaintState); // Notice it uses new row, old column, you can only paint across a single column
|
||||
_triggerAutoRestore = true;
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
if (TasView.CurrentCell.RowIndex.Value < _triggerAutoRestoreFromFrame)
|
||||
_triggerAutoRestoreFromFrame = TasView.CurrentCell.RowIndex.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -829,13 +829,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
Text = column.Text + " (" + column.Name + ")",
|
||||
Checked = column.Visible,
|
||||
CheckOnClick = true,
|
||||
Tag = column
|
||||
Tag = column.Name
|
||||
};
|
||||
|
||||
menuItem.CheckedChanged += (o, ev) =>
|
||||
{
|
||||
var sender = o as ToolStripMenuItem;
|
||||
(sender.Tag as InputRoll.RollColumn).Visible = sender.Checked;
|
||||
TasView.AllColumns.Find(c => c.Name == (string)sender.Tag).Visible = sender.Checked;
|
||||
TasView.AllColumns.ColumnsChanged();
|
||||
CurrentTasMovie.FlagChanges();
|
||||
RefreshTasView();
|
||||
|
|
Loading…
Reference in New Issue