Quest Tracker Info Panel
Quote:
|
Quote:
|
Well, doing my usual infopanel set up and I have successfully got the watch frame linked to the infopanel. However, it doesn't seem to want to go in the panel. And once the infopanel is set up the watch frame is no longer moveable by nUI.
I'm reparenting WatchFrame which is the main frame for the Objectives window but it just refuses to keep the anchors I give it. I can't see where but perhaps nUI is re-anchoring after I have reparented it. So, for now at least, it isn't possible to move the watchframe into an infopanel. |
You probably need to call nUI_Movers:lockFrame( WatchFrame, false, OBJECTIVES_TRACKER_LABEL ); to unlock the frame so you can move and/or size it. Also have a look in the [ nUI > Integration > nUI_Minimap.lua ] file at the bottom to see the handstands you have to do to move/resize the frame.
|
Hmm, thanks Scott.
I'm doing this at present for resizing so I guess I need to use the title instead of nil. Code:
plugin.sizeChanged = function( scale, height, width ) Code:
plugin.setEnabled = function( enabled ) Will try it out again tomorrow though. |
I think the thing that may be an issue here is that you need a "StartMoving" and a "StartSizing" call after you unlock the frame and before you start trying to change the size. Then you need a "StopMovingOrSizing" when you're done.
Also, you should probably use the label to unlock the frame, but you are correct to not use the label when you lock it back. Otherwise it will appear in the movable frame list when you use '/nui movers' |
One other thing... I suspect that resizing the tracking window to fit the info panel is going to cause issues with "not enough room to track more quests" etc.... not sure how that's going to play out.
|
Quote:
|
Yeah - you would have to make it a child of a scroll frame, but that should be doable.
|
That will be a challenge. I've only managed to do a simple scroll list before.
|
It's actuall fairly straight forward... you just need the scroll pane as a parent to the quest tracker frame and the vertical scroll bar. I have code I've written for nUI6 to do scroll frames for the configuration box. I'll dig it up and when I get home this evening and send it to you.
|
1 Attachment(s)
Hmm, WatchFrame is not movable. Adjusted the mover locking code and added the ismoving etc code thats in combatlog but no dice. And setting the frame as movable just breaks it even more with the mouse not responding to anything else.
Well, with the moving code taken out and just the addition of the frame name on the movers code and a ClearAllPoints call it is now in the right place but too big. As this screenshot shows. Ah, with the FrameName in the movers code it keeps the tracker in the movers list but in the wrong place. Using the nil reference as usual it removes the tracker from the movers list which is what we want. |
You should be able to change the size of the watch frame after you unlock it and after you do the "StartSizing" call on it. Again, look at the "ResetWatchFrame()" method in [ nUI > Integration > nUI_Minimap ] and see how nUI is doing it. All you should have to do is basically copy and paste that method, then change where you are moving it to, what size you're making it and to "lose" the label when you lock it back down.
|
*blush* was looking at the wrong file rofl.
Trying again :D |
Scratch that, sigh, WatchFrame_Expand errors out due to WatchFrame:GetTop() and WatchFrame:GetBottom() both being nil and thus unable to be calculated on.
Although, I may be doing something wrong using it. The Minimap file isn't a great example, not being an infopanel file. Anyways. Here's what I have so far in the 3 main functions. Anything out of place in these functions ? Oh, and this is the version of nUI that fixes the no unit frames error when you login, which I can confirm works as I changed back and started getting the error again, so went back to your fixed version :D Code:
function ResetObjectivesFrame(parent, width, height) Code:
plugin.sizeChanged = function( scale, height, width ) Code:
plugin.setEnabled = function( enabled ) Code:
[2009/12/23 16:50:10-231-x1]: Interface\FrameXML\WatchFrame.lua:341: attempt to perform arithmetic on a nil value: |
1 Attachment(s)
Xrystal --
Here's the scroll frame from nUI6's viewport configuration panel. In short, you want to create a "UIPanelScrollFrameTemplate" frame as the "parent" that you size to fit the info panel. You then would make it the parent to WatchFrame and call the SetScrollChild() method to make WatchFrame the scroll child. Size the Watch frame the way you want it -- not the size of the info panel, but the size of the watch frame "inside" the scroll frame. If you look at the attached code, the master frame you create is the same as the "ViewportConfig" frame in my code. The WatchFrame is the same as the "ViewportConfig.scroller" frame in my code. You should be able to work out what you need from there. . |
Thanks Scott, will work on that attempt next :D see if that helps :D
|
1 Attachment(s)
Well, so thought I'd start over kinda and start with tying the WatchFrame to this new ScrollFrame thingy :D
For some reason it isn't parenting the WatchFrame properly, which could be why it didn't work with the infopanel as I expected. Apart from some slight positioning offsets it is positioning itself correctly but the moment I move the scroll frame the WatchFrame doesn't move with it despite me setting its new parent to it. Here's the code portion that creates the ScrollFrame and Scroller: Code:
-- Create Main Scroll Frame Code:
local function ResetWatchFrame() Code:
local plugin = CreateFrame( "Frame", "Mini_ObjectiveFrame", UIParent ); |
3 Attachment(s)
Okay, managed to get the WatchFrame to reset itself everytime the scroll frame is moved. However, despite the initial alignment being almost correct the moment the scroll frame is moved the alignment returns back to the non scrollframe way.
Edit: Woot, got it to move and stay inside the frame when it moved. Which works until the scrollframe is moved so that the height I specified to the watch frame means the watchframe has to move outside of the box to stay its height. So it looks like it is ignoring the fact it is in a scroll frame or there is something I am missing from your code Scott. Edit2: Well, thought I would test it on a character with more than 1 quest to track :D Screenshot 3 is the result. I guess there is more involved in getting the scroll frame to scroll :D But I'm not sure which of the rest of your code is relevant. |
Xrystal --
If you want, zip up the code you have so far and attach it as a message here -- I'll take a look at it and see if I can sort out what's missing and then post it back to you. |
1 Attachment(s)
Okay, here it goes. Pretty simple but just can't fathom that scrolling stuff. My scroll windows in my other addon just used the Slider object but only used it to scroll through lists. I won't be spending much time on this stuff till probably after the new year. My fiance has got some vacation time so its mega Aion levelling time rofl.
|
I think I'm in love... :p:o:D
|
2 Attachment(s)
Well, playing with the addon while fiance is at family dinner rofl :D
Well, looks like my scrollframe code isn't totally at fault but how the watchframe is working with it. After looking at some code on various sites an Edit Box control has frequently been used as a scroll child. My code is identical functionality wise so thought I would try the edit box out to see if it scrolls. And it does. The downside is that it is somehow too narrow. Barring that though, it looks like I need to find out if the WatchFrame is repeatedly redrawing itself and ignoring any parent frame it is supposed to be working with. Well, figured out the width thing .. now to figure out why the watchframe won't react the same way. |
3 Attachment(s)
Woot, getting there :D
What I had to do was ignore setting up a scrollchild frame and parenting that to the watch frame but tell the watchframe to be the scrollchild itself. It needs some more work though but definitely an improvement :D Edit: Okay, maybe not working quite the way I'd hoped :D Edit 2 : One step nearer. Frame 1 = Standard Container Frame parented to UIParent Frame 2 = ScrollFrame parented to Frame1 Frame 3 = WatchFrame parented to Frame2 and set to ScrollChild Will mean that there is a gap around the watchframe to the container frame but still not properly working as moving the container frame just highlights a different part of the watchframe as if you were scrolling. |
You really like that wall in the inn don't ya ?
Have you looked how it works out when you have a quest that has an useable thingie in the inventory ? Oh and; [chanting]We want beta addon ! We want beta addon ! We want beta addon ! We want beta addon ! :banana::D (Might be the best nUI plug in evah :banana:, no pressure tho:D) |
Rofl, once it does what it should do at minimum I'll throw it out there for you to test :D
Theory is that once I get it working as a standalone addon I can easily plug it into an infopanel :D And nope, not got any quests on my lowbies that use items. And those dratted icon thingies on the left keep disappearing on me due to the fact they are positioned outside of the WatchFrame it seems. But I did manage to add the max of 10 objectives without it kicking up a fuss about space :D So tons of stuff to test the scrolling and display for. Just have to figure out why it refuses to confine its 640 height inside the scroll frame rofl. I would guess though that the item icons appear on the right hand side as for the life of me I cannot get the writing to fill out rofl. Forgot all about clickable quest item icons on there :D |
Xrystal - can I have your babies? ;)
|
rofl, that would be a bit difficult seeing as I would be the one having babies :P If I wanted to :D rofl
|
And her fiance would probably object
|
That too :D
|
Hey, Xrystal. Did you get any farther with this infopanel?? Inquiring minds want to know...
|
Not yet, fiance has been on vacation until today and today I had an appointment for a new course then came back and slept for almost 12 hours rofl.
I'll be trying to tackle that and anything else I stumble across over the next week or two, or three rofl. |
4 Attachment(s)
Well, just in case nUI was exacerbating the issue I made a virgin copy of wow and just had this mini objectives frame addon loaded up. Pretty much rewrote the code with a bit of help from the code Scott posted and one I googled and between the two I managed to get it kinda working the way I expected without nUI loaded. The first screen shot shows it working even if dragged to the bottom of the screen it still keeps the position you had scrolled it to instead of autoscrolling as it did before. The only bugbear I have spotted with this version is that it stops moving the scroll bar on the last segment but takes note of how long you scroll with the mouse and it will take that long to scroll back up to where the quests are. Despite the scrollbar not moving at all once it doesn't have anything else to scroll.
Screenshot 2 shows how nUI deals with it. After some fiddling around with where the nUI mover code needs to go and get refreshed everything seems fine until you move the frame to near the dashboard. I suspect the viewport changes in nUI are affecting the UIParent edge for the frame and its confusing things. Also, I noticed something unrelated but what I was using for testing not working as normal wow does. Look at the micromenu buttons. Even my level 5 characters in virign wow can click on achievements but nUI doesn't let you. I've added the 2 versions of the addon for people to play around with as they choose. Scott, when you get 5 seconds somewhere in your busy schedule if you can confirm whether my suspicions are correct above the Viewport messing with the frame movement results. |
Thanks wonderwoman, going to try it out later today :D
|
Gee... I wonder.... does she wear that tight fitting outfit too?
|
Rofl, if I wore that type of outfit it would be tight .. and not a good sight .. rofl. And even if I was 'fit' to wear it I wouldn't rofl. Heck, even when I had my numerous swimming lessons as youngster I never wore a bikini rofl.
|
Oh yeah Scott. I've not figured it out yet but is there a way for me to say temporarily disable the tracker from being controlled by nUI and re-enable it.
If so, perhaps I could disable it on login and enable it on logout. Thus, I could pretty much use my basic addon without the nUI related stuff which is the working model and then if I re-enable it on logout if they later chose to remove the plugin they would be none the wiser *crosses fingers*. Then of course I could handle it like any other non nUI addon that is placed in an infopanel. |
Well... not really a way to do it on login. But if you don't put your plugin in the table of info panel plugins, nUI will ignore it, or you can just set "enabled" to false which will also cause nUI to ignore it.
nUI processes that table when the VARIABLES_LOADED event fires and when it does, it puts the data into several other tables that are used to control the list of info panels, the rotation order, etc. So in nUI5 there's no way to unwind that... you can only prevent it from happening in the first place. That said -- if your only interest is in preventing the info panel from being shown or hidden by the rotation button, you can be sneaky about that. In the plugin.initPanel() method, you can skip the call to SetParent( plugin.container ) that you use to have your addon be controlled by the container itself which would prevent the info panel button from being able to show/hide your plugin... but all of the method calls would still be made for things like plugin.setScale() etc. |
Ah, thats not the problem Scott.
The code at present isn't as a plugin but it doesn't work properly if nUI is active. Without nUI it is doing exactly what I want it to do. All I can think of is that the little bit of control that nUI has over the watchframe is messing it up somewhere. So I was wondering if there was a programmatic way I can tell nUI to forget it knows about the watchframe so that my addon will work but in case people change their mind about the addon nUI can recontrol the watchframe as before. In particular in non nUI you can drag the frame anywhere on the screen and it only changes the display when right at the bottom of the screen as it realises it cannot display all of tracked item 3 due to space limitations. However in nUI that happens when the frame is dragged down only as far as the dashboard. But then again, it is possible once I infopanel frame it, it won't have that problem. Hmm, yes, think I'll try that later on when I get back from my job searching tasks. |
Ah -- okay -- there are two things that are at play there -- in the [ Interface > AddOns > nUI > Integration > nUI_Minimap.lua ] file (if memory serves me correctly -- I'm at work and can't look) there's a function at the bottom of the file called ResetWatch() or something to that effect. You could stub that function out in your plugin by replacing it with an empty function in your own code.
So if my function is nUI.ResetWatch = function() do this; do that; end you would declare the same thing in your plugin... nUI.ResetWatch = function() end That would prevent nUI from modifying the object frame itself (size, location, etc.). The other thing you would have to do is to unlock the frame using the nUI_Movers function. I believe the appropriate place for that would be in the plugin's init method. |
Quote:
What sorta job you looking for and in what area? I have a few contacts across the US I can maybe give you info on. |
Rofl, well Im in the UK so that wouldn't work rofl. Although once my fiance gets his act together and gets filling in that immigration paperwork hopefully at some point in the *near* future I'll be looking for work there. Near seems to be lasting for the last 4 years rofl.
|
Quote:
|
Quote:
|
3 Attachment(s)
Well this helped somewhat. It still doesn't want to hide the watchframe completely in my window though for some reason but at least it is scrolling through the list. Although the scrolling still needs work. Rofl.
If you notice in one of the screenshots the frame has been moved to the bottom of the screen. Instead of keeping the contents as they were it has moved down the list being tracked as if the frame is just a window of the real frame that is static. Oh well, I'm sure I'll get there eventually rofl. Quote:
|
2 Attachment(s)
Okay, incorporated the almost working scrollable quest watch frame into the infopanel system but unfortunately it isn't working the way I had planned.
As you can see it still is refusing to confine its display to the container frame but instead just doesn't display the text until the container frame is moved over it. |
The first of those two images looks basically right to me except that the top is cut off... I can't tell if that's because it's not scrolled all the way up, or if the top of the objective frame is higher than the top of the container.
If it's the latter, then how are you anchoring the quest frame to the scroll frame? It should have the top left anchored to the top left. |
Thats what I can't figure out.
I am anchoring the TOPLEFT to TOPLEFT and so it should show the top of the quest tracker as I haven't scrolled it at all. However, it seems to think that it is at the end which you can see is caused by the fact that despite parenting the watchframe to the scrollchild it isn't restricting the display. Moving the frame around as you can see from the 2nd screenshot will just highlight the elements of the list that would appear at that position as if the bottom of the watchframe is anchored to the bottom of the UIParent. Changing the value of the WatchFrame height affects how far down the screen it shows but it defeats the object of being able to have it as long as you like, just visibly showing what the frame has been told to show. However, without nUI it doesn't seem to do that, although there are some other things that are not working right that aren't a problem with nUI. Go figure. |
4 Attachment(s)
okay, here are some more screenshots of the frame without the infopanel system. I moved the frame around without scrolling so that you can see the effect moving has. Instead of keeping the top of the list on display, which should be the case if I haven't scrolled anything, it decides to show me another part of the list.
I thought at first that resetting the WatchFrame on moving but that would defeat the object of the scrolling as it would just reset it to the top everytime. |
Have you unlocked the quest frame using the nUI_Movers method call *before* you try to re-anchor it?? Otherwise, it's not anchoring the way you think it is.
|
Yep. And generally the code is identical but I have been fiddling with both so now theyre out of synch again. So I'm gonna go and re-synch them, double check the results in game then post, both lua files ( without the infopanel attachment lua ). In essence they should work identically but it seems theyre not. I'll get back to you shortly.
|
Aha, interesting. The problem I still get without nUI loaded is that it tries to scroll past the end of the list of tracked items ( I assume to get to the bottom of the watchframe ) but the list itself doesn't move, but the scrollbox does. And then, because this isn't working right it then goes and disconnects the watchframe from the moveable scrollframe and until I scroll back to the last tracked item it acts like the nUI added version.
Edit: Another problem is when it reaches the bottom of the screen it decides to all of a sudden reset its positioning to the top of the list. But this could be due to the running out of space and the watchframe running some other code to arrange what gets displayed... hmm... wonder if there are other functions being called. Will have to look into that. Edit2: Ah, testing with and without nUI and the problems are similar, just happens in different ways. In essence it forgets somewhere that it doesn't belong to UIParent. So, it sounds like under certain circumstances it is reparenting back until I do something to get its attention back again. Will take a look at what watchframe.lua does again in case there are some more events and functions that are triggering the reset and tell it to reset mine at the same time. May have to store current position in scrolling list if that is the case so that it is unnoticeable. Here's the code anyway. It should work with or without nUI as I am testing for it before using the nUI commands. Code:
local ObjectivesBackdrop = { |
The first thing that jumps out at me is you are setting the size of the scroll child frame (s) to 2x2 and then using that to parent the watch frame... which sets its width to the scroll child width... which is 2.
I would suggest that WatchFrame should *be* the scroll child, actually. I would unlock the WatchFrame as the first thing I do in setting all of this up. Then I would *not* lock it back down again. So, in CreateScrollFrame I would... Unlock the watch frame Create the container frame Create the scroll frame Set the watch frame as the scroll child Reset the watch frame done |
I did try that way and it worked worse than it is now but I'll try it again. The width on the scroll child gets altered later as it gets filled out to be the same size as the parent frame.
|
If you want, you can ZIP up your plugin in whatever state it is in when you stop tonight (it's, what, 5:30 your time, right?) and e-mail it to me at [email protected] and I'll look at it either tonight or tomorrow morning and see if I can get it working.
|
Okay, the good news is it seems to be working consistently with the following code changed regardless as to whether nUI is loaded or not. However, it still is adamant about sitting in the background as if it is still owned by UIParent.
Thanks for that Scott. I'm gonna spend some time reading through WatchFrame again and see if it is trying to do something else with it based on an event and see if I can trap it happening and stop it. The rest of the code is the same as before. Code:
local function CreateScrollFrame() |
One thing I see is this...
Code:
if ( nUI_Loaded ) then Just put this at the top of your source file... Code:
nUI_ResetWatchFrame = function() end; |
Quote:
I <3 you guys! |
FYI -- I moved this from plugin support to developer chat since it's really more code/design/testing centric than actual support for a plugin.
|
I've already mailed you the copy of the files at its best functionality so far but I did just try this suggestion and if I place that code with or without the test above all my functions the scrolling stops working completely. Only where it is currently does the scrolling work.
Ah, nUI loads up after my addon does and so it replaces my fake function with its real one. Okay, after some debugging it looks like the earliest spot I can put it is when ADDON_LOADED for nUI is actioned. At that point the function has been defined and I negate it. Clearing it before its created gets ignored as it creates it when nUI is loaded anyway. Ah, sudden burst of inspiration, if my addon is loaded before nUI ( the non infopanel version anyway as it seems to be alphabetical ), perhaps if I store the WatchFrame values before nUI changes them then restore them afterwards then do what I want. Although I doubt that will work as the same problem occurs without nUI installed now so will come back to this idea when I am left with nUI being loaded as a problem and see if that resolves it. Quote:
|
All times are GMT -6. The time now is 04:35 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI