Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qutrits committed Jul 3, 2023
1 parent c6d9bbb commit b3b4ab1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Entities/LevelStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public class LevelStats {
public bool isCreative;
public bool IsFinal;
public int TimeLimitSeconds;
public int TimeLimitSecondsForTeam;
public int TimeLimitSecondsForSquad;
public TimeSpan AveDuration { get { return TimeSpan.FromSeconds((int)this.Duration.TotalSeconds / (this.Played == 0 ? 1 : this.Played)); } }
public TimeSpan AveFinish { get { return TimeSpan.FromSeconds((double)this.FinishTime.TotalSeconds / (this.FinishedCount == 0 ? 1 : this.FinishedCount)); } }
public TimeSpan Duration;
Expand All @@ -475,7 +475,7 @@ public class LevelStats {
public int Season;
public int FinishedCount;

public LevelStats(string levelName, LevelType type, bool isCreative, bool isFinal, int season, int timeLimitSeconds, int timeLimitSecondsForTeam, Image roundIcon, Image roundBigIcon) {
public LevelStats(string levelName, LevelType type, bool isCreative, bool isFinal, int season, int timeLimitSeconds, int timeLimitSecondsForSquad, Image roundIcon, Image roundBigIcon) {
this.RoundIcon = roundIcon;
this.RoundBigIcon = roundBigIcon;
this.Name = levelName;
Expand All @@ -484,7 +484,7 @@ public LevelStats(string levelName, LevelType type, bool isCreative, bool isFina
this.isCreative = isCreative;
this.IsFinal = isFinal;
this.TimeLimitSeconds = timeLimitSeconds;
this.TimeLimitSecondsForTeam = timeLimitSecondsForTeam;
this.TimeLimitSecondsForSquad = timeLimitSecondsForSquad;
this.Stats = new List<RoundInfo>();
this.Clear();
}
Expand Down
12 changes: 6 additions & 6 deletions Views/Overlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ private void UpdateInfo() {
} else if (!this.lastRound.UseShareCode) {
if ("main_show".Equals(this.lastRound.ShowNameId) && level.TimeLimitSeconds > 0) {
this.lblDuration.Text = $"{Multilingual.GetWord("overlay_duration")} ({TimeSpan.FromSeconds(level.TimeLimitSeconds):m\\:ss}) :";
} else if (("squads_2player_template".Equals(this.lastRound.ShowNameId) || "squads_4player".Equals(this.lastRound.ShowNameId)) && level.TimeLimitSecondsForTeam > 0) {
this.lblDuration.Text = $"{Multilingual.GetWord("overlay_duration")} ({TimeSpan.FromSeconds(level.TimeLimitSecondsForTeam):m\\:ss}) :";
} else if (("squads_2player_template".Equals(this.lastRound.ShowNameId) || "squads_4player".Equals(this.lastRound.ShowNameId)) && level.TimeLimitSecondsForSquad > 0) {
this.lblDuration.Text = $"{Multilingual.GetWord("overlay_duration")} ({TimeSpan.FromSeconds(level.TimeLimitSecondsForSquad):m\\:ss}) :";
} else {
this.lblDuration.Text = $"{Multilingual.GetWord("overlay_duration")} :";
}
Expand All @@ -893,8 +893,8 @@ private void UpdateInfo() {
} else if (!this.lastRound.UseShareCode) {
if ("main_show".Equals(this.lastRound.ShowNameId) && level.TimeLimitSeconds > 0) {
this.lblDuration.TextRight = $"{TimeSpan.FromSeconds(level.TimeLimitSeconds) - (end - start):m\\:ss\\.ff}";
} else if (("squads_2player_template".Equals(this.lastRound.ShowNameId) || "squads_4player".Equals(this.lastRound.ShowNameId)) && level.TimeLimitSecondsForTeam > 0) {
this.lblDuration.TextRight = $"{TimeSpan.FromSeconds(level.TimeLimitSecondsForTeam) - (end - start):m\\:ss\\.ff}";
} else if (("squads_2player_template".Equals(this.lastRound.ShowNameId) || "squads_4player".Equals(this.lastRound.ShowNameId)) && level.TimeLimitSecondsForSquad > 0) {
this.lblDuration.TextRight = $"{TimeSpan.FromSeconds(level.TimeLimitSecondsForSquad) - (end - start):m\\:ss\\.ff}";
} else {
this.lblDuration.TextRight = $"{end - start:m\\:ss\\.ff}";
}
Expand All @@ -909,8 +909,8 @@ private void UpdateInfo() {
} else if (!this.lastRound.UseShareCode) {
if ("main_show".Equals(this.lastRound.ShowNameId) && level.TimeLimitSeconds > 0) {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{(TimeSpan.FromSeconds(level.TimeLimitSeconds)) - (DateTime.UtcNow - startTime):m\\:ss}" : $"{(TimeSpan.FromSeconds(level.TimeLimitSeconds)) - (DateTime.UtcNow - start):m\\:ss}";
} else if (("squads_2player_template".Equals(this.lastRound.ShowNameId) || "squads_4player".Equals(this.lastRound.ShowNameId)) && level.TimeLimitSecondsForTeam > 0) {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{(TimeSpan.FromSeconds(level.TimeLimitSecondsForTeam)) - (DateTime.UtcNow - startTime):m\\:ss}" : $"{(TimeSpan.FromSeconds(level.TimeLimitSecondsForTeam)) - (DateTime.UtcNow - start):m\\:ss}";
} else if (("squads_2player_template".Equals(this.lastRound.ShowNameId) || "squads_4player".Equals(this.lastRound.ShowNameId)) && level.TimeLimitSecondsForSquad > 0) {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{(TimeSpan.FromSeconds(level.TimeLimitSecondsForSquad)) - (DateTime.UtcNow - startTime):m\\:ss}" : $"{(TimeSpan.FromSeconds(level.TimeLimitSecondsForSquad)) - (DateTime.UtcNow - start):m\\:ss}";
} else {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{DateTime.UtcNow - startTime:m\\:ss}" : $"{DateTime.UtcNow - start:m\\:ss}";
}
Expand Down

0 comments on commit b3b4ab1

Please sign in to comment.