diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index 7c08567..f00e742 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -115,6 +115,13 @@ namespace OWTrack { Wins.Text = tr.GetWins().ToString(); Losses.Text = tr.GetLosses().ToString(); + if (tr.newSR == 0) + { + if (tr.srDiff() < 1) { srLabel.Text = tr.startSR.ToString() + " - 0"; } + else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff(); + } + else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff(); + srTextBox.Text = null; File.WriteAllText(Directory.GetCurrentDirectory() + "/data.json", JsonConvert.SerializeObject(tr)); } @@ -150,13 +157,7 @@ namespace OWTrack } else tr.newSR = sr; } - if (tr.newSR == 0) - { - if (tr.srDiff() < 1) { srLabel.Text = tr.startSR.ToString() + " - 0"; } - else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff(); - } - else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff(); - srTextBox.Text = null; + update(); } } } diff --git a/OWTrack/Tracker.cs b/OWTrack/Tracker.cs index b293edc..afdfe43 100644 --- a/OWTrack/Tracker.cs +++ b/OWTrack/Tracker.cs @@ -10,7 +10,7 @@ namespace OWTrack public int wins, losses, startSR, newSR = 0; public void Track() { } - public void reset() { wins = 0; losses = 0; } + public void reset() { wins = 0; losses = 0; startSR = 0; newSR = 0; } public void addWin() { wins++; } public void addLoss() { losses++; } public void reduceWin() { wins--; }