This lesson, we're going to create a function to handle turning on and off buttons, so passing in
whatever button object that we want.
And this one will turn it off.
And will you create another function that will turn it on?
So it's going to select the whatever button object is passed in and apply disabled to it and set disabled.
To be true because we're turning it off.
So that's going to allow the player not to be able to interact with it and then us updating the style.
So it's a visual as well that the color of the button text is going to change.
And we'll have another function that will be turn on and passing in whatever button it is.
So the button objects from the elements.
So we can use that for any one of the buttons and we can simply turn them on and off.
And this one will be disabled, will be false, and we'll turn the color back to just split.
So now we can turn buttons on and off as needed.
So once a deal is hit, we're going to turn off the game button, deal, object.
And when we press deal, we see that the button goes, Gry, and it's no longer clickable.
And we also need to turn off the hytten stand buttons before we launch the game.
So going into an I.T., once we build the gameboard, let's turn off the button hit as we don't want
someone to be able to take a hit because it's not going to be a valid.
So we're turning those off and also turning off stand as an option.
So we load the game.
We have an option to bet the amount and we an option to deal and we would press deal.
Then we lose the option to deal again because we're then the game is in play and we need to take cards
and update the content and the gameplay.
That's coming up next, where we're going to update and have the ability to take a card.
And as well, we're going to re-enable the buttons to hit and stand.
Depending on the calculations.
We'll do a calculation within the deal that afterwards it's dealt that the player can take either if
they have an ability to take a card that will re-enable the hit and stand.
So that's all still to come in the upcoming lessons.
So go ahead and add in these useful functions where we can turn on and off the various.
Buttons in the gameplay.