private readonly List<ShipLabel[]> _friendLabels = new List<ShipLabel[]>();\r
private readonly List<ShipLabel[]> _enemyLabels = new List<ShipLabel[]>();\r
private readonly List<Panel> _panelList = new List<Panel>();\r
- private bool _hpPercent;\r
private readonly List<ShipLabel> _hpLabels = new List<ShipLabel>();\r
private readonly ResizableToolTip _toolTip = new ResizableToolTip {ShowAlways = true};\r
private readonly BattleInfo.BattleResult[] _result = new BattleInfo.BattleResult[2];\r
ResumeLayout();\r
}\r
\r
- public void SetShowHpPercent(bool hpPercent)\r
+ public event Action HpLabelClick;\r
+\r
+ private void HpLabelClickHandler(object sender, EventArgs ev)\r
+ {\r
+ HpLabelClick?.Invoke();\r
+ }\r
+\r
+ public void ToggleHpPercent()\r
{\r
- if (hpPercent == _hpPercent)\r
- return;\r
foreach (var label in _hpLabels)\r
label.ToggleHpPercent();\r
- _hpPercent = hpPercent;\r
}\r
\r
public void Update(Sniffer sniffer)\r
_panelList[i].Width = panelWidth;\r
_infomationPanel.Location = new Point(\r
(int)Round(0 * ShipLabel.ScaleFactor.Width) + AutoScrollPosition.X,\r
- (int)Round(20 * ShipLabel.ScaleFactor.Height) +AutoScrollPosition.Y);\r
+ (int)Round(20 * ShipLabel.ScaleFactor.Height) + AutoScrollPosition.Y);\r
_infomationPanel.Visible = true;\r
}\r
\r
};\r
_friendLabels.Add(friend);\r
_hpLabels.Add(friend[0]);\r
+ friend[0].Click += HpLabelClickHandler;\r
var enemy = new[]\r
{\r
new ShipLabel {Location = new Point(119, 2), AutoSize = true},\r