Merge pull request #3098 from TASEmulators/TAStudioUpdateSelf

TAStudio update self
This commit is contained in:
SuuperW 2022-02-04 14:55:18 -06:00 committed by GitHub
commit e1c2016c91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 20 deletions

View File

@ -19,7 +19,6 @@ namespace BizHawk.Client.EmuHawk
[OptionalService]
public ISaveRam SaveRamEmulator { get; private set; }
private bool _hackyDontUpdate;
private bool _initializing; // If true, will bypass restart logic, this is necessary since loading projects causes a movie to load which causes a rom to reload causing dialogs to restart
private int _lastRefresh;
@ -67,11 +66,6 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (_hackyDontUpdate)
{
return;
}
if (_exiting)
{
return;

View File

@ -16,6 +16,7 @@ namespace BizHawk.Client.EmuHawk
// Input Painting
private string _startBoolDrawColumn = "";
private string _startAxisDrawColumn = "";
private bool _drewAxis;
private bool _boolPaintState;
private int _axisPaintState;
private int _axisBackupState;
@ -657,7 +658,6 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.SetBoolStates(firstSel, (frame - firstSel) + 1, buttonName, !allPressed);
_boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName);
_triggerAutoRestore = true;
JumpToGreenzone(true);
RefreshDialog();
}
else if (ModifierKeys == Keys.Shift && ModifierKeys == Keys.Alt) // Does not work?
@ -671,7 +671,6 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.ToggleBoolState(TasView.CurrentCell.RowIndex.Value, buttonName);
_boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName);
_triggerAutoRestore = true;
JumpToGreenzone(true);
RefreshDialog();
}
}
@ -791,6 +790,7 @@ namespace BizHawk.Client.EmuHawk
_startSelectionDrag = false;
_startBoolDrawColumn = "";
_startAxisDrawColumn = "";
_drewAxis = false;
_paintingMinFrame = -1;
TasView.ReleaseCurrentCell();
@ -842,14 +842,11 @@ namespace BizHawk.Client.EmuHawk
}
else
{
if (!string.IsNullOrWhiteSpace(_startBoolDrawColumn))
if (!string.IsNullOrWhiteSpace(_startBoolDrawColumn) || _drewAxis)
{
// If painting up, we have altered frames without loading states (for smoothness)
// So now we have to ensure that all the edited frames are invalidated
if (_paintingMinFrame < Emulator.Frame)
{
GoToFrame(_paintingMinFrame);
}
GoToLastEmulatedFrameIfNecessary(_paintingMinFrame);
}
ClearLeftMouseStates();
@ -1169,11 +1166,10 @@ namespace BizHawk.Client.EmuHawk
}
}
var getVal = (i < CurrentTasMovie.InputLogLength) ? CurrentTasMovie.GetAxisState(i, _startAxisDrawColumn) : setVal;
CurrentTasMovie.SetAxisState(i, _startAxisDrawColumn, setVal); // Notice it uses new row, old column, you can only paint across a single column
}
if (getVal != setVal) { JumpToGreenzone(); }
}
_drewAxis = true;
}
CurrentTasMovie.IsCountingRerecords = wasCountingRerecords;

View File

@ -960,18 +960,16 @@ namespace BizHawk.Client.EmuHawk
Emulator.ResetCounters();
}
UpdateOtherTools();
UpdateTools();
}
public void AddBranchExternal() => BookMarkControl.AddBranchExternal();
public void RemoveBranchExternal() => BookMarkControl.RemoveBranchExternal();
private void UpdateOtherTools() // a hack probably, surely there is a better way to do this
private void UpdateTools()
{
_hackyDontUpdate = true;
Tools.UpdateToolsBefore();
Tools.UpdateToolsAfter();
_hackyDontUpdate = false;
}
public void TogglePause()