OSDN Git Service
(root)
/
kancollesniffer
/
KancolleSniffer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HPの数字のクリックでパーセント表示を切り替えられるようにする
[kancollesniffer/KancolleSniffer.git]
/
KancolleSniffer
/
BattleResultPanel.cs
diff --git
a/KancolleSniffer/BattleResultPanel.cs
b/KancolleSniffer/BattleResultPanel.cs
index
81cb58b
..
4dcb344
100644
(file)
--- a/
KancolleSniffer/BattleResultPanel.cs
+++ b/
KancolleSniffer/BattleResultPanel.cs
@@
-28,7
+28,6
@@
namespace KancolleSniffer
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 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
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
@@
-48,13
+47,17
@@
namespace KancolleSniffer
ResumeLayout();
\r
}
\r
\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
{
\r
- if (hpPercent == _hpPercent)
\r
- return;
\r
foreach (var label in _hpLabels)
\r
label.ToggleHpPercent();
\r
foreach (var label in _hpLabels)
\r
label.ToggleHpPercent();
\r
- _hpPercent = hpPercent;
\r
}
\r
\r
public void Update(Sniffer sniffer)
\r
}
\r
\r
public void Update(Sniffer sniffer)
\r
@@
-250,7
+253,7
@@
namespace KancolleSniffer
_panelList[i].Width = panelWidth;
\r
_infomationPanel.Location = new Point(
\r
(int)Round(0 * ShipLabel.ScaleFactor.Width) + AutoScrollPosition.X,
\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
_infomationPanel.Visible = true;
\r
}
\r
\r
@@
-318,6
+321,7
@@
namespace KancolleSniffer
};
\r
_friendLabels.Add(friend);
\r
_hpLabels.Add(friend[0]);
\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
var enemy = new[]
\r
{
\r
new ShipLabel {Location = new Point(119, 2), AutoSize = true},
\r