Thread Tools Display Modes
08-08-15, 07:03 PM   #1
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
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?
  Reply With Quote
08-08-15, 07:35 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The whole frame would need to be secure, since it's controlling which buttons are showing at which moment.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-09-15, 03:39 PM   #3
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
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).
  Reply With Quote
08-09-15, 03:57 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
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.

Last edited by semlar : 08-09-15 at 04:00 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How to allow scrolling in combat?


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