private void Tick(object sender, ElapsedEventArgs e) { OnPropertyChanged(nameof(CompleteTime)); OnPropertyChanged(nameof(DuringTime)); if (State == DockState.Building && Config.Current.NotifyWhenBuild && CompleteTime.InASecond()) { NotifierFactories.Current?.Show(StringTable.Notification_Build_Title, string.Format(StringTable.Notification_Build_Text, Id, Config.Current.ShowBuildingShipName ? $"「{CreatedShip.Name}」" : StringTable.Ship_LowerCase), Config.MakeSoundWithPath(Config.Current.NotifyBuildSound)); } }
private void Tick(object sender, ElapsedEventArgs e) { OnPropertyChanged(nameof(CompleteTime)); if (Ship != null) { if (Ship.RepairingHP == Ship.HP.Max) { return; } Ship.RepairingHP = Ship.HP.Max - (int)Math.Ceiling(CompleteTime.Remain().TotalSeconds / Ship.RepairTimePerHP.TotalSeconds); } if (State == DockState.Repairing && Config.Current.NotifyWhenRepair && CompleteTime.InASecond(Config.Current.NotifyTimeAdjust)) { NotifierFactories.Current?.Show(StringTable.Notification_Repair_Title, string.Format(StringTable.Notification_Repair_Text, Id, Ship.ShipInfo.Name), Config.MakeSoundWithPath(Config.Current.NotifyRepairSound)); } }