8000 Improvement: Upgraded Contract Automation to Use the New Immersive Dialog Format by IllianiBird · Pull Request #6849 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Upgraded Contract Automation to Use the New Immersive Dialog Format #6849

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

Merged

Conversation

IllianiBird
Copy link
Collaborator

These dialogs come from the intermediary period when we were still trying to figure out a replacement dialog system that eventually evolved into the Immersive Dialog format.

Old

image

New

image

Copy link
codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.

Project coverage is 12.04%. Comparing base (49d3af0) to head (3617fd3).
Report is 124 commits behind head on master.

Files with missing lines Patch % Lines
...aign/market/contractMarket/ContractAutomation.java 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6849   +/-   ##
=========================================
  Coverage     12.03%   12.04%           
- Complexity     6889     6894    +5     
=========================================
  Files          1103     1103           
  Lines        142284   142289    +5     
  Branches      21991    21991           
=========================================
+ Hits          17121    17133   +12     
+ Misses       123328   123323    -5     
+ Partials       1835     1833    -2     

☔ View full report in Codecov by Sentry.
📢 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.

@HammerGS HammerGS requested a review from Copilot May 7, 2025 23:50
Copy link
Contributor
@Copilot 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

Upgrades the contract automation dialogs to use the new Immersive Dialog format while deprecating the legacy dialog component. Key changes include:

  • Deprecation of the ContractAutomationDialog class.
  • Replacement of legacy dialog classes with ImmersiveDialogSimple.
  • Updates to resource string formatting and report message generation.

Reviewed Changes

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

File Description
MekHQ/src/mekhq/gui/dialog/ContractAutomationDialog.java Deprecated unused dialog class.
MekHQ/src/mekhq/campaign/market/contractMarket/ContractAutomation.java Updated dialog implementations and resource formatting for both mothball and transit operations.
MekHQ/resources/mekhq/resources/ContractAutomation.properties Modified resource string patterns to use indexed placeholders.

@@ -189,7 +223,8 @@ public static void performAutomatedActivation(Campaign campaign) {
MekHQ.triggerEvent(new UnitChangedEvent(unit));

if (unit.isMothballed()) {
campaign.addReport(String.format(resources.getString("activationFailed.text"), unit.getName()));
campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE, "activationFailed.text"),
Copy link
Preview
Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

The call to addReport for activation failure is split into two parameters instead of formatting the string with the hyperlinked name. Consider changing it to campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE, "activationFailed.text", unit.getHyperlinkedName())).

Copilot uses AI. Check for mistakes.

@IllianiBird IllianiBird marked this pull request as ready for review May 19, 2025 23:17
@IllianiBird IllianiBird requested a review from a team as a code owner May 19, 2025 23:17
@IllianiBird IllianiBird merged commit 0fa061b into MegaMek:master May 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0