Hello !
I want to create a game mechanic where the player can collect discs by exploring the world the game.
In the menu, the player will have a collected discs section.
In this section, there is a long scrollable list of 100 Discs with Numbers “Disc0,Disc1,Disc2,Disc3”
The Player will see all the Discs, but the ones he havent collected will be greyed out but the ones he did collected will be displayed in colors.
The Player cannot click on the greyed out discs obviously, but he can click on the ones he unlocked.
Doing so will open a text document, similar to a journal note or Something similar.
For now, i have a BP_Disc that have an integrer instance editable, i Place the disc in the level and i can assign it with an index in the detail panel.
When i collect theses discs, that index data is sent to the Widget.
But the issue is that i need to create 100 buttons in my widget, and by doing so, i need to “unlock” them individually when picking up a new disc.
this is a massive issue, because it forces me to have 100 on clicked event, 100 buttons, and 100 lines of blueprint code to unlock each individual buttons.
Is there a way that i could automatically create all theses disc buttons from 0 to 100 and space them properly on different lines and collumns, then upon picking up a disc, get its id, find in the generated buttons the corresponding index and finally unlocking the correct disc button while having One single OnClicked event that would transmit its execution to the proper data ?
I know this sounds complicated, but i feel like it should be possible, i’ve seen this in many games, mostly with notes or journal pages or with a collectible images list but also with bestiary systems, where the list items all exists but are greyed out and become avalible when discovering the correct element.
Another example with the Unlocks menu in Binding of Isaac.
If you guys know of a tutorial that could help, or some kind of guide or even code example, i would be extremely gratefull.
Thanks !