From 4610461a818a1e6bc20a0f4e5c62e841c502ce13 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 3 Dec 2011 11:29:27 +1300 Subject: [PATCH] fix naming convention in RadarWidget --- OpenRA.Mods.RA/Widgets/RadarWidget.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.RA/Widgets/RadarWidget.cs b/OpenRA.Mods.RA/Widgets/RadarWidget.cs index 7694976b9f..8d184c123f 100755 --- a/OpenRA.Mods.RA/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.RA/Widgets/RadarWidget.cs @@ -7,6 +7,7 @@ * see COPYING. */ #endregion + using System; using System.Drawing; using System.Linq; @@ -21,9 +22,12 @@ namespace OpenRA.Mods.RA.Widgets public int AnimationLength = 5; public string RadarOnlineSound = null; public string RadarOfflineSound = null; + float radarMinimapHeight; int AnimationFrame = 0; bool hasRadar = false; + bool animating = false; + int updateTicks = 0; float previewScale = 0; RectangleF mapRect = Rectangle.Empty; @@ -84,7 +88,7 @@ namespace OpenRA.Mods.RA.Widgets public override bool HandleMouseInput(MouseInput mi) { - if (!hasRadar || Animating) return false; + if (!hasRadar || animating) return false; if (!mapRect.Contains(mi.Location)) return false; @@ -135,7 +139,7 @@ namespace OpenRA.Mods.RA.Widgets rsr.DrawSprite(shroudSprite, o, s); // Draw viewport rect - if (hasRadar && !Animating) + if (hasRadar && !animating) { var wr = Game.viewport.WorldRect; var wro = new int2(wr.X, wr.Y); @@ -148,8 +152,6 @@ namespace OpenRA.Mods.RA.Widgets } } - bool Animating = false; - int updateTicks = 0; public override void Tick() { var hasRadarNew = world.LocalPlayer == null || world.LocalPlayer.WinState != WinState.Undefined || @@ -157,7 +159,7 @@ namespace OpenRA.Mods.RA.Widgets if (hasRadarNew != hasRadar) { - Animating = true; + animating = true; Sound.Play(hasRadarNew ? RadarOnlineSound : RadarOfflineSound); } hasRadar = hasRadarNew; @@ -179,7 +181,7 @@ namespace OpenRA.Mods.RA.Widgets shroudSprite.sheet.Texture.SetData(Minimap.ShroudBitmap(world)); } - if (!Animating) + if (!animating) return; // Increment frame @@ -193,7 +195,7 @@ namespace OpenRA.Mods.RA.Widgets // Animation is complete if (AnimationFrame == (hasRadar ? AnimationLength : 0)) - Animating = false; + animating = false; } int2 CellToMinimapPixel(int2 p)