diff --git a/megamek/i18n/megamek/client/messages.properties b/megamek/i18n/megamek/client/messages.properties
index 9a906e0d485..2d9c94f1a3f 100644
--- a/megamek/i18n/megamek/client/messages.properties
+++ b/megamek/i18n/megamek/client/messages.properties
@@ -1259,6 +1259,8 @@ CommonSettingsDialog.showDamageDecal=Show damage to units on the unit icon
CommonSettingsDialog.showDamageLevel=Show damage to units on the unit label
CommonSettingsDialog.showIPAddressesInChat.tooltip=If enabled, all server and client IP addresses will be logged in the public chat box.
Enabling this can allow information disclosure, such as private IP addresses of the server.
CommonSettingsDialog.showIPAddressesInChat=Show IP Addresses in Chat (WARNING: Security Sensitive)
+CommonSettingsDialog.startSearchlightsOn.tooltip=If enabled, units always start with their Searchlights illuminated.
+CommonSettingsDialog.startSearchlightsOn=Start with Searchlights on
CommonSettingsDialog.showMapsheets=Show mapsheet borders.
CommonSettingsDialog.showPilotPortraitTT=Show pilot portrait in tooltip.
CommonSettingsDialog.showReportSprites=Show Report Sprites in Report Log
diff --git a/megamek/src/megamek/client/ui/swing/CommonSettingsDialog.java b/megamek/src/megamek/client/ui/swing/CommonSettingsDialog.java
index 0686dcf5229..67fef8db7b5 100644
--- a/megamek/src/megamek/client/ui/swing/CommonSettingsDialog.java
+++ b/megamek/src/megamek/client/ui/swing/CommonSettingsDialog.java
@@ -172,6 +172,7 @@ private void moveElement(DefaultListModel srcModel, int srcIndex, int trg
private final JCheckBox showUnitId = new JCheckBox(Messages.getString("CommonSettingsDialog.showUnitId"));
private JComboBox displayLocale;
private final JCheckBox showIPAddressesInChat = new JCheckBox(Messages.getString("CommonSettingsDialog.showIPAddressesInChat"));
+ private final JCheckBox startSearchlightsOn = new JCheckBox(Messages.getString("CommonSettingsDialog.startSearchlightsOn"));
private final JCheckBox showDamageLevel = new JCheckBox(Messages.getString("CommonSettingsDialog.showDamageLevel"));
private final JCheckBox showDamageDecal = new JCheckBox(Messages.getString("CommonSettingsDialog.showDamageDecal"));
private final JCheckBox showMapsheets = new JCheckBox(Messages.getString("CommonSettingsDialog.showMapsheets"));
@@ -1489,6 +1490,7 @@ private JPanel getSettingsPanel() {
addLineSpacer(comps);
comps.add(checkboxEntry(showIPAddressesInChat, Messages.getString("CommonSettingsDialog.showIPAddressesInChat.tooltip")));
+ comps.add(checkboxEntry(startSearchlightsOn, Messages.getString("CommonSettingsDialog.startSearchlightsOn.tooltip")));
return createSettingsPanel(comps);
}
@@ -1579,6 +1581,7 @@ public void setVisible(boolean visible) {
stampFormat.setText(CP.getStampFormat());
reportKeywordsTextPane.setText(CP.getReportKeywords());
showIPAddressesInChat.setSelected(CP.getShowIPAddressesInChat());
+ startSearchlightsOn.setSelected(CP.getStartSearchlightsOn());
defaultAutoejectDisabled.setSelected(CP.defaultAutoejectDisabled());
useAverageSkills.setSelected(CP.useAverageSkills());
@@ -1997,6 +2000,7 @@ protected void okAction() {
CP.setStampFormat(stampFormat.getText());
CP.setReportKeywords(reportKeywordsTextPane.getText());
CP.setShowIPAddressesInChat(showIPAddressesInChat.isSelected());
+ CP.setStartSearchlightsOn(startSearchlightsOn.isSelected());
CP.setDefaultAutoejectDisabled(defaultAutoejectDisabled.isSelected());
CP.setUseAverageSkills(useAverageSkills.isSelected());
diff --git a/megamek/src/megamek/common/preference/ClientPreferences.java b/megamek/src/megamek/common/preference/ClientPreferences.java
index 6cc7cc9ee54..41acd2eab4b 100644
--- a/megamek/src/megamek/common/preference/ClientPreferences.java
+++ b/megamek/src/megamek/common/preference/ClientPreferences.java
@@ -59,8 +59,9 @@ public class ClientPreferences extends PreferenceStoreProxy {
public static final String REPORT_KEYWORDS = "ReportKeywords";
private static final String REPORTKEYWORDSDEFAULTS = "Needs\nRolls\nTakes\nHit\nFalls\nSkill Roll\nPilot Skill\nPhase\nDestroyed\nDamage";
public static final String IP_ADDRESSES_IN_CHAT = "IPAddressesInChat";
+ public static final String START_SEARCHLIGHTS_ON = "StartSearchlightsOn";
//endregion Variable Declarations
-
+
//region Constructors
public ClientPreferences(IPreferenceStore store) {
this.store = store;
@@ -89,6 +90,7 @@ public ClientPreferences(IPreferenceStore store) {
store.setDefault(MEMORY_DUMP_ON, false);
store.setDefault(REPORT_KEYWORDS, REPORTKEYWORDSDEFAULTS);
store.setDefault(IP_ADDRESSES_IN_CHAT, false);
+ store.setDefault(START_SEARCHLIGHTS_ON, true);
setLocale(store.getString(LOCALE));
setMekHitLocLog();
}
@@ -301,6 +303,14 @@ public void setShowIPAddressesInChat(boolean value) {
store.setValue(IP_ADDRESSES_IN_CHAT, value);
}
+ public boolean getStartSearchlightsOn() {
+ return store.getBoolean(START_SEARCHLIGHTS_ON);
+ }
+
+ public void setStartSearchlightsOn(boolean value) {
+ store.setValue(START_SEARCHLIGHTS_ON, value);
+ }
+
protected Locale locale = null;
public void setLocale(String l) {
diff --git a/megamek/src/megamek/server/GameManager.java b/megamek/src/megamek/server/GameManager.java
index 1a566c6e304..c0afe42b496 100644
--- a/megamek/src/megamek/server/GameManager.java
+++ b/megamek/src/megamek/server/GameManager.java
@@ -1072,8 +1072,15 @@ private void resetEntityPhase(GamePhase phase) {
}
// reset spotlights
+ // If deployment phase, set Searchlight state based on startSearchLightsOn;
+ if (phase.isDeployment()) {
+ boolean startSLOn = PreferenceManager.getClientPreferences().getStartSearchlightsOn();
+ entity.setSearchlightState(startSLOn);
+ entity.setIlluminated(startSLOn);
+ }
entity.setIlluminated(false);
entity.setUsedSearchlight(false);
+
entity.setCarefulStand(false);
entity.setNetworkBAP(false);