Skip to content

Move Searchlights default option to game options. Allow turning off searchlights in lobby#8148

Open
TenkawaBC wants to merge 6 commits intoMegaMek:mainfrom
TenkawaBC:searchlight-preference-changes
Open

Move Searchlights default option to game options. Allow turning off searchlights in lobby#8148
TenkawaBC wants to merge 6 commits intoMegaMek:mainfrom
TenkawaBC:searchlight-preference-changes

Conversation

@TenkawaBC
Copy link
Copy Markdown
Contributor

Implements RFE #8108

  • Searchlight status now shows in Equipment Choice Panel.
  • If you turn off the searchlight in the panel, it will turn it off when auto is on when starting.
  • Moved Searchlights on by default to Game Options from Client Settings

Searchlight status now shows in Equipment Choice Panel.
If you turn off the searchlight in the panel, it will turn it off when auto is on when starting.
Moved Searchlights on by default to Game Options from Client Settings
@TenkawaBC TenkawaBC requested a review from a team as a code owner March 31, 2026 04:23
@TenkawaBC
Copy link
Copy Markdown
Contributor Author

I tested this with mechs and confirmed existing ones worked, and the override worked.

Adding searchlights manually to non-mek/tank units also works correctly from what I can see.

Note: To add a searchlight to a unit and then turn it off takes the following steps:

  1. Set planetary conditions to darkness
  2. Go into the customize of the mek and choose equipment
  3. Select Searchlight
  4. Click Ok
  5. do step 2 again
  6. Turn on/off the searchlight. and click ok

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 9.09091% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.91%. Comparing base (fdc0576) to head (b1a37bd).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../client/ui/dialogs/customMek/EquipChoicePanel.java 0.00% 36 Missing ⚠️
...src/megamek/server/totalWarfare/TWGameManager.java 20.00% 8 Missing ⚠️
megamek/src/megamek/common/units/Entity.java 25.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8148   +/-   ##
=========================================
  Coverage     29.90%   29.91%           
- Complexity    17390    17400   +10     
=========================================
  Files          3172     3172           
  Lines        307533   307559   +26     
  Branches      53774    53785   +11     
=========================================
+ Hits          91981    92014   +33     
+ Misses       205975   205968    -7     
  Partials       9577     9577           

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

@TenkawaBC
Copy link
Copy Markdown
Contributor Author

I had a thought about simplifying some of the logic to make it easier. I'll put a other commit on it on mar 31 with the change

…nging away from the default. then actioning it when it is true.

This removes logic from the equipment choice dialog and puts it into TWGameManager.
@TenkawaBC
Copy link
Copy Markdown
Contributor Author

This is ready for review now.

Copy link
Copy Markdown
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

Implements RFE #8108 by moving the “searchlights on by default” behavior from client preferences into a game option, and adding a per-unit lobby override so players can start individual units with searchlights on/off.

Changes:

  • Added a new game option (searchlights_on) defaulting to enabled, with UI strings.
  • Server deployment logic now uses the game option plus a per-entity override to decide initial searchlight state.
  • Client lobby equipment UI shows (and attempts to apply) a per-unit “Searchlight On?” setting and removes the old client setting.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
megamek/src/megamek/server/totalWarfare/TWGameManager.java Uses game option + per-entity override to set initial searchlight state during deployment.
megamek/src/megamek/common/units/Entity.java Adds searchlightOverride flag with getter/setter for per-unit start behavior.
megamek/src/megamek/common/preference/ClientPreferences.java Removes the old client preference for starting searchlights on.
megamek/src/megamek/common/options/OptionsConstants.java Introduces SEARCHLIGHTS_ON option key.
megamek/src/megamek/common/options/GameOptions.java Registers the new game option with default true.
megamek/src/megamek/client/ui/dialogs/customMek/EquipChoicePanel.java Adds “Searchlight On?” checkbox and applies per-entity override from the lobby UI.
megamek/resources/megamek/common/options/messages.properties Adds display name/description for the new game option.
megamek/resources/megamek/client/messages.properties Removes old client settings strings and adds label for “Searchlight On?”.

💡 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants