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 Prisoner Ransom & Free Prompts to Mission Completion #4469

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Previously, it was very easy to forget to ransom prisoners of war when resolving a Mission. We added a nag to try and resolve this, but I felt we could do more.

Now, when resolving the Mission the user will be presented with a prompt to perform the following actions:

  • ransom friendly PoWs (if any personnel have the PoW status, and prisoner ransom is enabled)
  • ransom prisoners (if there are any prisoners, and prisoner ransom is enabled)
  • free prisoners (if there are still prisoners left)

For the first prompt, the user will be given an alternative prompt if they have insufficient funds to ransom their PoWs.

A new feature was implemented in the mission completion method. This introduction checks if the campaign option 'Use AtB Prisoner Ransom' is enabled. If active, it calculates and presents a total ransom value for all current prisoners. If the user confirms, the ransom is added to the campaign funds and the prisoners are removed from the roster.
Added a new method in the Campaign class to filter for friendly PoWs. Additionally, updated the GUI properties to include dialog for friendly prisoner ransom confirmation. The mouse adapter has been modified to use the updated dialog for friendly prisoner ransom. The BriefingTab has also been updated to incorporate the new friendly ransom process in the mission completion sequence.
@IllianiCBT IllianiCBT added Personnel Personnel-related Issues GUI UX User experience labels Jul 23, 2024
@IllianiCBT IllianiCBT self-assigned this Jul 23, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.23%. Comparing base (7ee9b9c) to head (16cc56c).
Report is 9 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4469      +/-   ##
============================================
- Coverage     10.24%   10.23%   -0.01%     
  Complexity     5809     5809              
============================================
  Files           925      925              
  Lines        126456   126523      +67     
  Branches      18770    18781      +11     
============================================
  Hits          12953    12953              
- Misses       112228   112295      +67     
  Partials       1275     1275              

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

# Conflicts:
#	MekHQ/resources/mekhq/resources/GUI.properties
@IllianiCBT IllianiCBT merged commit 51c2f0f into MegaMek:master Jul 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Personnel Personnel-related Issues UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants