Repository navigation
Conversation
sampconrad
left a comment
There was a problem hiding this comment.
Thanks for this, @DEVLlN. The tests are thorough and the locales are clean. I'd like to change the approach before this goes further.
Blocking
-
Please make this a Click Casting action instead of a slot-1 option. Add a Lock and Attack entry to the Action Combat Mode section of the action dropdown, next to Start Attack and Toggle Focus Enemy. That removes the setup chain (Left Click on Action Button 1, Auto Attack in slot 1, a separate toggle). It also works on any click-cast button or key, and needs no new per-character option. In code that is roughly:
- An entry in
OVERRIDE_ORDERandOVERRIDE_LABELSinTabClickCasting.lua, and inCM.Constants.OverrideActions. - A
CM.Constants.Macrostext, likeCM_StartAttack, that locks the enemy under the crosshair and then runs/startattack [harm,nodead]. - A matching line in
ACTION_MACRO_TEXTSinBindingOverrides.lua.
With that, the
ACTIONBUTTON1exception for the click-cast-only option, thetargetLockActionButton1key and theBuildClickCastMacroTextspecial-casing aren't needed. It also stops bypassing the Prelines Editor overrides. - An entry in
-
How this differs from Auto Target Lock. The existing Auto Target Lock option already locks on attack with a very similar preline. Please say in the PR what the new action does that it doesn't (it doesn't toggle the lock off, and an ally can't replace it). Spells would still go through the existing option.
Before merge
- Please do the in-game checks: one click locks and starts Auto Attack, repeated clicks keep attacking, aiming at a second enemy switches the lock, in combat, and on a modifier slot and a side button.
- Please test on Retail, Forever and Classic and check there are no Lua errors.
- Update the
domain-click-casting.mdnote, theTabClickCasting.luaandGameplay.luaheaders, and all 11 locales for the new action name. KeepUI/Editors/TargetingMacroPrelinesEditor.luain theRelated:header ofTargetingMacroBuilder.luaif that file is touched. - Run
pwsh ./scripts/lint-changed.ps1twice.
Summary
Add Lock and Attack beside Start Attack in the Action Combat Mode section of Click Casting. Choose it for Left Click, a modifier slot, or either of the optional Mouse Button 4 and 5 slots on the Base tab. The side-button slots are off by default. Aim at a living enemy and press the binding to replace the enemy lock and start or continue Auto Attack in the same press.
With no living enemy under the crosshair, the action falls back to the living enemy lock, then to the current living enemy target. Repeated presses keep attacking, and aiming at an ally keeps the living enemy lock. The dedicated Target Lock and Cycle Lock keybinds keep their existing behavior.
Auto Target Lock gives an existing living enemy lock priority on normal bar actions. Lock and Attack gives the aimed-at enemy priority and only runs when explicitly bound and pressed. In Support Mode it runs Start Attack so it preserves the ally focus. Regular spells still use their existing targeting and Prelines Editor settings.
Validation
pwsh ./scripts/lint-changed.ps1twice. All checks passed.