Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Nag Dialog for Exceeding Cargo Capacity While Destination is Set #3969

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Apr 6, 2024

Current Implementation

None

Problem

Currently it is easy to exceed cargo capacity, unless you are watching your maximum cargo capacity like a hawk.

Solution

If the user has set a destination on the interstellar map, this nag will trigger in the event that current cargo tonnage exceeds cargo capacity. I opted to disable the check when no destination is set, as I figured while the user is on-planet there is no need to remain within cargo capacity.

image image

Notes

This is definitely a nag I don't expect all users will appreciate, however the ease with which this nag can be suppressed seemed to warrant its inclusion for those users who do try to keep cargo within capacity.

Ideally, this nag would start suppressed on a new campaign, however I couldn't figure out how to enable that functionality. If that functionality does exist, and someone can point me towards it, it would empower me to add more niche nags like this, in future.

@IllianiCBT IllianiCBT self-assigned this Apr 6, 2024
@IllianiCBT IllianiCBT added the GUI label Apr 6, 2024
Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 10.65%. Comparing base (eaeb54e) to head (635b1e8).

Files Patch % Lines
MekHQ/src/mekhq/gui/dialog/MHQOptionsDialog.java 0.00% 7 Missing ⚠️
.../gui/dialog/nagDialogs/CargoCapacityNagDialog.java 0.00% 6 Missing ⚠️
MekHQ/src/mekhq/gui/CampaignGUI.java 0.00% 3 Missing ⚠️
MekHQ/src/mekhq/campaign/CampaignSummary.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3969      +/-   ##
============================================
- Coverage     10.65%   10.65%   -0.01%     
  Complexity     5536     5536              
============================================
  Files           841      842       +1     
  Lines        114411   114429      +18     
  Branches      17209    17211       +2     
============================================
  Hits          12189    12189              
- Misses       100992   101010      +18     
  Partials       1230     1230              

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

@HammerGS HammerGS merged commit 01c9be4 into MegaMek:master Apr 30, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants