I’ve been looking to make an Addon for Dual-boxing for WoW Classic. Reviewing the Alpha build’s interface code, the Focus target has been removed completely, probably because Vanilla didn’t have Focus targets.
However, the concept of a Focus target was added in 2.0 because they were simultaneously removing the ability to make a custom focus target by removing the direct LUA scripting of target management, due to Secure Frames.
I haven’t ever really looked into creating Secure Frame children, but I was wondering if this scenario is possible:
Given the name of a player character, out of combat, create a Secure Frame that targets that player character and/or creates a referencable name (like we do with ‘target’, ‘targettarget’, ‘party1’ etc.).
I don’t really know much about what Secure Frames are capable of doing from a completely custom point of view, as I’ve always used the ability to set the focus out of combat, then used the focus unit for casting.
Is it possible to create an entirely extra unit frame out of combat that can be referenced by name when targetting or casting, during combat?
If so, can someone point me at some good explanations of how to do it or addons that already do it? (as opposed to ones that reskin existing units)
If the base FocusFrame has been removed, doesn’t mean you can’t create a SecureUnitButtonTemplate derived frame with the unit attribute of “focus” of your own. Doesn’t mean you can but until it can be tested it’s a bit hard to know.
Creating a SecureUnit and changing it’s attributes in combat can’t be done.
Can I create a frame with a tag/reference of “followunit” and then set that to a specific non-party player character, and be able to reference it in macros like
/follow [@followunit]
That’s one of the goals of the addon. Originally I was just going to use @focus. It can all be set up out of combat if necessary as long as I can run a macro that allows the reference of that fixed target.
(I’ve never actually used secure frames themselves. Always used the built in focus)
Base unit ids
https://wow.gamepedia.com/UnitId
I don’t know if they will actually block the use of any of these in custom unit frame creation for Classic.
The base ones don’t in a limited fashion. But classic won’t let me use focus
because the concept has been cut out of the UI, so I’d need to create my own base Unit ID.
If the unit id of “focus” is removed then you’re out of luck but if not and just the focus frame has been removed then you might be able to create your own as in:
--Create the unit button:
local f = CreateFrame("Button", "MyFocusFrame", UIParent, "SecureUnitButtonTemplate")
--Tell it which unit to represent (in this case "focus":
f:SetAttribute("unit", "focus")
RegisterUnitWatch(f) -- Tell the game to "look after it"
--Tell it to show the unit's vehicle when the unit is in one:
f:SetAttribute("toggleForVehicle", true)
--Give it the standard click actions:
f:RegisterForClicks("AnyUp")
f:SetAttribute("*type1", "target") -- Target unit on left click
f:SetAttribute("*type2", "togglemenu") -- Toggle units menu on left click
f:SetAttribute("*type3", "assist") -- On middle click, target the target of the clicked unit
--Make it visible for testing purposes:
f:SetPoint("CENTER")
f:SetSize(100, 100)
f:SetBackdrop({ bgFile = "Interface\\BUTTONS\\WHITE8X8" })
f:SetBackdropColor(0.3, 0.3, 0.3, 0.6)
--Then add other objects such as font strings portraits etc.
That would give you a unit to “focus” on.
Thanks! I’ll give it a try when the Classic Beta comes out.
Yes, many unknowables atm.
I doubt beta will clear up all the unknowables but maybe a few
Beta may not have addons enabled at the beginning (most unlikely)