Have gather information take precedence over repair

Differential Revision: https://code.wildfiregames.com/D1374
Reviewed by: mimo
This was SVN commit r21502.
This commit is contained in:
temple 2018-03-11 17:07:12 +00:00
parent 8124a6c76b
commit dad45b60cd

View file

@ -244,16 +244,7 @@ function displaySingle(entState)
Engine.GetGUIObjectByName("resourceCarryingText").caption = entState.foundation.numBuilders ?
Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")) + " " : "";
}
else if (entState.repairable && entState.needsRepair)
{
Engine.GetGUIObjectByName("resourceCarryingIcon").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingText").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingIcon").sprite = "stretched:session/icons/repair.png";
Engine.GetGUIObjectByName("resourceCarryingIcon").tooltip = getRepairTimeTooltip(entState);
Engine.GetGUIObjectByName("resourceCarryingText").caption = entState.repairable.numBuilders ?
Engine.FormatMillisecondsIntoDateStringGMT(entState.repairable.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")) + " " : "";
}
else if (entState.resourceSupply && (!entState.resourceSupply.killBeforeGather || !entState.hitpoints) && entState.visibility == "visible")
else if (entState.resourceSupply && (!entState.resourceSupply.killBeforeGather || !entState.hitpoints))
{
Engine.GetGUIObjectByName("resourceCarryingIcon").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingText").hidden = false;
@ -264,6 +255,15 @@ function displaySingle(entState)
}) + " ";
Engine.GetGUIObjectByName("resourceCarryingIcon").tooltip = translate("Current/max gatherers");
}
else if (entState.repairable && entState.needsRepair)
{
Engine.GetGUIObjectByName("resourceCarryingIcon").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingText").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingIcon").sprite = "stretched:session/icons/repair.png";
Engine.GetGUIObjectByName("resourceCarryingIcon").tooltip = getRepairTimeTooltip(entState);
Engine.GetGUIObjectByName("resourceCarryingText").caption = entState.repairable.numBuilders ?
Engine.FormatMillisecondsIntoDateStringGMT(entState.repairable.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")) + " " : "";
}
else
{
Engine.GetGUIObjectByName("resourceCarryingIcon").hidden = true;