I'm thinking of sth. like
Lua Code:
local unit = CreateFrame("Frame")
unit:Hide()
unit:RegisterEvent("PET_BATTLE_OPENING_START")
unit:RegisterEvent("PET_BATTLE_CLOSE")
--event
unit:SetScript("OnEvent", function(...)
local self, event, arg1 = ...
if event == "PET_BATTLE_OPENING_START" then
for _, v in pairs(oUF_Diablo_Units) do
local f = _G[v]
if f then f:SetParent(unit) end
end
elseif event == "PET_BATTLE_CLOSE" then
for _, v in pairs(oUF_Diablo_Units) do
local f = _G[v]
if f then f:SetParent(UIParent) end
end
end
end)
Petbattle can only be enganged out of combat.