72 public static boolean isPopulated(SectorEntityToken targetGate) {
73 if (targetGate.getContainingLocation() ==
null)
return false;
75 LocationAPI loc = targetGate.getContainingLocation();
76 if (loc.hasTag(Tags.THEME_CORE_POPULATED))
return true;
78 return !Misc.getMarketsInLocation(loc).isEmpty();
89 final ArrayList<SectorEntityToken> gates =
92 dialog.showCampaignEntityPicker(
"Select destination",
"Destination:",
"Initiate transit",
94 new BaseCampaignEntityPickerListener() {
95 public void pickedEntity(SectorEntityToken
entity) {
101 JumpDestination dest =
new JumpDestination(
entity,
null);
114 ListenerUtil.reportFleetTransitingGate(
Global.
getSector().getPlayerFleet(),
117 public void cancelledEntityPicking() {
120 public String getMenuItemNameOverrideFor(SectorEntityToken
entity) {
123 public String getSelectedTextOverrideFor(SectorEntityToken
entity) {
124 return entity.getName() +
" - " +
entity.getContainingLocation().getNameWithTypeShort();
126 public void createInfoText(TooltipMakerAPI info, SectorEntityToken
entity) {
129 int available = (int)
Global.
getSector().getPlayerFleet().getCargo().getFuel();
131 Color reqColor = Misc.getHighlightColor();
132 Color availableColor = Misc.getHighlightColor();
133 if (cost > available) {
134 reqColor = Misc.getNegativeHighlightColor();
137 info.setParaSmallInsignia();
145 info.beginGrid(200f, 2, Misc.getGrayColor());
146 info.setGridFontSmallInsignia();
147 info.addToGrid(0, 0,
" Fuel required:", Misc.getWithDGS(cost), reqColor);
148 info.addToGrid(1, 0,
" Fuel available:", Misc.getWithDGS(available), availableColor);
151 public boolean canConfirmSelection(SectorEntityToken
entity) {
153 int available = (int)
Global.
getSector().getPlayerFleet().getCargo().getFuel();
154 return cost <= available;
156 public float getFuelColorAlphaMult() {
159 public float getFuelRangeMult() {
161 if (Misc.GATE_FUEL_COST_MULT <= 0)
return 0f;
162 return 1f / Misc.GATE_FUEL_COST_MULT;