Skip to content

Commit 21443ac

Browse files
committed
Merge branch 'main' into familyTree
2 parents d4eb736 + 0d05b47 commit 21443ac

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

megamek/resources/megamek/client/messages.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,9 @@ CommonSettingsDialog.showIPAddressesInChat.tooltip=<html>If enabled, all server
13691369
CommonSettingsDialog.showIPAddressesInChat=Show IP Addresses in Chat (WARNING: Security Sensitive)
13701370
CommonSettingsDialog.startSearchlightsOn.tooltip=<html>If enabled, units always start with their Searchlights illuminated.</html>
13711371
CommonSettingsDialog.startSearchlightsOn=Start with Searchlights on
1372+
CommonSettingsDialog.spritesOnly.tooltip=Some units display photos of their BattleTech models in certain views, such \
1373+
as TRO View. Enabling this option will cause the unit sprite to display, instead.
1374+
CommonSettingsDialog.spritesOnly=Sprites Only
13721375
CommonSettingsDialog.showMapsheets=Show map-sheet borders.
13731376
CommonSettingsDialog.showPilotPortraitTT=Show pilot portrait in tooltip.
13741377
CommonSettingsDialog.showReportPlayerList=Show Player Search List and Buttons
@@ -5022,7 +5025,6 @@ ForceDisplay.Button.ECM=ECM
50225025
ForceDisplay.Button.Quirks=Quirks
50235026
ForceDisplay.Button.C3=C3
50245027
ForceDisplay.Button.Misc=Misc.
5025-
50265028
# Source Chooser Dialog
50275029
SourceChooser.title=Choose Source
50285030
SourceChooser.list=Choose From List:

megamek/src/megamek/client/ui/dialogs/buttonDialogs/CommonSettingsDialog.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ private <T> void moveElement(DefaultListModel<T> srcModel, int srcIndex, int trg
272272
"CommonSettingsDialog.showIPAddressesInChat"));
273273
private final JCheckBox startSearchlightsOn = new JCheckBox(Messages.getString(
274274
"CommonSettingsDialog.startSearchlightsOn"));
275+
private final JCheckBox spritesOnly = new JCheckBox(Messages.getString(
276+
"CommonSettingsDialog.spritesOnly"));
275277
private final JCheckBox showDamageLevel = new JCheckBox(Messages.getString("CommonSettingsDialog.showDamageLevel"));
276278
private final JCheckBox showDamageDecal = new JCheckBox(Messages.getString("CommonSettingsDialog.showDamageDecal"));
277279
private final JCheckBox showMapSheets = new JCheckBox(Messages.getString("CommonSettingsDialog.showMapsheets"));
@@ -2188,6 +2190,8 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
21882190
Messages.getString("CommonSettingsDialog.showIPAddressesInChat.tooltip")));
21892191
comps.add(checkboxEntry(startSearchlightsOn,
21902192
Messages.getString("CommonSettingsDialog.startSearchlightsOn.tooltip")));
2193+
comps.add(checkboxEntry(spritesOnly,
2194+
Messages.getString("CommonSettingsDialog.spritesOnly.tooltip")));
21912195
return createSettingsPanel(comps);
21922196
}
21932197

@@ -2296,6 +2300,7 @@ public void setVisible(boolean visible) {
22962300
reportFilterKeywordsTextPane.setText(CLIENT_PREFERENCES.getReportFilterKeywords());
22972301
showIPAddressesInChat.setSelected(CLIENT_PREFERENCES.getShowIPAddressesInChat());
22982302
startSearchlightsOn.setSelected(CLIENT_PREFERENCES.getStartSearchlightsOn());
2303+
spritesOnly.setSelected(CLIENT_PREFERENCES.getSpritesOnly());
22992304

23002305
defaultAutoEjectDisabled.setSelected(CLIENT_PREFERENCES.defaultAutoEjectDisabled());
23012306
useAverageSkills.setSelected(CLIENT_PREFERENCES.useAverageSkills());
@@ -2790,6 +2795,7 @@ protected void okAction() {
27902795
CLIENT_PREFERENCES.setReportFilterKeywords(reportFilterKeywordsTextPane.getText());
27912796
CLIENT_PREFERENCES.setShowIPAddressesInChat(showIPAddressesInChat.isSelected());
27922797
CLIENT_PREFERENCES.setStartSearchlightsOn(startSearchlightsOn.isSelected());
2798+
CLIENT_PREFERENCES.setSpritesOnly(spritesOnly.isSelected());
27932799
CLIENT_PREFERENCES.setEnableExperimentalBotFeatures(enableExperimentalBotFeatures.isSelected());
27942800
CLIENT_PREFERENCES.setDefaultAutoEjectDisabled(defaultAutoEjectDisabled.isSelected());
27952801
CLIENT_PREFERENCES.setUseAverageSkills(useAverageSkills.isSelected());

megamek/src/megamek/client/ui/dialogs/unitSelectorDialogs/EntityReadoutPanel.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@
6363
import megamek.client.ui.util.UIUtil;
6464
import megamek.client.ui.util.UIUtil.FixedXPanel;
6565
import megamek.client.ui.util.ViewFormatting;
66-
import megamek.common.units.Entity;
6766
import megamek.common.Report;
67+
import megamek.common.preference.PreferenceManager;
6868
import megamek.common.templates.TROView;
69+
import megamek.common.units.Entity;
6970

7071
/**
7172
* @author Jay Lawson
@@ -209,7 +210,8 @@ public void showEntity(Entity entity, boolean showDetail, boolean useAlternateCo
209210
}
210211

211212
private void setFluffImage(Entity entity) {
212-
Image image = FluffImageHelper.getFluffImage(entity);
213+
boolean isSpritesOnly = PreferenceManager.getClientPreferences().getSpritesOnly();
214+
Image image = isSpritesOnly ? null : FluffImageHelper.getFluffImage(entity);
213215
// Scale down to the default width if the image is wider than that
214216
if (null != image) {
215217
if (image.getWidth(this) > DEFAULT_WIDTH) {

megamek/src/megamek/common/preference/ClientPreferences.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public class ClientPreferences extends PreferenceStoreProxy {
9696
private static final String REPORT_FILTER_KEYWORDS_DEFAULTS = "Fire Hit Damage\nHit Damage";
9797
public static final String IP_ADDRESSES_IN_CHAT = "IPAddressesInChat";
9898
public static final String START_SEARCHLIGHTS_ON = "StartSearchlightsOn";
99+
public static final String SPRITES_ONLY = "SpritesOnly";
99100
public static final String ENABLE_EXPERIMENTAL_BOT_FEATURES = "EnableExperimentalBotFeatures";
100101
public static final String NAG_ASK_FOR_VICTORY_LIST = "AskForVictoryList";
101102
public static final String SHOW_AUTO_RESOLVE_PANEL = "ShowAutoResolvePanel";
@@ -145,6 +146,7 @@ public ClientPreferences(IPreferenceStore store) {
145146
store.setDefault(REPORT_FILTER_KEYWORDS, REPORT_FILTER_KEYWORDS_DEFAULTS);
146147
store.setDefault(IP_ADDRESSES_IN_CHAT, false);
147148
store.setDefault(START_SEARCHLIGHTS_ON, true);
149+
store.setDefault(SPRITES_ONLY, false);
148150
store.setDefault(ENABLE_EXPERIMENTAL_BOT_FEATURES, false);
149151
store.setDefault(USER_DIR, "");
150152
store.setDefault(MML_PATH, "");
@@ -407,6 +409,14 @@ public void setStartSearchlightsOn(boolean value) {
407409
store.setValue(START_SEARCHLIGHTS_ON, value);
408410
}
409411

412+
public boolean getSpritesOnly() {
413+
return store.getBoolean(SPRITES_ONLY);
414+
}
415+
416+
public void setSpritesOnly(boolean value) {
417+
store.setValue(SPRITES_ONLY, value);
418+
}
419+
410420
public void setEnableExperimentalBotFeatures(boolean value) {
411421
store.setValue(ENABLE_EXPERIMENTAL_BOT_FEATURES, value);
412422
}

0 commit comments

Comments
 (0)