-
Notifications
You must be signed in to change notification settings - Fork 191
Improvement: #6867 Added Weapons as a separate autologistics category #6943
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
Improvement: #6867 Added Weapons as a separate autologistics category #6943
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6943 +/- ##
=========================================
Coverage 11.97% 11.98%
- Complexity 6789 6793 +4
=========================================
Files 1101 1101
Lines 141489 141474 -15
Branches 21915 21918 +3
=========================================
+ Hits 16950 16952 +2
+ Misses 122741 122717 -24
- Partials 1798 1805 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Infantry equipment should be already excluded. If it isn't, it should be. |
Stuff like their basic rifles, yeah. It’s being included now as a weapon. I’ll make an update to this to keep them as ‘other’ & add a test for that Edit: I'll double check what the table shows for in use. I feel like they might only be showing because I have them in my warehouse & they aren't counted as parts in use, therefore none'll be ordered. If that's the case I'll keep it so if we ever track it it'll just need updated in the parts in use method. |
All's good regarding infantry weapons. They only showed on the table because I had some in the warehouse - it's an old save :) This is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small point of feedback, but not a deal breaker
…string into an int
…ing into an int for all autologistics options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR separates Weapons from the “Other” autologistics category, allowing players to manage weapon stock levels independently.
- Added new tests for getting and setting weapon autologistics values
- Integrated a new Weapons field into CampaignOptions, Campaign, and the UI panel
- Updated the CampaignOptions XML handling and properties file to include the new Weapons category
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
MekHQ/unittests/mekhq/campaign/CampaignTest.java | Added tests for weapon stock level operations |
MekHQ/src/mekhq/gui/campaignOptions/contents/EquipmentAndSuppliesTab.java | Integrated new UI components for weapon restock settings |
MekHQ/src/mekhq/campaign/CampaignOptions.java | Introduced new getter/setter and XML handling for weapons |
MekHQ/src/mekhq/campaign/Campaign.java | Updated default stock percent logic to differentiate Weapons |
MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties | Added labels and tooltips for weapon restock option |
initialAllPercents = getAllDefaultStockPercents(); | ||
|
||
// Let's change it and make sure that it uses the new value | ||
when(mockCampaignOptions.getAutoLogisticsWeapons()).thenReturn(DESIRED_STOCK_LEVEL); //TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider removing or resolving the TODO comment once the intended behavior for weapon autologistics is finalized.
when(mockCampaignOptions.getAutoLogisticsWeapons()).thenReturn(DESIRED_STOCK_LEVEL); //TODO | |
// Mock the campaign options to return the desired stock level for weapon autologistics | |
when(mockCampaignOptions.getAutoLogisticsWeapons()).thenReturn(DESIRED_STOCK_LEVEL); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, it's nice to see Copilot bullying someone else for a change! :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that was actually something I missed. The //TODO tag itself just needed removed. It was originally commented out during the development process. I left the //TODO flag so I'd uncomment it once it's implemented it. Just forgot to remove the todo :clown:
Fixes #6867
Weapons on units were part of the "Other" category. A player wanting to keep a stock of backup weapons would need to manually change the value for each weapon they use, or change the default for "other". This adds "Weapons" as its own category of autologistics.