summaryrefslogtreecommitdiff
path: root/Penguloon/Objects/ObjectUpgrade.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-16 14:49:40 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-16 14:49:40 +0100
commit6996be0fc143085b6aa459f2eb7b288ac1617c0b (patch)
tree55f5ca1e95dc52cf9a1e81a0250fb9436e5ec6a9 /Penguloon/Objects/ObjectUpgrade.cs
parent1f5295752f9052c2b7b64660fa36293f18de73d0 (diff)
upgrade sounds
Diffstat (limited to 'Penguloon/Objects/ObjectUpgrade.cs')
-rw-r--r--Penguloon/Objects/ObjectUpgrade.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Penguloon/Objects/ObjectUpgrade.cs b/Penguloon/Objects/ObjectUpgrade.cs
index 278a1fb..a72edd4 100644
--- a/Penguloon/Objects/ObjectUpgrade.cs
+++ b/Penguloon/Objects/ObjectUpgrade.cs
@@ -21,6 +21,7 @@ namespace Penguloon.Objects
PopCount,
Speed,
Money,
+ Range,
}
public enum UpgradeState
@@ -66,6 +67,7 @@ namespace Penguloon.Objects
case UpgradeType.Money: Icon = ContentManager.GetTexture("UI/money"); break;
case UpgradeType.PopCount: Icon = ContentManager.GetTexture("UI/explosion"); break;
case UpgradeType.Speed: Icon = ContentManager.GetTexture("UI/speed"); break;
+ case UpgradeType.Range: Icon = ContentManager.GetTexture("UI/radar"); break;
}
}
@@ -80,6 +82,10 @@ namespace Penguloon.Objects
SpriteFont font = ContentManager.GetFont(StaticUIValues.IngameFont);
int textHeight = (int)font.MeasureString(Text).Y;
+ int textWidth = (int)font.MeasureString(Text).X;
+
+ int costHeight = (int)font.MeasureString("$" + Cost.ToString() + ",-").Y;
+ int costWidth = (int)font.MeasureString("$" + Cost.ToString() + ",-").X;
if (State == UpgradeState.Idle)
spriteBatch.Draw(Background, destinationRectangle: new Rectangle(
@@ -101,8 +107,13 @@ namespace Penguloon.Objects
(int)StaticUIValues.UpgradePanelSize.Y / 2));
spriteBatch.DrawString(ContentManager.GetFont(StaticUIValues.IngameFont),
- Text, new Vector2(ParentLevel.Map.MapWidth + StaticUIValues.BorderWidth + 90,
- startY + ((int)StaticUIValues.UpgradePanelSize.Y * index) + (int)(StaticUIValues.UpgradePanelSize.Y / 2) - textHeight / 2),
+ Text, new Vector2(StaticUIValues.ScreenViewport.X - 20 - textWidth,
+ startY + ((int)StaticUIValues.UpgradePanelSize.Y * index) + (int)(StaticUIValues.UpgradePanelSize.Y / 3) - textHeight / 2),
+ Color.FromNonPremultiplied(20, 20, 20, 255));
+
+ spriteBatch.DrawString(ContentManager.GetFont(StaticUIValues.IngameFont),
+ "$" + Cost.ToString() + ",-", new Vector2(StaticUIValues.ScreenViewport.X - 20 - costWidth,
+ startY + ((int)StaticUIValues.UpgradePanelSize.Y * index) + (int)(StaticUIValues.UpgradePanelSize.Y / 2) + (int)(StaticUIValues.UpgradePanelSize.Y / 4) - costHeight / 2),
Color.FromNonPremultiplied(20, 20, 20, 255));
spriteBatch.Draw(ContentManager.GetTexture("UI/objectSelectionBorder"),