Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

14th item slot blank (Inventory Menu script)

5 years ago

I've discovered my Inventory Menu script is causing item 14 to disappear.

I was testing out some items, and I noticed that no matter what happens, the 14th item slot (the second item in the third row) is always blank. If I use an item, the item that was previously in the 15th slot (third item in the third row), moves the the 14th slot and disappears. I have no script with respect to these particular items other than using ITEMSTATE to make them appear in the inventory at that point. I DO, however, have the following script regarding the item window: (all < or > changed to [ and ] )

IF %ITEMMENU = 1 THEN

$PAGETEXT :="[style] table, table table tr:nth-child(3) td:nth-child(2) {visibility: hidden;}

table table tr td {visibility: visible;}

table td:nth-child(4) {visibility: visible;}

[/style]" + $PAGETEXT

ELSE IF %ITEMMENU = 0 THEN

$PAGETEXT :="[style] table, table table tr:nth-child(3) td:nth-child(2) {visibility: hidden;}

table table tr td {visibility: hidden;}

table td:nth-child(4) {visibility: hidden;}

[/style]" + $PAGETEXT

When I delete that block of script that makes the Inventory borders invisible, the problem is solved and the 14th item is visible, so clearly the hide the inventory border script is causing the problem.

Anyone care to guess what part of what is in (or isn’t) in the above script is causing the problem?

14th item slot blank (Inventory Menu script)

5 years ago
table, table table tr:nth-child(3) td:nth-child(2) {visibility: hidden;}

The tr:nth-child(3) td:nth-child(2) portion quite explicitly selects the third row, second data cell. I don't know what HTML you're using, but if removing that line solves the problem without affecting anything else, go for it.

14th item slot blank (Inventory Menu script)

5 years ago
Thanks. I deleted exactly this in only the top paragraph (if %ITEMMENU = 1): "tr:nth-child(3) td:nth-child(2)"

That appears to have solved it. Glad to know what the numbers actually mean with that script. I was completely going blind there.

Of course, there could always be some hidden repercussions I have yet to see, but so far that seems to have done the trick. Thanks again, as always.

14th item slot blank (Inventory Menu script)

5 years ago
One strange side effect so far is that if I remove that line, while all my items come back, when you click on an item and the image gets larger, the bottom border line returns. So I need to figure out what part of the script is related to that particular border, and why it DOESN'T show up if I leave the line tr:nth-child(3) tr:nth-child(2) in as hidden.

Strangely, replacing the argument of either one with any number other than 3 or 2 results in that little piece of the border being there when you click on an item to bring up the item description. Deleting both also results in that piece of the border showing up when you click on the item (but deleting both DOES fix the problem of disappearing item). It looks like this with the line deleted:

But with that line intact, it looks like this (although I lose the item at row three column 2):

Something odd is going on here. Why would the item at (3,2) be related to the bottom border when the item is enlarged and the description brought up?

14th item slot blank (Inventory Menu script)

5 years ago

Yeah, that's my bad. I actually had no idea the inventory automatically split items into rows and assumed you were using a custom inventory or something, haha. The point of tr:nth-child(3) tr:nth-child(2) was to hide that border, since it's also row 3, column 2 of a table, but because of my misunderstanding, the 14th item thumbnail was affected too.

Added on to the last rule and made it important; that should do it for you.

table, table table tr:nth-child(3) td:nth-child(2) {visibility: hidden;}

table table tr td {visibility: visible;}

table td:nth-child(4), table table td.smallerText {visibility: visible !important;}

14th item slot blank (Inventory Menu script)

5 years ago
Yeah, that seems to have solved it. I appreciate it. No idea why it works, but it does, so hopefully that will be the end of this issue (it seems I'm not the only person who has requested an invisible inventory border).