Upgradeable cores

This commit is contained in:
Anuken
2020-06-27 19:16:39 -04:00
parent 313cadb763
commit 80332e37d5
63 changed files with 365 additions and 290 deletions

View File

@@ -4,6 +4,7 @@ import arc.*;
import arc.graphics.*;
import arc.graphics.Texture.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.scene.style.*;
import arc.scene.ui.*;
import arc.scene.ui.ImageButton.*;
@@ -348,6 +349,26 @@ public class SchematicsDialog extends BaseDialog{
}
}
});
cont.row();
float cons = schem.powerConsumption(), prod = schem.powerProduction();
if(!Mathf.zero(cons) || !Mathf.zero(prod)){
cont.table(t -> {
if(!Mathf.zero(prod)){
t.image(Icon.powerSmall).color(Pal.powerLight).padRight(3);
t.add("+" + Strings.autoFixed(prod, 2)).color(Pal.powerLight).left();
if(!Mathf.zero(cons)){
t.add().width(15);
}
}
if(!Mathf.zero(cons)){
t.image(Icon.powerSmall).color(Pal.remove).padRight(3);
t.add("-" + Strings.autoFixed(cons, 2)).color(Pal.remove).left();
}
});
}
show();
}