From 8f50205e10a84ec88bc1c192a4e556a9a593b7f7 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Sat, 13 Jan 2018 21:40:10 +0100 Subject: stats reset btn --- Penguloon/UserdataManager.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Penguloon/UserdataManager.cs') diff --git a/Penguloon/UserdataManager.cs b/Penguloon/UserdataManager.cs index f3c5aa5..bdbea57 100644 --- a/Penguloon/UserdataManager.cs +++ b/Penguloon/UserdataManager.cs @@ -30,12 +30,19 @@ namespace Penguloon } } - public static void ReadData(Context context) + public static void ReadData(Context context, bool reset = false) { File file = new File(context.CacheDir, "userdata.txt"); - if (!file.Exists()) + if (!file.Exists() || reset) + { + TotalKills = 0; + TotalMoneySpent = 0; + GamesPlayed = 0; + HighestRound = 0; + HighestKills = 0; WriteData(context); + } using (var streamReader = new System.IO.StreamReader(file.AbsolutePath, true)) { -- cgit v1.2.3-70-g09d2