Skip to content

Added Status Self-Validation; Prevented Assignment of Invalid Statuses to PoWs; Updated Status Change Menu #6531

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

Merged
merged 5 commits into from
Apr 4, 2025

Conversation

IllianiBird
Copy link
Collaborator

  • Introduced two new flags, isPrisonerSuitableStatus and isCauseOfDeath, to PersonnelStatus.
  • Added utility methods to filter statuses based on prisoner suitability and cause of death.
  • Implemented the statusValidator method to validate and auto-correct invalid personnel statuses for prisoners.
  • Modified PersonnelTableMouseAdapter to dynamically filter allowed statuses in the UI based on prisoner status and context.
  • Deprecated the old getImplementedStatuses() method in favor of the new overloaded version with filtering capabilities.

Dev Notes

This PR does a couple of things. First of all it locks Prisoners out of certain Personnel Statuses that aren't valid for prisoners. This prevents users from accidentally getting confused with what statuses are valid and what aren't. For example, I've seen instances of users assigning prisoners the 'PoW' status - however that status is not meant for NPC PoWs, and using it there breaks prisoner tracking.

Next, on load, we validate all prisoners have valid statuses to handle <50.05 campaigns.

Finally, I updated the Change Status menu so that it only shows Statuses the character is eligible for. I also grouped all of the Cause of Death statuses under a sub-menu, so the whole dropdown is a lot less cluttered.

- Changed "PoW" label to "Captured by the OpFor" for clarity.
- Introduced two new flags, `isPrisonerSuitableStatus` and `isCauseOfDeath`, to `PersonnelStatus` for enhanced status classification.
- Added utility methods to filter statuses based on prisoner suitability and cause of death.
- Implemented the `statusValidator` method to validate and auto-correct invalid personnel statuses, particularly for prisoners.
- Updated legacy code paths to utilize the newly introduced status validation during campaign loading and prisoner status changes.
- Modified `PersonnelTableMouseAdapter` to dynamically filter allowed statuses in the UI based on prisoner status and context.
- Deprecated the old `getImplementedStatuses()` method in favor of the new overloaded version with filtering capabilities.
@IllianiBird IllianiBird added Bug Personnel Personnel-related Issues UX User experience Severity: Low Issues described as low severity as per the new issue form labels Apr 1, 2025
@IllianiBird IllianiBird self-assigned this Apr 1, 2025
… to the correct method `getImplementedStatuses(boolean, boolean)`.
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.29%. Comparing base (0496d05) to head (28de045).
Report is 48 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6531      +/-   ##
============================================
+ Coverage     11.28%   11.29%   +0.01%     
+ Complexity     6321     6318       -3     
============================================
  Files          1080     1080              
  Lines        137543   137589      +46     
  Branches      21300    21328      +28     
============================================
+ Hits          15517    15540      +23     
- Misses       120473   120494      +21     
- Partials       1553     1555       +2     

☔ 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.

…ing personnel status updates align with campaign-specific context (e.g., date).
@rjhancock rjhancock merged commit ad5e79a into MegaMek:master Apr 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Personnel Personnel-related Issues Severity: Low Issues described as low severity as per the new issue form UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants