MLB-LED-Scoreboard / mlb-led-scoreboard

An LED scoreboard for Major League Baseball :baseball:
GNU General Public License v3.0
576 stars 102 forks source link

Add option to display team record on game screen #486

Closed ty-porter closed 1 year ago

ty-porter commented 1 year ago

Addresses #485

Still undergoing testing. This adds the layout keys needed to render the team record on the game screen. By default, the record will render off screen since it takes up quite a bit of space (8 max):

(WWW-LL)
12345678

Requested behavior can be achieved with a custom coordinates file and the following config setting:

 "full_team_names": false

Future enhancements may need to specify smaller font sizes to fit in smaller

WardBrian commented 1 year ago

I was working on a version here: https://github.com/WardBrian/mlb-led-scoreboard/tree/feature/pregame-record

as the name suggests I was only having it on the pregame screen, but I stopped really developing after I realized it wouldn’t fit my layout

ty-porter commented 1 year ago

Screenshots of all officially supported boards:

Size Screenshot Notes
w32h32 w32h32 Not intending to provide good support for this size
w64h32 w64h32 Will probably overlap when RHE >10, unless H/E disabled like w64h64
w64h64 w64h64-4x6font Font 4x6 override
w128h32 w128h32-4x6font Font 4x6 override
w128h64 w128h64
w196h64 w196h64
WardBrian commented 1 year ago

I think any board at least 64-wide would be able to show them during the pregame when there are no scores

Edit: when does the "warmup" layout get applied?

ty-porter commented 1 year ago

It looks like the main renderer is checking status.is_pregame(game.status()) for each game and rendering out of the pregame renderer which can either do a warmup state or a start time if not in warmup. But in either case in all game states the team row i's getting rendered from the teams renderer anyway

https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/blob/5dcc41f49d2480feba8e1c35f5eea045366b952e/renderers/main.py#L121-L131

https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/blob/5dcc41f49d2480feba8e1c35f5eea045366b952e/renderers/games/pregame.py#L9-L19

It should be fine for the team renderer to make that is_pregame() status check as well

WardBrian commented 1 year ago

I meant the data.config.layout for warmup: https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/blob/5dcc41f49d2480feba8e1c35f5eea045366b952e/data/config/layout.py#L8

I don't think anyone uses this, but in theory it works like the no-hitter layout where you can do custom coordinates for that state of game but not others. It looks like this is literally done only for the Warmup status and not all pregame statuses however

ty-porter commented 1 year ago

It looks like this is literally done only for the Warmup status and not all pregame statuses however

I think this is my hangup here, I'm not convinced adding this for only the warmup state will give a consistent experience.

If we need that I think that can be a follow-on?

WardBrian commented 1 year ago

As long as there is an "enabled" flag in the coordinates, individual users could enable it in the warmup layout state if they wanted to. I think we should consider adding more layout states like "pregame", but that can definitely be a follow-on