8000 Improvement: Switched Faction Logos to Use Same Logos as Campaign Options IIC by IllianiBird · Pull Request #6857 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Switched Faction Logos to Use Same Logos as Campaign Options IIC #6857

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 1 commit into from
May 6, 2025

Conversation

IllianiBird
Copy link
Collaborator
@IllianiBird IllianiBird commented May 3, 2025

Previously I set us up to use the colored icons found in the force icon section of data images. However those icons were designed for force icons and ended up with some really weird scaling.

This PR moves us to use the same icons that we're already using in Campaign Options IIC. This has a few benefits: more consistent scaling, and a unity of design. A player will see the faction icon for Clan Wolf in CO IIC and then, when they encounter Clan Wolf in the field, will see the same icon again.

This PR is required for #6858 and I would like to see both merged into 50.06.

Copy link
codecov bot commented May 3, 2025

Codecov Report

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

Project coverage is 11.52%. Comparing base (3f2d5f0) to head (3d7c72c).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/universe/Factions.java 0.00% 85 Missing ⚠️
.../gui/dialog/resupplyAndCaches/DialogItinerary.java 0.00% 2 Missing ⚠️
MekHQ/src/mekhq/campaign/Campaign.java 0.00% 1 Missing ⚠️
MekHQ/src/mekhq/campaign/mission/AtBContract.java 0.00% 1 Missing ⚠️
...ign/mission/resupplyAndCaches/StarLeagueCache.java 0.00% 1 Missing ⚠️
...kHQ/src/mekhq/gui/dialog/ContractMarketDialog.java 0.00% 1 Missing ⚠️
...rc/mekhq/gui/dialog/RetirementDefectionDialog.java 0.00% 1 Missing ⚠️
...ekhq/gui/dialog/randomEvents/GrayMondayDialog.java 0.00% 1 Missing ⚠️
...q/gui/dialog/resupplyAndCaches/DialogSwindled.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6857      +/-   ##
============================================
- Coverage     11.52%   11.52%   -0.01%     
  Complexity     6567     6567              
============================================
  Files          1100     1100              
  Lines        140971   140961      -10     
  Branches      21845    21839       -6     
============================================
- Hits          16243    16241       -2     
+ Misses       123030   123019      -11     
- Partials       1698     1701       +3     

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

Comment on lines +364 to +377
case "TH" -> "logo_mercenaries"; // Terran Hegemony
case "CI" -> "logo_mercenaries"; // Chainelane Isles
case "SOC" -> "logo_mercenaries"; // The Society
case "CWI" -> "logo_mercenaries"; // Clan Widowmaker
case "EF" -> "logo_mercenaries"; // Elysian Fields
case "GV" -> "logo_mercenaries"; // Greater Valkyrate
case "JF" -> "logo_mercenaries"; // JarnFolk
case "MSC" -> "logo_mercenaries"; // Marik-Stewart Commonwealth
case "OP" -> "logo_mercenaries"; // Oriente Protectorate
case "RA" -> "logo_mercenaries"; // Raven Alliance
case "RCM" -> "logo_mercenaries"; // Rim Commonality
case "NIOPS" -> "logo_mercenaries"; // Niops Association
case "AXP" -> "logo_mercenaries"; // Axumite Providence
case "NDC" -> "logo_mercenaries"; // New Delphi Compact
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm currently working with an artist to add art for the missing icons, but for now we use mercenaries as a fallback.

@HammerGS HammerGS requested a review from Copilot May 6, 2025 02:47
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 updates the faction logo retrieval to use the same icons as Campaign Options IIC, addressing scaling inconsistencies and unifying design. Key changes include replacing calls to getFactionLogo that depend on a Campaign and a boolean flag with a new method based solely on game year and faction code, and deprecating the old method in favor of a more consistent API.

  • Updated dialog classes to use getFactionLogo(int, String) with campaign.getGameYear().
  • Removed fallback parameter and deprecated the old getFactionLogo(Campaign, String, boolean) method.
  • Adjusted multiple files (di 8000 alogs, contracts, campaign, etc.) to use the new API.

Reviewed Changes

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

Show a summary per file
File Description
MekHQ/src/mekhq/gui/dialog/resupplyAndCaches/DialogSwindled.java Updated faction logo retrieval call
MekHQ/src/mekhq/gui/dialog/resupplyAndCaches/DialogItinerary.java Updated faction logo retrieval calls
MekHQ/src/mekhq/gui/dialog/randomEvents/GrayMondayDialog.java Updated faction logo retrieval call
MekHQ/src/mekhq/gui/dialog/RetirementDefectionDialog.java Updated faction logo retrieval call
MekHQ/src/mekhq/gui/dialog/ContractMarketDialog.java Updated faction logo retrieval call
MekHQ/src/mekhq/campaign/universe/Factions.java Introduced new API and deprecated the old method
MekHQ/src/mekhq/campaign/mission/resupplyAndCaches/StarLeagueCache.java Updated faction logo retrieval call
MekHQ/src/mekhq/campaign/mission/AtBContract.java Updated faction logo retrieval call
MekHQ/src/mekhq/campaign/Campaign.java Updated faction logo retrieval call
Comments suppressed due to low confidence (2)

MekHQ/src/mekhq/campaign/universe/Factions.java:302

  • Consider adding an inline comment explaining the fallback logic here to clarify why these specific logos are selected based on gameYear.
if (gameYear >= 3060) { yield "logo_rasalhague_dominion"; } else { yield "logo_clan_ghost_bear"; }

MekHQ/src/mekhq/campaign/universe/Factions.java:264

  • Verify that all references have been updated to use the new getFactionLogo(int, String) method before eventually removing this deprecated method.
@Deprecated(since = "0.50.06", forRemoval = true)

@Scoppio Scoppio merged commit 9a60fb7 into MegaMek:master May 6, 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.

2 participants
0