Snakybo / Clicked

A keybind management addon for World of Warcraft.
GNU General Public License v3.0
37 stars 7 forks source link

Cell unit frames compatibility #231

Closed CPyle closed 1 month ago

CPyle commented 1 month ago

I currently use Vuhdo unit frames, and Clicked works perfectly fine with it. I am not sure if this is because Vuhdo has legacy support for "Clique" mode or if it would work out of the box.

I would prefer to use Cell for unit frames now, but the author of Cell has explicitly stated they will not support external click casting addons, and Clicked is too good for me to give up. I don't want to split my bindings across multiple addons.

Is adding support for other raid frames something that would be in scope for Clicked? Is writing a "bridge" addon myself to hook those frames and register them with Clicked a big lift or would it be fairly simple?

Thanks!

Snakybo commented 1 month ago

This is an issue with Cell — Unit frames have to register themselves for use by addons like Clicked. There's a fairly simple and mostly standardized way of doing this (see here) which is why VuhDo, ElvUI, SUF, Grid2, etc. all work out of the box.

See this in the Cell description, so it's something they're actively not wanting to support for whatever reason.

Someone in the Cell Discord posted a snippet on how to integrate it with Clicked: https://discord.com/channels/1122747237546610760/1268727594841538651

local F = Cell.funcs
local _G = _G

Cell:UnregisterCallback("UpdateClickCastings", "UpdateClickCastings")

Cell:UnregisterCallback("UpdateQueuedClickCastings", "UpdateQueuedClickCastings")

_G.ClickCastFrames = _G.ClickCastFrames or {}

F:IterateAllUnitButtons(function(b)
        _G.ClickCastFrames[b] = true

        b:SetAttribute("type1","target")
        b:SetAttribute("type2","togglemenu")     
end, false, true)

I don't use Cell so I don't know exactly where this code goes, but this is the snippet.

CPyle commented 1 month ago

Thanks, this was very helpful! Cell has a "snippets" feature where you can just insert code that will run after the addon loads its frames, this works.