Addon_action_blocked
I keep getting this error when out on the Timeless Isle:
Code:
26x [ADDON_ACTION_BLOCKED] AddOn "BasicUI" tried to call the protected function "OverrideActionBarButton1:Show()". Treeston from MMO Champions help me figure out a way to move it maybe it isn't correct. So here is the code im currently using... Lua Code:
I'm wondering if it might need to be a secure hook or maybe I could hide my datapanel when any vehicle UI shows up. Maybe something like: Lua Code:
Still learning so any help would be great. Thanks Coke |
Well, what did you expect? :) You're overiding functions of protected frames.
Secure hook or not ... if you try to move protected frames from unsecure code in combat this action would be blocked. Why don't you move the frames once if the addon loads? Are they re-anchored on the fly during normal gameplay? |
Quote:
But when im not ins a vehicle and just in combat that is when the error pops up, like you said its a protected frame, maybe ill just have to move the datapanel to always show on the top although I really like it at the bottom of the screen. |
All of these lines will break the default UI and spam you with "action blocked" errors:
Code:
MainMenuBar.ClearAllPoints = bottom Code:
hooksecurefunc('OverrideActionBar_SetDefaultAnchor', function(self) Code:
hooksecurefunc("OverrideActionBar_SetDefaultAnchor", function(self) Code:
local queue = {} Code:
DataPanel:RegisterUnitEvent("UNIT_ENTERING_VEHICLE", "player") |
Quote:
Beings that Vehicles and Pet Battle both hide the mainbar I went with the hide option so I had to modify the code a little. Code:
-- Hide Panels When in a Vehicle or Pet Battle I currently have "if not InCombatLockdown() then" to stop tooltips in combat. Is there a "if not InVehicle" or "if not InPetBattle" Thanks again Phanx. Coke |
Quote:
|
1 Attachment(s)
Quote:
I've tried the following: In the main code: Code:
if MainPanel:IsVisable() then In the Stat it self: Code:
if (MainPanel:IsVisable() ~= false) then In the stat in the game tooltip part of the code: Code:
if MainPanel:Show() == true then The reason for 1 main panel and 3 smaller panels on top of the main panel is when setting up the locations for the stat positions it is a little over whelming to try to set up 9 locations vs making 3 panels and then only having to so a left, center and right. Then setting up the width MainPanel:GetWidth()/3 makes them all be the correct size to fit all 3 in the panel. Thanks for taking so much time in helping me. As you can see I thinking im heading in the right direction when trying to figure out and learn new things. When I looked up IsVisable() the example it gave me was Code:
visable = MyObject:IsVisable() Thanks Coke |
Yep, the problem is exactly what I suspected:
Code:
local Stat = CreateFrame('Frame') You later set the parent of the fontstring, but not the parent of the frame, so while the fontstring gets hidden, the frame does not. You should be passing around (and reparenting, resizing, positioning, etc) the whole plugin frame, not just its fontstring. ------ Unrelated to your actual problem, but somewhat important: (1) Having functions with names like "PP" is a really bad idea. Nobody who reads your code to try to help you with it will have any clue what "PP" means, and you yourself will probably forget what "PP" means if you don't look at your code for a few weeks, months, or years. Addons aren't macros. Space isn't limited. Use names that make sense. In this case, after wasting a bunch of time finding where this function is defined and reading through its contents, I'd suggest calling it "PlacePlugin". (2) Also, it's currently a global, along with such gems as "PL", "PC", and "PR", all of which are horrible choices for global variables/names... they're horrible names in general, but they're even worse as globals because if anyone else's addon accidentally leaks its own horribly named "PC" global, for example, it will likely break both addons. And if Blizzard accidentally leaks a global "PC", you could break the entire UI. Even "MainPanel" is not a good choice for a global name. Use unique, descriptive names for globals if you must make them, but avoid making them unless you actually need to. "BasicUI_MainPanel" would be a better choice for the name of this frame, and the left/center/right frames don't need global names at all. (3) Putting the entire contents of your file in your OnEnable function doesn't really accomplish anything other than making your code unnecessarily unreadable, either. It's okay to define things in the main chunk of your file. And finally, I know we've addressed this in at least one of your other threads, but you can't override methods on secure frames. This (and the many other sections like it) will not work: Code:
PlayerFrame.ClearAllPoints = top |
Here's a partial rewrite of your file:
http://pastebin.com/qL6gijfy May or may not work as-is, but should give you some ideas on how to clean up the many problems your code. See comments for what I didn't include. |
Quote:
When I get home this evening I will pastebin the code so you can see it. Thank you for helping a 40 year old, video game playing, none high school graduating, forklift driver to figure out this lua programming. I think I'm starting to see some reasoning for the changes and starting to figure out (tho it may be a little bit at a time) how and why the lua code for wow works. Just my luck 9 years of playing wow and just before they launch their final explanation I'm starting to understand how it works... seems like I might be a day late and 3 Billion dollars short. LOL Again thanks for all your help. Coke |
1 Attachment(s)
Ok here is the code that works, but as you can see in the screen shot I cannot see the text on the bar.
Datapanel Coke |
Just a side note: I hope there is an option to turn off the load spam. It is all well and good to see an AddOn greet you the first time, letting you know it is loaded and working, but I loathe AddOns that continue to spit that spam out with no option to turn it off.
And yes, I have a few of them like that, and it drives me crazy. |
Quote:
|
Quote:
Coke |
Quote:
If you feel the need for a "welcome" message at all, you should only print it the first time a user logs in with your addon (eg. its saved variables are nil). After that, presumably your users are able to remember that they're using your addon, and able to see its frames on their screen; you don't need to tell them over and over that they're using your addon. |
Quote:
Coke |
There still seems to be some leaking globals for BasicUI_Datapanel.lua (checking with FindGlobals). Just a heads up
Code:
function <D:\BasicUI_Datapanel.lua:166,193> (89 instructions, 356 bytes at 0000000000392030) |
Quote:
Well couldn't figure out how to get the text to show so I went this route. Not sure if its any better then the original but everything hides and with a reload im able to adjust the stat positions. Coke |
Quote:
Then do an if/then during ADDON_LOADED (or OnInitialize for Ace3 AddOns). OnInit only fires once, and you would do the following check after you have set up or validated your saved variables. Code:
if BasicUI.message_seen then |
Phanx,
Finally got your code to work. It was missing where to place the text. so I used: Code:
Module:PlacePlugin(db.datapanel.armor, plugin.text) Will have to now recreate all the other stat to make them work as well. Thank You very much for your help. Coke |
All times are GMT -6. The time now is 01:53 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI