Quantcast How to show children of a hidden frame? - WoWInterface
Thread Tools Display Modes
06-22-19, 11:43 AM   #1
Lybrial
A Cyclonian
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 40
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
06-22-19, 11:58 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,109
First: remove the /run

Second: If you want them to remain shown, why parent them to a frame that might get hidden. A frame doesn't need to be a "child" of another frame to be anchored to it.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-22-19 at 12:08 PM.
  Reply With Quote
06-22-19, 12:20 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,109
Probably worth pointing out the changes coming to secure frame anchoring in 8.2
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
06-22-19, 12:35 PM   #4
Lybrial
A Cyclonian
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 40
Thx again man. So much I have to learn
  Reply With Quote
06-24-19, 02:43 PM   #5
LudiusMaximus
A Cliff Giant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 71
Regarding your second question, you are probably looking for SetIgnoreParentAlpha()?

https://wow.gamepedia.com/API_Region...oreParentAlpha
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to show children of a hidden frame?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off