View Single Post
04-28-24, 02:53 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,330
Originally Posted by LudiusMaximus View Post
Could you also tell me how to do this in Wrath Classic?
Wrath Classic just has the OnValueChanged script on .scrollBar. The OnMouseWheel script on the scroll frame just calls :SetValue() on the bar, which triggers it.

Lua Code:
  1. AchievementFrameAchievementsContainer.ScrollBar:HookScript("OnValueChanged",function(self,value)
  2.     print(value);
  3. end);



Originally Posted by LudiusMaximus View Post
In general: What did you do to see all the scripts of the scroll bar/box?
Most of what I've done has been tweaking Blizzard code to add features or change how things worked. I've just had a lot of experience in reading Blizzard's UI source code to know where to look to find things. In this case, I looked for the initialization function(s) that are called on load that registers handling user interaction and follow the trail. It helps having an IDE that lets you search an entire directory tree for a keyword.



Originally Posted by LudiusMaximus View Post
Could you recommend a resource where I could learn about the details of CallbackRegistries?
I learned it from reading Blizzard's source code, but Warcraft Wiki has a page on it.
https://warcraft.wiki.gg/wiki/EventRegistry

Note: The linked page appears to be a merged topic on the EventRegistry (aka GlobalCallbackRegistry), but there is a section about the CallbackRegistryMixin.

If you want to see the relevant code yourself:
SharedXML/GlobalCallbackRegistry.lua
SharedXML/CallbackRegistry.lua
__________________
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)

Last edited by SDPhantom : 04-28-24 at 03:21 PM.
  Reply With Quote