V0.1.0 - KH


UI Trouble

Author: Kevin Hall

Posted on 07/6/24

THE PROBLEM

We were all very excited to get our spell system integrated into our game!  It was my job to hook up the UI portion of the project.  So I got started on updating the HUD widget to include the cooldown effect on the spell images, but also was able to add the current spell amount to each spell!  This did not come without struggle!  I had first made multiple individual functions for each spell to check if it was on cool down or not and then updated the progress bar.  I then had 4 separate binds for all the different functions and it was causing multiple bugs, for example if I used a spell it would put all the spells ui elements on cool down, and then depending on what spell I had selected all the ui elements would be on cool down or not on cooldown.  The desired behavior is that each individual element will be on cool down or not depending on their individual cooldown state.  

THE SOLUTION

I deleted the unneeded functions and just made one function that uses a switch to determine  what spell we are updating, then a branch node for saying whether it is on cooldown or not. Setting the progress bar on the widget to the appropriate alpha, whether the branch returns true or false. All of this led me to being able to do pretty much the same thing for the spell uses on the text variable hooked up to the widget

Get Plight of the Gods

Leave a comment

Log in with itch.io to leave a comment.