5858import mekhq .campaign .universe .Planet ;
5959import mekhq .campaign .universe .PlanetarySystem ;
6060import mekhq .campaign .universe .Systems ;
61+ import mekhq .campaign .universe .factionStanding .FactionStandingUtilities ;
6162import mekhq .gui .baseComponents .immersiveDialogs .ImmersiveDialogSimple ;
6263import mekhq .utilities .MHQXMLUtility ;
6364import mekhq .utilities .ReportingUtilities ;
@@ -158,56 +159,83 @@ private boolean pickJumpPoint(LocalDate now) {
158159 return randomInt (2 ) == 1 ;
159160 }
160161
162+ /**
163+ * Use {@link #getReport(LocalDate, Money, boolean)} instead
164+ */
165+ @ Deprecated (since = "0.50.07" , forRemoval = true )
161166 public String getReport (LocalDate date , Money jumpCost ) {
162- StringBuilder sb = new StringBuilder ();
163- sb .append ("<html>" )
167+ return getReport (date , jumpCost , false );
168+ }
169+
170+ /**
171+ * Generates a detailed status report for the current location and travel state.
172+ *
173+ * <p>The report includes:</p>
174+ * <ul>
175+ * <li>The current system and position, indicating if on a planet, at a jump point (with recharge status),
176+ * in transit from a planet, or close to a jump point.</li>
177+ * <li>Travel progress, including the destination system, remaining jumps, or if already at the destination.</li>
178+ * <li>The estimated jump cost for the current journey.</li>
179+ * </ul>
180+ *
181+ * <p>The report is formatted as HTML suitable for display in GUI components.</p>
182+ *
183+ * @param date the current {@link LocalDate} for context-sensitive names and status
184+ * @param jumpCost the estimated jump cost as a {@link Money} value
185+ * @param isUseCommandCircuit whether the command circuit option is enabled
186+ *
187+ * @return a formatted HTML string representing the travel and location status report
188+ */
189+ public String getReport (LocalDate date , Money jumpCost , boolean isUseCommandCircuit ) {
190+ double currentRechargeTime = currentSystem .getRechargeTime (date , isUseCommandCircuit );
191+
192+ StringBuilder report = new StringBuilder ();
193+ report .append ("<html>" )
164194 // First Line
165195 .append ("In " ).append (currentSystem .getPrintableName (date )).append (' ' );
166196
167197 if (isOnPlanet ()) {
168- sb .append ("on planet " ).append (getPlanet ().getPrintableName (date ));
198+ report .append ("on planet " ).append (getPlanet ().getPrintableName (date ));
169199 } else if (isAtJumpPoint ()) {
170- sb .append ("at jump point" );
171- if (!Double .isInfinite (currentSystem . getRechargeTime ( date ) )) {
172- sb .append (" (Jumpship " )
200+ report .append ("at jump point" );
201+ if (!Double .isInfinite (currentRechargeTime )) {
202+ report .append (" (Jumpship " )
173203 .append (String .format (Locale .ROOT ,
174204 "%.0f" ,
175- (100.0 * rechargeTime ) / currentSystem . getRechargeTime ( date ) ))
205+ (100.0 * rechargeTime ) / currentRechargeTime ))
176206 .append ("% charged)" );
177207 }
178208 } else {
179209 if ((null != jumpPath ) && (currentSystem == jumpPath .getLastSystem ())) {
180- sb .append (String .format (Locale .ROOT , "%.2f" , getTransitTime ())).append (" days from planet" );
210+ report .append (String .format (Locale .ROOT , "%.2f" , getTransitTime ())).append (" days from planet" );
181211 } else {
182212 double timeToJP = currentSystem .getTimeToJumpPoint (1.0 ) - getTransitTime ();
183- sb .append (String .format (Locale .ROOT , "%.2f" , timeToJP )).append (" days from jump point" );
213+ report .append (String .format (Locale .ROOT , "%.2f" , timeToJP )).append (" days from jump point" );
184214 }
185-
186215 }
187216
188- sb .append ("<br/>" );
217+ report .append ("<br/>" );
189218
190219 // Second Line
191-
192220 if ((null != jumpPath ) && !jumpPath .isEmpty ()) {
193- sb .append ("Traveling to " ).append (jumpPath .getLastSystem ().getPrintableName (date )).append (": " );
221+ report .append ("Traveling to " ).append (jumpPath .getLastSystem ().getPrintableName (date )).append (": " );
194222 if (jumpPath .getJumps () > 0 ) {
195- sb .append (jumpPath .getJumps ())
223+ report .append (jumpPath .getJumps ())
196224 .append (jumpPath .getJumps () == 1 ? " jump remaining" : " jumps remaining" );
197225 } else {
198- sb .append ("In destination system" );
226+ report .append ("In destination system" );
199227 }
200228 } else {
201- sb .append ("Not traveling" );
229+ report .append ("Not traveling" );
202230 }
203231
204- sb .append ("<br/>" );
232+ report .append ("<br/>" );
205233
206234 // Third Line
207- sb .append ("Estimated Jump Cost: " ).append (jumpCost .toAmountString ()).append (" C-Bills<br><br>" );
235+ report .append ("Estimated Jump Cost: " ).append (jumpCost .toAmountString ()).append (" C-Bills<br><br>" );
208236
209- sb .append ("</html>" );
210- return sb .toString ();
237+ report .append ("</html>" );
238+ return report .toString ();
211239 }
212240
213241 public JumpPath getJumpPath () {
@@ -226,7 +254,11 @@ public void setJumpPath(JumpPath path) {
226254 * @return True if the JumpShip has to spend time recharging, otherwise false.
227255 */
228256 public boolean isRecharging (Campaign campaign ) {
229- return currentSystem .getRechargeTime (campaign .getLocalDate ()) > 0 ;
257+ boolean isUseCommandCircuit = FactionStandingUtilities .isUseCommandCircuit (campaign .isOverridingCommandCircuitRequirements (),
258+ campaign .isGM (), campaign .getCampaignOptions ().isUseFactionStandingCommandCircuitSafe (),
259+ campaign .getFactionStandings (), campaign .getActiveAtBContracts ());
260+
261+ return currentSystem .getRechargeTime (campaign .getLocalDate (), isUseCommandCircuit ) > 0 ;
230262 }
231263
232264 /**
@@ -235,7 +267,11 @@ public boolean isRecharging(Campaign campaign) {
235267 * @param campaign The campaign object which owns the JumpShip.
236268 */
237269 public void setRecharged (Campaign campaign ) {
238- rechargeTime = currentSystem .getRechargeTime (campaign .getLocalDate ());
270+ boolean isUseCommandCircuit = FactionStandingUtilities .isUseCommandCircuit (campaign .isOverridingCommandCircuitRequirements (),
271+ campaign .isGM (), campaign .getCampaignOptions ().isUseFactionStandingCommandCircuitSafe (),
272+ campaign .getFactionStandings (), campaign .getActiveAtBContracts ());
273+
274+ rechargeTime = currentSystem .getRechargeTime (campaign .getLocalDate (), isUseCommandCircuit );
239275 }
240276
241277 /**
@@ -244,10 +280,14 @@ public void setRecharged(Campaign campaign) {
244280 public void newDay (Campaign campaign ) {
245281 final boolean wasTraveling = !isOnPlanet ();
246282
283+ boolean isUseCommandCircuit = FactionStandingUtilities .isUseCommandCircuit (campaign .isOverridingCommandCircuitRequirements (),
284+ campaign .isGM (), campaign .getCampaignOptions ().isUseFactionStandingCommandCircuitSafe (),
285+ campaign .getFactionStandings (), campaign .getActiveAtBContracts ());
286+
247287 // recharge even if there is no jump path
248288 // because JumpShips don't go anywhere
249289 double hours = 24.0 ;
250- double neededRechargeTime = currentSystem .getRechargeTime (campaign .getLocalDate ());
290+ double neededRechargeTime = currentSystem .getRechargeTime (campaign .getLocalDate (), isUseCommandCircuit );
251291 double usedRechargeTime = Math .min (hours , neededRechargeTime - rechargeTime );
252292 if (usedRechargeTime > 0 ) {
253293 campaign .addReport ("JumpShips spent " +
0 commit comments