Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tastudio: drawing stuff, selection, patterns, add column lua function #1125

Merged
merged 22 commits into from Mar 8, 2018
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

no need to update float edit stuff or cell changes when its not needed

  • Loading branch information...
TASeditor committed Feb 26, 2018
commit 8c5491f8e9e515bf417bcc0009901eb2af5d0f15
@@ -900,6 +900,11 @@ private void TasView_PointedCellChanged(object sender, InputRoll.CellEventArgs e
return;
}

if (!MouseButtonHeld)
{
return;
}

// skip rerecord counting on drawing entirely, mouse down is enough
// avoid introducing another global
bool wasCountingRerecords = Global.MovieSession.Movie.IsCountingRerecords;
@@ -1146,39 +1151,43 @@ private void TasView_PointedCellChanged(object sender, InputRoll.CellEventArgs e
private void TasView_MouseMove(object sender, MouseEventArgs e)
{
// For float editing
int increment = (_floatEditYPos - e.Y) / 4;
if (_floatEditYPos == -1)
return;
if (FloatEditingMode)
{
int increment = (_floatEditYPos - e.Y) / 4;
if (_floatEditYPos == -1)
return;

float value = _floatPaintState + increment;
ControllerDefinition.FloatRange range = Global.MovieSession.MovieControllerAdapter.Definition.FloatRanges
[Global.MovieSession.MovieControllerAdapter.Definition.FloatControls.IndexOf(_floatEditColumn)];
float value = _floatPaintState + increment;
ControllerDefinition.FloatRange range = Global.MovieSession.MovieControllerAdapter.Definition.FloatRanges
[Global.MovieSession.MovieControllerAdapter.Definition.FloatControls.IndexOf(_floatEditColumn)];

// Range for N64 Y axis has max -128 and min 127. That should probably be fixed in ControllerDefinition.cs.
// SuuperW: I really don't think changing it would break anything, but adelikat isn't so sure.
float rMax = range.Max;
float rMin = range.Min;
if (rMax < rMin)
{
rMax = range.Min;
rMin = range.Max;
}
// Range for N64 Y axis has max -128 and min 127. That should probably be fixed in ControllerDefinition.cs.
// SuuperW: I really don't think changing it would break anything, but adelikat isn't so sure.
float rMax = range.Max;
float rMin = range.Min;
if (rMax < rMin)
{
rMax = range.Min;
rMin = range.Max;
}

if (value > rMax)
{
value = rMax;
}
else if (value < rMin)
{
value = rMin;
}
if (value > rMax)
{
value = rMax;
}
else if (value < rMin)
{
value = rMin;
}

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

_triggerAutoRestore = true;
JumpToGreenzone();
DoTriggeredAutoRestoreIfNeeded();
_triggerAutoRestore = true;
JumpToGreenzone();
DoTriggeredAutoRestoreIfNeeded();

}
RefreshDialog();
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.