Ticket #3288: selection_panels_v2.patch
File selection_panels_v2.patch, 1.2 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/selection_panels.js
g_SelectionPanels.Research = { 778 778 "getItems": function(unitEntState, selection) 779 779 { 780 780 // TODO 8 is the row lenght, make variable 781 781 if (getNumberOfRightPanelButtons() > 8 && selection.length > 1) 782 782 return []; 783 for (var ent of selection) 783 784 let techs = []; 785 for (let ent of selection) 784 786 { 785 var entState = GetEntityState(ent); 786 if (entState.production && entState.production.technologies.length) 787 return entState.production.technologies; 787 let entState = GetEntityState(ent); 788 if (entState.production && entState.production.technologies) 789 for (let tech of entState.production.technologies) 790 if (techs.indexOf(tech) == -1) 791 techs.push(tech); 788 792 } 789 return [];793 return techs; 790 794 }, 791 795 "hideItem": function(i, rowLength) // called when no item is found 792 796 { 793 797 Engine.GetGUIObjectByName("unitResearchButton["+i+"]").hidden = true; 794 798 // We also remove the paired tech and the pair symbol