Skip to content

Commit

Permalink
tastudio analog editing:
Browse files Browse the repository at this point in the history
- mouse dragging during float edit mode updates the displayed value and fires restore on mouse up
- Enter key exits float edit mode after applying the dragged value, while Escape exits it after ignoring the dragged value (should Escape cancel all changes?)
- currently disabled switch to enter float edit mode by single click
  • Loading branch information
feos committed Nov 12, 2016
1 parent f760b35 commit 175862a
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 36 deletions.
57 changes: 34 additions & 23 deletions BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ private void TasView_MouseDown(object sender, MouseEventArgs e)
_patternPaint = false;


if (e.Clicks != 2)
if (e.Clicks != 2 && !Settings.SingleClickFloatEdit)
{
CurrentTasMovie.ChangeLog.BeginNewBatch("Paint Float " + buttonName + " from frame " + frame);
_startFloatDrawColumn = buttonName;
Expand Down Expand Up @@ -609,6 +609,9 @@ private void ClearLeftMouseStates()
if (_floatEditRow != -1 && _floatPaintState != CurrentTasMovie.GetFloatState(_floatEditRow, _floatEditColumn))
{
floatEditRow = -1;
_triggerAutoRestore = true;
JumpToGreenzone();
DoTriggeredAutoRestoreIfNeeded();
RefreshDialog();
}
_floatPaintState = 0;
Expand Down Expand Up @@ -931,6 +934,7 @@ private void TasView_MouseMove(object sender, MouseEventArgs e)
value = rMin;

CurrentTasMovie.SetFloatState(_floatEditRow, _floatEditColumn, value);
_floatTypedValue = value.ToString();

RefreshDialog();
}
Expand All @@ -950,18 +954,6 @@ private void TasView_KeyDown(object sender, KeyEventArgs e)
{
GoToNextMarker();
}
else if (e.KeyCode == Keys.Escape)
{
if (_floatEditRow != -1)
{
_floatEditRow = -1;
}
else
{
// not using StopSeeking() here, since it has special logic and should only happen when seek frame is reached
CancelSeekContextMenuItem_Click(null, null);
}
}

// SuuperW: Float Editing
if (_floatEditRow != -1)
Expand Down Expand Up @@ -1031,6 +1023,14 @@ private void TasView_KeyDown(object sender, KeyEventArgs e)
else
value = Convert.ToSingle(_floatTypedValue);
}
else if (e.KeyCode == Keys.Enter)
{
if (_floatEditYPos != -1)
{
_floatEditYPos = -1;
}
floatEditRow = -1;
}
else if (e.KeyCode == Keys.Escape)
{
if (_floatEditYPos != -1) // Cancel change from dragging cursor
Expand Down
6 changes: 6 additions & 0 deletions BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e)
AutosaveAsBk2MenuItem.Checked = Settings.AutosaveAsBk2;
AutosaveAsBackupFileMenuItem.Checked = Settings.AutosaveAsBackupFile;
BackupPerFileSaveMenuItem.Checked = Settings.BackupPerFileSave;
SingleClickFloatEditMenuItem.Checked = Settings.SingleClickFloatEdit;
}

private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -903,6 +904,11 @@ private void applyPatternToPaintedInputToolStripMenuItem_CheckedChanged(object s
onlyOnAutoFireColumnsToolStripMenuItem.Enabled = applyPatternToPaintedInputToolStripMenuItem.Checked;
}

private void SingleClickFloatEditMenuItem_Click(object sender, EventArgs e)
{
Settings.SingleClickFloatEdit ^= true;
}

private void BindMarkersToInputMenuItem_Click(object sender, EventArgs e)
{
CurrentTasMovie.BindMarkersToInput = BindMarkersToInputMenuItem.Checked;
Expand Down
2 changes: 2 additions & 0 deletions BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public TAStudioSettings()
AutosaveAsBk2 = false;
AutosaveAsBackupFile = false;
BackupPerFileSave = false;
SingleClickFloatEdit = false;
// default to taseditor fashion
denoteStatesWithIcons = false;
denoteStatesWithBGColor = true;
Expand All @@ -95,6 +96,7 @@ public TAStudioSettings()
public bool AutosaveAsBk2 { get; set; }
public bool AutosaveAsBackupFile { get; set; }
public bool BackupPerFileSave { get; set; }
public bool SingleClickFloatEdit { get; set; }

public bool denoteStatesWithIcons { get; set; }
public bool denoteStatesWithBGColor { get; set; }
Expand Down

0 comments on commit 175862a

Please sign in to comment.