Fixed fractional resources showing up in the GUI
This was SVN commit r7831.
This commit is contained in:
parent
cad0baed3c
commit
dd2fcad2a2
@ -89,7 +89,7 @@ function displayGeneralInfo(playerState, entState, template)
|
||||
// Resource stats
|
||||
if (entState.resourceSupply)
|
||||
{
|
||||
var resources = entState.resourceSupply.amount + "/" + entState.resourceSupply.max + " ";
|
||||
var resources = Math.ceil(+entState.resourceSupply.amount) + "/" + entState.resourceSupply.max + " ";
|
||||
var resourceType = entState.resourceSupply.type["generic"];
|
||||
|
||||
getGUIObjectByName("sdResourceStats").caption = resources;
|
||||
|
@ -168,17 +168,6 @@ function updatePlayerDisplay(simState)
|
||||
// Utility functions
|
||||
//-------------------------------- -------------------------------- --------------------------------
|
||||
|
||||
function ceiling(number)
|
||||
{
|
||||
var integer = parseInt(number);
|
||||
var remainder = number - integer;
|
||||
|
||||
if (remainder != 0)
|
||||
integer++;
|
||||
|
||||
return integer;
|
||||
}
|
||||
|
||||
function toTitleCase(string)
|
||||
{
|
||||
if (string.length > 0)
|
||||
|
@ -134,7 +134,7 @@ function setupUnitPanel(guiName, usedPanels, unitEntState, items, callback)
|
||||
// Position the visible buttons (TODO: if there's lots, maybe they should be squeezed together to fit)
|
||||
var numButtons = i;
|
||||
var rowLength = 8;
|
||||
var numRows = ceiling(numButtons / rowLength);
|
||||
var numRows = Math.ceil(numButtons / rowLength);
|
||||
var buttonSideLength = getGUIObjectByName("unit"+guiName+"Button[0]").size.bottom;
|
||||
var buttonSpacer = ((guiName == "Selection")? buttonSideLength+1 : buttonSideLength+2);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user