switch properly
This commit is contained in:
@@ -11,6 +11,8 @@ def main():
|
||||
print(scoreboard_matrix.current_slide)
|
||||
if scoreboard_matrix.current_slide == "score":
|
||||
canvas = score.draw_frame(scoreboard_matrix)
|
||||
if not canvas:
|
||||
scoreboard_matrix.current_slide = "fantasy"
|
||||
if canvas:
|
||||
scoreboard_matrix.canvas = scoreboard_matrix.matrix.SwapOnVSync(canvas)
|
||||
|
||||
|
||||
+1
-2
@@ -207,8 +207,7 @@ def draw_frame(matrix):
|
||||
if next_x >= total_scroll_width:
|
||||
scroll_x = 0
|
||||
tick = 0
|
||||
matrix.next_slide("fantasy")
|
||||
return matrix.canvas
|
||||
return None
|
||||
scroll_x = next_x
|
||||
|
||||
return matrix.canvas
|
||||
@@ -6,7 +6,6 @@ import vars
|
||||
class ScoreboardMatrix():
|
||||
logo_cache = {}
|
||||
current_slide = "score"
|
||||
slide_count = 0
|
||||
options = RGBMatrixOptions()
|
||||
options.rows = 32
|
||||
options.cols = 64
|
||||
@@ -41,11 +40,4 @@ class ScoreboardMatrix():
|
||||
self.logo_cache[key] = None
|
||||
return None
|
||||
|
||||
def iterate_slide_count(self):
|
||||
self.slide_count += 1
|
||||
|
||||
def next_slide(self, slide_name):
|
||||
self.slide_count = 0
|
||||
self.current_slide = slide_name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user