Fix observer tooltips (Bug #769)
This commit is contained in:
@@ -164,7 +164,7 @@ namespace OpenRA
|
|||||||
orderManager.LastTickTime += Settings.Game.Timestep;
|
orderManager.LastTickTime += Settings.Game.Timestep;
|
||||||
Widget.DoTick();
|
Widget.DoTick();
|
||||||
var world = orderManager.world;
|
var world = orderManager.world;
|
||||||
if( orderManager.GameStarted && world.LocalPlayer != null )
|
if (orderManager.GameStarted)
|
||||||
++Viewport.TicksSinceLastMove;
|
++Viewport.TicksSinceLastMove;
|
||||||
Sound.Tick();
|
Sound.Tick();
|
||||||
Sync.CheckSyncUnchanged( world, () => { orderManager.TickImmediate(); } );
|
Sync.CheckSyncUnchanged( world, () => { orderManager.TickImmediate(); } );
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
|
|
||||||
public override void DrawInner()
|
public override void DrawInner()
|
||||||
{
|
{
|
||||||
if (Viewport.TicksSinceLastMove < TooltipDelay || world == null || world.LocalPlayer == null)
|
if (Viewport.TicksSinceLastMove < TooltipDelay || world == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var cell = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
var cell = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
||||||
if (!world.Map.IsInMap(cell)) return;
|
if (!world.Map.IsInMap(cell)) return;
|
||||||
|
|
||||||
if (!world.LocalPlayer.Shroud.IsExplored(cell))
|
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(cell))
|
||||||
{
|
{
|
||||||
var utext = "Unexplored Terrain";
|
var utext = "Unexplored Terrain";
|
||||||
var usz = Game.Renderer.Fonts["Bold"].Measure(utext) + new int2(20, 24);
|
var usz = Game.Renderer.Fonts["Bold"].Measure(utext) + new int2(20, 24);
|
||||||
|
|||||||
Reference in New Issue
Block a user