Title screen: icon-only quit, no Create/accessibility/Mods buttons, pack version instead of the Minecraft lines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fulldroper
2026-10-14 05:58:03 +03:00
co-authored by Claude Opus 5.5
parent 6ec630bf47
commit 1dcefc772c
5 changed files with 235 additions and 19 deletions
+30
View File
@@ -188,6 +188,35 @@ def fit(im: Image.Image, max_w: int, max_h: int) -> Image.Image:
return im.resize((im.width * k, im.height * k), Image.NEAREST)
# The quit button of the title screen: a door frame with an arrow going out — the library's "sign-out" icon redrawn
# on the 13 px grid of Minecraft's own button icons. '#' is white, '+' the light grey Minecraft shades them with.
QUIT_ICON = '''
#######......
#++++++......
#+...........
#+.......#...
#+.......##..
#+..########.
#+..#########
#+..+++++##+.
#+.......#+..
#+.......+...
#+...........
#######......
+++++++......
'''
def button_icon(rows: str) -> Image.Image:
"""A 20x20 picture for a 20x20 button; the drawing starts at (4, 4), where Minecraft puts its own icons."""
im = Image.new('RGBA', (20, 20), (0, 0, 0, 0))
for y, row in enumerate(rows.split()):
for x, c in enumerate(row):
if c != '.':
im.putpixel((4 + x, 4 + y), (255, 255, 255, 255) if c == '#' else (208, 208, 208, 255))
return im
def main() -> None:
mc_jar, create_jar, key_art = sys.argv[1], sys.argv[2], Path(sys.argv[3])
emblem_raw = Path(sys.argv[4]) if len(sys.argv) > 4 else None
@@ -250,6 +279,7 @@ def main() -> None:
# --- FancyMenu: title screen background, the logo it shows, window icons -------------------------
shade(cover(art, 1920, 1080), *((0.95, 1.0) if night else (0.80, 0.92))).convert('RGB').save(OUT / 'menu' / 'background.png')
stack([wordmark(8), motto(3)], gap=12).save(OUT / 'menu' / 'logo.png')
button_icon(QUIT_ICON).save(OUT / 'menu' / 'quit.png')
print('done:', ', '.join(sorted(str(p.relative_to(OUT)).replace('\\', '/') for p in OUT.rglob('*.png'))))