WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Hiding the UI, but Map and Objectives/Quests are not hiding? (https://www.wowinterface.com/forums/showthread.php?t=56584)

Krainz 08-22-18 12:05 AM

Hiding the UI, but Map and Objectives/Quests are not hiding?
 
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?


All times are GMT -6. The time now is 04:51 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI