Turn notification

This commit is contained in:
Anuken
2020-05-16 16:40:24 -04:00
parent bdbc8ab6d2
commit 2b46659daf
5 changed files with 39 additions and 5 deletions

View File

@@ -364,7 +364,7 @@ public class PlanetDialog extends FloatingDialog{
}).fillX().row();
//production
if(selected.hasSave() && selected.save.meta.hasProduction){
if(selected.hasBase() && selected.save.meta.hasProduction){
stable.add("Production:").row();
stable.table(t -> {
t.left();
@@ -381,7 +381,7 @@ public class PlanetDialog extends FloatingDialog{
}
//disaply how many turns this sector has been attacked
if(selected.getTurnsPassed() > 0){
if(selected.getTurnsPassed() > 0 && selected.hasBase()){
stable.row();
stable.add("[scarlet]" + Iconc.warning + " " + selected.getTurnsPassed() + "x attacks");

View File

@@ -41,7 +41,13 @@ public class HudFragment extends Fragment{
private long lastToast;
@Override
public void build(Group parent){
Events.on(TurnEvent.class, e -> {
//TODO localize, clean up, etc
int attacked = universe.getSectorsAttacked();
showToast("New turn: [accent]" + universe.getTurn() + "[]" + (attacked > 0 ? "\n[scarlet]" + Iconc.warning + " " + attacked + " sectors attacked!": ""));
});
//menu at top left
parent.fill(cont -> {