Tidy more uses of BottomRight/TopLeft, bogus location of FormatTime.
This commit is contained in:
@@ -49,11 +49,8 @@ namespace OpenRA.Mods.RA
|
||||
}
|
||||
|
||||
// Loop through the map looking for templates to overlay
|
||||
var tl = w.Map.TopLeft;
|
||||
var br = w.Map.BottomRight;
|
||||
|
||||
for (int i = tl.X; i < br.X; i++)
|
||||
for (int j = tl.Y; j < br.Y; j++)
|
||||
for (int i = w.Map.Bounds.Left; i < w.Map.Bounds.Right; i++)
|
||||
for (int j = w.Map.Bounds.Top; j < w.Map.Bounds.Bottom; j++)
|
||||
if (BridgeTypes.Keys.Contains(w.Map.MapTiles[i, j].type))
|
||||
ConvertBridgeToActor(w, i, j);
|
||||
|
||||
|
||||
@@ -25,10 +25,9 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
{
|
||||
int2 loc = (.5f * (w.Map.TopLeft + w.Map.BottomRight).ToFloat2()).ToInt2();
|
||||
Game.MoveViewport(loc);
|
||||
|
||||
ViewportOrigin = loc;
|
||||
var b = w.Map.Bounds;
|
||||
ViewportOrigin = new int2(b.Left + b.Width/2, b.Top + b.Height/2);
|
||||
Game.MoveViewport(ViewportOrigin);
|
||||
|
||||
Actors = w.WorldActor.Trait<SpawnMapActors>().Actors;
|
||||
Sound.SoundVolumeModifier = 0.25f;
|
||||
|
||||
@@ -465,7 +465,7 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
var lowpower = power.PowerState != PowerState.Normal;
|
||||
var time = CurrentQueue.GetBuildTime(info.Name)
|
||||
* ((lowpower)? CurrentQueue.Info.LowPowerSlowdown : 1);
|
||||
DrawRightAligned(WorldUtils.FormatTime(time), pos + new int2(-5, 35), lowpower ? Color.Red: Color.White);
|
||||
DrawRightAligned(WidgetUtils.FormatTime(time), pos + new int2(-5, 35), lowpower ? Color.Red: Color.White);
|
||||
|
||||
var bi = info.Traits.GetOrDefault<BuildingInfo>();
|
||||
if (bi != null)
|
||||
|
||||
@@ -121,8 +121,8 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
Game.Renderer.BoldFont.DrawText(sp.Info.Description, pos, Color.White);
|
||||
|
||||
pos += new int2(0,20);
|
||||
Game.Renderer.BoldFont.DrawText(WorldUtils.FormatTime(sp.RemainingTime).ToString(), pos, Color.White);
|
||||
Game.Renderer.BoldFont.DrawText("/ {0}".F(WorldUtils.FormatTime(sp.TotalTime)), pos + new int2(45,0), Color.White);
|
||||
Game.Renderer.BoldFont.DrawText(WidgetUtils.FormatTime(sp.RemainingTime).ToString(), pos, Color.White);
|
||||
Game.Renderer.BoldFont.DrawText("/ {0}".F(WidgetUtils.FormatTime(sp.TotalTime)), pos + new int2(45,0), Color.White);
|
||||
|
||||
if (sp.Info.LongDesc != null)
|
||||
{
|
||||
|
||||
@@ -66,12 +66,12 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
{
|
||||
// losing
|
||||
tc = "Strategic defeat in " +
|
||||
((svc.CriticalTicksLeft > svc.TicksLeft) ? WorldUtils.FormatTime(svc.CriticalTicksLeft) : WorldUtils.FormatTime(svc.TicksLeft));
|
||||
((svc.CriticalTicksLeft > svc.TicksLeft) ? WidgetUtils.FormatTime(svc.CriticalTicksLeft) : WidgetUtils.FormatTime(svc.TicksLeft));
|
||||
}else
|
||||
{
|
||||
// winning
|
||||
tc = "Strategic victory in " +
|
||||
((svc.CriticalTicksLeft > svc.TicksLeft) ? WorldUtils.FormatTime(svc.CriticalTicksLeft) : WorldUtils.FormatTime(svc.TicksLeft));
|
||||
((svc.CriticalTicksLeft > svc.TicksLeft) ? WidgetUtils.FormatTime(svc.CriticalTicksLeft) : WidgetUtils.FormatTime(svc.TicksLeft));
|
||||
}
|
||||
|
||||
var size = Game.Renderer.BoldFont.Measure(tc);
|
||||
|
||||
Reference in New Issue
Block a user