I am in the process of making a character customization menu and ran into a fork in the road.
When the player initially opens the menu, they are first shown all the shirts they can choose from and switch between pants, hats, etc, using a set of buttons at the top.
All of the asset choices given are displayed using image buttons within a scrolling frame.
My current function to load these clothes is shown below.
local function loadClothes(clothingType) clearCurrentAssets() --Clears assets shown for assetId, assetData in pairs(ClothingLib.Clothes) do --Creates buttons with clothing choices if clothingType == assetData.Type then createAssetButton(assetData, assetId) end end end
So when displaying the clothes using my current method, each time the player chooses a button(Shirts, Hats, Pants, etc), it will clear the current shown assets in a selection frame, and then add all of the buttons relative to the asset the player wants to see. I.e. The player chooses pants, it clears the shirts, creates pants buttons.
My question is if this method will be okay even when hundreds of assets are shown relative to the type. Or if it would be better to pre-load each asset into its own selection frame and just change what selection frame is visible depending on what the player wants to view.
This other method would result in a longer load(Barey noticeable) and would also require multiple selection frames to keep track of(five in total.)
With my current method, it only requires one selection frame but has to load the clothes every time the player chooses another option.
I feel like one is better than the other, but I may be wrong, so I figured I might as well ask.