This has taken me a bit of time to figure out what I think is going on, but i'm going to try my best to try and explain it with an example resource,
I have been struggling with a repeated error in F8 when it comes to adding items to columns in the lobby menu. Whether it be using "AddSettings" or "AddPlayer", i am repeatedly seeing this error be thrown. I struggled to figure out what was causing it, so I did some digging by adding a heap of debug lines into the ScaleformUI lua file, and I noticed what was happening (I think). In the screenshot below, the top of the stack is the PlayerListColumn:_itemCreation function. I decided to add the following debug line into here:
local menuIndex = self.Pagination:GetMenuIndexFromPageIndex(page, pageIndex)
-- Debug line
print("page: "..page)
print("menuIndex: "..menuIndex)
And this revealed that the page was 0, and the menuIndex was returning a negative number, which is an invalid index, and thus no item was found, which was throwing the following error:
I decided to create a debug script to try and figure out what i was doing to cause this to happen. It turns out that adding any item to a column whilst the menu is OPEN, is causing this error. When the menu is closed, you can add items to the settings column and the player column with no issues. However when the menu is open, adding items (with the goal of displaying new items in real time), is throwing this error. This same behaviour was also happening in the SettingsColumns _itemCreation function as well.
I have created the attached example script to showcase this bug. Follow these steps to replicate it:
Type /open to display a Lobby menu with the local player added in the players column
Press "Escape" to close the menu
Type /create a few times, followed by /open. You will see multiple local players added to the players column (expected behaviour)
Now press the Create Player button, followed by F8. You will see the error.
Hopefully ive provided some clear information on what i am experiencing. This is using the current latest "Release" build of ScaleformUI Lua.
This has taken me a bit of time to figure out what I think is going on, but i'm going to try my best to try and explain it with an example resource,
I have been struggling with a repeated error in F8 when it comes to adding items to columns in the lobby menu. Whether it be using "AddSettings" or "AddPlayer", i am repeatedly seeing this error be thrown. I struggled to figure out what was causing it, so I did some digging by adding a heap of debug lines into the ScaleformUI lua file, and I noticed what was happening (I think). In the screenshot below, the top of the stack is the PlayerListColumn:_itemCreation function. I decided to add the following debug line into here:
And this revealed that the page was 0, and the menuIndex was returning a negative number, which is an invalid index, and thus no item was found, which was throwing the following error:![image](https://github.com/manups4e/ScaleformUI/assets/47719567/34e75fec-c497-41e8-9287-1eeece1f47f7)
I decided to create a debug script to try and figure out what i was doing to cause this to happen. It turns out that adding any item to a column whilst the menu is OPEN, is causing this error. When the menu is closed, you can add items to the settings column and the player column with no issues. However when the menu is open, adding items (with the goal of displaying new items in real time), is throwing this error. This same behaviour was also happening in the SettingsColumns _itemCreation function as well.
I have created the attached example script to showcase this bug. Follow these steps to replicate it:
Hopefully ive provided some clear information on what i am experiencing. This is using the current latest "Release" build of ScaleformUI Lua.
[example.zip](https://github.com/manups4e/ScaleformUI/files/14068636/example.zip)