View Single Post
10-20-16, 10:50 PM   #17
Krainz
A Wyrmkin Dreamwalker
Join Date: Oct 2016
Posts: 57
Thanks for the help!

What I want to do isn't offered by any other addon.

ie, I'm using 'C_Timer.After()' to set a specific time out of combat or without moving for the UI to fade.

Like a soft AFK check, that would hide the UI while idle.

As of now I'm doing tests with C_Timer.After(3, UIFrameFadeOut(UIParent, 3, UIParent:GetAlpha(), 0)) within the code you provided.

I replaced all UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1); for UIParent:SetAlpha(1); though, because I don't want fade-ins. They're bad for User Experience.

However, after the UI hides, it tends to quickly hide away back again and it seems to be hard to keep the UI visible while I'm active. I want it to not be visible while I'm not active.

What is weird is that the UI is hiding immediately when I talk to an NPC, like a shopkeeper for example.

Once the UI starts hiding, if I start moving it will also not make it stop hiding. It will instead start a loop.

I think the checker should start AFTER three seconds of idleness.

In essence, the UI should not hide when there's any activity going on, and that's not happening.

With the code you provided, the interactions work as intended (except for the wait time that's not yet in the code, and the fade-in that I'd like to be replaced for an instant show). With my edits, they get all clunky. I'll make a separate post for feedback for each code attempt.

Something like

if not (moved mouse/character moved/in combat) -> wait 3 seconds -> AFK!

AFK! -> fade UI over 2 seconds down to 0 (yes, zero)

moved mouse/character moved/in combat -> UI instantly shows (no fade-in)

The code you provided is very close to that.
  Reply With Quote