Source:
<code>public void actionPerformed(ActionEvent event) { <START> if (event.getSource().equals(btnStart) || event.getSource().equals(btnNextMonth)) { <END> int days = (int)spnDays.getValue(); boolean firstDay = true; MekHQ.registerHandler(this); if (event.getSource().equals(btnNextMonth)) { GregorianCalendar cal = gui.getCampaign().getCalendar(); Duration duration = Duration.between(cal.getTime().toInstant(), new java.util.GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, 1).getTime().toInstant()); days = Math.abs((int)duration.toDays()); } for (int numDays = days; numDays > 0; numDays--) { if (gui.getCampaign().checkOverDueLoans() || gui.nagShortMaintenance() || (gui.getCampaign().getCampaignOptions().getUseAtB()) && (gui.nagShortDeployments() || gui.nagOutstandingScenarios())) { break; } if (gui.getCampaign().checkRetirementDefections() || gui.getCampaign().checkYearlyRetirements()) { gui.showRetirementDefectionDialog(); break; } if(!gui.getCampaign().newDay()) { break; } if(firstDay) { logPanel.refreshLog(gui.getCampaign().getCurrentReportHTML()); firstDay = false; } else { logPanel.appendLog(Collections.singletonList("<hr/>")); logPanel.appendLog(gui.getCampaign().fetchAndClearNewReports()); } } gui.refreshCalendar(); gui.refreshLocation(); gui.initReport(); gui.refreshAllTabs(); } }</code><technical_language>removing this existing feature is broken in a way: > If advance multiple days is stopped due event a need interact user, spinner longer reflect *days left* instead reflect days originally requested. spinner logic be: 1. Save number of days iteration number of days remaining. 2. for loop completes: - If number of days remaining is equal 0, set spinner original number of days requested. - Otherwise, set spinner number of days remaining. provide for new behavior breaking behavior</technical_language>

Target:
public void actionPerformed(ActionEvent event) { if (event.getSource().equals(btnStart) || event.getSource().equals(btnNextMonth)) { int days = (int)spnDays.getValue(); boolean firstDay = true; MekHQ.registerHandler(this); if (event.getSource().equals(btnNextMonth)) { GregorianCalendar cal = gui.getCampaign().getCalendar(); Duration duration = Duration.between(cal.getTime().toInstant(), new java.util.GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, 1).getTime().toInstant()); days = Math.abs((int)duration.toDays()); } int numDays; for (numDays = days; numDays > 0; numDays--) { if (gui.getCampaign().checkOverDueLoans() || gui.nagShortMaintenance() || (gui.getCampaign().getCampaignOptions().getUseAtB()) && (gui.nagShortDeployments() || gui.nagOutstandingScenarios())) { break; } if (gui.getCampaign().checkRetirementDefections() || gui.getCampaign().checkYearlyRetirements()) { gui.showRetirementDefectionDialog(); break; } if(!gui.getCampaign().newDay()) { break; } if(firstDay) { logPanel.refreshLog(gui.getCampaign().getCurrentReportHTML()); firstDay = false; } else { logPanel.appendLog(Collections.singletonList("<hr/>")); logPanel.appendLog(gui.getCampaign().fetchAndClearNewReports()); } } if (numDays > 0) { this.spnDays.setValue(numDays); } gui.refreshCalendar(); gui.refreshLocation(); gui.initReport(); gui.refreshAllTabs(); } }