From 61f4d1f4bd40c89c7211c2d62f0a1c6bfa9d43db Mon Sep 17 00:00:00 2001 From: Naram Qashat Date: Mon, 10 Apr 2017 10:26:10 -0400 Subject: [PATCH] Some minor changes, as well as updating NuGet package for MathNet. --- ColorToWall.cs | 2 +- FindClosestColor.cs | 4 +--- MainForm.cs | 4 ++-- TerrariaPixelArtHelper.csproj | 5 ++--- packages.config | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ColorToWall.cs b/ColorToWall.cs index 776ff62..5a09c56 100644 --- a/ColorToWall.cs +++ b/ColorToWall.cs @@ -274,7 +274,7 @@ void FlashInternal(int interval, Color flashColor, int flashes) void cbWall_SelectedIndexChanged(object sender, EventArgs e) { - var wallItemName = this.CurrentWallName; + string wallItemName = this.CurrentWallName; this.cbWallColor.Enabled = wallItemName != "No Wall"; this.WallSelectorChanged?.Invoke(sender, new WallSelectorChangedEventArgs(this.Color, wallItemName, this.CurrentColorName)); diff --git a/FindClosestColor.cs b/FindClosestColor.cs index b73b384..8397bd5 100644 --- a/FindClosestColor.cs +++ b/FindClosestColor.cs @@ -116,10 +116,8 @@ public Color SelectedColor public void UpdateSelectedColorLabel() => this.lblSelectedColor.Text = FormattableString.Invariant($"({this.SelectedColor.R}, {this.SelectedColor.G}, {this.SelectedColor.B}, {this.SelectedColor.A})"); - public void UpdateSelectedColorWall() - { + public void UpdateSelectedColorWall() => this.pnlWall.BackgroundImage = MainForm.GetWallFrame(this.selectedColorItem.WallItem.Name, this.selectedColorItem.Color, 0, 0, 0); - } void lbColors_SelectedIndexChanged(object sender, EventArgs e) { diff --git a/MainForm.cs b/MainForm.cs index 18e4044..e2af5ac 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -139,7 +139,7 @@ void pictureBox_Click(object sender, EventArgs e) int x = mouseArgs.X / 16; int y = mouseArgs.Y / 16; var color = MainForm.currentBitmap.GetPixel(x, y); - var colorIndex = MainForm.currentImageColors.Keys.ToList().IndexOf(color); + int colorIndex = MainForm.currentImageColors.Keys.ToList().IndexOf(color); (this.flpColorToWall.Controls[colorIndex] as ColorToWall).Flash(500, Color.Red, 3); this.flpColorToWall.ScrollControlIntoView(this.flpColorToWall.Controls[colorIndex]); } @@ -171,7 +171,7 @@ void picutreBox_MouseMove(object sender, MouseEventArgs e) if (x == MainForm.currentBitmap.Width || y == MainForm.currentBitmap.Height) return; var color = MainForm.currentBitmap.GetPixel(x, y); - var colorIndex = MainForm.currentImageColors.Keys.ToList().IndexOf(color); + int colorIndex = MainForm.currentImageColors.Keys.ToList().IndexOf(color); var colorToWall = this.flpColorToWall.Controls[colorIndex] as ColorToWall; this.tsslPipe.Visible = true; this.tsslCurrentPixel.Text = FormattableString.Invariant($"Current Pixel: {x}, {y} | Currently Selected Wall: {colorToWall.SelectedWall}"); diff --git a/TerrariaPixelArtHelper.csproj b/TerrariaPixelArtHelper.csproj index 11258dc..17f4eb6 100644 --- a/TerrariaPixelArtHelper.csproj +++ b/TerrariaPixelArtHelper.csproj @@ -76,9 +76,8 @@ TerrariaPixelArtHelper.Program - - packages\MathNet.Numerics.3.17.0\lib\net40\MathNet.Numerics.dll - True + + packages\MathNet.Numerics.3.18.0\lib\net40\MathNet.Numerics.dll packages\nQuant.1.0.3\lib\net40\nQuant.Core.dll diff --git a/packages.config b/packages.config index f64b961..51c70ea 100644 --- a/packages.config +++ b/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file