def __rotate_rate_for_status(self, status): rotate_rate = self.data.config.live_rotate_rate if Status.is_pregame(status): rotate_rate = self.data.config.pregame_rotate_rate if Status.is_complete(status): rotate_rate = self.data.config.final_rotate_rate return rotate_rate
def __draw_game(self, game, overview): color = self.data.config.scoreboard_colors.color("default.background") self.canvas.Fill(color["r"], color["g"], color["b"]) # Draw the pregame renderer if Status.is_pregame(overview.status): scoreboard = Scoreboard(overview) scroll_max_x = self.__max_scroll_x(self.data.config.layout.coords("pregame.scrolling_text")) pregame = Pregame(overview) renderer = PregameRenderer(self.canvas, pregame, scoreboard, self.data, self.scrolling_text_pos) self.__update_scrolling_text_pos(renderer.render()) # Draw the final game renderer elif Status.is_complete(overview.status): scroll_max_x = self.__max_scroll_x(self.data.config.layout.coords("final.scrolling_text")) final = Final(game) scoreboard = Scoreboard(overview) renderer = FinalRenderer(self.canvas, final, scoreboard, self.data, self.scrolling_text_pos) self.__update_scrolling_text_pos(renderer.render()) # Draw the scoreboar renderer elif Status.is_irregular(overview.status): scoreboard = Scoreboard(overview) if scoreboard.get_text_for_reason(): scroll_max_x = self.__max_scroll_x(self.data.config.layout.coords("status.scrolling_text")) renderer = StatusRenderer(self.canvas, scoreboard, self.data, self.scrolling_text_pos) self.__update_scrolling_text_pos(renderer.render()) else: StatusRenderer(self.canvas, scoreboard, self.data).render() else: scoreboard = Scoreboard(overview) ScoreboardRenderer(self.canvas, scoreboard, self.data).render() self.canvas = self.matrix.SwapOnVSync(self.canvas)
def __rotate_rate_for_status(self, status): rotate_rate = self.data.config.rotation_rates_live if Status.is_pregame(status): rotate_rate = self.data.config.rotation_rates_pregame if Status.is_complete(status): rotate_rate = self.data.config.rotation_rates_final return rotate_rate
def __draw_game(self, game, overview): self.canvas.Fill(*ledcolors.scoreboard.fill) # Draw the pregame renderer if Status.is_pregame(overview.status): pregame = Pregame(overview) renderer = PregameRenderer(self.canvas, pregame, self.data.config.coords["pregame"], self.scrolling_text_pos) self.__update_scrolling_text_pos(renderer.render()) # Draw the final game renderer elif Status.is_complete(overview.status): final = Final(game) scoreboard = Scoreboard(overview) renderer = FinalRenderer(self.canvas, final, scoreboard, self.data.config, self.scrolling_text_pos) self.__update_scrolling_text_pos(renderer.render()) # Draw the scoreboar renderer elif Status.is_irregular(overview.status): scoreboard = Scoreboard(overview) StatusRenderer(self.canvas, scoreboard, self.data.config).render() else: scoreboard = Scoreboard(overview) ScoreboardRenderer(self.canvas, scoreboard, self.data.config).render() self.canvas = self.matrix.SwapOnVSync(self.canvas)