Go to Page... |
Thread Tools | Display Modes |
11-30-22, 10:54 PM | #1 |
Trying to fix "Addon tried to call the protected function frame:SetPoint()"
I'm working on a simple addon that puts a little hotbar under your personal resource display so you can easily track your procs and cooldowns of the common abilities. I'm frequently getting the following error in bugsack, occurring when the personal resource display appears and the addon ties to attach its frame to it. It seems to mostly occur when there's some kind of state change like just landing from a ferry, a targeted NPC turning hostile which forces the bar to appear, etc.
[ADDON_ACTION_BLOCKED] AddOn 'Handybar' tried to call the protected function 'Handybar_Frame:SetPoint()'. So,what my addon is doing is creating an event frame and main frame for the addon as such: Lua Code:
Then, in InitializeHB() (which is called from the event handler a few blocks down) I'm creating the ability icon frames and aligning them up on the main frame, with iconList just being a list of action bar slot IDs I'm hardcoding per character in my script for the time being: Lua Code:
Now here's my event handler. The SetPoint() on Line 7 here seems to be where the error is getting thrown. Lua Code:
This code is largely copied from Weakauras' PRD attaching code, however it's possible that I didn't quite catch something. Is there anything obvious I'm doing wrong here? If it would be helpful I can pastebin the entire lua file or something as well. This has been my dream addon for a long time and I'm working on hard on getting it stable enough to share. I did as much research as I could, but all the google results for this error are just talking about sending it to the addon devs and I couldn't find anything about it from the dev perspective. |
|
12-01-22, 01:34 AM | #2 |
You cannot affect movement (setpoint) or visibility changes (show/hide) on secure frames in-combat.
You'd need to use a secure header to control visibility (within the macro system options constraints). But it looks to me that your problem has a much easier solution. If your buttons that you are trying to attach to your personal resource display are not meant to be clickable to cast but instead just show cooldown and such information about your abilities, you do not need to have them inherit secure templates `SecureActionButtonTemplate` and you'd sidestep the whole problem. |
|
12-07-22, 12:12 AM | #3 | |
Lua Code:
and I'm still seeing the problem. Is that still not set up correctly? My goal here is to just create a frame that looks exactly like an action bar slot but is not at all interactive. Alternatively, I'm looking into headers here but I don't see anything about headers for the buttons, they seem to do very particular things relating to other stuff like party frames and buffs/debuffs. |
||
12-09-22, 05:44 AM | #4 | |
|
||
12-09-22, 01:42 PM | #5 |
Yeah, I've been doing a lot of research and experimenting with this since then and that seems to be the case.
It's starting to look like what I'm trying to do here maybe isn't really possible, unfortunately it's just a symptom of the fact that the PRD can potentially be a new frame every time it appears which forces me to call SetPoint in combat occasionally. I might make a new thread for this just because the focus has evolved and the subject doesn't have anything to do with what I'm trying to do anymore, but are there potentially any ways to display a non-clickable moveable action bar slot that doesn't care about taint? Or alternatively would there possibly be some trick to snap my frame to the PRD maybe like right before InCombatLockdown ticks on? |
|
12-09-22, 08:51 PM | #6 |
You essentially want to replicate the visual appearance of actionbuttons without making them secure frames.
If they are not secure frames then anchoring them to your personal resource display in-combat or not is not an issue. So shift your focus to that would be the suggestion. The easiest way would probably be to create a "actionbutton lookalike" display with weakauras and anchor it to that frame. Example: https://wago.io/9HqgUhL-q |
|
12-12-22, 05:58 PM | #7 | |
For now I've found a "good enough" solution by just setting the PRD to always be visible, alternatively I might just anchor the displays at a fixed point onscreen and get used to viewing them like that instead of moving with my health bar. I would still love to find a way to snap these to my PRD and have it properly hide/show if possible, but if it's not possible, I can live without it. |
||
WoWInterface » Developer Discussions » Lua/XML Help » Trying to fix "Addon tried to call the protected function frame:SetPoint()" |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|