Quantcast
Screenshot timing issues - WoWInterface
Thread Tools Display Modes
05-09-16, 01:12 AM   #1
yoshimo
An Aku'mai Servant
Join Date: May 2006
Posts: 30
Screenshot timing issues

Having a screenshot taken automatically if achievements or their criteria are earned seems rather easy if you tie the screenshot function to the event.
What i do not understand is how you make sure that the achievement frame is neither still flashing golden and has no text and no icon in it nor that it has already began to fade out.
To me it seems that it is depending on the speed of the computer of its components and the amount of addons loaded, isn't it?
Having a static delay of a second also doesn't seem to be a good choice either.
  Reply With Quote
05-09-16, 01:48 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,929
If you hook the right functions, you can get the screenshot to activate perfectly each time.

Lua Code:
  1. local Hooked={};
  2. local function OnFinished() RunBinding("SCREENSHOT"); end
  3.  
  4. hooksecurefunc("AchievementAlertFrame_SetUp",function(frame)
  5.     if not Hooked[frame] then
  6.         if frame.glow then frame.glow.supressGlow=true; end
  7.         frame.animIn:HookScript("OnFinished",OnFinished);
  8.         Hooked[frame]=true;
  9.     end
  10. end);

This catches when a dynamic achievement alert frame is shown and hooks the animIn animation to take a screenshot when it finishes fading in. This also tells the frames to suppress the glow animation so it doesn't interfere.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
05-14-16, 05:51 PM   #3
Hiketeia
An Aku'mai Servant
 
Hiketeia's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 33
Pretty! I used to use 'Multishot' addon but it broke a while back. Thanks for sharing.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Screenshot timing issues

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