Sector abandon button
This commit is contained in:
@@ -890,6 +890,32 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
});
|
||||
|
||||
dialog.addCloseButton();
|
||||
|
||||
if(sector.hasBase()){
|
||||
dialog.buttons.button("@sector.abandon", Icon.cancel, () -> {
|
||||
ui.showConfirm("@sector.abandon.confirm", () -> {
|
||||
dialog.hide();
|
||||
|
||||
if(sector.isBeingPlayed()){
|
||||
hide();
|
||||
//after dialog is hidden
|
||||
Time.runTask(7f, () -> {
|
||||
//force game over in a more dramatic fashion
|
||||
for(var core : player.team().cores().copy()){
|
||||
core.kill();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(sector.save != null){
|
||||
sector.save.delete();
|
||||
}
|
||||
sector.save = null;
|
||||
}
|
||||
updateSelected();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@@ -1080,7 +1106,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
}
|
||||
|
||||
//make sure there are no under-attack sectors (other than this one)
|
||||
//TODO abandon button?
|
||||
for(Planet planet : content.planets()){
|
||||
if(!planet.allowWaveSimulation && !debugSelect){
|
||||
int attackedCount = planet.sectors.count(s -> s.isAttacked() && s != sector);
|
||||
|
||||
Reference in New Issue
Block a user