Inventory: Item Details


Diggin' In

So, what's on the plate today? Well, I'll start with last night, while I was trying to sleep. My brain just wouldn't shut down, I kept thinking about my new work project and this one. My mind was racing with next steps for both. Unfortunately, I didn't get an opportunity to touch my work project. But I'm here and ready to work on my personal one!

So, the first thing to do is get my item detail pane working. Actually, no, I think I want to make a small change first. At the moment, each item slot just displays the current quantity and the icon. I'd like to update that to show the actual name of the item as well. But, what is the appropriate way to display both quantity and the name using one label? I mean, I could break it apart and have two labels, one for quantity and another for name. 

I would discuss this with Gemini, but at the moment I'm connected to a VPN in another country that isn't supported. So, I decided to go with adding a new label. I'll use the original one for my item name, and the new one will hold the quantity. Now how do I get them to play nice together? I decided to encase my icon and quantity in a margin container and messed with some other settings until it looked right in the 2D preview. Hopefully, it'll look right once it contains real data. Then I had to update my code to assign the right values to the right nodes, which was pretty easy.

After those updates, I made sure to test they worked right before I jumped into the item detail display. It works, but it's not exaclty pretty. I made a couple of changes to the new label and it seems to look okay, even  with bigger numbers. Looking at the console for my testing session though indicates I may have a problem with my button signal connection. It doesn't really seem like a big issue though. It's just complaining that I'm trying to connect a signal in the exact same way as it is already connected. 

I decided to take a stab at fixing it, but I'm having a hard time with getting the syntax just right. It took me a few tries, but I finally did it all on my own. See, I couldn't ask Gemini for help because my internet dropped while I was working. Don't really know what's going on here, but the internet has been having intermittent outages nearly every day. Anyway, I can deal with it, I have access to a decent hotspot. So, it is now time to dig into the item detail panel! 

I'm thinking I may want to "hold" the item information for my display. I'm really not sure if it matters though. For now, I'll work without doing that. I am adding some extra checks, just in case my inventory slots or item detail display are passed an invalid item somehow. After a bit of bank and forth with Gemini to make sure I'm not going to break the game with my bad code, it was time to start updating the item detail display!

This part was pretty easy. I did add a few checks to make sure I wasn't going to crash the game with bad data. Once that was done, I had to fiddle with a few settings to get the UI looking a little better. It's still not as good as I like, but it works, and that's what matters at this point. Remember, "Make it work first, you can make it pretty later"!

Next Time

And that's all I have time for today. Well, I have more time, but I'm taking a step back now to relax and enjoy my time here. Next time I'll dive into the button assignments. That one will take a bit of effort, and tomorrow is a day out at a theme park. So it probably won't be until Sunday that I dive back in.

Leave a comment

Log in with itch.io to leave a comment.