Quantcast Using UIFrameFadeIn/Out to hide UIParent no longer hides the map and quest objectives - WoWInterface
Thread Tools Display Modes
08-28-18, 05:41 AM   #1
Krainz
An Aku'mai Servant
Join Date: Oct 2016
Posts: 31
Using UIFrameFadeIn/Out to hide UIParent no longer hides the map and quest objectives

Hi,

You guys helped me in the past with this addon:

Code:
local addonName, addonTable = ... ;

local addon = CreateFrame("Frame");

local GetCursorPosition, IsMouselooking = GetCursorPosition, IsMouselooking
local GetMouseFocus = GetMouseFocus
local UIParent, WorldFrame = UIParent, WorldFrame


function addon:FadeIn()
	if not MovieFrame:IsShown() then
		UIFrameFadeIn(UIParent, addonTable.TIMETOFADEIN, UIParent:GetAlpha(), addonTable.FADEIN);
	end
end;

function addon:FadeOut()
	UIFrameFadeOut(UIParent, addonTable.TIMETOFADEOUT, UIParent:GetAlpha(), addonTable.FADEOUT);
end;

function addon:Fadera()
	UIFrameFadeOut(UIParent, 0.1, UIParent:GetAlpha(), 0.01);
end;


addon.timer = 0
local taxi = 0
addon:SetScript("OnEvent", function(self, event, ...)

		if event == "PLAYER_CONTROL_LOST" and not (UnitAffectingCombat("Player") or InCombatLockdown() or IsInInstance()) then
			self.taxi = 1
			addon:Fadera();
		end;
		if event == "PLAYER_CONTROL_GAINED" then
			self.taxi = 0
		end;
		if event == "CINEMATIC_START" then
			self.taxi = 1
			addon:Fadera();
		end;
		if event == "CINEMATIC_STOP" then
			self.taxi = 0
		end;
		if event == "LFG_UPDATE" then
			addon:FadeIn();
			self.timer = 4
		end;
end);

addon:RegisterEvent('PLAYER_CONTROL_LOST')
addon:RegisterEvent('PLAYER_CONTROL_GAINED')
addon:RegisterEvent('CINEMATIC_START')
addon:RegisterEvent('CINEMATIC_STOP')
addon:RegisterEvent('LFG_UPDATE')



addon:SetScript("OnUpdate", function(self, elapsed)
		self.timer = self.timer + elapsed

		local speed = GetUnitSpeed("player");
		local x, y = GetCursorPosition();

		if InCinematic() or (QuestFrame:IsShown() and IsAddOnLoaded("CatchTheWind")) then
			self.timer = addonTable.TIMEAFK
			addon:FadeOut();
		elseif
		((self.taxi ~= 1
		and
		((self.x ~= x and not (not IsResting() and not IsInInstance()))
		or (self.y ~= y and not (not IsResting() and not IsInInstance()))
		or (UnitAffectingCombat("Player")
		or InCombatLockdown()
		or (speed ~=0 and not (not IsResting() and not IsInInstance()))
		or UnitName("mouseover")
		or WorldMapFrame:IsShown()
		or MailFrame:IsShown()
		or (CollectionsJournal and CollectionsJournal:IsShown())
		or GossipFrame:IsShown()
		or GameTooltipTextLeft1:GetText()
		or UnitCastingInfo("Player")
		or UnitChannelInfo("Player")
		or (UnitExists("Target") and not InCinematic())))
		)
		or ChatFrame1EditBox:IsShown()
		)
		and not (QuestFrame:IsShown() and IsAddOnLoaded("CatchTheWind"))
		then
			if not InCinematic() then
				addon:FadeIn();
			end;
		elseif not IsMouselooking() and self.timer > addonTable.TIMEAFK and (GetMouseFocus() == WorldFrame and not MovieFrame:IsShown())
		then
			self.timer = 0
			addon:FadeOut();
		end;
		if self.timer > addonTable.TIMEAFK or InCinematic() then
			if not IsMouselooking() and (GetMouseFocus() == WorldFrame and not MovieFrame:IsShown())

			then
				self.x = x
				self.y = y

			end;

			self.timer = 0
		end;
end)
After one of Legion's patches, it stopped hiding the map and objectives tracker, however. I don't know why. But that's fine.

The issue is, that also happens when the in-game cutscenes (those with the black bars, not the cinematic ones) play and it's kinda annoying to have the quest list + minimap showing up on top of the cutscene.

Is there a way to fix that?
  Reply With Quote
08-28-18, 07:29 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,729
What is the parent frame of the minimap cluster?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
08-28-18, 02:26 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,557
Is this happening with all addons disabled? Because I'm not having an issue with things hiding during cutscenes (at least not with my PocketPlot and WFWW enabled).
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-29-18, 01:22 AM   #4
Krainz
An Aku'mai Servant
Join Date: Oct 2016
Posts: 31
Originally Posted by zork View Post
What is the parent frame of the minimap cluster?
I don't know.

Originally Posted by Seerah View Post
Is this happening with all addons disabled? Because I'm not having an issue with things hiding during cutscenes (at least not with my PocketPlot and WFWW enabled).
You are absolutely correct. That doesn't happen with all addons disabled. Is there a way of "protecting" this operation so other addons don't interfere with it?

If it helps, here's my framestack for the minimap and quest objectives:




Last edited by Krainz : 08-29-18 at 01:27 AM.
  Reply With Quote
08-29-18, 07:45 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,557
One (or more) of your addons is changing the parent of these frames. A frame stack doesn't help with that.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-30-18, 12:19 AM   #6
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,729
You can try
Lua Code:
  1. /run print(MinimapCluster:GetParent():GetName())
and
Lua Code:
  1. /run print(Minimap:GetParent():GetName())
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Using UIFrameFadeIn/Out to hide UIParent no longer hides the map and quest objectives

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