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 Contract Difficulty Estimate, Including GUI Support #4943

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Sep 29, 2024

Requires #6046 (tests will fail until that PR is merged)

Refactored the AtBContract class to include methods for calculating and displaying contract difficulty. Added UI elements in ContractMarketDialog and ContractSummaryPanel to show difficulty estimates.

Added dialog calls for when the player is picking unusually easy or overly challenging contracts.

Enhanced code maintainability by removing a long switch statement for faction logos and replaced it with a function call. Expanded the switch to include all factions we have logos for, and not just the Clan factions.

image
image
image
image
image

Refactored the `AtBContract` class to include methods for calculating and displaying contract difficulty. Added UI elements in `ContractMarketDialog` and `ContractSummaryPanel` to show difficulty estimates.

Added dialog calls for when the player is picking unusually easy or overly challenging contracts.

Enhanced code maintainability by removing a long switch statement for faction logos and replaced it with a function call. Expanded the switch to include all factions we have logos for, and not just the Clan factions.
Replaced the use of sanitized faction codes with original faction codes for calculating enemy and ally power. Removed the redundant `sanitizeFactionCode` method to simplify the codebase. Additionally, streamlined error handling and improved UI messages for mission challenges for better readability.
@IllianiCBT IllianiCBT added GUI UX User experience labels Sep 29, 2024
@IllianiCBT IllianiCBT self-assigned this Sep 29, 2024
…rketDialog.

Updated difficulty conditional checks to ensure consistency and correct evaluation across `AtBContract.java` and `ContractMarketDialog.java`. This includes modifying threshold values and conditional logic for image selection and message determination.
Copy link
Member

@HammerGS HammerGS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and seems to work.

IllianiCBT and others added 2 commits October 1, 2024 20:25
Replaced the StratConSkillGenerator with ModifiedConstantSkillGenerator for skill generation. This adjustment aimed to achieve more consistent and predictable skill levels during mission setup.
@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.42%. Comparing base (98ed721) to head (675b83b).
Report is 63 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4943      +/-   ##
============================================
- Coverage     10.45%   10.42%   -0.03%     
+ Complexity     6013     6003      -10     
============================================
  Files           951      951              
  Lines        132877   133139     +262     
  Branches      19330    19380      +50     
============================================
- Hits          13891    13886       -5     
- Misses       117637   117903     +266     
- Partials       1349     1350       +1     

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

@HammerGS HammerGS merged commit 014fd07 into MegaMek:master Oct 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants