Functional Accept Match Timer
- 50541507
- May 4, 2022
- 1 min read
As of now, my Accept Match modal had a visual timer, but not a functional one, so I decided to create one. This was simple enough, as I just did some basic logic with Selects and Appends to Strings for the text countdown in a Timer looping every second, and for the progress bar, I used the same function as I did with my Slider to set the minimum and maximum values for the percentage.

After doing this however, I wanted the modal to disappear and for the game to stopped queueing after the timer reached 0, so I initially created an Event Dispatcher which is called in my modal Widget when the value of the timer is <= 0, and used it as an Event in my main Multiplayer Widget, but this didn't work. I then attempted to implement an interface into both the modal and Multiplayer Widgets, with calls and Events going between both, but this didn't work either. After some thought, I decided to try Binding to the Event Dispatcher instead of calling the Event in the Multiplayer Widget, and this worked fine. I also created a Custom Event to perform stuff like removing the modal from its parent widget, settings other variables and such that I called in the Multiplayer Widget with the Event Binding.


I also made the logic that comes off when the Cancel button is clicked into a Custom Event so I could call it here.



Comments