Skip to content

Commit

Permalink
added separate color key for strikeout, updated keys for play_result …
Browse files Browse the repository at this point in the history
…desc_length in small displays
  • Loading branch information
jimcreel committed Jul 16, 2023
1 parent b6c230c commit 03e2b63
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions colors/scoreboard.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
"r": 255,
"g": 235,
"b": 59
},
"strikeout": {
"r": 255,
"g": 0,
"b": 0
}
},
"batter_count": {
Expand Down
2 changes: 1 addition & 1 deletion coordinates/w128h32.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"play_result": {
"x": 60,
"y": 30,
"desc_length": "Short"
"desc_length": "short"
}
},
"pregame": {
Expand Down
2 changes: 1 addition & 1 deletion coordinates/w32h32.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"play_result": {
"x": 33,
"y": 33,
"desc_length": "Short"
"desc_length": "short"
}
},
"batter_count": {
Expand Down
2 changes: 1 addition & 1 deletion coordinates/w64h32.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"x": 15,
"y": 29,
"font_name": "5x7",
"desc_length": "Short"
"desc_length": "short"
}

},
Expand Down
2 changes: 1 addition & 1 deletion coordinates/w64h64.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"play_result": {
"x": 31,
"y": 36,
"desc_length": "Short"
"desc_length": "short"
}
},
"pregame": {
Expand Down
5 changes: 4 additions & 1 deletion renderers/games/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def _render_at_bat(canvas, layout, colors, atbat: AtBat, text_pos, play_result,
def __render_play_result(canvas, layout, colors, play_result):

coords = layout.coords("atbat.play_result")
color = colors.graphics_color("atbat.play_result")
if "strikeout" in play_result:
color = colors.graphics_color("atbat.strikeout")
else:
color = colors.graphics_color("atbat.play_result")
font = layout.font("atbat.play_result")
try:
text = PLAY_RESULTS[play_result][coords["desc_length"]]
Expand Down

0 comments on commit 03e2b63

Please sign in to comment.