foreach (var label in labels)\r
{\r
Scaler.Scale(label);\r
- label.PresetColor =\r
- label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
}\r
}\r
\r
foreach (var label in friend.Concat(enemy))\r
{\r
panel.Controls.Add(label);\r
- label.BackColor = label.PresetColor = ShipLabel.ColumnColors[i % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[i % 2];\r
}\r
Controls.Add(panel);\r
}\r
foreach (var label in labels)\r
{\r
Scaler.Scale(label);\r
- label.PresetColor =\r
- label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
}\r
}\r
\r
foreach (var label in shipLabels[i])\r
{\r
Scaler.Scale(label);\r
- label.PresetColor = label.BackColor = ShipLabel.ColumnColors[i % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[i % 2];\r
label.Tag = i;\r
label.Click += onClick;\r
}\r
foreach (var label in _combinedLabels[i])\r
{\r
Scaler.Scale(label);\r
- label.PresetColor = label.BackColor = ShipLabel.ColumnColors[i % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[i % 2];\r
label.Tag = i;\r
label.Click += onClick;\r
}\r
foreach (var label in _repairLabels[i].Labels)\r
{\r
Scaler.Scale(label);\r
- label.PresetColor = label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
label.Click += onClick;\r
}\r
}\r
labels.Fleet.Text = "";\r
labels.Name.SetName("");\r
labels.Time.Text = "";\r
- labels.Damage.BackColor = labels.Damage.PresetColor;\r
+ labels.Damage.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
}\r
}\r
}
\ No newline at end of file
{\r
public static Color[] ColumnColors = {SystemColors.Control, Color.White};\r
public static Font LatinFont { get; set; } = new Font("Tahoma", 8f);\r
- public Color PresetColor { get; set; }\r
public bool AnchorRight { get; set; }\r
+ private Color _initialBackColor;\r
private int _right = Int32.MinValue;\r
private int _left;\r
private SlotStatus _slotStatus;\r
public override Color BackColor\r
{\r
get => base.BackColor;\r
- set => base.BackColor = value == DefaultBackColor ? PresetColor : value;\r
+ set\r
+ {\r
+ if (_initialBackColor == Color.Empty)\r
+ _initialBackColor = value;\r
+ base.BackColor = value;\r
+ }\r
}\r
\r
[Flags]\r
if (status == null)\r
{\r
Text = "";\r
- BackColor = PresetColor;\r
+ BackColor = _initialBackColor;\r
return;\r
}\r
if (_hpPercent)\r
case ShipStatus.Damage.Small:\r
return Color.FromArgb(240, 240, 0);\r
default:\r
- return PresetColor;\r
+ return _initialBackColor;\r
}\r
}\r
\r
if (status == null)\r
{\r
Text = "";\r
- BackColor = PresetColor;\r
+ BackColor = _initialBackColor;\r
return;\r
}\r
var cond = status.Cond;\r
BackColor = cond >= 50\r
? CUDColors.Yellow\r
: cond >= 30\r
- ? PresetColor\r
+ ? _initialBackColor\r
: cond >= 20\r
? CUDColors.Orange\r
: CUDColors.Red;\r
foreach (var label in labels)\r
{\r
Scaler.Scale(label);\r
- label.PresetColor =\r
- label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
}\r
}\r
\r
foreach (var label in labels)\r
{\r
Scaler.Scale(label);\r
- label.PresetColor =\r
- label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
}\r
_shipListPanel.SetHpPercent(labels[0]);\r
}\r
foreach (var label in labels)\r
{\r
Scaler.Scale(label);\r
- label.PresetColor =\r
- label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
+ label.BackColor = ShipLabel.ColumnColors[(i + 1) % 2];\r
}\r
_shipListPanel.SetHpPercent(labels[0]);\r
}\r