100 if (
entity.getContainingLocation() ==
null)
return null;
101 float minDist = Float.MAX_VALUE;
102 SectorEntityToken nearest =
null;
103 for (SectorEntityToken curr :
entity.getContainingLocation().getEntitiesWithTag(Tags.STABLE_LOCATION)) {
104 float dist = Misc.getDistance(curr,
entity);
105 if (dist < minDist) {
178 final ArrayList<SectorEntityToken> systems =
new ArrayList<SectorEntityToken>();
180 if (curr ==
entity.getContainingLocation())
continue;
181 if (curr.hasTag(Tags.THEME_HIDDEN) && !
"Limbo".equals(curr.getBaseName()))
continue;
182 if (curr.isDeepSpace())
continue;
183 if (curr.getHyperspaceAnchor() ==
null)
continue;
184 if (Misc.getStarSystemForAnchor(curr.getHyperspaceAnchor()) ==
null)
continue;
185 systems.add(curr.getHyperspaceAnchor());
187 dialog.showCampaignEntityPicker(
"Select destination for gate hauler",
"Destination:",
"Execute",
189 new BaseCampaignEntityPickerListener() {
190 public void pickedEntity(SectorEntityToken
entity) {
196 StarSystemAPI system = Misc.getStarSystemForAnchor(
entity);
197 intel.initiateDeparture(system);
200 public void cancelledEntityPicking() {
203 public String getMenuItemNameOverrideFor(SectorEntityToken
entity) {
204 StarSystemAPI system = Misc.getStarSystemForAnchor(
entity);
205 if (system !=
null) {
206 return system.getNameWithLowercaseTypeShort();
210 public String getSelectedTextOverrideFor(SectorEntityToken
entity) {
211 StarSystemAPI system = Misc.getStarSystemForAnchor(
entity);
212 if (system !=
null) {
213 return system.getNameWithLowercaseType();
217 public void createInfoText(TooltipMakerAPI info, SectorEntityToken
entity) {
219 info.setParaSmallInsignia();
220 String daysStr =
"days";
221 if (days == 1) daysStr =
"day";
222 info.addPara(
" Estimated gate hauler travel time: %s " + daysStr, 0f, Misc.getHighlightColor(),
"" + days);
225 public boolean canConfirmSelection(SectorEntityToken
entity) {
228 public float getFuelColorAlphaMult() {
231 public float getFuelRangeMult() {