I did not found any direct event for being "idle".
But you can try to track the absence of non-idle events using EVENT_MANAGER:RegisterForAllEvents
All you have to do is to find out all event-codes not affecting your idleness.
Once your timer thinks you are idle due to not getting non-idle events double check it with:
idle = SCENE_MANAGER:IsShowing("hud") and not IsUnitDead("player") and IsGameCameraActive() and not (IsPlayerMoving() or IsUnitInCombat("player") or IsInteractionCameraActive())
I currently do a PoC.
|