Skip to content

Commit

Permalink
Merge pull request #3943 from IllianiCBT/Nag_UnmaintainedSalvage
Browse files Browse the repository at this point in the history
Unmaintained Unit Nag Dialog Suppressed for Units set to Salvage
  • Loading branch information
HammerGS authored Apr 6, 2024
2 parents e3ac419 + bf3cc5f commit 54ec53e
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
import javax.swing.*;

public class UnmaintainedUnitsNagDialog extends AbstractMHQNagDialog {
private boolean checkHanger() {
for (Unit u : getCampaign().getHangar().getUnits()) {
if((u.isUnmaintained()) && (!u.isSalvage())) {
return true;
}
}
return false;
}

//region Constructors
public UnmaintainedUnitsNagDialog(final JFrame frame, final Campaign campaign) {
super(frame, "UnmaintainedUnitsNagDialog", "UnmaintainedUnitsNagDialog.title",
Expand All @@ -37,6 +46,6 @@ public UnmaintainedUnitsNagDialog(final JFrame frame, final Campaign campaign) {
@Override
protected boolean checkNag() {
return !MekHQ.getMHQOptions().getNagDialogIgnore(getKey())
&& getCampaign().getHangar().getUnitsStream().anyMatch(Unit::isUnmaintained);
&& checkHanger();
}
}

0 comments on commit 54ec53e

Please sign in to comment.