Add right-click-to-command control scheme#2298
Draft
leosnake2208 wants to merge 2 commits into
Draft
Conversation
Optional control scheme matching modern RTS games: the right mouse button issues orders to the current selection, while the left mouse button only selects/deploys and deselects on empty ground. Reuses the game's own command dispatch (and network path) by redirecting the RMB-up handler into the shared LMB-up command dispatch. Special left-click modes (repair/sell/place/beacon/ superweapon/planning) keep their vanilla behaviour. Gated behind [Phobos] ModernControls (default off).
Contributor
|
rename the tag to RightClickCommand since ModernControl is an ambigious name that can refer to many things |
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Address review feedback (Coronia): "ModernControls" is an ambiguous name. Rename the INI tag, config field, source file, namespace and hook names to the clearer "RightClickCommand"; update docs and CREDITS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Done — renamed the tag to |
leosnake2208
added a commit
to leosnake2208/Phobos
that referenced
this pull request
Jul 19, 2026
… TypeSelectByMultiClick Mirror the upstream PR structure in the integrated local build. The single ModernControls toggle/file is replaced by two, matching PR Phobos-developers#2298 (right-click to command) and PR Phobos-developers#2297 (multi-click type-select): - src/Misc/RightClickCommand.cpp - RMB command + LMB select/deselect, gated by [Phobos] -> RightClickCommand - src/Misc/MultiClickTypeSelect.cpp - double/triple-click type-select, gated by [Phobos] -> TypeSelectByMultiClick Both default true (this is the personal build). The fork-only 250px double-click radius and selection-group matching are preserved. The two features share RightClickCommand::RmbCommandInProgress: the RMB redirect flows through the 0x693290 multi-click hook, which clears the flag and skips the event, so an RMB order is never miscounted as a left-click. WASD panning stays separate and always-on (CameraPanWASD.cpp). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
hint: we'd appreciate (even broken) real human English more than an LLM text ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
An opt-in control scheme matching modern RTS games:
Special left-click modes are preserved on both buttons: while placing a building, repairing, selling, toggling power, planting a beacon, planning a path, or targeting a superweapon, the left button performs that action and the right button cancels it — exactly as in vanilla. Only mouse behaviour changes; no keyboard hotkeys are rebound.
Config
Gated behind a new user setting, default off:
Implementation
The tactical mouse message handler (
MouseClass@0x6930A0) dispatches window mouse messages through a jump table.RBUTTONUPandLBUTTONUPare two cases of the same function, sharing one stack frame andthis.0x693397): the RBUTTONUP handler, past its drag-flag gate, populates the view-relative click point and jumps into the shared LMB-up command dispatch at0x69323E, so the order flows through the game's ownDecideAction→ apply path — reusing 100% of the command and network logic (no argument/packet reconstruction). A flag tells the LBUTTONUP hook to let this RMB-issued order pass unmodified.0x6931B4,0x693276): right afterDecideAction, any command action is downgraded toAction::None, so the left button only selects/box-selects/deploys. On empty ground a would-be move becomes a deselect (MapClass::UnselectAll). Completed band-selects exit earlier and never reach this point.InSpecialLeftClickMode) keeps repair/sell/placement/beacon/planning/superweapon-targeting on their vanilla buttons.Validated with the repo's
check-hooksskill — no conflicts with Phobos or Ares 3.0p1; hook sizes and return targets check out. Built clean (Debug/Release, 0 warnings). The scheme was developed and extensively tested in-game on the CnCNet Yuri's Revenge build.Notes