Skip to content

PR: Option to Disable Intel Breach - #8593

Draft
psikomonkie wants to merge 2 commits into
MegaMek:mainfrom
psikomonkie:pr/disable-prisoner-intel-breach
Draft

PR: Option to Disable Intel Breach#8593
psikomonkie wants to merge 2 commits into
MegaMek:mainfrom
psikomonkie:pr/disable-prisoner-intel-breach

Conversation

@psikomonkie

@psikomonkie psikomonkie commented Dec 22, 2025

Copy link
Copy Markdown
Member

Adds a campaign option to "Disable Intel Breach Chance". This option can only be enabled if the MekHQ prisoner capture style is enabled. If the setting is enabled, intel breach events won't happen when releasing prisoners.

@psikomonkie psikomonkie added the (RFE) Enhancement Requests for Enhancement, new features or implementations label Dec 22, 2025
});
comboPrisonerCaptureStyle.addMouseListener(createTipPanelUpdater(prisonersAndDependentsHeader,
"PrisonerCaptureStyle"));
comboPrisonerCaptureStyle.addItemListener(e -> {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'e' is never used.
@codecov

codecov Bot commented Dec 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.84615% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.49%. Comparing base (8a9fdfd) to head (c760869).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...khq/gui/campaignOptions/contents/PersonnelTab.java 0.00% 17 Missing ⚠️
...ekhq/campaign/campaignOptions/CampaignOptions.java 25.00% 3 Missing ⚠️
...ign/campaignOptions/CampaignOptionsMarshaller.java 0.00% 2 Missing ⚠️
...n/randomEvents/prisoners/PrisonerEventManager.java 0.00% 2 Missing ⚠️
...n/campaignOptions/CampaignOptionsUnmarshaller.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8593      +/-   ##
============================================
- Coverage     12.49%   12.49%   -0.01%     
+ Complexity     7549     7546       -3     
============================================
  Files          1293     1293              
  Lines        166130   166164      +34     
  Branches      25039    25043       +4     
============================================
+ Hits          20753    20754       +1     
- Misses       143382   143416      +34     
+ Partials       1995     1994       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IllianiBird

IllianiBird commented Dec 22, 2025

Copy link
Copy Markdown
Collaborator

I don't think the enable-disable state will work in campaign options. We've had issues with it in the past not properly updating state.

I recommend testing the various ways to open campaign options with prisoners enabled and disabled. Assuming we haven't magically fixed the issue you'll likely see your option incorrectly enabled/disabled.

As we don't use this functionality anywhere else in COIIC (for this reason) you can probably get rid.

@psikomonkie

Copy link
Copy Markdown
Member Author

I don't think the enable-disable state will work in campaign options. We've had issues with it in the past not properly updating state.

I recommend testing the various ways to open campaign options with prisoners enabled and disabled. Assuming we haven't magically fixed the issue you'll likely see your option incorrectly enabled/disabled.

As we don't use this functionality anywhere else in COIIC (for this reason) you can probably get rid.

It seems to be working - I messed around with saving the settings, closing without saving them, reloading MekHQ, relaunching MekHQ, with all variations of the campaign options for prisoners & the intel breach option and it looks to be properly enabling/disabling. I'm curious if there can be an issue with the order the components are being added to the Campaign Options, and just I got lucky with this. I can remove it because there really isn't any harm in it being toggled when the other prisoner settings are used.

@VicenteCartas

Copy link
Copy Markdown
Collaborator

@psikomonkie Is this PR active or could we close it for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

(RFE) Enhancement Requests for Enhancement, new features or implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants