Skip to content

Conversation

@IllianiBird
Copy link
Collaborator

This PR predominantly updates the dynamic information display in Campaign Options so that it can show more information in fewer lines. While I was at it I also went ahead and increased the default width of options panels so that when the maximum line width is reached (in the dynamic information display panel) it wouldn't cause the width of the panel to 'wiggle'.

I also spotted a couple of minor bugs not worth going into. They've been fixed now.

Finally I changed the arrangement of options in the skill randomization tab so that it would be easier to see the information panel when reviewing options.

@IllianiBird IllianiBird self-assigned this Nov 20, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner November 20, 2025 20:09
@IllianiBird IllianiBird added Bug GUI Campaign Options Relates to, or includes, campaign option changes Severity: Low Issues described as low severity as per the new issue form labels Nov 20, 2025
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 0% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.72%. Comparing base (f130d04) to head (15fb778).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...q/gui/campaignOptions/contents/AdvancementTab.java 0.00% 42 Missing ⚠️
...Options/components/CampaignOptionsHeaderPanel.java 0.00% 12 Missing ⚠️
...ekhq/gui/campaignOptions/contents/FinancesTab.java 0.00% 4 Missing ⚠️
...gui/campaignOptions/contents/RelationshipsTab.java 0.00% 4 Missing ⚠️
.../gui/campaignOptions/CampaignOptionsUtilities.java 0.00% 3 Missing ⚠️
...tions/components/CampaignOptionsStandardPanel.java 0.00% 3 Missing ⚠️
...paignOptions/components/CampaignOptionsButton.java 0.00% 1 Missing ⚠️
...ignOptions/components/CampaignOptionsCheckBox.java 0.00% 1 Missing ⚠️
...aignOptions/components/CampaignOptionsSpinner.java 0.00% 1 Missing ⚠️
...gnOptions/components/CampaignOptionsTextField.java 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8264      +/-   ##
============================================
- Coverage     11.72%   11.72%   -0.01%     
- Complexity     7532     7535       +3     
============================================
  Files          1271     1271              
  Lines        162724   162766      +42     
  Branches      24515    24518       +3     
============================================
+ Hits          19082    19084       +2     
- Misses       141644   141682      +38     
- Partials       1998     2000       +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 November 20, 2025 21:45
Copilot finished reviewing on behalf of HammerGS November 20, 2025 21:49
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 PR enhances the Campaign Options UI by increasing information display capacity, preventing panel width fluctuations, improving the skill randomization panel layout, and fixing several minor bugs. The changes focus on making the dynamic information display more compact (increasing word wrap from 75 to 120 characters) while establishing a consistent minimum panel width (950 scaled pixels) to eliminate "wiggling" when content changes.

Key Changes:

  • Increased word wrap width from 75 to 120 characters for more compact information display
  • Added CAMPAIGN_OPTIONS_PANEL_WIDTH constant and minimum width enforcement to prevent panel size fluctuations
  • Reorganized skill randomization panel layout for better usability (converting from 2-column to 3-column layout)
  • Fixed mouse listener bugs in FinancesTab where wrong checkboxes were referenced
  • Reduced tip panel height parameters across multiple tabs to accommodate more compact display
  • Renamed "RandomMarriageOppositeSexDiceSize" to "RandomMarriageDiceSize" for clarity

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
TurnoverAndRetentionTab.java Reduced fatigue tab tip panel height from 7 to 5
SystemsTab.java Reduced tip panel heights for reputation (10→8), faction standing (4→3), and ATOW (9→8) tabs
RulesetsTab.java Reduced StratCon tab tip panel height from 6 to 4
RepairAndMaintenanceTab.java Reduced repair tab tip panel height from 4 to 3
RelationshipsTab.java Renamed marriage dice size variables, reduced tip panel heights, removed duplicate same-sex dice UI from marriage panel
PersonnelTab.java Reduced tip panel heights for awards (5→4), medical (4→3), personnel info (4→3), and prisoners/dependents (9→6) tabs
MarketsTab.java Reduced tip panel heights for personnel market (11→9), unit market (5→4), and contract market (5→3) tabs
FinancesTab.java Fixed mouse listener bug where wrong checkboxes were used for payForFoodBox and payForHousingBox; reduced tip panel heights for general (10→8) and price multipliers (2→1) tabs
EquipmentAndSuppliesTab.java Reduced tip panel heights for acquisition (4→3), planetary acquisition (14→12), and tech limits (3→2) tabs
BiographyTab.java Reduced tip panel heights for general (8→6), backgrounds (5→3), and education (4→3) tabs
AdvancementTab.java Reorganized skill randomization panel from 2-column to 3-column layout; converted several vertical stacks to horizontal rows; reduced XP awards (8→6) and skill randomization (12→11) tip panel heights
CampaignOptionsTextField.java Removed isResourceKeyValid check from tooltip setting logic; removed unused import
CampaignOptionsStandardPanel.java Added minimum/preferred size enforcement for CAMPAIGN_OPTIONS_PANEL_WIDTH (implementation has bug - creates unused JPanel instance)
CampaignOptionsSpinner.java Removed isResourceKeyValid check from tooltip setting; reformatted parameter list
CampaignOptionsHeaderPanel.java Refactored tooltip label creation into separate method with proper minimum/preferred size overrides
CampaignOptionsCheckBox.java Removed isResourceKeyValid check from tooltip setting logic; removed unused import
CampaignOptionsButton.java Removed isResourceKeyValid check from tooltip setting logic; removed unused import
CampaignOptionsUtilities.java Added CAMPAIGN_OPTIONS_PANEL_WIDTH constant (950); increased word wrap from 75 to 120 characters; removed isResourceKeyValid check
CampaignOptionsDialog.properties Fixed typo in UseInitiativeBonus tooltip; renamed RandomMarriageOppositeSexDiceSize to RandomMarriageDiceSize; removed warning from UseStratCon tooltip
Comments suppressed due to low confidence (1)

MekHQ/src/mekhq/gui/campaignOptions/contents/RelationshipsTab.java:409

  • Inconsistency between the variable name and the resource key. The variable is named lblRandomMarriageDiceSize (line 99) but the component is created with the old resource key "RandomMarriageOppositeSexDiceSize". This should be updated to match the resource file which uses "RandomMarriageDiceSize".

Update to:

lblRandomMarriageDiceSize = new CampaignOptionsLabel("RandomMarriageDiceSize");
lblRandomMarriageDiceSize.addMouseListener(createTipPanelUpdater(marriageHeader,
      "RandomMarriageDiceSize"));
spnRandomMarriageDiceSize = new CampaignOptionsSpinner("RandomMarriageDiceSize",
      5000, 0, 100000, 1);
spnRandomMarriageDiceSize.addMouseListener(createTipPanelUpdater(marriageHeader,
      "RandomMarriageDiceSize"));
        lblRandomMarriageDiceSize = new CampaignOptionsLabel("RandomMarriageOppositeSexDiceSize");
        lblRandomMarriageDiceSize.addMouseListener(createTipPanelUpdater(marriageHeader,
              "RandomMarriageOppositeSexDiceSize"));
        spnRandomMarriageDiceSize = new CampaignOptionsSpinner("RandomMarriageOppositeSexDiceSize",
              5000, 0, 100000, 1);
        spnRandomMarriageDiceSize.addMouseListener(createTipPanelUpdater(marriageHeader,
              "RandomMarriageOppositeSexDiceSize"));

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Campaign Options Relates to, or includes, campaign option changes GUI Severity: Low Issues described as low severity as per the new issue form

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant