WoW-Pro Guides

WoW-Pro Guides

3M Downloads

Remembering Location/Size

CodingDino opened this issue ยท 11 comments

commented

At some point the addon lost it's ability to remember it's location and size on log out. I don't know what happened and I can't seem to fix it. I can probably brute force it by saving it as a setting in the profile, but I don't really want to when Blizzard automatically remembers that for you. Grrrr...

Silvann if you get a chance to look at it, I'd really appreciate it. It's the Cata branch I'm speaking of.

commented

Will do. I think I know why (in theory), but can't test it right now.

commented

Ah, okay. Well we can create them before OnEnable. Honestly I'm not really sure what I was thinking when I moved it in there.

commented

Yeah, so the problem is, Blizzard applies what location and size it remembers before the addons' OnEnable function is called, i.e, before the frames are even created. So, we should either brute force it as you suggested or create the frames outside of functions (like it was before) or some other more elegant solution that I'm still trying to find, hehe.

commented

Hmm, OnInitialization is also too late, soI put the anchor and main frames creations outside of any functions, to run when they are encountered by WoW. But since only the MainFrame pos/size gets recorded by Blizzard, I have to delete these lines in ResizeSet() function:

WoWPro.MainFrame:ClearAllPoints()
WoWPro.MainFrame:SetPoint("TOPRIGHT", WoWPro.AnchorFrame, "TOPRIGHT")

Do you remember why you did add them? Will it break anything else if we remove those lines? If so, I'll think in other ways...

commented

Regarding the ResizeSet function... I'm assuming it had to do with my ongoing battle with getting the addon to anchor correctly after being moved. But they may no longer be needed. Try removing them and then experiment by moving the addon around a bit and increasing the number of rows when set to auto-resize, and see if any strange behavior results.

commented

This now works only if I reload while in scroll mode. On the auto-resize setting, the frame position is still lost :(

commented

Oops, missed that. I'll check that later.

commented

No worries! Thanks for looking into it :D

commented

Weird, I'm not able to reproduce that. Let's see what's different... if you keep, say, all the options on default (so with auto-resize), the frame position is lost? Does this happen in Cata beta?

commented

Cata beta and also with the recorder enabled, so that may be it. Going to test more.

commented

Seems to be working fine now, I dunno what was going on before.