Optimize game.expandSkills.

(cherry picked from commit fcc1d48119587ec9bb7a1e5f2470ee7c3dd3c1cb)
This commit is contained in:
Tipx-L 2023-08-24 07:21:19 -07:00
parent 71a801e279
commit b6ca7b534e
1 changed files with 8 additions and 15 deletions

View File

@ -38698,22 +38698,15 @@
}
return out;
},
expandSkills:function(skills){
var skills2=[];
for(var i=0;i<skills.length;i++){
var info=get.info(skills[i]);
if(info){
if(info.group) skills2=skills2.concat(info.group);
}
else{
console.log(skills[i]);
}
expandSkills:skills=>skills.addArray(skills.reduce((previousValue,currentValue)=>{
const info=get.info(currentValue);
if(info){
if(Array.isArray(info.group)) previousValue.push(...info.group);
else if(info.group) previousValue.push(info.group);
}
for(var i=0;i<skills2.length;i++){
skills.add(skills2[i]);
}
return skills;
},
else console.log(currentValue);
return previousValue;
},[])),
css:style=>Object.keys(style).forEach(value=>{
let uiStyle=ui.style[value];
if(!uiStyle){