Sector abandon button
This commit is contained in:
@@ -620,6 +620,8 @@ sectors.underattack = [scarlet]Under attack! [accent]{0}% damaged
|
|||||||
sectors.underattack.nodamage = [scarlet]Uncaptured
|
sectors.underattack.nodamage = [scarlet]Uncaptured
|
||||||
sectors.survives = [accent]Survives {0} waves
|
sectors.survives = [accent]Survives {0} waves
|
||||||
sectors.go = Go
|
sectors.go = Go
|
||||||
|
sector.abandon = Abandon
|
||||||
|
sector.abandon.confirm = This sector's core(s) will self-destruct.\nContinue?
|
||||||
sector.curcapture = Sector Captured
|
sector.curcapture = Sector Captured
|
||||||
sector.curlost = Sector Lost
|
sector.curlost = Sector Lost
|
||||||
sector.missingresources = [scarlet]Insufficient Core Resources
|
sector.missingresources = [scarlet]Insufficient Core Resources
|
||||||
|
|||||||
@@ -480,8 +480,8 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
|
dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
|
||||||
dialog.buttons.defaults().size(200f, 54f).pad(2f);
|
dialog.buttons.defaults().size(200f, 54f).pad(2f);
|
||||||
dialog.setFillParent(false);
|
dialog.setFillParent(false);
|
||||||
dialog.buttons.button("@cancel", dialog::hide);
|
dialog.buttons.button("@cancel", Icon.cancel, dialog::hide);
|
||||||
dialog.buttons.button("@ok", () -> {
|
dialog.buttons.button("@ok", Icon.ok, () -> {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
confirmed.run();
|
confirmed.run();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -890,6 +890,32 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
});
|
});
|
||||||
|
|
||||||
dialog.addCloseButton();
|
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();
|
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)
|
//make sure there are no under-attack sectors (other than this one)
|
||||||
//TODO abandon button?
|
|
||||||
for(Planet planet : content.planets()){
|
for(Planet planet : content.planets()){
|
||||||
if(!planet.allowWaveSimulation && !debugSelect){
|
if(!planet.allowWaveSimulation && !debugSelect){
|
||||||
int attackedCount = planet.sectors.count(s -> s.isAttacked() && s != sector);
|
int attackedCount = planet.sectors.count(s -> s.isAttacked() && s != sector);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class ItemTurret extends Turret{
|
|||||||
|
|
||||||
/** Makes copies of all bullets and limits their range. */
|
/** Makes copies of all bullets and limits their range. */
|
||||||
public void limitRange(){
|
public void limitRange(){
|
||||||
limitRange(2f);
|
limitRange(5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Makes copies of all bullets and limits their range. */
|
/** Makes copies of all bullets and limits their range. */
|
||||||
|
|||||||
Reference in New Issue
Block a user