summaryrefslogtreecommitdiff
path: root/Penguloon/Controls/LevelSelector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Penguloon/Controls/LevelSelector.cs')
-rw-r--r--Penguloon/Controls/LevelSelector.cs80
1 files changed, 76 insertions, 4 deletions
diff --git a/Penguloon/Controls/LevelSelector.cs b/Penguloon/Controls/LevelSelector.cs
index 885d6c1..6322b79 100644
--- a/Penguloon/Controls/LevelSelector.cs
+++ b/Penguloon/Controls/LevelSelector.cs
@@ -60,6 +60,8 @@ namespace Penguloon.Controls
if (Panel2.Intersects(fingerRec) && Levels[selectedMap].MinimumLevel <= UserdataManager.Level)
{
+ if (Levels[selectedMap].MinimumLevel == 0 && !BillingManager.MapPackPurchased) return;
+
SoundManager.PlayClickSound();
SceneManager.GameScene = new GameScene(ParentScene.Main, Levels[selectedMap]);
SceneManager.SelectedScene = SelectedScene.Ingame;
@@ -107,11 +109,15 @@ namespace Penguloon.Controls
Levels.Add(new IceLevel3());
Levels.Add(new SandLevel1());
- Levels.Add(new SandLevel2());
- Levels.Add(new SandLevel3());
- Levels.Add(new SpaceLevel1());
- Levels.Add(new SpaceLevel2());
+ //if (BillingManager.MapPackPurchased)
+ {
+ Levels.Add(new SandLevel2());
+ Levels.Add(new SandLevel3());
+
+ Levels.Add(new SpaceLevel1());
+ Levels.Add(new SpaceLevel2());
+ }
}
public override void Draw(float deltaTime)
@@ -139,6 +145,18 @@ namespace Penguloon.Controls
//DrawLevel(new Vector2(Panel0.X + 25, Panel0.Y + Panel0.Height - 20), Levels[selectedMap - 2].MinimumLevel);
}
+ else if (Levels[selectedMap - 2].MinimumLevel == 0)
+ {
+ if (!BillingManager.MapPackPurchased)
+ {
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"),
+ destinationRectangle: Panel0);
+ }
+
+ // draw star here
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/star"),
+ destinationRectangle: new Rectangle(Panel0.X + 25, Panel0.Y + 25, 100, 100));
+ }
}
if (selectedMap - 1 >= 0)
@@ -154,6 +172,19 @@ namespace Penguloon.Controls
ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"),
destinationRectangle: new Rectangle(Panel1.X + 25, Panel1.Y + 25, 100, 100));
}
+ else if (Levels[selectedMap - 1].MinimumLevel == 0)
+ {
+ if (!BillingManager.MapPackPurchased)
+ {
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"),
+ destinationRectangle: Panel1);
+ }
+
+ // draw star here
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/star"),
+ destinationRectangle: new Rectangle(Panel1.X + 25, Panel1.Y + 25, 100, 100));
+ }
+
DrawLevel(new Vector2(Panel1.X + 25, Panel1.Y + Panel1.Height - 10), Levels[selectedMap - 1].MinimumLevel);
}
@@ -170,6 +201,19 @@ namespace Penguloon.Controls
ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"),
destinationRectangle: new Rectangle(Panel4.X + 25, Panel4.Y + 25, 100, 100));
}
+ else if (Levels[selectedMap + 2].MinimumLevel == 0)
+ {
+ if (!BillingManager.MapPackPurchased)
+ {
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"),
+ destinationRectangle: Panel4);
+ }
+
+ // draw star here
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/star"),
+ destinationRectangle: new Rectangle(Panel4.X + 25, Panel4.Y + 25, 100, 100));
+ }
+
DrawLevel(new Vector2(Panel4.X + 25, Panel4.Y + Panel4.Height - 10), Levels[selectedMap + 2].MinimumLevel);
}
@@ -186,6 +230,19 @@ namespace Penguloon.Controls
ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"),
destinationRectangle: new Rectangle(Panel3.X + 25, Panel3.Y + 25, 100, 100));
}
+ else if (Levels[selectedMap + 1].MinimumLevel == 0)
+ {
+ if (!BillingManager.MapPackPurchased)
+ {
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"),
+ destinationRectangle: Panel3);
+ }
+
+ // draw star here
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/star"),
+ destinationRectangle: new Rectangle(Panel3.X + 25, Panel3.Y + 25, 100, 100));
+ }
+
DrawLevel(new Vector2(Panel3.X + 25, Panel3.Y + Panel3.Height - 10), Levels[selectedMap + 1].MinimumLevel);
}
@@ -197,15 +254,30 @@ namespace Penguloon.Controls
ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"),
destinationRectangle: Panel2);
+
ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"),
destinationRectangle: new Rectangle(Panel2.X + 25, Panel2.Y + 25, 100, 100));
}
+ else if (Levels[selectedMap].MinimumLevel == 0)
+ {
+ if (!BillingManager.MapPackPurchased)
+ {
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"),
+ destinationRectangle: Panel2);
+ }
+
+ // draw star here
+ ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/star"),
+ destinationRectangle: new Rectangle(Panel2.X + 25, Panel2.Y + 25, 100, 100));
+ }
DrawLevel(new Vector2(Panel2.X + 25, Panel2.Y + Panel2.Height - 10), Levels[selectedMap].MinimumLevel);
}
private void DrawLevel(Vector2 position, int minLevel)
{
+ if (minLevel == 0) return;
+
ParentScene.DrawText(ContentManager.GetFont(StaticUIValues.StatsFont),
minLevel.ToString(),
new Vector2((int)position.X + ContentManager.GetFont(StaticUIValues.StatsFont).MeasureString(ParentScene.Main.Resources.GetString(Resource.String.StatsLevel) + " ").X, position.Y),