-
Notifications
You must be signed in to change notification settings - Fork 188
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
Added Support for Mission and Scenario Hyperlinking #6643
Conversation
- 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.
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
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 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>"));
MekHQ/src/mekhq/gui/baseComponents/immersiveDialogs/ImmersiveDialogCore.java
Outdated
Show resolved
Hide resolved
…ialogCore.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Builder.build
# Conflicts: # MekHQ/src/mekhq/campaign/finances/Finances.java
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.