Turn logic / Cross-sector production / Pad tweaks
This commit is contained in:
@@ -273,11 +273,11 @@ public class PlanetDialog extends FloatingDialog{
|
||||
}
|
||||
|
||||
if(sec.hostility >= 0.02f){
|
||||
drawSelection(sec, Color.scarlet, 0.11f * sec.hostility, 0.0001f);
|
||||
drawSelection(sec, Color.scarlet, 0.11f * sec.hostility, -0.02f);
|
||||
}
|
||||
|
||||
if(sec.save != null){
|
||||
drawSelection(sec, Color.lime, 0.03f, 0.0009f);
|
||||
drawSelection(sec, Color.lime, 0.03f, -0.01f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,6 +355,25 @@ public class PlanetDialog extends FloatingDialog{
|
||||
}
|
||||
}).fillX().row();
|
||||
|
||||
//production
|
||||
if(selected.hasSave() && selected.save.meta.hasProduction){
|
||||
stable.add("Production:").row();
|
||||
stable.table(t -> {
|
||||
t.left();
|
||||
|
||||
selected.save.meta.productionRates.each(entry -> {
|
||||
int total = (int)(entry.value * turnDuration / 60f);
|
||||
if(total > 1){
|
||||
t.image(entry.key.icon(Cicon.small)).padRight(3);
|
||||
t.add(ui.formatAmount(total) + " /turn").color(Color.lightGray);
|
||||
t.row();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
stable.row();
|
||||
|
||||
stable.button("Launch", Styles.transt, () -> {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user