mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Show researchable techs of all selected entities, not only the first one. Fixes #3288.
This was SVN commit r18194.
This commit is contained in:
parent
01d41cc8a5
commit
de06dc76f7
1 changed files with 11 additions and 7 deletions
|
|
@ -777,16 +777,20 @@ g_SelectionPanels.Research = {
|
|||
},
|
||||
"getItems": function(unitEntState, selection)
|
||||
{
|
||||
// TODO 8 is the row lenght, make variable
|
||||
if (getNumberOfRightPanelButtons() > 8 && selection.length > 1)
|
||||
if (getNumberOfRightPanelButtons() > g_SelectionPanels.Queue.getMaxNumberOfItems() &&
|
||||
selection.length > 1)
|
||||
return [];
|
||||
for (var ent of selection)
|
||||
|
||||
let techs = [];
|
||||
for (let ent of selection)
|
||||
{
|
||||
var entState = GetEntityState(ent);
|
||||
if (entState.production && entState.production.technologies.length)
|
||||
return entState.production.technologies;
|
||||
let entState = GetEntityState(ent);
|
||||
if (entState.production && entState.production.technologies)
|
||||
for (let tech of entState.production.technologies)
|
||||
if (techs.indexOf(tech) == -1)
|
||||
techs.push(tech);
|
||||
}
|
||||
return [];
|
||||
return techs;
|
||||
},
|
||||
"hideItem": function(i, rowLength) // called when no item is found
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue