Thread Tools Display Modes
01-21-10, 12:13 AM   #21
Amenity
Guest
Posts: n/a
Originally Posted by ChaosInc View Post
Did you make sure to use WatchFrame:IsMovable(true) first?
I'm pretty sure I did, yeah. That was several days and a TON of changes ago. My addon isn't anywhere near the addon it was 12 hours ago. Quite honestly, since my SavedVariable system is working just fine now I've got no reason to go back and mess with it (the Tframe.SetPoint = function() end was where I went wrong, as mentioned above).

EDIT: Code to try

lua Code:
  1. if WatchFrame:GetScript("OnEvent") then
  2.     WatchFrame:HookScript("OnEvent", function() applyChanges() end)
  3. else
  4.     WatchFrame:SetScript("OnEvent", function() applyChanges() end)
  5. end
Ok, granted I don't know much about hooking, but I'm failing to see the functional difference between HookScript and SetScript there (aside from the unlikely event you end up with a nil script...iirc HookScript will DIVIDE BY ZERO OH SHI-).

Also, my positioning was working just fine with WatchFrame retaining its' parent (UIParent). In fact right now as a temporary fix to other issues I'm having, it can ONLY be parented to UIParent:

lua Code:
  1. elseif cmd == 'lock' then
  2.         Tframe:SetMovable(false)
  3.         Tframe:EnableMouse(false)
  4.         point, relativeTo, relativePoint, xOfs, yOfs = Tframe:GetPoint()
  5.         TframeLOC = {point, "UIParent", relativePoint, xOfs, yOfs}
  6.         print("Quest Tracker is now LOCKED")
Dirty as hell I know, but functional.

In terms of simply moving the quest tracker and having it stay at said location, mission accomplished. The issue comes with the collapse/expand button. Click it one and it collapses just fine, click it again and it expands...throwing an "arithmetic with nil" error and refusing to move at all (with the ironic result that after that error, the only thing that is working is the collapse/expand button, with no errors at all).

Also, frame height is borked. You can set it to some arbitrary value (I'm using 500), but it won't auto-size itself anymore. It resizes to its' minimum value and stays there. I haven't gotten around to that part yet, as I'm more concerned with actual function than frame sizing issues (since this is going into a static UI setup maintained at a precise scale setting).

I'm about to log in and start bashing on this little bugger again. God help me. Feel like I need to bring out my rosary...
  Reply With Quote
01-21-10, 12:27 AM   #22
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Here's page 2! (see page 1)

lua Code:
  1. if WatchFrame:GetScript("OnEvent") then  -- does the frame have an "OnEvent" script?
  2.     WatchFrame:HookScript("OnEvent", function() applyChanges() end) -- yes, include this function with existing scripts
  3. else
  4.     WatchFrame:SetScript("OnEvent", function() applyChanges() end) -- no, create "OnEvent" script with this function
  5. end

Hope that clears it up a bit.
  Reply With Quote
01-21-10, 02:14 AM   #23
Amenity
Guest
Posts: n/a
I'm really sick of seeing this (clickeh for teh big):



As it sits right now, the only way I can load up and not fire that error is to have WatchFrame parented to UIParent, its' normal parent (MinimapCluster) or some other random frame (I tried just making a default kgPanel and parenting it to that...it acts exactly the same as parenting it to UIParent, aside from positioning).

I think that the problem has something to do with the WatchFrame size doing funky crap when you use SetPoint on it. If I bash "WatchFrame:SetPoint(wherever)" into my console (after WatchFrame:ClearAllPoints(), in the default UI), it moves the frame but that's when the sizefunk occurs.

I really am beginning to think that all my issues are the result of me just taking the wrong approach in the first place. I'm gonna save the code I have and start over from a new angle.

I just gotta keep telling myself:

"This can be done. This can be done. This can be done. This can be done..."
  Reply With Quote
01-21-10, 02:50 AM   #24
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
So basicly it works fine when you parent it to cup but then it spits out an error on startup? You can get dirty and make a frame with onupdate and parent the frame to cup 2 seconds after loading.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
01-21-10, 01:29 PM   #25
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-21-10, 02:33 PM   #26
Amenity
Guest
Posts: n/a
Originally Posted by Seerah View Post
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:
  1. --Ezra learning to play the bassoon
  2. local function fhqwhgads(self, event, addon)
  3.     if point then
  4.         w:ClearAllPoints()
  5.         w:SetPoint(point, relativeTo, relativePoint, xOfs, yOfs)
  6.         w.ClearAllPoints = function() end
  7.         w.SetPoint = function() end
  8.         w.SetAllPoints = function() end
  9.         --w:SetHeight(500)
  10.         print("aTRACKt loaded.")
  11.     else print("Come on, fhqwhgads...")
  12.     end
  13. 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

Last edited by Amenity : 01-21-10 at 02:36 PM.
  Reply With Quote
01-21-10, 03:30 PM   #27
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
A frame can have multiple anchor points (which the WatchFrame does). If you do not call ClearAllPoints() on a frame when setting a new point, you *add* to the existing anchor points. So... In your screenshot above, the WatchFrame is anchored to its default points of below the minimap and the bottom-right corner, and your new anchor point(s) on the left of the screen. This has stretched it across.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-21-10, 04:08 PM   #28
Amenity
Guest
Posts: n/a
Originally Posted by Seerah View Post
A frame can have multiple anchor points (which the WatchFrame does). If you do not call ClearAllPoints() on a frame when setting a new point, you *add* to the existing anchor points. So... In your screenshot above, the WatchFrame is anchored to its default points of below the minimap and the bottom-right corner, and your new anchor point(s) on the left of the screen. This has stretched it across.
D'OH! I hadn't even considered that possibility!

Now it seems like it should have been obvious...I mean, GetPoint does contain an argument.
  Reply With Quote
01-21-10, 05:44 PM   #29
Amenity
Guest
Posts: n/a
Woot, beta's uploaded.

aTRACKt - Move the Quest Tracker!

And really, this thing is more you guys than it is me...I just happened to stumble across a combination that worked. If you want to put out your own (undoubtedly better) addon, I've got no problems with removing mine.
  Reply With Quote
01-21-10, 06:13 PM   #30
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Well, I'm glad you got it sorted out
If I ever get happy with my one once I have it working with nUI I may upload my one as an alternative seeing as mine does something other than just move it but will see. The non nUI version was just a building block en-route to the final product
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-21-10, 06:50 PM   #31
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Yay!

I got some more work done on mine this afternoon and still plan on releasing it, but there's no reason for you to remove yours.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-21-10, 11:40 PM   #32
Amenity
Guest
Posts: n/a
Taking some time to elaborate here.

After Seerah so gently pointed out that I was being a retard, I thought about it for a bit and decided that I should figure out where the other point was and see if I could do something with that...which ended in dramatic failure. (lolparentchainofdoom)

So I figured my best bet was to try to figure out how WoW was handling the sizing and replicate it. Welllll...it was a lot more complex than I figured it would be, but I did manage to come up with this:

lua Code:
  1. local maxHeight = (w:GetTop() - w:GetBottom())
  2. local maxWidth = WatchFrameLines:GetWidth()
  3. w:SetHeight(maxHeight)
  4. w:SetWidth(maxWidth)

So far, so good.
  Reply With Quote
01-22-10, 12:22 AM   #33
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The WatchFrame's actual default height is determined by its two anchor points. Think of it this way. You have a wall that is 10 feet hight. You want to paint it red, and you want the red to start 1 foot from the ceiling, and 2 feet from the floor. What is the height of the red portion of your wall? Answer: 7 feet.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-22-10, 04:22 AM   #34
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
*slaps head* Thanks Seerah, that is one thing I never double checked on my code. I think I reanchored but probably not completely enough for it to remove the bottom anchor at the bottom of the screen.

*forgets shes only had 4hrs sleep and gets back to dabbling with scrollable quest tracker* rofl

Edit: D'oh, nope, thats not it. Back to the drawing board.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 01-22-10 at 04:26 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Ok...I officially give up. I'm stuck and need help with the dumbest thing ever.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off