Optimize game.css.

(cherry picked from commit dcf133dfaf344e56503890904293b88511896be9)
This commit is contained in:
Tipx-L 2023-08-24 07:01:33 -07:00
parent 4e66afb155
commit 71a801e279
1 changed files with 7 additions and 9 deletions

View File

@ -38714,16 +38714,14 @@
} }
return skills; return skills;
}, },
css:function(style){ css:style=>Object.keys(style).forEach(value=>{
for(var i in style){ let uiStyle=ui.style[value];
if(ui.style[i]) ui.style[i].innerHTML=i+JSON.stringify(style[i]).replace(/"/g,""); if(!uiStyle){
else{ uiStyle=ui.style[value]=document.createElement('style');
ui.style[i]=document.createElement('style'); document.head.appendChild(uiStyle);
ui.style[i].innerHTML=i+JSON.stringify(style[i]).replace(/"/g,"");
document.head.appendChild(ui.style[i]);
} }
} uiStyle.innerHTML=`${value}${JSON.stringify(style[value]).replace(/"/g,"")}`;
}, }),
hasPlayer:(func,includeOut)=>game.players.some(value=>(includeOut||!value.isOut())&&func(value)), hasPlayer:(func,includeOut)=>game.players.some(value=>(includeOut||!value.isOut())&&func(value)),
hasPlayer2:(func,includeOut)=>game.players.concat(game.dead).some(value=>(includeOut||!value.isOut())&&func(value)), hasPlayer2:(func,includeOut)=>game.players.concat(game.dead).some(value=>(includeOut||!value.isOut())&&func(value)),
countPlayer:(func,includeOut)=>{ countPlayer:(func,includeOut)=>{