diff --git a/mpf/core/text_ui.py b/mpf/core/text_ui.py index ca24939b5..6b18c93e6 100644 --- a/mpf/core/text_ui.py +++ b/mpf/core/text_ui.py @@ -117,9 +117,6 @@ def __init__(self, machine: "MachineController") -> None: self._bcp_connected) self.machine.events.add_handler('shutdown', self.stop) self.machine.add_crash_handler(self.stop) - self.machine.events.add_handler('player_number', self._update_player) - self.machine.events.add_handler('player_ball', self._update_player) - self.machine.events.add_handler('player_score', self._update_player) self.machine.events.add_handler('ball_ended', self._update_player) @@ -147,6 +144,9 @@ def _init(self, **kwargs): self.machine.events.add_handler("mode_{}_started".format(mode.name), self._mode_change) self.machine.events.add_handler("mode_{}_stopped".format(mode.name), self._mode_change) + for player_var in self.machine.config['player_vars']: + self.machine.events.add_handler("player_{}".format(player_var), self._update_player) + self.machine.switch_controller.add_monitor(self._update_switches) self.machine.register_monitor("machine_vars", self._update_machine_vars) self.machine.variables.machine_var_monitor = True