-
Notifications
You must be signed in to change notification settings - Fork 339
Fix #7015 - Show Spotting FOV for Mast Mount elevation bonus #7830
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
base: main
Are you sure you want to change the base?
Conversation
PR Description: Summary Adds a "Show Spotting FOV" toggle that visualizes the +1 elevation bonus from Mast Mounts when determining what a VTOL can spot versus what it can directly fire at. Fixes #7015 Root Cause The FOV visualization in FovHighlightingAndDarkening.java calculates line-of-sight based solely on the unit's physical position without considering equipment modifiers. Per BattleTech rules, Mast Mount allows a VTOL to spot targets (for C3, TAG, artillery, indirect fire) as if it were one elevation level higher, but this bonus does NOT apply to direct fire attacks. The existing FOV display only showed what the unit could directly fire at, with no option to visualize the extended spotting range. This is a missing feature rather than broken logic - the game correctly applies the Mast Mount bonus during actual spotting resolution, but the visual FOV display had no mechanism to show this bonus to the player. Changes - New menu item: View > Show Spotting FOV (keyboard shortcut: O) - When enabled, FOV calculations include the +1 elevation bonus from Mast Mount equipment - Visual indicators when active: blue tint + reversed stripe direction - Automatically resets to OFF at game start to prevent player confusion
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 implements a new "Show Spotting FOV" visualization mode that displays the extended line-of-sight range available when VTOLs use Mast Mount equipment for spotting (C3, TAG, indirect fire) versus direct fire attacks. Per BattleTech rules, Mast Mount provides a +1 elevation bonus for spotting but not for direct fire.
Key Changes:
- Added keyboard shortcut (O) and menu toggle for "Show Spotting FOV" mode
- Modified FOV calculations to apply Mast Mount +1 elevation bonus when spotting mode is enabled
- Visual distinction through blue tint and reversed stripe direction when active
- Automatic reset to OFF at game start
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| KeyCommandBind.java | Adds FOV_SPOTTING key binding with 'O' shortcut |
| FovHighlightingAndDarkening.java | Implements Mast Mount elevation bonus logic, adds cache clearing, and applies visual indicators (blue tint, reversed stripes) |
| BoardView.java | Extends drawHexLayer methods with reverseStripes parameter and implements gradient paint reversal logic |
| GUIPreferences.java | Adds FOV_SPOTTING_MODE preference with getter/setter methods |
| CommonMenuBar.java | Integrates new menu item with accelerator and preference change handling |
| ClientGUI.java | Handles toggle action and auto-resets spotting mode at game start |
| messages.properties | Adds menu label and tooltip text for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
megamek/src/megamek/client/ui/clientGUI/boardview/FovHighlightingAndDarkening.java
Show resolved
Hide resolved
megamek/src/megamek/client/ui/clientGUI/boardview/FovHighlightingAndDarkening.java
Show resolved
Hide resolved
megamek/src/megamek/client/ui/clientGUI/boardview/BoardView.java
Dismissed
Show dismissed
Hide dismissed
Sleet01
left a comment
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.
LGTM


Summary
Adds a "Show Spotting FOV" toggle that visualizes the +1 elevation bonus from Mast Mounts when determining what a VTOL can spot versus what it can directly fire at.
Fixes #7015
Root Cause
The FOV visualization in FovHighlightingAndDarkening.java calculates line-of-sight based solely on the unit's physical position without considering equipment modifiers. Per BattleTech rules, Mast Mount allows a VTOL to spot targets (for C3, TAG, artillery, indirect fire) as if it were one elevation level higher, but this bonus does NOT apply to direct fire attacks.
The existing FOV display only showed what the unit could directly fire at, with no option to visualize the extended
spotting range. This is a missing feature rather than broken logic - the game correctly applies the Mast Mount bonus during actual spotting resolution, but the visual FOV display had no mechanism to show this bonus to the player.
Changes