Turn logic / Cross-sector production / Pad tweaks

This commit is contained in:
Anuken
2020-05-15 11:03:21 -04:00
parent 603cb4295a
commit b68e0a8562
16 changed files with 188 additions and 39 deletions

View File

@@ -21,6 +21,7 @@ import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.input.*;
import mindustry.net.Packets.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.ui.dialogs.*;
@@ -296,6 +297,41 @@ public class HudFragment extends Fragment{
p.touchable(Touchable.disabled);
});
//DEBUG: rate table
parent.fill(t -> {
t.bottom().left();
t.table(Styles.black6, c -> {
Bits used = new Bits(content.items().size);
Runnable rebuild = () -> {
c.clearChildren();
for(Item item : content.items()){
if(state.stats.getExport(item) >= 1){
c.image(item.icon(Cicon.small));
c.label(() -> (int)state.stats.getExport(item) + " /s").color(Color.lightGray);
c.row();
}
}
};
c.update(() -> {
boolean wrong = false;
for(Item item : content.items()){
boolean has = state.stats.getExport(item) >= 1;
if(used.get(item.id) != has){
used.set(item.id, has);
wrong = true;
}
}
if(wrong){
rebuild.run();
}
});
});
});
blockfrag.build(parent);
}