Okay, I gave up and spent some time looking through Stuf's code. The problem is that it doesn't create its frames right away when it loads. To fix that, you'll need to use function hooks to detect when Stuf creates the frames. Replace your OnLoad scripts with this (change the blue part at the top for each panel):
Code:
self.unit = "party1"
self.frame = _G["Stuf.units." .. self.unit]
self.initFunc = function()
self:RegisterEvent("PLAYER_TARGET_CHANGED")
self.frame:HookScript("OnEnter", function()
self:Show()
end)
self.frame:HookScript("OnLeave", function()
if not UnitIsUnit("target", self.unit) then
self:Hide()
end
end)
end
if self.frame then
self.initFunc()
else
hooksecurefunc(Stuf, "CreateUnitFrame", function()
-- Can't undo hooksecurefunc. Make sure it only initializes once.
if self.frame then return end
self.frame = _G["Stuf.units." .. self.unit]
if self.frame then
self.initFunc()
end
end)
end