Skip to content

Commit

Permalink
Renamed ShowBezierSpline to ShowSpline.
Browse files Browse the repository at this point in the history
Added ShowCenterSpline to make it possible to hide or show the Transform in the center of the spline.
  • Loading branch information
BlizzCrafter committed Mar 5, 2019
1 parent a9c1822 commit 8366e6b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
3 changes: 2 additions & 1 deletion MonoGame.SplineFlower.Content/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class Setup
public static float SplineStepDistance { get; private set; }
public static int LineSteps { get; set; } = 20;

public static bool ShowBezierSpline { get; set; } = true;
public static bool ShowSpline { get; set; } = true;
public static bool ShowSplineWalker { get; set; } = true;

public static Color BaseLineColor { get; set; } = Color.White;
Expand Down Expand Up @@ -38,6 +38,7 @@ public static class Setup

public static Color CenterSplineColor { get; set; } = new Color(237, 188, 100, 225);
public static int CenterSplineIndex { get; } = -999999;
public static bool ShowCenterSpline { get; set; } = true;

public static bool MovePointAxis { get; set; } = true;

Expand Down
27 changes: 20 additions & 7 deletions MonoGame.SplineFlower.Editor/EditorForm.Designer.cs

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

7 changes: 6 additions & 1 deletion MonoGame.SplineFlower.Editor/EditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void toolStripMenuItemCenterSpline_Click(object sender, EventArgs e)

private void toolStripMenuItemDrawSpline_CheckedChanged(object sender, EventArgs e)
{
Setup.ShowBezierSpline = toolStripMenuItemDrawSpline.Checked;
Setup.ShowSpline = toolStripMenuItemDrawSpline.Checked;
}

private void toolStripMenuItemDrawBaseLine_CheckedChanged(object sender, EventArgs e)
Expand All @@ -57,6 +57,11 @@ private void toolStripMenuItemDrawTrigger_CheckedChanged(object sender, EventArg
Setup.ShowTriggers = toolStripMenuItemDrawTrigger.Checked;
}

private void toolStripMenuItemDrawCenterSpline_CheckedChanged(object sender, EventArgs e)
{
Setup.ShowCenterSpline = toolStripMenuItemDrawCenterSpline.Checked;
}

private void toolStripMenuItemDrawSplineWalker_CheckedChanged(object sender, EventArgs e)
{
Setup.ShowSplineWalker = toolStripMenuItemDrawSplineWalker.Checked;
Expand Down
2 changes: 1 addition & 1 deletion MonoGame.SplineFlower.Samples/Marker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override void Update(GameTime gameTime)

public override void Draw(SpriteBatch spriteBatch)
{
if (Setup.ShowBezierSpline && ShowSplineMarker)
if (Setup.ShowSpline && ShowSplineMarker)
{
spriteBatch.Draw(_Arrow,
Position,
Expand Down
4 changes: 2 additions & 2 deletions MonoGame.SplineFlower/BezierSpline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public void AddCurveRight()

public void DrawSpline(SpriteBatch spriteBatch)
{
if (Setup.ShowBezierSpline)
if (Setup.ShowSpline)
{
if (!Setup.Initialized)
{
Expand Down Expand Up @@ -589,7 +589,7 @@ public void DrawSpline(SpriteBatch spriteBatch)
DrawCircle(spriteBatch, _Trigger[i].Progress);
}
}
DrawCircle(spriteBatch, CenterSpline.Position, Setup.CenterSplineColor);
if (Setup.ShowCenterSpline) DrawCircle(spriteBatch, CenterSpline.Position, Setup.CenterSplineColor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion MonoGame.SplineFlower/SplineWalker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ private int GetNextHigherTriggerIndex()

public virtual void Draw(SpriteBatch spriteBatch)
{
if (Setup.ShowBezierSpline && Setup.ShowSplineWalker)
if (Setup.ShowSpline && Setup.ShowSplineWalker)
{
spriteBatch.Draw(Setup.Pixel,
_Size,
Expand Down

0 comments on commit 8366e6b

Please sign in to comment.