Originally Posted by Seerah
The code in WatchFrame.lua is attempting to do some arithmetic on line 341. That line is:
Code:
local maxHeight = (WatchFrame:GetTop() - WatchFrame:GetBottom()); -- Can't use lineFrame:GetHeight() because it could be an invalid rectangle (width of 0)
Your changes are making one of these numbers (either GetTop or GetBottom) not valid (nil) at the time this attempts to run. My solution in the addon I've been working on for the past couple weeks (it'll get finished eventually ) is to delay my code from running until after the Blizz code is all finished with what it needs to do. I register for the PEW event, and use an OnUpdate script to run my code a second after that. I haven't tried using PLAYER_ALIVE, though.
|
Yeah, I mentioned that line doing some funky math earlier. PLAYER_ALIVE isn't fixing the sizing issue, though. I'm not familiar with PEW...and all my searches for it just return stuff like "SHARKSWITHLAZORBEEMZPEWPEWPEW". **EDIT: Just realised you meant PLAYER_ENTERING_WORLD. I'm an idiot.**
However, I've very nearly got it now. I got up today and made myself a nice breakfast and a cup of chamomile tea, blasted some Massive Attack to block out distractions (heart Mezzanine!), and started over from scratch. Good in, good out.
Right now I have everything working except for this sizing issue, with no errors. If I just wanted it to have a static size it'd be mission accomplished...but that's not what I'm wanting to do. However, after some experimentation I've noticed some weird behavior in my SetPoint function:
lua Code:
--Ezra learning to play the bassoon
local function fhqwhgads(self, event, addon)
if point then
w:ClearAllPoints()
w:SetPoint(point, relativeTo, relativePoint, xOfs, yOfs)
w.ClearAllPoints = function() end
w.SetPoint = function() end
w.SetAllPoints = function() end
--w:SetHeight(500)
print("aTRACKt loaded.")
else print("Come on, fhqwhgads...")
end
end
As that sits right there, the watch frame (w) is at its' (from what I can tell) minimum height, and does not resize for quests. However, if you comment out w:ClearAllPoints() it does, but you get...well, the only way you'll really get it is if I just show you (click for biggeh):
Notice under the minimap? Also, only one of the circular buttons on the tracker?
However, they all work...
Odd thing is...I can't figure out
how they're there (let alone
why):
Etc, etc. The collapse/expand button is directly parented to WatchFrame, and all the other buttons are attached to it in a rather convoluted way (they're parented to a line, that parents through all the preceeding lines to WatchFrameLines, which is parented to WatchFrame). I don't get it.
Also, my function is running A LOT. Like, at random times it'll just run itself anywhere from 3-15 times all at once. Don't get that, either...though it's probably improper use of something or other.
Gonna take a break from it for a bit and come back to it. Here's a pastey with what I've got so far:
http://pastey.net/131769