diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2017-12-27 18:49:00 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2017-12-27 18:49:00 +0100 |
| commit | cf94a59c7188b10db9b31b818a6d0995d9ab0aee (patch) | |
| tree | cbf3ac1aaa10419df8bbe0e07f71cce11ecded75 | |
| parent | 020fd61af37eaaac81d7b930be15f8c350f28b7d (diff) | |
BLESSED BY PASTOR LUL
| -rw-r--r-- | Penguloon/Levels/LevelBase.cs | 14 | ||||
| -rw-r--r-- | Penguloon/Resources/Resource.Designer.cs | 21 | ||||
| -rw-r--r-- | Penguloon/Resources/Values/Strings.xml | 10 | ||||
| -rw-r--r-- | Penguloon/Scenes/StatsScene.cs | 81 | ||||
| -rw-r--r-- | Penguloon/StaticUIValues.cs | 6 |
5 files changed, 131 insertions, 1 deletions
diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs index f331ae7..fbd6bd7 100644 --- a/Penguloon/Levels/LevelBase.cs +++ b/Penguloon/Levels/LevelBase.cs @@ -17,6 +17,8 @@ namespace Penguloon.Levels public int Money { get; set; } = 0; + public int MoneySpent { get; set; } = 0; + public int ID { get; set; } public int Kills { get; set; } = 0; @@ -81,6 +83,7 @@ namespace Penguloon.Levels } Money -= ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item2; + MoneySpent += ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item2; Map.SpawnObject(ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item1.GetType(), new Vector2(posToSpawnX, posToSpawnY)); @@ -103,6 +106,17 @@ namespace Penguloon.Levels public void FinishGame() { // upload score here or something + UserdataManager.GamesPlayed++; + UserdataManager.TotalKills += Kills; + UserdataManager.TotalMoneySpent += MoneySpent; + + if (Kills > UserdataManager.HighestKills) + UserdataManager.HighestKills = Kills; + + if (Map.WaveManager.CurrentWave - 1 > UserdataManager.HighestRound) + UserdataManager.HighestRound = Map.WaveManager.CurrentWave - 1; + + UserdataManager.WriteData(ParentScene.Main.Context); } } }
\ No newline at end of file diff --git a/Penguloon/Resources/Resource.Designer.cs b/Penguloon/Resources/Resource.Designer.cs index c33b048..196b7e9 100644 --- a/Penguloon/Resources/Resource.Designer.cs +++ b/Penguloon/Resources/Resource.Designer.cs @@ -96,6 +96,27 @@ namespace Penguloon // aapt resource value: 0x7f030002 public const int MenuBtnStats = 2130903042; + // aapt resource value: 0x7f030010 + public const int StatsBestKills = 2130903056; + + // aapt resource value: 0x7f030011 + public const int StatsBestRound = 2130903057; + + // aapt resource value: 0x7f03000f + public const int StatsBestStatsTitle = 2130903055; + + // aapt resource value: 0x7f03000d + public const int StatsTotalGames = 2130903053; + + // aapt resource value: 0x7f03000c + public const int StatsTotalKills = 2130903052; + + // aapt resource value: 0x7f03000e + public const int StatsTotalMoneySpent = 2130903054; + + // aapt resource value: 0x7f03000b + public const int StatsTotalStatsTitle = 2130903051; + static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); diff --git a/Penguloon/Resources/Values/Strings.xml b/Penguloon/Resources/Values/Strings.xml index 1a1452b..638a5bb 100644 --- a/Penguloon/Resources/Values/Strings.xml +++ b/Penguloon/Resources/Values/Strings.xml @@ -20,4 +20,14 @@ <string name="IngameOptionsQuitConfirmation">Are you sure you want to quit?</string> <string name="IngameYes">Yes</string> <string name="IngameNo">No</string> + + <!-- stats --> + <string name="StatsTotalStatsTitle">Career total</string> + <string name="StatsTotalKills">Kills</string> + <string name="StatsTotalGames">Games</string> + <string name="StatsTotalMoneySpent">Money Spent</string> + + <string name="StatsBestStatsTitle">Career best</string> + <string name="StatsBestKills">Kills</string> + <string name="StatsBestRound">Round</string> </resources> diff --git a/Penguloon/Scenes/StatsScene.cs b/Penguloon/Scenes/StatsScene.cs index 21adf27..c488f81 100644 --- a/Penguloon/Scenes/StatsScene.cs +++ b/Penguloon/Scenes/StatsScene.cs @@ -60,10 +60,89 @@ namespace Penguloon.Scenes private void DrawStats(int borderHorizontalY) { - DrawText(ContentManager.GetFont(StaticUIValues.MenuFont), UserdataManager.TotalKills.ToString(), + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsTotalStatsTitle), new Vector2(120, borderHorizontalY), new Vector2(0, 0), + TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + + // Total kills + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsTotalKills), + new Vector2(120, borderHorizontalY + 25 + (60 * 1)), + new Vector2(0, 0), + TextAllignment.LeftTop, Color.White, Color.Black, 2); + + // Total kills stat + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + UserdataManager.TotalKills.ToString(), + new Vector2(920, borderHorizontalY + 25 + (60 * 1)), + new Vector2(0, 0), + TextAllignment.RightTop, Color.White, Color.Black, 2); + + // Total games + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsTotalGames), + new Vector2(120, borderHorizontalY + 25 + (60 * 2)), + new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); + + // Total games stat + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + UserdataManager.GamesPlayed.ToString(), + new Vector2(920, borderHorizontalY + 25 + (60 * 2)), + new Vector2(0, 0), + TextAllignment.RightTop, Color.White, Color.Black, 2); + + // Total money spent + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsTotalMoneySpent), + new Vector2(120, borderHorizontalY + 25 + (60 * 3)), + new Vector2(0, 0), + TextAllignment.LeftTop, Color.White, Color.Black, 2); + + // Total money spent stat + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + UserdataManager.TotalMoneySpent.ToString(), + new Vector2(920, borderHorizontalY + 25 + (60 * 3)), + new Vector2(0, 0), + TextAllignment.RightTop, Color.White, Color.Black, 2); + + /////////////////// + + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsBestStatsTitle), + new Vector2(120, borderHorizontalY + 50 + (60 * 4)), + new Vector2(0, 0), + TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + + // Total kills + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsBestKills), + new Vector2(120, borderHorizontalY + 75 + (60 * 5)), + new Vector2(0, 0), + TextAllignment.LeftTop, Color.White, Color.Black, 2); + + // Total kills stat + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + UserdataManager.HighestKills.ToString(), + new Vector2(920, borderHorizontalY + 75 + (60 * 5)), + new Vector2(0, 0), + TextAllignment.RightTop, Color.White, Color.Black, 2); + + // Total games + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + Main.Resources.GetString(Resource.String.StatsBestRound), + new Vector2(120, borderHorizontalY + 75 + (60 * 6)), + new Vector2(0, 0), + TextAllignment.LeftTop, Color.White, Color.Black, 2); + + // Total games stat + DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), + UserdataManager.HighestRound.ToString(), + new Vector2(920, borderHorizontalY + 75 + (60 * 6)), + new Vector2(0, 0), + TextAllignment.RightTop, Color.White, Color.Black, 2); } } }
\ No newline at end of file diff --git a/Penguloon/StaticUIValues.cs b/Penguloon/StaticUIValues.cs index f4637b7..0734bad 100644 --- a/Penguloon/StaticUIValues.cs +++ b/Penguloon/StaticUIValues.cs @@ -21,6 +21,8 @@ namespace Penguloon public static string IngameFont { get; set; } + public static string StatsFont { get; set; } + public static int IngameUIWidth { get; set; } public static int BorderWidth { get; set; } = 20; @@ -50,6 +52,7 @@ namespace Penguloon ChangeSpeedButtonWidth = 200; IngameOptionsSize = new Vector2(800, 1000); IngameFont = "Fonts/GWENT/36"; + StatsFont = "Fonts/GWENT/48"; IngameUITextAreaHeight = 160; } else if (ScreenViewport.X >= 1920) @@ -63,6 +66,7 @@ namespace Penguloon ChangeSpeedButtonWidth = 200; IngameOptionsSize = new Vector2((int)(800 * 0.85), (int)(1000 * 0.85)); IngameFont = "Fonts/GWENT/36"; + StatsFont = "Fonts/GWENT/48"; IngameUITextAreaHeight = 160; } else if (ScreenViewport.X >= 1280) @@ -75,6 +79,7 @@ namespace Penguloon ChangeSpeedButtonWidth = 130; IngameOptionsSize = new Vector2((int)(800 * 0.7), (int)(1000 * 0.7)); IngameFont = "Fonts/GWENT/24"; + StatsFont = "Fonts/GWENT/48"; IngameUITextAreaHeight = 120; } else @@ -87,6 +92,7 @@ namespace Penguloon ChangeSpeedButtonWidth = 130; IngameOptionsSize = new Vector2((int)(800 * 0.7), (int)(1000 * 0.7)); IngameFont = "Fonts/GWENT/24"; + StatsFont = "Fonts/GWENT/48"; IngameUITextAreaHeight = 120; } |
