better visuals for placing attractions and modifiers

This commit is contained in:
Ellpeck 2020-06-10 16:42:45 +02:00
parent 7a371335e6
commit 060c69007d
3 changed files with 5 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -156,17 +156,19 @@ namespace TouchyTickets {
} }
// draw attractions // draw attractions
foreach (var (pos, attraction) in this.attractions) { foreach (var (pos, attraction) in this.attractions) {
if (this.SelectedPosition != pos && this.PlacingModifier != null && this.PlacingModifier.IsAffected(attraction)) { if (this.PlacingModifier != null && this.PlacingModifier.IsAffected(attraction)) {
var color = GameImpl.Instance.Tickets >= attraction.GetModifierPrice(this.PlacingModifier) ? Color.Yellow : Color.Red;
foreach (var offset in attraction.Type.GetCoveredTiles()) foreach (var offset in attraction.Type.GetCoveredTiles())
batch.Draw(batch.GetBlankTexture(), new RectangleF(position + (pos + offset).ToVector2() * tileSize, tileSize), Color.Yellow * 0.25F * alpha); batch.Draw(batch.GetBlankTexture(), new RectangleF(position + (pos + offset).ToVector2() * tileSize, tileSize), color * 0.25F * alpha);
} }
batch.Draw(attraction.Type.TextureRegion, position + pos.ToVector2() * tileSize, Color.White * alpha, 0, Vector2.Zero, scale, SpriteEffects.None, 0); batch.Draw(attraction.Type.TextureRegion, position + pos.ToVector2() * tileSize, Color.White * alpha, 0, Vector2.Zero, scale, SpriteEffects.None, 0);
} }
// placing attraction // placing attraction
if (this.PlacingAttraction != null) { if (this.PlacingAttraction != null) {
var placingPos = position + this.PlacingPosition.ToVector2() * tileSize; var placingPos = position + this.PlacingPosition.ToVector2() * tileSize;
var color = this.CanPlace(this.PlacingPosition, this.PlacingAttraction) ? Color.Yellow : Color.Red;
foreach (var pos in this.PlacingAttraction.Type.GetCoveredTiles()) foreach (var pos in this.PlacingAttraction.Type.GetCoveredTiles())
batch.Draw(batch.GetBlankTexture(), new RectangleF(placingPos + pos.ToVector2() * tileSize, tileSize), Color.Black * 0.25F * alpha); batch.Draw(batch.GetBlankTexture(), new RectangleF(placingPos + pos.ToVector2() * tileSize, tileSize), color * 0.25F * alpha);
batch.Draw(this.PlacingAttraction.Type.TextureRegion, placingPos, Color.White * alpha * 0.5F, 0, Vector2.Zero, scale, SpriteEffects.None, 0); batch.Draw(this.PlacingAttraction.Type.TextureRegion, placingPos, Color.White * alpha * 0.5F, 0, Vector2.Zero, scale, SpriteEffects.None, 0);
} }
} }