WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   How to allow scrolling in combat? (https://www.wowinterface.com/forums/showthread.php?t=52588)

Nimhfree 08-08-15 07:03 PM

How to allow scrolling in combat?
 
I have a ScrollFrame that inherits from HybridScrollFrameTemplate. In it I am displaying buttons that inherit from SecureActionButtonTemplate. I can control setting the values by detecting when I am in combat. However, if someone tries to scroll while in combat an error is thrown:

1x [ADDON_ACTION_BLOCKED] AddOn 'Wholly' tried to call the protected function 'com_mithrandir_whollyFrameScrollFrame:SetVerticalScroll()'.
!BugGrabber\BugGrabber.lua:589 in function <!BugGrabber\BugGrabber.lua:589
[C]: in function `SetVerticalScroll'
FrameXML\HybridScrollFrame.lua:195 in function `HybridScrollFrame_SetOffset'
FrameXML\HybridScrollFrame.lua:30 in function <FrameXML\HybridScrollFrame.lua:29
[C]: in function `SetValue'
FrameXML\HybridScrollFrame.lua:67 in function <FrameXML\HybridScrollFrame.lua:57

I am not actually calling HybridScrollFrame_SetOffset within my addon code, but it is being called automatically by Blizzard code when scrolling happens.

Basically the whole frame setup is not secure, but the buttons need to be since I have them have macros set to target NPCs. As one plays in the UI, those buttons will have their specific macro values changed. I should be able to delay reseting the macro values until out of combat if the user were to change the the display while in combat.

So does anyone know if there a way I can get the scrolling not to give me an error?

Seerah 08-08-15 07:35 PM

The whole frame would need to be secure, since it's controlling which buttons are showing at which moment.

Nimhfree 08-09-15 03:39 PM

Do you have any suggested reading I can do because I have been searching on the net for a way to try to make my ScrollFrame secure, and experimented around a bit with no luck. Can I just make the ScrollFrame that contains the secure button secure, and not worry about the other frames? For example, in one UI version I have three scroll frames, only one of which contains secure buttons. I was hoping to not need to make the other scroll frames secure (assuming I can figure out how to make the one with secure buttons secure).

semlar 08-09-15 03:57 PM

Rather than inherit from the existing scrollframe template, you need to reproduce everything that it would normally do inside of the restricted environment.

If you're new to secure handlers, you might want to skim over iriel's field guide.


All times are GMT -6. The time now is 05:56 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI