Quantcast
WoWInterface - View Single Post - How to show children of a hidden frame?
View Single Post
06-22-19, 11:43 AM   #1
Lybrial
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 86
How to show children of a hidden frame?

Hi,

im using the following macro to make sure my player nameplate is always showing but invisible:

Code:
/run SetCVar ("nameplateSelfAlpha", 0)
/run SetCVar ("nameplatePersonalShowAlways", 1)
When I now attach a frame to the player nameplate:

Code:
-- Attaches frame to the player nameplate
function AttachFrameToPlayerNameplate(frame, forceDetach)
	local namePlatePlayer = C_NamePlate.GetNamePlateForUnit("player");
	
	if namePlatePlayer and not forceDetach then
		frame:SetParent(namePlatePlayer);
		frame:ClearAllPoints();
		frame:SetPoint("CENTER", namePlatePlayer, "CENTER", 0, 250);
		frame:SetScale(UIParent:GetEffectiveScale()); -- cause personal resource display does not get sacled with UI scale
	else
		-- Default position when player nameplate does not exist
		frame:SetParent(UIParent);
		frame:ClearAllPoints();
		frame:SetPoint("CENTER", UIParent, "CENTER", 0, -250);
		frame:SetScale(1);
	end
end
The frame will be invisible too. I have two questions:

First: Is there a way to move the macro code into the lua code?
Second: How can I show the children of a hidden frame?
  Reply With Quote