feat: display demo/autorandom
Python Lint CI / ruff (push) Successful in 6m42s
Python Lint CI / ruff-format-check (push) Failing after 6m41s
Python Lint CI / ty (push) Successful in 6m47s

This commit is contained in:
2026-11-11 18:42:16 +01:00
parent 06e625bb27
commit a9b730ff12
3 changed files with 25 additions and 5 deletions
+25 -4
View File
@@ -21,6 +21,7 @@ from .constants import (
)
from .enums import ForgeState
from .forge_data import ForgeData
from .glsl_funcs import mod
FONT_1 = ImageFont.truetype(FONT_1_PATH, 5)
FONT_2 = ImageFont.truetype(FONT_2_PATH, 8)
@@ -63,10 +64,30 @@ def __get_running_display(data: ForgeData) -> Image.Image:
draw.rectangle((6, 7, 6 + int(53 * data.beat_progress), 10), fill="white", width=0)
# time
draw.text((94, -2), f"{int(data.time)}", fill="white", font=FONT_1)
draw.rectangle(
(67, 7, 67 + int(53 * data.time_progress), 10), fill="white", width=0
)
if data.demo:
draw.text((68, -2), "DEMO", fill="white", font=FONT_1)
else:
draw.text((68, -2), f"TIME: {int(data.time)}", fill="white", font=FONT_1)
if data.auto_random:
draw.rectangle(
(
67, 7,
67
+ int(
53
* mod(data.beats, data.auto_random_cycle)
/ data.auto_random_cycle
),
10,
),
fill="white",
width=0,
)
else:
draw.rectangle(
(67, 7, 67 + int(53 * data.time_progress), 10), fill="white", width=0
)
# page
draw.circle((55 + 8 * data.page, 61), 2, fill="white")