Skip to content

Commit

Permalink
Clear avg damage between quests and improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danong committed Sep 3, 2018
1 parent f85a3c6 commit 00de74f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ private void update_tick(object sender, EventArgs e)
if (this.in_quest)
{
this.in_quest = false;
Array.Clear(this.player_damages_avg, 0, this.player_damages_avg.Length);
this.quest_end = DateTime.UtcNow;
}
this.update_info(true);
Expand All @@ -120,7 +121,7 @@ private void update_info(bool quest_end)
{
float dps = this.player_damages[index] / (float)(this.quest_end - this.first_damage).TotalSeconds;
this.player_name_tbs[index].Text = this.player_names[index];
this.player_dmg_tbs[index].Text = this.player_names[index] == "" ? "" : this.player_damages[index].ToString() + " (" + ((float)((double)this.player_damages[index] / (double)num * 100.0)).ToString("0.0") + "%) " + dps.ToString("0.0") + " DPS";
this.player_dmg_tbs[index].Text = this.player_names[index] == "" ? "" : this.player_damages[index].ToString() + " (" + ((float)((double)this.player_damages[index] / (double)num * 100.0)).ToString("0.0") + "%) " + dps.ToString("0.0") + " DPS ";
}
}
else
Expand All @@ -131,7 +132,7 @@ private void update_info(bool quest_end)
this.player_damages_avg[index] -= this.player_damages_avg[index] / 8;
this.player_damages_avg[index] += new_sample / 8;
this.player_name_tbs[index].Text = this.player_names[index];
this.player_dmg_tbs[index].Text = this.player_names[index] == "" ? "" : " " + ((float)((double)this.player_damages[index] / (double)num * 100.0)).ToString("0.0") + "% " + this.player_damages_avg[index].ToString("0.0") + " DPS";
this.player_dmg_tbs[index].Text = this.player_names[index] == "" ? "" : " " + ((float)((double)this.player_damages[index] / (double)num * 100.0)).ToString("0.0") + "% " + this.player_damages_avg[index].ToString("0.0") + " DPS ";
}
if (num == 0)
{
Expand Down

0 comments on commit 00de74f

Please sign in to comment.