Skip to content

Conversation

@HammerGS
Copy link
Member

Summary

Adds MegaMekLab UI support for three cockpit modification equipment types: DNI Cockpit Modification, Enhanced Imaging (EI) Interface, and Damage Interrupt Circuit. Includes game year validation support.

Requires: MegaMek PR Implement-DNI-EI-DIC-Support for core equipment support.

Changes

  1. Add cockpit modification checkboxes to Mek chassis view (DNI, EI, DIC)
  2. Add DNI checkbox to Combat Vehicle chassis view
  3. Add DNI checkbox to Aerospace/Conventional Fighter chassis view
  4. Add DNI checkbox to Support Vehicle chassis view
  5. Add DNI/EI checkboxes to Battle Armor enhancement view
  6. Update structure tabs to handle cockpit modification state changes
  7. Add BuildListener interface methods for cockpit modification events
  8. Update UnitUtil.validateUnit() to pass game year to TestEntity when "Use Game Year" is enabled

Files Changed

  • BMChassisView.java - Mek cockpit modification UI (DNI, EI, DIC)
  • CVChassisView.java - Combat Vehicle DNI checkbox
  • ASChassisView.java - Aerospace/Conv Fighter DNI checkbox
  • SVChassisView.java - Support Vehicle DNI checkbox
  • BAEnhancementView.java - Battle Armor DNI/EI checkboxes
  • BMStructureTab.java - Mek structure tab integration
  • CVStructureTab.java - Combat Vehicle structure tab integration
  • ASStructureTab.java - Aerospace structure tab integration
  • SVStructureTab.java - Support Vehicle structure tab integration
  • MekBuildListener.java - Mek listener interface
  • CVBuildListener.java - Combat Vehicle listener interface
  • AeroBuildListener.java - Aerospace listener interface
  • SVBuildListener.java - Support Vehicle listener interface
  • UnitUtil.java - Game year validation support
  • Views.properties - i18n strings for UI labels

Testing

  • Manual Testing: All unit types verified for save/load/display
    • Mek: DNI, EI, DIC
    • Combat Vehicle: DNI
    • Conventional Fighter: DNI
    • Aerospace Fighter: DNI
    • Support Vehicle (Ground/VTOL): DNI
    • Battle Armor (IS): DNI
    • Battle Armor (Clan): EI
  • Game Year Validation: Verified equipment availability respects "Use Game Year" setting

Copilot AI review requested due to automatic review settings January 30, 2026 22:56
@HammerGS HammerGS requested a review from a team as a code owner January 30, 2026 22:56
@HammerGS HammerGS added AI Generated Code AI-generated fix. Requires human testing and review before merging. Needs Player Testing PR lacks actual play testing. labels Jan 30, 2026
Copy link
Contributor

Copilot AI left a 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 pull request implements UI support for three cockpit modification equipment types in MegaMekLab: DNI (Direct Neural Interface) Cockpit Modification, Enhanced Imaging (EI) Interface, and Damage Interrupt Circuit. The implementation adds checkboxes to various unit type editors and integrates game year validation for equipment availability.

Changes:

  • Added UI checkboxes for DNI, EI, and DIC across multiple unit types (Meks, Combat Vehicles, Aerospace Fighters, Support Vehicles, Battle Armor)
  • Updated build listener interfaces to handle cockpit modification state changes
  • Enhanced game year validation in unit verification to respect the "Use Game Year" configuration setting

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
UnitUtil.java Adds game year validation support when "Use Game Year" setting is enabled
BMChassisView.java Adds DNI, EI, and DIC checkboxes to Mek chassis view
BMStructureTab.java Implements equipment add/remove logic for Mek cockpit modifications
CVChassisView.java Adds DNI checkbox to Combat Vehicle chassis view
CVStructureTab.java Implements DNI equipment handling for Combat Vehicles
ASChassisView.java Adds DNI checkbox to Aerospace/Conventional Fighter chassis view
ASStructureTab.java Implements DNI equipment handling for Aerospace Fighters
SVChassisView.java Adds DNI checkbox to Support Vehicle chassis view
SVStructureTab.java Implements DNI equipment handling for Support Vehicles
BAEnhancementView.java Adds DNI and EI checkboxes to Battle Armor enhancement view
MekBuildListener.java Adds interface methods for DNI, EI, and DIC events
CVBuildListener.java Adds interface method for DNI events
AeroBuildListener.java Adds interface method for DNI events
SVBuildListener.java Adds interface method for DNI events
Views.properties Adds i18n strings for all new UI labels and tooltips

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HammerGS HammerGS force-pushed the Implement-DNI-EI-DIC-UI branch 2 times, most recently from 163ebc6 to b033d6d Compare January 30, 2026 23:17
@pavelbraginskiy
Copy link
Member

It would be more consistent with the rest of the interface if the checkboxes were hidden rather than disabled if the equipment isn't allowed by year or tech base.
If you want to keep them visible, there's a bug where they don't become unchecked when the year/tech base changes to where the equipment is no longer legal.

@pavelbraginskiy
Copy link
Member

The page number references in the tooltips are to the old IO, not to Alternate Eras, we should use the more up-to-date book.

@pavelbraginskiy
Copy link
Member

The DNI mod appears on record sheets for Battle Armor, but not any other unit types. Let me know if you want me to handle the record sheet stuff for these.

- Add cockpit modification UI to BMChassisView (Meks)
- Add DNI checkbox to CVChassisView (Combat Vehicles)
- Add DNI checkbox to ASChassisView (Aerospace/Conventional Fighters)
- Add DNI checkbox to SVChassisView (Support Vehicles)
- Add DNI/EI checkboxes to BAEnhancementView (Battle Armor)
- Update structure tabs to handle cockpit modification changes
- Add BuildListener methods for cockpit modification events
- Update UnitUtil.validateUnit() to respect game year setting
- Add i18n strings for cockpit modification labels

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@HammerGS HammerGS force-pushed the Implement-DNI-EI-DIC-UI branch from b033d6d to ca9973a Compare January 30, 2026 23:58
@HammerGS
Copy link
Member Author

The DNI mod appears on record sheets for Battle Armor, but not any other unit types. Let me know if you want me to handle the record sheet stuff for these.

I feel like this is so edge its not worth a box, I'm off the do nothing till asked till then players can write it in.

HammerGS added a commit to MegaMek/megamek that referenced this pull request Feb 4, 2026
)

## Summary
Adds core support loading and improvements to validating for three
cockpit modification equipment types: DNI Cockpit Modification (IS,
Advanced), Enhanced Imaging (EI) Interface (Clan, Experimental), and
Damage Interrupt Circuit (IS, Experimental). Also adds game year
validation support for equipment availability.

**Requires:** MegaMekLab PR
[`Implement-DNI-EI-DIC-UI`](MegaMek/megameklab#2128)
for full UI functionality.

## Changes
1. Add equipment definitions with correct tech levels (DNI=Advanced,
DIC=Experimental)
2. Add BLK file save/load for slotless (LOC_NONE) equipment across all
unit types
  3. Fix Unit Viewer to display cockpit modifications for non-Mek units
4. Add game year support in ITechManager.isLegal() for equipment
availability
5. Add game year support in TestEntity.hasIncorrectIntroYear() for
validation
6. Mark DNI and EI as retrofittable equipment (skipped in intro year
validation per IO p.69)

## Files Changed
  - `MiscType.java` - Tech level fixes for DNI and DIC
  - `ITechManager.java` - Game year support in isLegal()
  - `TestEntity.java` - Game year field and validation support
  - `BLKFile.java` - Slotless equipment save/load methods
- `BLK*File.java` (10 files) - Load slotless equipment for each unit
type
  - `ReadoutUtils.java` - Show cockpit mods in Unit Viewer
  - `*TROView.java` (4 files) - TRO display for cockpit mods
  - `CockpitModificationTest.java` - Unit tests for save/load
- `TestEntityGameYearValidationTest.java` - Unit tests for game year
validation

  ## Testing
- **Unit Tests:** 17 tests covering save/load and game year validation
(all passing)
- **Manual Testing:** Verified on Mek, Combat Vehicle, Conventional
Fighter, Aerospace Fighter, Support Vehicle (Ground/VTOL), Battle Armor
  (IS/Clan)
- **Game Year Validation:** Tested EI (intro 3040) and DNI (intro 3052)
with game years before/after intro dates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Code AI-generated fix. Requires human testing and review before merging. Needs Player Testing PR lacks actual play testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants