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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 283 B

+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")
-1
View File
@@ -33,7 +33,6 @@ def generate_background_image() -> None:
draw.rectangle((6, 6, 60, 11), outline="white", fill="black")
# time
draw.text((68, -2), "TIME:", fill="white", font=FONT_1)
draw.rectangle((67, 6, 121, 11), outline="white", fill="black")
# pipes