Planet launch candidate system
This commit is contained in:
@@ -256,6 +256,13 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
this.listener = listener;
|
||||
launchSector = sector;
|
||||
|
||||
//automatically select next planets; TODO pan!
|
||||
if(sector.planet.launchCandidates.size == 1){
|
||||
state.planet = sector.planet.launchCandidates.first();
|
||||
}
|
||||
|
||||
//TODO pan over to correct planet
|
||||
|
||||
//update view to sector
|
||||
zoom = 1f;
|
||||
state.zoom = 1f;
|
||||
@@ -292,7 +299,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
|
||||
boolean canSelect(Sector sector){
|
||||
if(mode == select) return sector.hasBase();
|
||||
//cannot launch to existing sector w/ accelerator
|
||||
//cannot launch to existing sector w/ accelerator TODO test
|
||||
if(mode == planetLaunch) return !sector.hasBase();
|
||||
if(sector.hasBase() || sector.id == sector.planet.startSector) return true;
|
||||
//preset sectors can only be selected once unlocked
|
||||
@@ -452,7 +459,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
boolean selectable(Planet planet){
|
||||
//TODO what if any sector is selectable?
|
||||
//TODO launch criteria - which planets can be launched to? Where should this be defined? Should planets even be selectable?
|
||||
if(mode == planetLaunch) return launchSector != null && planet != launchSector.planet;
|
||||
if(mode == planetLaunch) return launchSector != null && planet != launchSector.planet && launchSector.planet.launchCandidates.contains(planet);
|
||||
return planet == state.planet || (planet.alwaysUnlocked && planet.isLandable()) || planet.sectors.contains(Sector::hasBase);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user