FauxScrollFrame Issues
I have used FauxScrollFrame for my Updates Splash Frame in my new UI addon and it works fine .. The base frame is shown, with the scrollframe inside it, with the fontstrings containing text or emptiness as required.
I then copied the functionality over for my profile list in the options screen and changed the appropriate variables and after opening the options screen, selecting the addon, then the profile page ( in this case ) it then shows the caption and scroll frame but no fontrstring contents. Framestack shows the individual fontstrings in both frames so they are being created and I have hard coded them to show regardless of content, so , should show whatever the text is. If anyone can see something that I have not noticed for some reason (despite going through it several times and it being a copy and past with appropriate changes made) it would be appreciated. Splash Screen ( FauxScrollFrame segment ) XML and Load/Update lua code blocks Lua Code:
Lua Code:
All this does is extract the relevant changes to the addon since the last update and displays it on the screen. Very basic at the moment and I tell it to display it every time rather than only if the version is different. So I know it works as expected still ... Now, the options screen's profile management page, is supposed to have the same type of scroll list except instead of contact version update text it is supposed to contact a list of profiles that exist ( there is always at least one - the built in one ). Here is the equivalent code for this part of the addon. Lua Code:
Lua Code:
As you can see I even tried hard coding text to display and nothing is showing up at all even though I am using the same fontstring template code which is as follows: Lua Code:
The templates are loaded first so that anything that needs them can access them so that isn't the problem. Thanks for reading all the way day. Any thoughts are appreciated. I know it might not be the best way but it worked the first time round so was expecting it to work the second time round. |
I haven't figured out exactly what your issue is yet - but I will point out things that I see.
In OnLoad you are creating too many fontstrings. The whole point of FauxScrollFrame is that only the visible items have widgets assoicated with them. It is like a window on your data So this doesn't seem ritght Lua Code:
What you should be doing in your update is iterating over FauxScrollFame's list of items, and changing them to suit where your current window into the data is. So lets see how big your window is. According to what you tell FauxScrollFrame here Lua Code:
Here's the signature: Lua Code:
You have 50 data items, and you want to show 1 item at a time. So there is an issue. So what you are supposed to do in your Update function, is get the offset, and use that as the starting position in your data array, then you iterate over the FauxScrollFrame's items, and set them to show what is in your data array. That way you don't have to create 50+ fontstrings. I don't currently see the connection between your fontstrings and the FauxScrollFrame's items. Whatever the number you pass as the numToDisplay parameter is the number of fontstrings you should create. Don't create any more than that. What people normally do is define a constant NUM_DISPLAY_ITEMS, then use that to create the items, and to pass in the Update method Hope that helps! |
Hmm thanks for the info on
Quote:
Aha, this is where I got that code from. https://wowwiki.fandom.com/wiki/Maki...lFrameTemplate I can't imagine why I used 1 .. unless I thought it meant how many lines per entry. It was a long while ago so that reasoning is foggy I am afraid... anyway I will look over it again and make sure the values are what I expect. Based on my usage it should be something along the lines of : 50 max items in the Data List. 16 or however many it lets me fit into the area I want to use as the display, and 12 as the height of the line. Creating the fontstring should use the display count, update loop should use the display count, but use the list count to know whether I have reached the end of the list. Quote:
The FontString template used in the fontstring creation has a parentKey of List. It is parented to the ScrollFrame ( self.ScrollFrame in the functions ). However, the problem I was having is that one frame works and the other doesn't even though they are literally copy and paste xml and lua code blocks with just the main frame names and array names changed accordingly. Maybe the problem is that on the profile list in the options screen I only have 1 item .. maybe that is too few for it to work .. 50,1,12 should have worked regardless of how many I was creating as I only had 1 item to display. But 50,1,12 also allowed me to display 6 items on the screen... so maybe that value isn't set in stone and the items will still display regardless as I have a 1,50 loop being used. Anyway, thanks again, and I will take another look and maybe setting it to what it should be may solve the problem I am having somehow .. I hate those types of solutions but I can't complain if it does work rofl. |
Unfortunately, changing the loop counter to 16 and the FauxScrollFrame_Update parameters to 50,16,12 didn't make a blind bit of difference.
The Splash screen is still showing it's 6 items as before, no difference whatsoever. And the profile screen is still showing nother except the scrollbar and the scroll frame border. None of the individual text lines on the profile are showing at all. This is now the changed blocks of code: Lua Code:
Lua Code:
As you can see they are almost identical. So, should work in an almost identical manner but it doesn't. Could this be caused by how the Options screen works with those special config panel functions ? Lua Code:
Panel Functions - At present only the title is updated .. I tried updating the Scroll Frame here but it didn't make a difference either. Lua Code:
|
So I would define
Lua Code:
Then in OnLoad Lua Code:
And In update: Lua Code:
|
Yes, I probably will at some point .. I need to get it working like the other one works first though.
Tried looking at https://www.townlong-yak.com/framexm..._BindingUI.lua and https://www.townlong-yak.com/framexm..._BindingUI.xml As that is the nearest to what I am doing but the code is considerably more different to mine to see what they are doing different than me .. outside of the whole frame rofl. SplashScroll works fine... fonts are visible with no additional effort. ProfileList doesn't show the text .. it scrolls, the fontstrings are created, they just aren't visible .. on this frame. so why not ???? Hopefully these images will explain what I mean Splash Screen Image Profile List Output Image Confused.com rofl |
Yeah. I can't see it from the code that you have shown. If you have a repo - post a link
|
Quote:
I don't have a repo .. but have uploaded it to the project on here for it. https://www.wowinterface.com/downloa...velopment.html It's going to be a big project but the code you need to look at are the Features/Profiles and Features/Splash folders apart from the main addon files the rest shouldn't have any direct involvement with the files. |
self.ScrollFrame:GetWidth() returns 0 in XrystalUI_ProfileList_OnLoad, you can use anchors instead:
Lua Code:
|
Your fontstrings aren't fully anchored. They only have 1 point anchored TOPLEFT.
They should also anchor on the right side of the scrollframe Code:
if i == 1 then |
hmm, they have their width and height set at time of creation, to go with the anchors so should have worked together. I'll have to take another look to see of i messed that part up on the profilr part of the code.
Thanks. |
Thanks for that independent view of the code.I clearly didn't think outside of the box enough on this one rofl.
As I suspected, that can't be the reason one works and the other doesn't. Both scroll frames have access to the same template with the initial TOPLEFT anchor. When the fontstrings are created BOTH scroll frames specify the height and width based on the container they are in. This is supposed to be the equivalent of specifying a TOPLEFT and BOTTOMRIGHT anchor system. However, seeing as I assume it worked, I made the change anyway .. as follows: Lua Code:
This seems to work as expected. I can't understand why the Splash Screen worked without the change and the Profile List worked after the change ( without affecting the Splash Screen ). I double checked the code yet again in case I missed something connected to the anchoring and sizing system but nada .. they were identical. The only difference is that the Profile List is being housed into another frame created by Blizzard which may not be definied in the same way the UIParent is that my Splash Screen sits on. I will have to remember to bear that in mind when something similar crops up. The question will always remain with why one worked and the other didn't... the mystery still exists. But at least it works now, so thanks. |
Quote:
Could be that XrystalUI_Splash has a size and an anchor point, while XrystalUI_Config_ProfileManager does not. This could lead to the 0 width problem you observed. Lua Code:
|
Quote:
XrystalUI_Splash plugs into UIParent and is the equivalent of XrystalUI_Config_ProfileManager which plugs into Blizzards Config system. As far as I know you don't specify any anchors or sizes as Blizzard does the work for you as soon as you tell it to add it to the Config system. It does appear that the problem is due to how the two systems work. The example from Blizzard doesn't include anchors etc on their guide to using it on the beta code .. https://github.com/tomrus88/Blizzard...tionsFrame.lua Which would confuse things. However, https://wow.gamepedia.com/Using_the_...s_Addons_panel does specify that FrameXML will reposition it and not resize it, which is what I assume it did, resize it to fit into their main panel. Lua Code:
Oh well, it works now, and at least I can walk away knowing that the mystery is solved. I may end up hitting it again down the line so hopefully I will come across this post which will remind me why following the examples didn't work rofl. But seeing as I usually copy from an existing addon of mine that I know does what I want rofl .. it shouldn't be a problem anymore rofl. Anyway thanks again. |
All times are GMT -6. The time now is 12:25 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI