UIListLayout internal error when used in CoreGui

I am working on a plugin that has a menu where certain objects are listed and some information about these objects. A UIListLayout is used to display this information, and there are some buttons to sort the rows in different ways.

However, whenever I try to re-sort the rows (and thus ApplyLayout is called on the UIListLayout in the plugin CoreGui), the following error occurs and the sorting fails:

Now there are a few strange things here:

  • The error seems internal, it does not have any useful information for me apart from me knowing something went wrong. I can’t really tell what/if I’m doing anything wrong, though.

  • When I use this exact same UI in-game in PlayerGui instead (so not as a CoreGui UI, but just a regular UI menu), the UI works just fine without ever generating this error. So it seems there is a difference in behaviour between CoreGui and regular UI.

The error is generated 100% of the time when I try to use UIListLayout::ApplyLayout with the layout ordering set to Custom and with a valid sorting function provided (i.e. when I copy over the UIListLayout to a regular UI, it works as intended, just not in the CoreGui for some reason).

I can provide a repro plugin if needed, just let me know.

cc @darthskrill @Tiffblocks (because I’ve seen you address bugs about these classes before). Also, if you happen to know if this is somehow caused by me and not a bug, could you tell me if you know what I could be doing wrong?

1 Like

I’ll look into this.

1 Like

Not sure if this has to do with it but:

No, that is unrelated (notice how it says “in CoreGui” in the title here meaning it is related to plugins, while you have a screenshot from the console in a live server), please post that in its own bug report with a reproduction file. Make sure to follow the format for bug reports and post it in the right category (Client Bugs).

I meant the part besides the warnings*

Edit: NVM I tested some more and it seems to only occur in game.

Edit #2:
Now it’s happening on line 15, but for a bit it was also line 33.

I’m certain it isn’t my game because I didn’t make any code changes during the time it went from 33 to 15.

Edit #3:
Doing UIListLayout:ApplyLayout() causes EXTREME lag for while its running. Most of the time it crashes my game,

All of these issues should be fixed by a change that will be enabled soon.

2 Likes

Awesome, I’ll test it straight away once it’s live

1 Like

This is no longer relevant due to a change in UIListLayout behaviour (custom sort function etc is deprecated)

I enabled the fix a few days ago and forgot to post here. While SetCustomSortFunction is deprecated, it should no longer be broken.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.