Give observers a minimap

This commit is contained in:
Paul Chote
2011-07-09 03:12:09 +12:00
parent 9eb7a3c27b
commit 562931196f
3 changed files with 309 additions and 267 deletions

View File

@@ -125,7 +125,7 @@ namespace OpenRA.Mods.RA.Widgets
public override void Draw()
{
if( world == null || world.LocalPlayer == null ) return;
if (world == null) return;
var o = new float2(mapRect.Location.X, mapRect.Location.Y + world.Map.Bounds.Height * previewScale * (1 - radarMinimapHeight)/2);
var s = new float2(mapRect.Size.Width, mapRect.Size.Height*radarMinimapHeight);
@@ -149,7 +149,7 @@ namespace OpenRA.Mods.RA.Widgets
int updateTicks = 0;
public override void Tick()
{
var hasRadarNew = world
var hasRadarNew = world.LocalPlayer == null || world
.ActorsWithTrait<ProvidesRadar>()
.Any(a => a.Actor.Owner == world.LocalPlayer && a.Trait.IsActive);