take low power slowdown into account

fixes #4840
This commit is contained in:
Matthias Mailänder
2014-04-18 18:29:10 +02:00
parent 326d28a084
commit b6f2c119a7
2 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
@@ -64,8 +64,12 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
? Color.White : Color.Red;
powerLabel.IsVisible = () => power != 0;
var timeString = "T: {0}".F(WidgetUtils.FormatTime(palette.CurrentQueue.GetBuildTime(actor)));
var lowpower = pm.PowerState != PowerState.Normal;
var time = palette.CurrentQueue.GetBuildTime(actor)
* ((lowpower) ? palette.CurrentQueue.Info.LowPowerSlowdown : 1);
var timeString = "T: {0}".F(WidgetUtils.FormatTime(time));
timeLabel.GetText = () => timeString;
timeLabel.GetColor = () => lowpower ? Color.Red : Color.White;
var costString = "$: {0}".F(cost);
costLabel.GetText = () => costString;