\r
using System;\r
using System.Collections.Generic;\r
+using System.ComponentModel;\r
using System.Diagnostics;\r
using System.Drawing;\r
using System.Globalization;\r
private readonly Config _config = new Config();\r
private readonly ConfigDialog _configDialog;\r
private readonly ProxyManager _proxyManager;\r
- private readonly ToolTip _toolTipQuest = new ToolTip {ShowAlways = true};\r
- private readonly ToolTip _tooltipCopy = new ToolTip {AutomaticDelay = 0};\r
+ private readonly ResizableToolTip _toolTip = new ResizableToolTip {ShowAlways = true};\r
+ private readonly ResizableToolTip _toolTipQuest = new ResizableToolTip {ShowAlways = true, AutoPopDelay = 10000};\r
+ private readonly ResizableToolTip _tooltipCopy = new ResizableToolTip {AutomaticDelay = 0};\r
private int _currentFleet;\r
private bool _combinedFleet;\r
private readonly Label[] _labelCheckFleets;\r
labelPresetAkashiTimer.BackColor = ShipLabel.ColumnColors[1];\r
_listForm = new ListForm(_sniffer, _config) {Owner = this};\r
_notificationManager = new NotificationManager(Alarm);\r
- try\r
- {\r
- _config.Load();\r
- }\r
- catch (Exception ex)\r
- {\r
- throw new ConfigFileException("設定ファイルが壊れています。", ex);\r
- }\r
+ _config.Load();\r
_proxyManager = new ProxyManager(_config, this);\r
_errorLog = new ErrorLog(_sniffer);\r
_proxyManager.UpdatePacFile();\r
{\r
var target = "";\r
_sniffer.LoadState();\r
- ItemSpec.LoadTpSpec();\r
+ DataLoader.LoadTpSpec();\r
_watcher.SynchronizingObject = this;\r
_watcherTimer.Tick += (sender, ev) =>\r
{\r
_sniffer.LoadState();\r
break;\r
case "TP.csv":\r
- ItemSpec.LoadTpSpec();\r
+ DataLoader.LoadTpSpec();\r
break;\r
}\r
};\r
{\r
control.Font = new Font(control.Font.FontFamily, control.Font.Size * _config.Zoom / 100);\r
}\r
+ foreach (var toolTip in new[]{_toolTip, _toolTipQuest, _tooltipCopy})\r
+ {\r
+ toolTip.Font = new Font(toolTip.Font.FontFamily, toolTip.Font.Size * _config.Zoom / 100);\r
+ }\r
ShipLabel.LatinFont = new Font("Tahoma", 8f * _config.Zoom / 100);\r
var cur = CurrentAutoScaleDimensions;\r
ShipLabel.ScaleFactor = new SizeF(ShipLabel.ScaleFactor.Width * cur.Width / prev.Width,\r
if (ac >= 10000)\r
ac = 9999;\r
labelAchievement.Text = ac >= 1000 ? ((int)ac).ToString("D") : ac.ToString("F1");\r
- toolTipAchievement.SetToolTip(labelAchievement,\r
+ _toolTip.SetToolTip(labelAchievement,\r
"今月 " + _sniffer.Achievement.ValueOfMonth.ToString("F1") + "\n" +\r
"EO " + _sniffer.ExMap.Achievement);\r
UpdateMaterialHistry();\r
for (var i = 0; i < _labelCheckFleets.Length; i++)\r
_labelCheckFleets[i].Visible = _currentFleet == i;\r
UpdateAkashiTimer();\r
- UpdateFighterPower(_combinedFleet);\r
+ var battle = _sniffer.Battle;\r
+ UpdateFighterPower(_combinedFleet && (battle.BattleState == BattleState.None || battle.EnemyIsCombined));\r
UpdateLoS();\r
UpdateCondTimers();\r
}\r
: _sniffer.GetContactTriggerRate(_currentFleet);\r
var text = "制空: " + (fp[0] == fp[1] ? $"{fp[0]}" : $"{fp[0]}~{fp[1]}") +\r
$" 触接: {cr * 100:f1}";\r
- toolTipFighterPower.SetToolTip(labelFighterPower, text);\r
- toolTipFighterPower.SetToolTip(labelFighterPowerCaption, text);\r
+ _toolTip.SetToolTip(labelFighterPower, text);\r
+ _toolTip.SetToolTip(labelFighterPowerCaption, text);\r
}\r
\r
private void UpdateLoS()\r
labelLoS.Text = RoundDown(_sniffer.GetFleetLineOfSights(_currentFleet, 1)).ToString("F1");\r
var text = $"係数3: {RoundDown(_sniffer.GetFleetLineOfSights(_currentFleet, 3)):F1}\r\n" +\r
$"係数4: {RoundDown(_sniffer.GetFleetLineOfSights(_currentFleet, 4)):F1}";\r
- toolTipLoS.SetToolTip(labelLoS, text);\r
- toolTipLoS.SetToolTip(labelLoSCaption, text);\r
+ _toolTip.SetToolTip(labelLoS, text);\r
+ _toolTip.SetToolTip(labelLoSCaption, text);\r
}\r
\r
private double RoundDown(double number)\r
if (power.AirCombat != power.Interception)\r
{\r
var text = "防空: " + power.Interception + power.UnknownMark;\r
- toolTipFighterPower.SetToolTip(labelEnemyFighterPower, text);\r
- toolTipFighterPower.SetToolTip(labelEnemyFighterPowerCaption, text);\r
+ _toolTip.SetToolTip(labelEnemyFighterPower, text);\r
+ _toolTip.SetToolTip(labelEnemyFighterPowerCaption, text);\r
}\r
UpdateFighterPower(_sniffer.CombinedFleetType > 0 && battle.EnemyIsCombined);\r
labelFighterPower.ForeColor = new[]\r
{\r
count[i].Text = "";\r
count[i].ForeColor = Color.Black;\r
- _toolTipQuest.SetToolTip(count[i], "");\r
+ _toolTip.SetToolTip(count[i], "");\r
continue;\r
}\r
count[i].Text = " " + c;\r
count[i].ForeColor = c.Cleared ? CUDColor.Green : Color.Black;\r
- _toolTipQuest.SetToolTip(count[i], c.ToToolTip());\r
+ _toolTip.SetToolTip(count[i], c.ToToolTip());\r
}\r
else\r
{\r
category[i].BackColor = DefaultBackColor;\r
name[i].Text = count[i].Text = progress[i].Text = "";\r
_toolTipQuest.SetToolTip(name[i], "");\r
- _toolTipQuest.SetToolTip(count[i], "");\r
+ _toolTip.SetToolTip(count[i], "");\r
}\r
}\r
}\r
private void labelQuest_DoubleClick(object sender, EventArgs e)\r
{\r
var label = (Label)sender;\r
+ if (string.IsNullOrEmpty(label.Text))\r
+ return;\r
Clipboard.SetText(label.Text);\r
_tooltipCopy.Active = true;\r
_tooltipCopy.Show("コピーしました。", label);\r
catch (FileNotFoundException)\r
{\r
}\r
+ catch (Win32Exception)\r
+ {\r
+ }\r
}\r
}\r
}
\ No newline at end of file