From Map to Widget

I have a list of items in a map, Key which is an enum and floats.
It is an inventory of sorts, goods with their quantities.

During the game loop my actor “increases” the values.

I want to show the values when you hover over the actor.
I’ve currently implemented as a loop through the map and assign it to variables which is then bound to the textboxes.

But this is not working now because I have lots of items and I can’t manualy create the binds or create new variables.
I’ve search a bit for inventory and widgets but can’t seem to figure out how to do it.

“It” would be to create a Widget and have it show my map items with key and value.


One way to do it:

  • Maps are not ordered:


  • if you care about the enum order:

If that’s not it, do explain more as it was a somewhat confusing read, actually.