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] [OptionalService]
public ISaveRam SaveRamEmulator { get; private set; } 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 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; private int _lastRefresh;
@ -67,11 +66,6 @@ namespace BizHawk.Client.EmuHawk
return; return;
} }
if (_hackyDontUpdate)
{
return;
}
if (_exiting) if (_exiting)
{ {
return; return;

View File

@ -16,6 +16,7 @@ namespace BizHawk.Client.EmuHawk
// Input Painting // Input Painting
private string _startBoolDrawColumn = ""; private string _startBoolDrawColumn = "";
private string _startAxisDrawColumn = ""; private string _startAxisDrawColumn = "";
private bool _drewAxis;
private bool _boolPaintState; private bool _boolPaintState;
private int _axisPaintState; private int _axisPaintState;
private int _axisBackupState; private int _axisBackupState;
@ -657,7 +658,6 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.SetBoolStates(firstSel, (frame - firstSel) + 1, buttonName, !allPressed); CurrentTasMovie.SetBoolStates(firstSel, (frame - firstSel) + 1, buttonName, !allPressed);
_boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName); _boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName);
_triggerAutoRestore = true; _triggerAutoRestore = true;
JumpToGreenzone(true);
RefreshDialog(); RefreshDialog();
} }
else if (ModifierKeys == Keys.Shift && ModifierKeys == Keys.Alt) // Does not work? 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); CurrentTasMovie.ToggleBoolState(TasView.CurrentCell.RowIndex.Value, buttonName);
_boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName); _boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName);
_triggerAutoRestore = true; _triggerAutoRestore = true;
JumpToGreenzone(true);
RefreshDialog(); RefreshDialog();
} }
} }
@ -791,6 +790,7 @@ namespace BizHawk.Client.EmuHawk
_startSelectionDrag = false; _startSelectionDrag = false;
_startBoolDrawColumn = ""; _startBoolDrawColumn = "";
_startAxisDrawColumn = ""; _startAxisDrawColumn = "";
_drewAxis = false;
_paintingMinFrame = -1; _paintingMinFrame = -1;
TasView.ReleaseCurrentCell(); TasView.ReleaseCurrentCell();
@ -842,14 +842,11 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
if (!string.IsNullOrWhiteSpace(_startBoolDrawColumn)) if (!string.IsNullOrWhiteSpace(_startBoolDrawColumn) || _drewAxis)
{ {
// If painting up, we have altered frames without loading states (for smoothness) // 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 // So now we have to ensure that all the edited frames are invalidated
if (_paintingMinFrame < Emulator.Frame) GoToLastEmulatedFrameIfNecessary(_paintingMinFrame);
{
GoToFrame(_paintingMinFrame);
}
} }
ClearLeftMouseStates(); 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 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; CurrentTasMovie.IsCountingRerecords = wasCountingRerecords;

View File

@ -960,18 +960,16 @@ namespace BizHawk.Client.EmuHawk
Emulator.ResetCounters(); Emulator.ResetCounters();
} }
UpdateOtherTools(); UpdateTools();
} }
public void AddBranchExternal() => BookMarkControl.AddBranchExternal(); public void AddBranchExternal() => BookMarkControl.AddBranchExternal();
public void RemoveBranchExternal() => BookMarkControl.RemoveBranchExternal(); 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.UpdateToolsBefore();
Tools.UpdateToolsAfter(); Tools.UpdateToolsAfter();
_hackyDontUpdate = false;
} }
public void TogglePause() public void TogglePause()