Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
I'm sure I'm missing something simple here. I have about 30 skills in 4 categories. I want to display those separately on the Skills tab, and have their height set to display all of the items on the list. Here are two of the portals:
Quote:
|
|
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
Ah. Found an easy way. Ran Autoplace on each item, then moved them.
Quote:
|
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Actually, let me give you the newer code that hasn't made its way to the wiki yet.
Code:
autogap = 10 perform portal[skCSkills].batchadd perform portal[skPSkills].batchadd perform portal[skMSkills].batchadd perform portal[skSSkills].batchadd perform batchplace height = autotop |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
That will automatically place all the portals that are loaded into the batch, trying to give each one a reasonable fraction of the available vertical space, but not more than their own height needs - none will get less than 2 or 3 items showing at a time, so that there's a visible scrollbar that the user can manipulate (unless you give HL more portals than will actually fit in the available space, so that everything has to be squished).
Note that the autogap = 10 line is redundant, because the autogap defaults to 10. Each batchadd has an implied batchadd[autogap] to tell HL how big a space you want above this portal, if anything else is above this portal, but you can also specify different numbers on a portal-by-portal basis: batchadd[15], for example. |
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
I've set up the batch add as follows (commented out code at the bottom was the autosizing code):
Quote:
Last edited by Duggan; July 21st, 2017 at 05:02 AM. Reason: Adding complete code |
|
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Why the height="0" line in the third line of that portal? You don't have that line on the other portals, so I'd see if that's what's causing the weird behavior.
|
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
Quote:
It kind of looks like another table overlaying it. If you look at the right-hand side, you can see where the "real" table is sticking out, and if I click on the info button areas to make them show up, it's out of sync with the lines. If I reveal parts of the table by clicking on them, I can usually also make all of them go away and show that blank list by clicking into certain parts of the empty space. This overlay does not happen if I only add one item. It does happen if I add two. Also, no matter what order I do the Batchadd, it's always the first table that gets it. While fiddling around with adding the tables more manually, I also have once or twice had that first table show up with no lines, and not obscured, but if I click in, the lines appear. I don't know what that might mean. Last edited by Duggan; July 21st, 2017 at 09:00 AM. |
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I'd look in other files - see if there's any other visual elements related to skills or the skills layout that could be interfering with this.
I can't see anything else that looks odd about this. Try setting the visibility of each portal to 0 before the batchadd portal[skCSkills].visible = 0 That way, perhaps whatever's behind all this will become visible, which will hopefully help you find it. |
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
Setting them all to not be visible results in a blank page. Making any one of them visible still causes no problems. Add 2 and the batchadd results in the issue. I tried manually arranging them in height order by changing the "top" value and it worked fine, but only if I had an offset of at least 3 pixels. That led me to re-add the "redundant" autogap statement back in and that that fixes it. Somehow, the autogap was starting as 0.
So, problem solved, and we may have both learned something from this. If I were to bet, there's probably something to do with the selection outline, but that's sort of spitballing it because I don't know how your code works. |
#10 |
Thread Tools | |
Display Modes | |
|
|