Overhaul the replay sidebar.

This commit is contained in:
Paul Chote
2014-10-12 18:11:36 +13:00
parent 43f395b0c6
commit ad88378a0b
12 changed files with 660 additions and 276 deletions

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (world.Timestep == 1)
return "Max Speed";
return "{0:F1}x Speed".F(Game.Timestep * 1f / world.Timestep);
return "{0}% Speed".F(Game.Timestep * 100 / world.Timestep);
};
if (timer != null)
@@ -54,6 +54,16 @@ namespace OpenRA.Mods.RA.Widgets.Logic
status.IsVisible = shouldShowStatus;
status.GetText = statusText;
}
var percentage = widget.GetOrNull<LabelWidget>("GAME_TIMER_PERCENTAGE");
if (percentage != null)
{
var connection = orderManager.Connection as ReplayConnection;
if (connection != null && connection.TickCount != 0)
percentage.GetText = () => "({0}%)".F(orderManager.NetFrameNumber * 100 / connection.TickCount);
else
timer.Bounds.Width += percentage.Bounds.Width;
}
}
}
}