In The Mind of UI Functionality


This week I was putting together the player HUD and Pause menu, this post wont be necessarily about a problem that I have already solved but a problem I am currently facing and some thoughts on how it will be resolved. Our game has an inventory system and for the UI I want there to be separate UI's for each gun that the player can equip so the player has a good visual on what he has in his hand and bullet capacity. The problem im currently facing is trying to make a way to notify the player HUD when the current weapon is changed and to individually update the current ammo and the ammo in inventory. Since our game will incorporate multiple gun types the current ammo will not reload to the same amount for each gun like sniper and AR.

A solution I am thinking about is adding an id to each gun so when the player switched to that gun it will call a function in player HUD. That function will collapse and show the correct widget needed like I did for my options button menu and update the ammo text. The reason this is a problem in the works is because I am currently making a UI for the inventory system. Im hoping through getting the inventory system set fully up I will have a complete solution for the gun UI swap.

Get Dustborn: Code of Survival