mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
some gui cleanup
This was SVN commit r17307.
This commit is contained in:
parent
2548187474
commit
be2ddb9c63
2 changed files with 6 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue