Ejemplo n.º 1
0
        private void ButtonOK_Click(object sender, EventArgs e)
        {
            string path = $"{eCommands.update} {FNGroups} {this._color.ThisFNGroup.CollectionName}";
            string hex  = SAT.ColorToHex(this.NewColorBox.BackColor.A, this.NewColorBox.BackColor.R,
                                         this.NewColorBox.BackColor.G, this.NewColorBox.BackColor.B);
            bool keepalpha = this.CheckKeepAlpha.Checked;

            if (this.CheckReplaceSame.Checked)
            {
                var newcolor = new FEngColor(null)
                {
                    Alpha = this.NewColorBox.BackColor.A,
                    Red   = this.NewColorBox.BackColor.R,
                    Green = this.NewColorBox.BackColor.G,
                    Blue  = this.NewColorBox.BackColor.B
                };
                this._color.ThisFNGroup.TrySetSame(this._index, newcolor, keepalpha);
                if (keepalpha)
                {
                    this.CommandProcessed = $"{path} {ReplaceSameNoAlpha}[{this._index}] {hex}";
                }
                else
                {
                    this.CommandProcessed = $"{path} {ReplaceSameWithAlpha}[{this._index}] {hex}";
                }
            }
            else
            {
                this._color.Alpha = this.NewColorBox.BackColor.A;
                this._color.Red   = this.NewColorBox.BackColor.R;
                this._color.Green = this.NewColorBox.BackColor.G;
                this._color.Blue  = this.NewColorBox.BackColor.B;
                if (this.CheckReplaceAll.Checked)
                {
                    this._color.ThisFNGroup.TrySetAll(this._color, keepalpha);
                    if (keepalpha)
                    {
                        this.CommandProcessed = $"{path} {ReplaceAllNoAlpha} {hex}";
                    }
                    else
                    {
                        this.CommandProcessed = $"{path} {ReplaceAllWithAlpha} {hex}";
                    }
                }
                else
                {
                    this.CommandProcessed = $"{path} Color[{this._index}] {hex}";
                }
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return($"Offset: {this.Offset:X8} | Color: " +
            $"{SAT.ColorToHex(this.Alpha, this.Red, this.Green, this.Blue)}");
 }