Show the maximum population setting in a tooltip. Patch by elexis. Fixes #3197

This was SVN commit r16583.
This commit is contained in:
sanderd17 2015-04-26 09:42:54 +00:00
parent a959fcf337
commit 42c04cdad2
2 changed files with 2 additions and 1 deletions

View File

@ -711,6 +711,8 @@ function updatePlayerDisplay()
Engine.GetGUIObjectByName("resourceStone").caption = Math.floor(playerState.resourceCounts.stone);
Engine.GetGUIObjectByName("resourceMetal").caption = Math.floor(playerState.resourceCounts.metal);
Engine.GetGUIObjectByName("resourcePop").caption = playerState.popCount + "/" + playerState.popLimit;
Engine.GetGUIObjectByName("population").tooltip = translate("Population (current / limit)") + "\n" +
sprintf(translate("Maximum population: %(popCap)s"), { "popCap": playerState.popMax });
g_IsTrainingBlocked = playerState.trainingBlocked;
}

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<object name="population" size="370 0 460 100%" type="image" style="resourceCounter" tooltip_style="sessionToolTipBold">
<translatableAttribute id="tooltip">Population (current / limit)</translatableAttribute>
<object size="0 -4 40 34" type="image" sprite="stretched:session/icons/resources/population.png" ghost="true"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
</object>