Changing Firemode

How to write a function, that changes the switch(case) variables when i press the button?

you can pre-define a array and have all the weapon mode using enums or just integer is fine ,like TArray , and also have a variable a current firemode(for multiplayer you shoul set it as replicated in most cases),init the array and current fire mode from consturctor or blueprint construction script, and set up input to bind functions, such as when you press button B ,the change fire mode function get fired and you can reset the current fire mode to something else read from the firemode array