Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to display team record on game screen #486

Merged
merged 3 commits into from
Jul 12, 2023
Merged

Add option to display team record on game screen #486

merged 3 commits into from
Jul 12, 2023

Conversation

ty-porter
Copy link
Collaborator

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

@ty-porter ty-porter added the enhancement New feature or request label Jul 8, 2023
@ty-porter ty-porter changed the base branch from master to dev July 8, 2023 15:46
@ty-porter ty-porter closed this Jul 8, 2023
@ty-porter ty-porter reopened this Jul 8, 2023
@WardBrian
Copy link
Member

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
Copy link
Collaborator Author

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
Copy link
Member

WardBrian commented Jul 9, 2023

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
Copy link
Collaborator Author

ty-porter commented Jul 9, 2023

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

if status.is_pregame(game.status()): # Draw the pregame information
self.__max_scroll_x(layout.coords("pregame.scrolling_text"))
pregame = Pregame(game, self.data.config.time_format)
pos = pregamerender.render_pregame(
self.canvas,
layout,
colors,
pregame,
self.scrolling_text_pos,
self.data.config.pregame_weather,
self.is_playoffs,

def render_pregame(
canvas, layout: Layout, colors: Color, pregame: Pregame, probable_starter_pos, pregame_weather, is_playoffs
):
text_len = _render_pregame_info(canvas, layout, colors, pregame, probable_starter_pos, pregame_weather, is_playoffs)
if layout.state_is_warmup():
_render_warmup(canvas, layout, colors, pregame)
else:
_render_start_time(canvas, layout, colors, pregame)
return text_len

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

@WardBrian
Copy link
Member

I meant the data.config.layout for warmup:

LAYOUT_STATE_WARMUP = "warmup"

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
Copy link
Collaborator Author

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
Copy link
Member

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

@ty-porter ty-porter merged commit 733279f into dev Jul 12, 2023
@ty-porter ty-porter deleted the issue#485 branch July 12, 2023 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants