Skip to content

BFS Assets - #9653

Merged
pavelbraginskiy merged 9 commits into
MegaMek:mainfrom
pavelbraginskiy:bfs-assets
Aug 2, 2026
Merged

BFS Assets#9653
pavelbraginskiy merged 9 commits into
MegaMek:mainfrom
pavelbraginskiy:bfs-assets

Conversation

@pavelbraginskiy

@pavelbraginskiy pavelbraginskiy commented Jul 16, 2026

Copy link
Copy Markdown
Member

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pavelbraginskiy
pavelbraginskiy requested a review from a team as a code owner July 16, 2026 00:15
Copilot AI review requested due to automatic review settings July 16, 2026 00:15
@pavelbraginskiy pavelbraginskiy added the AI ready for Review Indicates that is has been in game tested and is ready for review as it can be label Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates MekHQ’s unit selector filtering to use shared, gap-robust unit-type mapping and centralized unit-type matching logic, rather than relying on positional combo-box indices and a localized “Support Vehicle” string check.

Changes:

  • Replaces inlined unit-type/support-vehicle filter logic with a matchesUnitTypeSelection(...) helper.
  • Switches unit-type selection handling to a “code for combo index” mapping to avoid index drift when unit types are omitted from the shared combo.

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

Comment thread MekHQ/src/mekhq/gui/dialog/MekHQUnitSelectorDialog.java Outdated
pavelbraginskiy and others added 2 commits July 15, 2026 17:42
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.81690% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.60%. Comparing base (a5395ce) to head (80aaec5).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../src/mekhq/gui/dialog/MekHQUnitSelectorDialog.java 2.81% 69 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9653      +/-   ##
============================================
- Coverage     20.61%   20.60%   -0.02%     
- Complexity    13351    13365      +14     
============================================
  Files          1497     1497              
  Lines        182829   182852      +23     
  Branches      28092    28092              
============================================
- Hits          37688    37673      -15     
- Misses       141403   141439      +36     
- Partials       3738     3740       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings July 23, 2026 05:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread MekHQ/src/mekhq/gui/dialog/MekHQUnitSelectorDialog.java Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +32 to +34
if git ls-remote --exit-code --heads \
${{ github.event.pull_request.head.repo.owner.html_url }}/mm-data.git \
${{ github.event.pull_request.head.ref }} > /dev/null 2>&1
pavelbraginskiy and others added 2 commits July 23, 2026 14:44
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 24, 2026 00:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 2, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 2, 2026 09:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

MekHQ/unittests/mekhq/gui/dialog/MekHQUnitSelectorDialogTest.java:89

  • This test relies on Mockito defaults for getUnitType() and hasDroneOs() to represent a “supported” entity. That makes it brittle (e.g., if the default int happens to match UnitType.GUN_EMPLACEMENT, or if the unsupported criteria evolve). Stub the relevant methods explicitly so the test only validates isCampaignAcquisitionCandidate logic.
    @Test
    void campaignActionsKeepSupportedStandardEntity() {
        Entity entity = mock(Entity.class);

        assertTrue(MekHQUnitSelectorDialog.isCampaignAcquisitionCandidate(entity));

Comment thread .github/workflows/ci.yml
}
MekTableModel mekModel = entry.getModel();
MekSummary mek = mekModel.getMekSummary(entry.getIdentifier());
ITechnology tech = UnitTechProgression.getProgression(mek, campaign.getTechFaction(), true);
pavelbraginskiy added a commit to MegaMek/megamek that referenced this pull request Aug 2, 2026
Must be merged with PRs MegaMek/megameklab#2264. MegaMek/mekhq#9653,
MegaMek/mm-data#470

## Add Battlefield Support Assets

This adds Battlefield Support Assets as a first-class unit type,
using a new `.bfs` YAML format for their card-based stats and UUID links
to corresponding standard units.
Assets are integrated into the unit cache and selector,
include Advanced Search filters, render printable BFS cards, and support
standalone or linked unit forms.

The update also adds lobby selection and configuration, Regular/Veteran
crews and costs,
persistent damage and MUL round-tripping, distinctive camouflage
overlays,
and dedicated Summary, TRO, and BFS Card views.
This PR provides the data model and non-gameplay infrastructure;
the Asset movement and combat rules will follow separately.
@pavelbraginskiy
pavelbraginskiy merged commit 1a7665e into MegaMek:main Aug 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI ready for Review Indicates that is has been in game tested and is ready for review as it can be

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants