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