shagu / pfUI

A User Interface Replacement for World of Warcraft: Vanilla & TBC
https://shagu.org/pfUI
MIT License
341 stars 116 forks source link

unitframes/clickcasting: prevent target switch in some cases (combopoints) #1315

Open welpenhund opened 1 month ago

welpenhund commented 1 month ago

Good morning, i am not even sure if it is a bug or can not be solved in a different way. But if you have click to cast enabled and left click yourself in "Player frame" to cast anything on yourself, all combo points that you had on your current target are lost. This only happens if you use the click to cast on yourself, if you use alt + use a spell from your spellbook they are not lost. Would there be any way to set an exception for casts on the own player frame (on click to cast) to not change the target and instead simulate alt clicking to self cast? So combo points would not be lost if you cast something on yourself with click to cast.

If not possible i understand, but thought it is worth to ask :-)

welpenhund commented 1 month ago

Can provide a video of what i mean if it's unclear, since no answer yet =(

shagu commented 1 month ago

Hey, you don't need to provide a video :)

The click cast implementation does always change the target to the clicked one, casts the spell and immediately switches back to the previous one. The process of switching targets makes you lose combo points.

The switch of targets is required as it can't directly cast to something like raid17-target on vanilla.

However, for selfcasts there would be a selfcast parameter that could be used API wise, but I haven't implemented any target-based special cases. As of now, it's straight up a simple target-cast-retarget mechanism that works on everything.

I don't think I will have time to work on any target checking special behaviours the nexts months. Maybe someone else wants to pick this up, otherwise it probably gets lost.

If anyone is interested, here's the (as of now simple) part: https://github.com/shagu/pfUI/blob/master/api/unitframes.lua#L2035-L2046

welpenhund commented 1 month ago

First of all, thanks for answering. And yes, it would be lovely if someone could add a check for selfcasts. (it really is only for selfcasts where it shouldn't drop combo points, i know that it will drop on someone else of course)

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity.