forked from mirrors/0ad
some gui cleanup
This was SVN commit r17307.
This commit is contained in:
@@ -381,7 +381,7 @@ function updateLeaderboard()
|
||||
// Get GUI leaderboard object
|
||||
var leaderboard = Engine.GetGUIObjectByName("leaderboardBox");
|
||||
// Sort list in acending order by rating
|
||||
boardList.sort(function(a, b) b.rating - a.rating);
|
||||
boardList.sort((a, b) => b.rating - a.rating);
|
||||
|
||||
var list = [];
|
||||
var list_name = [];
|
||||
|
||||
@@ -22,9 +22,10 @@ function getResourceTypeDisplayName(resourceType)
|
||||
}
|
||||
|
||||
// Fills out information that most entities have
|
||||
function displaySingle(entState, template)
|
||||
function displaySingle(entState)
|
||||
{
|
||||
// Get general unit and player data
|
||||
var template = GetTemplateData(entState.template);
|
||||
var specificName = template.name.specific;
|
||||
var genericName = template.name.generic;
|
||||
// If packed, add that to the generic name (reduces template clutter)
|
||||
@@ -288,7 +289,7 @@ function displaySingle(entState, template)
|
||||
}
|
||||
|
||||
// Fills out information for multiple entities
|
||||
function displayMultiple(selection, template)
|
||||
function displayMultiple(selection)
|
||||
{
|
||||
var averageHealth = 0;
|
||||
var maxHealth = 0;
|
||||
@@ -395,13 +396,11 @@ function updateSelectionDetails()
|
||||
if (!entState)
|
||||
return;
|
||||
|
||||
var template = GetTemplateData(entState.template);
|
||||
|
||||
// Fill out general info and display it
|
||||
if (selection.length == 1)
|
||||
displaySingle(entState, template);
|
||||
displaySingle(entState);
|
||||
else
|
||||
displayMultiple(selection, template);
|
||||
displayMultiple(selection);
|
||||
|
||||
// Show basic details.
|
||||
detailsPanel.hidden = false;
|
||||
|
||||
Reference in New Issue
Block a user