View Single Post
05/10/22, 12:23 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,971
I'd check what keybind is used for the zoom in and zoom out at the controls, chck that at the lua file where the settings menu for those controls are created (keybindings) and check what function is used there.
Maybe you can use ZO_PreHook or SecurePostHook on it to react on the zoom change then.

esoui/ingame/globals/bindings.xml
<Category name="SI_KEYBINDINGS_CATEGORY_CAMERA">
<Action name="CAMERA_ZOOM_OUT">
<Down>CameraZoomOut()</Down>
</Action>

<Action name="CAMERA_ZOOM_IN">
<Down>CameraZoomIn()</Down>
</Action>

Func names are CameraZoomIn and CameraZoomOut

Test if they are protected via IsProtectedFunction("CameraZoomIn") or not.
Looks like it isn't so a SecurePostHook should/could work.

Lua Code:
  1. SecurePostHook("CameraZoomIn", function()
  2.     d("Zooming in")
  3. end)
  4. SecurePostHook("CameraZoomOut", function()
  5.     d("Zooming out")
  6. end)

Yep, tested, works

Last edited by Baertram : 05/10/22 at 12:26 PM.
  Reply With Quote