Handling different controller modes (farming, building etc.)

Hello,

I’m creating a city builder game with farming elements (like Township for example) and I have a problem that I’m not able to solve.

The point is that I would like to have several modes available on the controller. For example, if I choose a building from the menu, the controller should be in the construction mode. Or after pressing a field actor in the level, the controller should be in default, farming or harvest mode based the state of the plant.

Each mode has it’s own HUD and functionalities. For example in farming mode a mouse click should select an actor under the cursor and in construction mode, a building should be created.

I have no idea how to implement such a functionality. I’ve tried to create components for each mode and attach them to the controller, but it didn’t help. My biggest problem is to create a proper input handling and functionality for each mode.

If anyone could provide a solution or at least indicate the right way, I would be very grateful.