Disables buttons using switch-case

the code is still hard to read, but it works well. I will try creating a separate function to work with parameters instead.