Move Searchlights default option to game options. Allow turning off searchlights in lobby#8148
Move Searchlights default option to game options. Allow turning off searchlights in lobby#8148TenkawaBC wants to merge 6 commits intoMegaMek:mainfrom
Conversation
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
|
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:
|
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
|
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.
|
This is ready for review now. |
There was a problem hiding this comment.
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.
megamek/src/megamek/client/ui/dialogs/customMek/EquipChoicePanel.java
Outdated
Show resolved
Hide resolved
…ior when reopening the box.
…into searchlight-preference-changes
Implements RFE #8108