8000 Added Support for Mission and Scenario Hyperlinking by IllianiBird · Pull Request #6643 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added Support for Mission and Scenario Hyperlinking #6643

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
merged 4 commits into from
Apr 26, 2025

Conversation

IllianiBird
Copy link
Collaborator
  • Added the ability to fetch a hyperlinked name for both Missions, Scenarios, and StratCon Scenarios.
  • Integrated these hyperlinks into the daily report and Immersive Dialog.

Dev Notes

This has been asked for a few times over the years, though surprisingly I couldn't find an RFE. Now, whenever a contract or scenario is mentioned in the daily report of an Immersive Dialog, clicking on that mission (or scenario) will take you straight to the Briefing Room with that specific mission (and/or scenario) selected.

- Introduced new constants `MISSION_COMMAND_STRING` and `SCENARIO_COMMAND_STRING` to handle mission and scenario routing.
- Extended the command processing logic in `ImmersiveDialogCore` to support focus actions for missions and scenarios using `MathUtility` for parsing identifiers.
- Adjusted hyperlink generation in `UnresolvedStratConContactsNagLogic` to use hyperlinked names for scenarios and contracts.
@IllianiBird IllianiBird added GUI UX User experience labels Apr 12, 2025
@IllianiBird IllianiBird self-assigned this Apr 12, 2025
Copy link
codecov bot commented Apr 12, 2025

Codecov Report

Attention: Patch coverage is 4.13793% with 139 lines in your changes missing coverage. Please review.

Project coverage is 11.44%. Comparing base (c77b064) to head (8de118a).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/gui/BriefingTab.java 0.00% 35 Missing ⚠️
...khq/campaign/stratcon/SupportPointNegotiation.java 0.00% 27 Missing ⚠️
...mponents/immersiveDialogs/ImmersiveDialogCore.java 0.00% 16 Missing ⚠️
MekHQ/src/mekhq/gui/ReportHyperlinkListener.java 0.00% 14 Missing ⚠️
MekHQ/src/mekhq/campaign/Campaign.java 0.00% 13 Missing ⚠️
MekHQ/src/mekhq/campaign/mission/Mission.java 7.69% 12 Missing ⚠️
MekHQ/src/mekhq/gui/CampaignGUI.java 0.00% 12 Missing ⚠️
.../src/mekhq/campaign/stratcon/StratconScenario.java 0.00% 3 Missing ⚠️
.../mekhq/campaign/stratcon/StratconRulesManager.java 0.00% 2 Missing ⚠️
...Dialogs/nagLogic/OutstandingScenariosNagLogic.java 50.00% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6643      +/-   ##
============================================
+ Coverage     11.40%   11.44%   +0.03%     
+ Complexity     6482     6481       -1     
============================================
  Files          1095     1094       -1     
  Lines        141048   140707     -341     
  Branches      21884    21822      -62     
============================================
+ Hits          16082    16099      +17     
+ Misses       123308   122951     -357     
+ Partials       1658     1657       -1     

☔ 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.

@IllianiBird IllianiBird marked this pull request as draft April 14, 2025 18:32
@Ham
8000
merGS HammerGS requested a review from Copilot April 23, 2025 02:38
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

This PR adds support for mission and scenario hyperlinking by replacing plain text names with clickable HTML hyperlinks across various UI components and reports. Key changes include:

  • Updating all relevant report and dialog methods to use getHyperlinkedName() instead of getName().
  • Introducing new constants and hyperlink handlers for "MISSION" and "SCENARIO" in immersive dialogs and hyperlink listeners.
  • Adding helper methods to focus on specific missions/scenarios via their IDs.

Reviewed Changes

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

Show a summary per file
File Description
MekHQ/src/mekhq/gui/dialog/nagDialogs/nagLogic/UnresolvedStratConContactsNagLogic.java Replaced getName() with getHyperlinkedName() in the unresolved contacts report.
MekHQ/src/mekhq/gui/dialog/nagDialogs/nagLogic/OutstandingScenariosNagLogic.java Updated formatting with hyperlinked names in scenario reports.
MekHQ/src/mekhq/gui/baseComponents/immersiveDialogs/ImmersiveDialogCore.java Added new command string constants and hyperlink click handling for missions and scenarios.
MekHQ/src/mekhq/gui/ReportHyperlinkListener.java Extended hyperlink listener support to map SCENARIO and MISSION hyperlinks to appropriate focus actions.
MekHQ/src/mekhq/gui/CampaignGUI.java & BriefingTab.java Introduced focusOnMission() and focusOnScenario() to support navigation via hyperlinks.
MekHQ/src/mekhq/campaign/* (SupportPointNegotiation, StratconScenario, Mission, Scenario, etc.) Added getHyperlinkedName() helper methods and updated report string formatting to incorporate hyperlinks.
MekHQ/src/mekhq/campaign/finances/Finances.java & MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java Updated financial and scenario reports to use hyperlinked names for better navigation.
Comments suppressed due to low confidence (1)

MekHQ/src/mekhq/campaign/finances/Finances.java:357

  • [nitpick] Consider refactoring the HTML string construction for error messages into a helper function to improve readability and maintain consistency across similar messages.
campaign.addReport(String.format("<font color='" + MekHQ.getMHQOptions().getFontColorNegativeHexColor() + "'>" + resourceMap.getString("InsufficientFunds.text"), resourceMap.getString("OperatingCosts.text"), "</font>"));

@IllianiBird IllianiBird marked this pull request as ready for review April 26, 2025 01:52
…ialogCore.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines 677 to 679
runningTotal = runningTotal.plus(transaction.getAmount());
csvPrinter.printRecord(
MekHQ.getMHQOptions().getDisplayFormattedDate(transaction.getDate()),
transaction.getType(),
transaction.getDescription(),
transaction.getAmount(),
runningTotal.toAmountAndSymbolString());
csvPrinter.printRecord(MekHQ.getMHQOptions().getDisplayFormattedDate(transaction.getDate()),
transaction.getType(),

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
Builder.build
should be avoided because it has been deprecated.
# Conflicts:
#	MekHQ/src/mekhq/campaign/finances/Finances.java
@IllianiBird IllianiBird merged commit 3693911 into MegaMek:master Apr 26, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
CB3
0