Item Slot: Pushing My Buttons


Let's GO!

I have been taking way too many breaks and lazy days for my liking. I'm really tempted to do it again today, I'm feeling exhausted. I don't think I've had a proper night's sleep since I left America. If it isn't a late night of meetings, it's a noisy early morning. Most nights it's both. Add in a liberal sprinkling of trips to the mall and my mind just isn't feeling very sharp and my motivation is in the toilet. With that said, I'm still going to do something on the project today.

Another Project

I do want to also share that I've begun another AI-assisted development project. Don't worry, it won't take my focus away from Xenodochium though. The other project is something for my day job. I'm using Claude to help build a data manipulation tool to assist in my duties. It will be a completely different type of project, obviously. No Godot, I'm using Visual Studio. Web-based front-end built using React. Tons of concepts I'm not super familiar with. Today was my first day working on it, and I'm sure it put a drain on my psyche too. All I did was get the basic concept down, and setup my development environment.

Time To Work

 Back to the topic at hand. I want to start with the item slot, adjusting the button behavior. I gotta figure out the best approach here, at the moment I don't think I'm doing things quite right. I decided to check with ChatGPT on this one, because I feel like I've gotten mixed signals from Gemini about it. See, for each item slot I populate in my inventory I'm running two separate find_child lookups. Gemini seems to think doing this may be an issue for performance once the actual inventory contents grow. ChatGPT seems to think it won't be much of an issue due to the small number of nodes in the scene.

Gemini suggested adding a script to my item slot, while ChatGPT suggested using groups. Neither of those approaches really appeal to me though. In the end, I decided to add a minimal script to my item slot. All it contains is three export variables, which I set to their respective nodes in the inspector. Testing shows it works the same way from my perspective, but it should be more performant when the inventory grows. 

After that, it was a fight to figure out how to remotely connect the pressed signal on the button to the correct function in the inventory while passing a parameter. Luckily, in the end this change has actually improved things slightly. Now when an item slot is returned to the pool, I can more easily clear its contents. And testing shows everything is working exactly how I want. There's still more to do here, but this is a good stopping point.

Next Time

The next session will consist of populating the item detail display. Once that's working, I can dig into actually dealing with the contextual buttons. Even though I am exhausted and didn't really feel like putting in much effort, I still accomplished a lot today. Catch you tomorrow (hopefully)!

Leave a comment

Log in with itch.io to leave a comment.