Fix param colors not workig properly

This commit is contained in:
KillzXGaming 2019-03-27 14:59:43 -04:00
parent 01fda68f93
commit c7eba775b9
10 changed files with 45 additions and 3 deletions

Binary file not shown.

View file

@ -85,6 +85,8 @@ namespace FirstPlugin.Forms
public void ApplyValueSingles() public void ApplyValueSingles()
{ {
SetColor(activeParam.Name, activeParam.ValueFloat);
activeParam.ValueFloat = new float[] activeParam.ValueFloat = new float[]
{ {
(float)barSlider1.Value, (float)barSlider1.Value,
@ -128,7 +130,12 @@ namespace FirstPlugin.Forms
{ {
ColorDialog colorDialog = new ColorDialog(); ColorDialog colorDialog = new ColorDialog();
colorDialog.Color = pictureBox1.BackColor; colorDialog.Color = pictureBox1.BackColor;
colorDialog.ShowDialog(); if (colorDialog.ShowDialog() == DialogResult.OK)
{
barSlider1.Value = colorDialog.Color.R / 255;
barSlider2.Value = colorDialog.Color.G / 255;
barSlider3.Value = colorDialog.Color.B / 255;
}
} }
} }
} }

View file

@ -45,7 +45,7 @@
this.alphaPB.Size = new System.Drawing.Size(71, 16); this.alphaPB.Size = new System.Drawing.Size(71, 16);
this.alphaPB.TabIndex = 6; this.alphaPB.TabIndex = 6;
this.alphaPB.TabStop = false; this.alphaPB.TabStop = false;
this.alphaPB.Click += new System.EventHandler(this.pictureBox1_Click); this.alphaPB.Click += new System.EventHandler(this.alphaPB_Click);
// //
// colorPB // colorPB
// //
@ -54,6 +54,7 @@
this.colorPB.Size = new System.Drawing.Size(63, 16); this.colorPB.Size = new System.Drawing.Size(63, 16);
this.colorPB.TabIndex = 7; this.colorPB.TabIndex = 7;
this.colorPB.TabStop = false; this.colorPB.TabStop = false;
this.colorPB.Click += new System.EventHandler(this.colorPB_Click);
// //
// barSlider4 // barSlider4
// //
@ -65,6 +66,7 @@
this.barSlider4.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.barSlider4.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.barSlider4.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))); this.barSlider4.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.barSlider4.BorderRoundRectSize = new System.Drawing.Size(32, 32); this.barSlider4.BorderRoundRectSize = new System.Drawing.Size(32, 32);
this.barSlider4.DataType = null;
this.barSlider4.DrawSemitransparentThumb = false; this.barSlider4.DrawSemitransparentThumb = false;
this.barSlider4.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider4.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider4.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider4.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
@ -72,6 +74,7 @@
this.barSlider4.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider4.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); this.barSlider4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F);
this.barSlider4.ForeColor = System.Drawing.Color.White; this.barSlider4.ForeColor = System.Drawing.Color.White;
this.barSlider4.IncrementAmount = 0.01F;
this.barSlider4.InputName = "W"; this.barSlider4.InputName = "W";
this.barSlider4.LargeChange = 5F; this.barSlider4.LargeChange = 5F;
this.barSlider4.Location = new System.Drawing.Point(141, 72); this.barSlider4.Location = new System.Drawing.Point(141, 72);
@ -109,6 +112,7 @@
this.barSlider3.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.barSlider3.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.barSlider3.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))); this.barSlider3.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.barSlider3.BorderRoundRectSize = new System.Drawing.Size(32, 32); this.barSlider3.BorderRoundRectSize = new System.Drawing.Size(32, 32);
this.barSlider3.DataType = null;
this.barSlider3.DrawSemitransparentThumb = false; this.barSlider3.DrawSemitransparentThumb = false;
this.barSlider3.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider3.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider3.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider3.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
@ -116,6 +120,7 @@
this.barSlider3.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider3.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); this.barSlider3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F);
this.barSlider3.ForeColor = System.Drawing.Color.White; this.barSlider3.ForeColor = System.Drawing.Color.White;
this.barSlider3.IncrementAmount = 0.01F;
this.barSlider3.InputName = "Z"; this.barSlider3.InputName = "Z";
this.barSlider3.LargeChange = 5F; this.barSlider3.LargeChange = 5F;
this.barSlider3.Location = new System.Drawing.Point(3, 72); this.barSlider3.Location = new System.Drawing.Point(3, 72);
@ -153,6 +158,7 @@
this.barSlider2.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.barSlider2.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.barSlider2.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))); this.barSlider2.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.barSlider2.BorderRoundRectSize = new System.Drawing.Size(32, 32); this.barSlider2.BorderRoundRectSize = new System.Drawing.Size(32, 32);
this.barSlider2.DataType = null;
this.barSlider2.DrawSemitransparentThumb = false; this.barSlider2.DrawSemitransparentThumb = false;
this.barSlider2.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider2.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider2.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider2.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
@ -160,6 +166,7 @@
this.barSlider2.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider2.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); this.barSlider2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F);
this.barSlider2.ForeColor = System.Drawing.Color.White; this.barSlider2.ForeColor = System.Drawing.Color.White;
this.barSlider2.IncrementAmount = 0.01F;
this.barSlider2.InputName = "Y"; this.barSlider2.InputName = "Y";
this.barSlider2.LargeChange = 5F; this.barSlider2.LargeChange = 5F;
this.barSlider2.Location = new System.Drawing.Point(141, 46); this.barSlider2.Location = new System.Drawing.Point(141, 46);
@ -197,6 +204,7 @@
this.barSlider1.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.barSlider1.BarPenColorMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.barSlider1.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))); this.barSlider1.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.barSlider1.BorderRoundRectSize = new System.Drawing.Size(32, 32); this.barSlider1.BorderRoundRectSize = new System.Drawing.Size(32, 32);
this.barSlider1.DataType = null;
this.barSlider1.DrawSemitransparentThumb = false; this.barSlider1.DrawSemitransparentThumb = false;
this.barSlider1.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider1.ElapsedInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider1.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider1.ElapsedPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
@ -204,6 +212,7 @@
this.barSlider1.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.barSlider1.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); this.barSlider1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F);
this.barSlider1.ForeColor = System.Drawing.Color.White; this.barSlider1.ForeColor = System.Drawing.Color.White;
this.barSlider1.IncrementAmount = 0.01F;
this.barSlider1.InputName = "X"; this.barSlider1.InputName = "X";
this.barSlider1.LargeChange = 5F; this.barSlider1.LargeChange = 5F;
this.barSlider1.Location = new System.Drawing.Point(3, 46); this.barSlider1.Location = new System.Drawing.Point(3, 46);
@ -230,6 +239,7 @@
this.barSlider1.UseInterlapsedBar = false; this.barSlider1.UseInterlapsedBar = false;
this.barSlider1.Value = 30F; this.barSlider1.Value = 30F;
this.barSlider1.ValueChanged += new System.EventHandler(this.barSlider_ValueChanged); this.barSlider1.ValueChanged += new System.EventHandler(this.barSlider_ValueChanged);
this.barSlider1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.barSlider1_Scroll);
// //
// vector4SliderPanel // vector4SliderPanel
// //

View file

@ -3,6 +3,7 @@ using System.Drawing;
using Switch_Toolbox.Library; using Switch_Toolbox.Library;
using Syroot.NintenTools.NSW.Bfres; using Syroot.NintenTools.NSW.Bfres;
using Bfres.Structs; using Bfres.Structs;
using System.Windows.Forms;
namespace FirstPlugin.Forms namespace FirstPlugin.Forms
{ {
@ -116,6 +117,8 @@ namespace FirstPlugin.Forms
public void ApplyValueSingles() public void ApplyValueSingles()
{ {
SetColor(activeParam.Name, activeParam.ValueFloat);
activeParam.ValueFloat = new float[] activeParam.ValueFloat = new float[]
{ {
(float)barSlider1.Value, (float)barSlider1.Value,
@ -159,7 +162,29 @@ namespace FirstPlugin.Forms
OnPanelChanged(activeParam, this); OnPanelChanged(activeParam, this);
} }
private void pictureBox1_Click(object sender, EventArgs e) private void colorPB_Click(object sender, EventArgs e)
{
ColorDialog colorDialog = new ColorDialog();
colorDialog.Color = colorPB.BackColor;
if (colorDialog.ShowDialog() == DialogResult.OK)
{
barSlider1.Value = colorDialog.Color.R / 255;
barSlider2.Value = colorDialog.Color.G / 255;
barSlider3.Value = colorDialog.Color.B / 255;
}
}
private void alphaPB_Click(object sender, EventArgs e)
{
ColorDialog colorDialog = new ColorDialog();
colorDialog.Color = alphaPB.BackColor;
if (colorDialog.ShowDialog() == DialogResult.OK)
{
barSlider4.Value = colorDialog.Color.R / 255;
}
}
private void barSlider1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
{ {
} }