Added Stardust to TopBar Statistics
Added Stardust to TopBar Statistics
PTC Account Name on Startup is only showen when we use a PTC Account for Login
diff --git a/PokemonGo.RocketAPI.Logic/Logic.cs b/PokemonGo.RocketAPI.Logic/Logic.cs
index e22e35f..2431b18 100644
--- a/PokemonGo.RocketAPI.Logic/Logic.cs
+++ b/PokemonGo.RocketAPI.Logic/Logic.cs
@@ -54,7 +54,8 @@ namespace PokemonGo.RocketAPI.Logic
await _client.SetServer();
var profile = await _client.GetProfile();
Logger.Normal(ConsoleColor.Yellow, "----------------------------");
- Logger.Normal(ConsoleColor.Cyan, "Account: " + _clientSettings.PtcUsername);
+ if (_clientSettings.AuthType == AuthType.Ptc)
+ Logger.Normal(ConsoleColor.Cyan, "PTC Account: " + _clientSettings.PtcUsername + "\n");
//Logger.Normal(ConsoleColor.Cyan, "Password: " + _clientSettings.PtcPassword + "\n");
Logger.Normal(ConsoleColor.DarkGray, "Latitude: " + _clientSettings.DefaultLatitude);
Logger.Normal(ConsoleColor.DarkGray, "Longitude: " + _clientSettings.DefaultLongitude);
@@ -162,6 +163,8 @@ namespace PokemonGo.RocketAPI.Logic
foreach (int xp in caughtPokemonResponse.Scores.Xp)
_stats.addExperience(xp);
_stats.increasePokemons();
+ var profile = await _client.GetProfile();
+ _stats.getStardust(profile.Profile.Currency.ToArray()[1].Amount);
}
_stats.updateConsoleTitle();
diff --git a/PokemonGo.RocketAPI.Logic/Utils/Statistics.cs b/PokemonGo.RocketAPI.Logic/Utils/Statistics.cs
index 489aa85..f7cd81e 100644
--- a/PokemonGo.RocketAPI.Logic/Utils/Statistics.cs
+++ b/PokemonGo.RocketAPI.Logic/Utils/Statistics.cs
@@ -12,6 +12,7 @@ namespace PokemonGo.RocketAPI.Logic.Utils
private int _totalPokemons;
private int _totalItemsRemoved;
private int _totalPokemonsTransfered;
+ private int _totalStardust;
private DateTime _initSessionDateTime = DateTime.Now;
@@ -30,6 +31,11 @@ namespace PokemonGo.RocketAPI.Logic.Utils
_totalPokemons += 1;
}
+ public void getStardust(int stardust)
+ {
+ _totalStardust = stardust;
+ }
+
public void addItemsRemoved(int count)
{
_totalItemsRemoved += count;
@@ -46,8 +52,8 @@ namespace PokemonGo.RocketAPI.Logic.Utils
}
public override string ToString()
- {
- return string.Format("{0} - Exp/H: {1:0.0} EXP P/H: {2:0.0} Pokemon(s) Items Removed: {3:0.0} Items Transfered: {4:0.0}", "Statistics", _totalExperience / _getSessionRuntime(), _totalPokemons / _getSessionRuntime(), _totalItemsRemoved, _totalPokemonsTransfered);
+ {
+ return string.Format("{0} - Exp/H: {1:0.0} EXP P/H: {2:0.0} Pokemon(s) Stardust: {3:0} Pokemon(s) Pokemon Transfered: {4:0} Items Removed: {5:0}", "Statistics", _totalExperience / _getSessionRuntime(), _totalPokemons / _getSessionRuntime(), _totalStardust, _totalPokemonsTransfered, _totalItemsRemoved);
}
}
}
\ No newline at end of file
You may download the files in Public Git.