Quantcast WoWInterface - View Single Post - Classic Beta 1.13.2 API changes
View Single Post
06-20-19, 01:38 PM   #13
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,169
What about "togglemenu" on a (non-Blizz. frames) target unit that is not the player?

I get an error about UnitIsOtherPlayersBattlePet which I'm pretty certain weren't a thing in vanilla .

Test Code:
Code:
local f = CreateFrame("Button", "FizzleTestUnitFrame", UIParent, "SecureUnitButtonTemplate")
f.unit = "target"
f:SetAttribute("unit", f.unit)
RegisterUnitWatch(f)
f:SetAttribute("toggleForVehicle", true)
f:RegisterForClicks("AnyUp")
f:SetAttribute("*type1", "target")
f:SetAttribute("*type2", "togglemenu")
f:SetAttribute("*type3", "assist")
f:SetPoint("TOP", 0, -5)
f:SetSize(100, 100)
f.Portrait = f:CreateTexture("$parentPortrait")
f.Portrait:SetAllPoints()
f:SetScript("OnEvent", function(self, event, ...)
	SetPortraitTexture(self.Portrait, self.unit)
end)
f:RegisterEvent("UNIT_PORTRAIT_UPDATE")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-20-19 at 01:43 PM.
  Reply With Quote