Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
遠征と入渠のカウントダウンの仕様変更
Browse files Browse the repository at this point in the history
・表示はゲームの表示通り
・通知のみ設定秒数だけ早める

fixed #51
  • Loading branch information
Grabacr07 committed Aug 6, 2014
1 parent 4f202d7 commit 0e3c61d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Grabacr07.KanColleWrapper/Models/Expedition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ private void UpdateCore()
{
if (this.ReturnTime.HasValue)
{
var remaining = this.ReturnTime.Value - TimeSpan.FromSeconds(KanColleClient.Current.Settings.NotificationShorteningTime) - DateTimeOffset.Now;
var remaining = this.ReturnTime.Value - DateTimeOffset.Now;
if (remaining.Ticks < 0) remaining = TimeSpan.Zero;

this.Remaining = remaining;

if (!this.notificated && this.Returned != null && remaining.Ticks <= 0)
if (!this.notificated
&& this.Returned != null
&& remaining <= TimeSpan.FromSeconds(KanColleClient.Current.Settings.NotificationShorteningTime))
{
this.Returned(this, new ExpeditionReturnedEventArgs(this.fleet.Name));
this.notificated = true;
Expand Down
6 changes: 4 additions & 2 deletions Grabacr07.KanColleWrapper/Models/RepairingDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ protected override void Tick()

if (this.CompleteTime.HasValue)
{
var remaining = this.CompleteTime.Value - TimeSpan.FromSeconds(KanColleClient.Current.Settings.NotificationShorteningTime) - DateTimeOffset.Now;
var remaining = this.CompleteTime.Value - DateTimeOffset.Now;
if (remaining.Ticks < 0) remaining = TimeSpan.Zero;

this.Remaining = remaining;

if (!this.notificated && this.Completed != null && remaining.Ticks <= 0)
if (!this.notificated
&& this.Completed != null
&& remaining <= TimeSpan.FromSeconds(KanColleClient.Current.Settings.NotificationShorteningTime))
{
this.Completed(this, new RepairingCompletedEventArgs(this.Id, this.Ship));
this.notificated = true;
Expand Down

0 comments on commit 0e3c61d

Please sign in to comment.