Help programming a 2D loot box

I’m a beginner programmer, and I need help creating a 2D loot box in Unreal Engine 5.5.0.

I want a simple screen with an icon in the center, which, when clicked, activates a GIF to display a randomly generated item with percentage rates for different rarities.

I think this could be done using User Widgets, their Blueprint graph and optionally a bit of C++.

First you would create a widget for the openning button UI. By making the button a variable, you can add an OnClicked event to the graph.

Then you can create a function, either in BP or C++ that handles the random selection of the loot and link it to the OnClicked event.

Finally you would need to display the correct GIF on the widget. I think the “Image” component should be able to display GIFs.