-
Notifications
You must be signed in to change notification settings - Fork 286
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
Fix for request 5333 - Add Gunnery / Pilot BV values to the unit selection screen. #5334
Fix for request 5333 - Add Gunnery / Pilot BV values to the unit selection screen. #5334
Conversation
Add Gunnery / Piloting values to the unit selection screen, and adjust BV accordingly. PV uses the Gunnery box only. This fixes issue 5333
megamek/src/megamek/client/ui/swing/dialog/AbstractUnitSelectorDialog.java
Fixed
Show resolved
Hide resolved
megamek/src/megamek/client/ui/swing/dialog/AbstractUnitSelectorDialog.java
Fixed
Show resolved
Hide resolved
int gunnery = 4; | ||
double modifier = 1; | ||
if (textGunnery.getText().matches("\\d+")) { | ||
gunnery = Integer.parseInt(textGunnery.getText()); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
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.
The .matches line above it is a validation that it is a number before it goes to the parsing
…t BV accordingly. PV uses the Gunnery box only. This fixes issue 5333 Updated with documentation and limits on the Gunnery/Pilot values.
int gunnery = 4; | ||
int piloting = 5; | ||
if (textGunnery.getText().matches("\\d+")) { | ||
gunnery = Integer.parseInt(textGunnery.getText()); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
}; | ||
}; | ||
if (textPilot.getText().matches("\\d+")) { | ||
piloting = Integer.parseInt(textPilot.getText()); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
…t BV accordingly. PV uses the Gunnery box only. This fixes issue 5333 Updated with documentation and limits on the Gunnery/Pilot values. Optioned in Client Settings now. Known issue: After enabling/disabling, MM must be restarted for the change to take effect.
…t BV accordingly. PV uses the Gunnery box only. This fixes issue 5333 Updated with documentation and limits on the Gunnery/Pilot values. Optioned in Client Settings now. Known issue: After enabling/disabling, MM must be restarted for the change to take effect.
Updated to be hidden behind a Client Settings option (Off by default). Turning it on or off requires restart of Megamek to apply. Tooltip added to the Client Settings option. |
Add Gunnery / Piloting values to the unit selection screen, and adjust BV accordingly. PV uses the Gunnery box only.
This fixes issue 5333