Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Oct 14, 2023
1 parent 1b0665c commit f8126fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions megamek/src/megamek/MMConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public final class MMConstants extends SuiteConstants {
public static final String PROJECT_NAME = "MegaMek";
public static final String MUL_URL_PREFIX = "http://www.masterunitlist.info/Unit/Details/";
public static final String BT_URL_SHRAPNEL = "https://bg.battletech.com/shrapnel/";
/** When this text is found in the source field, the Mek View will display a link to {@link #BT_URL_SHRAPNEL} */
public static final String SOURCE_TEXT_SHRAPNEL = "Shrapnel";
//endregion General Constants

//region GUI Constants
Expand Down
5 changes: 1 addition & 4 deletions megamek/src/megamek/common/MechView.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
import megamek.client.ui.Messages;
import megamek.client.ui.swing.GUIPreferences;
import megamek.client.ui.swing.util.UIUtil;
import megamek.codeUtilities.StringUtility;
import megamek.common.annotations.Nullable;
import megamek.common.eras.Era;
import megamek.common.eras.Eras;
import megamek.common.options.*;
import megamek.common.util.StringUtil;
import megamek.common.weapons.bayweapons.BayWeapon;
import megamek.common.weapons.infantry.InfantryWeapon;

import java.awt.*;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.*;
Expand Down Expand Up @@ -284,7 +281,7 @@ public MechView(final Entity entity, final boolean showDetail, final boolean use
dFormatter.format(cost) + " C-bills"));
String source = entity.getSource();
if (!source.isBlank()) {
if (source.contains("Shrapnel")) {
if (source.contains(MMConstants.SOURCE_TEXT_SHRAPNEL)) {
sHead.add(new HyperLinkElement(Messages.getString("MechView.Source"), MMConstants.BT_URL_SHRAPNEL, source));
} else {
sHead.add(new LabeledElement(Messages.getString("MechView.Source"), source));
Expand Down

0 comments on commit f8126fc

Please sign in to comment.