I designed this addon in August of 2010 and eventually got it working great before Cata came out. Since then I haven't had much computer access and something with the addon is now broken, just to clarify, it use to work just fine with no errors before the patch.
The problem now, at least the major one, is that one of my saved variables for the location of the minimap button does not want to load. Here is the xml code:
out_frame("Binder is Loaded. Use /binder to open window");
-- THE PROBLEM IS RIGHT HERE...THE ADDON_LOADED THING IS NOT HAPPENING
self:RegisterEvent( "ADDON_LOADED" );
SLASH_BINDER1 = "/Binder";
SlashCmdList["BINDER"] = function(msg)
if ( event == "ADDON_LOADED" ) then
It is probably a very simple change they made to the way addons work or load or something. I would greatly appreciate a link to somewhere that lists changes between patches.
That function is fine. It even loads a matrix of variables. but for some reason will not load the character specific variables. Please look at the code and help me out. I have used bug sack and buggrabber and they both don't detect any errors dealing with this.
Currently the addon will not even load the default location I have set for the mini map button. which should be a bit off to the left of center screen but it always ends up dead center on load.
Thanks for everything
As a side note, the button tends to be on top of things like cinematics and such...I have tried setting the frame strata to low and even removing it...but it isn't working.
if ( event == "ADDON_LOADED" ) then
Event handlers and other frame scripts are no longer passed global "this", "event", and "argN" variables. This change was made when Cataclysm was released, so your addon should have been broken at that time. You need to change your code to use the local variables that are passed as arguments to your frame script:
Great, thanks a ton. That worked perfectly and I was also able to fix the bug where it wouldn't remember the state of a checked button.
I have noticed a couple times, and i'm sure others have, that the button is visible in cinematics and such. Where is the setting to hide it... it should be in the mother frame for the button correct? How do I get it to disappear along with the rest of the ui?
It has occurred to me, after some testing, that the button also will not hide upon pushing alt-z. I think this is due to the fact that I have not set the parent to the UI, but when I do that, the button gets too small, and doesn't follow the mouse when dragging it.
To be more specific, you should always parent your frames to the UIParent, or to some other frame whose chain of parentage ends back at the UIParent. This will ensure that your frame is only shown when the user interface is shown (eg. not during cinematics, and not when the user hides the UI with Alt+Z).
Okay, so I will go and set the parent as the UI. I guess then I just have to go back and redo my math for boundries of the mini-map button and its size. I was having an issue with it last time I tried that. It seemed to think the screen was a lot smaller than it actually was, and I was having a problem getting the mini map button to be in the same place as the cursor. I will post the code in a bit when I fix some things.
well I can give you a hint on why it thinks your screen is a smaller size. From what I have read the game always sees the screen as xxx * 768. it is scaled up to your screen by some ratio and the width is set by your monitor size so mine would be like 1230 * 768 instead if 1920 + 1200. You can see this effect in game if you type /fstack and watch the screen pointer co-ords. you could do the following to get the screen ratio.
I figured it out, thanks everyone, the problem was simply what I was applying the UIParent:GetEffectiveScale() to, with some rethinking about the math and some testing I finally got it working right. It worked the way I had it before simply because the scale was being applied to the button differently because it was not a child of the UI.