Menus: original logo back, 24px corner buttons with real gear and globe icons, EMI buttons in casing style, no background behind the game menu, player reports from the game menu

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fulldroper
2026-10-14 09:18:05 +03:00
co-authored by Claude Opus 5.5
parent ba4dbd1052
commit bf6c483c8c
10 changed files with 197 additions and 99 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 395 B

+185 -92
View File
@@ -198,42 +198,22 @@ ICON_COLOURS = {
} }
QUIT_ICON = ''' QUIT_ICON = '''
#####..... #######.......
#......... #.............
#.....#... #.............
#.....##.. #.......#.....
#..####### #.......##....
#..####### #..#########..
#.....##.. #..##########.
#.....#... #..#########..
#......... #.......##....
+++++..... #.......#.....
#.............
#.............
#######.......
+++++++.......
''' # sign-out: a door frame with an arrow going out ''' # sign-out: a door frame with an arrow going out
SETTINGS_ICON = '''
....#....
.#.###.#.
..#####..
.###.###.
###...###
.###.###.
..#####..
.+.###.+.
....+....
''' # settings: a gear
LANGUAGE_ICON = '''
..#####..
.#..#..#.
#...#...#
#...#...#
#########
#...#...#
#...#...#
.+..#..+.
..+++++..
''' # globe; replaces Minecraft's own language icon, which is too big for the frame
ONLINE_ICON = ''' ONLINE_ICON = '''
....GGGGG.... ....GGGGG....
..GGGGGGGGG.. ..GGGGGGGGG..
@@ -305,50 +285,160 @@ def button_icon(rows: str, outline: bool = False, canvas: int = 20, at: int = -1
return im return im
def detailed_lettering(mask: np.ndarray, fill, grain: np.ndarray, k: int = 10, depth: int = 1) -> Image.Image: def shaded_disc(size: int, inside, colour, rim, lines=None) -> Image.Image:
"""The logo's lettering: the same blocky letters, colours, dark side and ink outline as `lettering`, but drawn """A small round pixel picture: `inside(x, y)` (centred coordinates, radius 1 = the edge) says what is solid,
`k` times finer. Every font pixel keeps the colour `lettering` gives it; inside it the metal's grain shows, and lit from the top left, a darker rim, and optional `lines(x, y)` drawn lighter on top."""
the bevel is two fine pixels wide instead of a whole font pixel.""" k, c = 8, (size - 1) / 2
pad = 1 + depth im = np.zeros((size, size, 4), np.float32)
m = np.pad(mask, pad) for py in range(size):
h, w = m.shape for px in range(size):
yy, xx = np.mgrid[0:h, 0:w] hits = sum(inside((px - c + (i % k + 0.5) / k - 0.5) / (size / 2), (py - c + (i // k + 0.5) / k - 0.5) / (size / 2))
if isinstance(fill, np.ndarray): for i in range(k * k))
base = fill[yy % fill.shape[0], xx % fill.shape[1]].astype(np.float32) if hits * 2 >= k * k:
dark = fill.reshape(-1, 3).mean(axis=0) * 0.45 x, y = (px - c) / (size / 2), (py - c) / (size / 2)
else: light = 1.18 - 0.30 * (x + y)
base = np.broadcast_to(np.array(fill, np.float32), (h, w, 3)).copy() rgb = np.array(colour, np.float32) * light
dark = np.array(fill, np.float32) * 0.45 if lines and lines(x, y):
side = np.zeros_like(m) rgb = np.minimum(rgb * 1.55 + 40, 255)
for d in range(1, depth + 1): im[py, px] = (*rgb, 255)
side |= shift(m, d, d) solid = im[..., 3] > 0
side &= ~m edge = solid & ~(shift(solid, 1, 0) & shift(solid, -1, 0) & shift(solid, 0, 1) & shift(solid, 0, -1))
body = m | side im[edge, :3] = rim
edge = np.zeros_like(m) return Image.fromarray(np.clip(im, 0, 255).astype(np.uint8), 'RGBA')
for dy in (-1, 0, 1):
for dx in (-1, 0, 1):
edge |= shift(body, dy, dx)
edge &= ~body
up = lambda a: np.repeat(np.repeat(a, k, 0), k, 1)
M, S, E = up(m), up(side), up(edge) def gear_icon(size: int = 14) -> Image.Image:
H, W = M.shape """Settings: a steel gear with eight teeth and a hole."""
# the grain: the inside of the block's texture, mirrored so it tiles without a seam, as a gentle brightness map def inside(x, y):
g = grain[2:14, 2:14].astype(np.float32).mean(axis=2) r, a = math.hypot(x, y), math.atan2(y, x)
g = np.concatenate([np.concatenate([g, g[:, ::-1]], 1), np.concatenate([g[::-1], g[::-1, ::-1]], 1)], 0) tooth = (math.degrees(a) % 45) < 21
g = (g / g.mean()) ** 0.8 return 0.34 < r < (0.98 if tooth else 0.74)
YY, XX = np.mgrid[0:H, 0:W] return shaded_disc(size, inside, (196, 200, 206), (70, 72, 78))
colour = up(base) * g[YY % g.shape[0], XX % g.shape[1]][..., None]
for width, lit, shade in ((1, 1.30, 0.62), (2, 1.15, 0.78), (3, 1.06, 0.90)): # the bevel, strongest at the rim
colour[M & ~shift(M, 0, -width)] *= (shade + 1) / 2 # right def globe_icon(size: int = 14) -> Image.Image:
colour[M & ~shift(M, 0, width)] *= (lit + 1) / 2 # left """Language: a blue globe with a meridian, an oval meridian and three parallels."""
colour[M & ~shift(M, -width, 0)] *= shade # bottom in shade def lines(x, y):
colour[M & ~shift(M, width, 0)] *= lit # top catches the light oval = 0.55 * math.sqrt(max(0.0, 1 - y * y))
out = np.zeros((H, W, 4), np.float32) return abs(x) < 0.08 or abs(abs(x) - oval) < 0.08 or abs(y) < 0.08 or abs(abs(y) - 0.52) < 0.08
out[..., :3] = INK return shaded_disc(size, lambda x, y: x * x + y * y < 0.97, (58, 108, 196), (24, 46, 100), lines)
out[S, :3] = dark * (0.85 + 0.15 * g[YY % g.shape[0], XX % g.shape[1]])[S][..., None]
out[M, :3] = colour[M]
out[M | S | E, 3] = 255 def on_canvas(icon: Image.Image, canvas: int) -> Image.Image:
im = Image.new('RGBA', (canvas, canvas))
im.alpha_composite(icon, ((canvas - icon.width) // 2, (canvas - icon.height) // 2))
return im
def casingify(sheet: Image.Image, wood: np.ndarray, frame, face=None) -> Image.Image:
"""EMI's little grey buttons and panels rebuilt in the look of our buttons. Buttons on EMI's sheet touch each other,
so a piece is told apart by its lines, not by gaps: the black lines (and a piece's outer edge) stay; the pixels
right next to them — the bevel — become the casing's metal frame; further in, the grey face becomes wood (or
`face`), and anything brighter or darker than the face around it is a symbol and is kept. A piece outlined in
white is EMI's highlighted state and gets brass. `frame` is (light, dark)."""
from collections import deque
px = np.asarray(sheet.convert('RGBA')).astype(np.float32)
out = px.copy()
solid = px[..., 3] > 0
lum = px[..., :3].mean(axis=2)
h, w = solid.shape
inner = shift(solid, 1, 0) & shift(solid, -1, 0) & shift(solid, 0, 1) & shift(solid, 0, -1)
line = solid & ((lum < 45) | ~inner)
dist = np.full((h, w), 99, int)
near = np.zeros((h, w), np.float32) # brightness of the nearest line
q = deque()
for y, x in zip(*np.nonzero(line)):
dist[y, x], near[y, x] = 0, lum[y, x]
q.append((y, x))
while q:
y, x = q.popleft()
for ny, nx in ((y + 1, x), (y - 1, x), (y, x + 1), (y, x - 1)):
if 0 <= ny < h and 0 <= nx < w and solid[ny, nx] and dist[ny, nx] > dist[y, x] + 1:
dist[ny, nx], near[ny, nx] = dist[y, x] + 1, near[y, x]
q.append((ny, nx))
# pieces smaller than 8 x 8 (dots, little icons) are left alone
big = np.zeros((h, w), bool)
seen = np.zeros((h, w), bool)
for sy, sx in zip(*np.nonzero(solid)):
if seen[sy, sx]:
continue
piece, q = [], deque([(sy, sx)])
seen[sy, sx] = True
while q:
y, x = q.popleft()
piece.append((y, x))
for ny, nx in ((y + 1, x), (y - 1, x), (y, x + 1), (y, x - 1)):
if 0 <= ny < h and 0 <= nx < w and solid[ny, nx] and not seen[ny, nx]:
seen[ny, nx] = True
q.append((ny, nx))
ys, xs = zip(*piece)
if max(ys) - min(ys) >= 7 and max(xs) - min(xs) >= 7:
big[tuple(zip(*piece))] = True
deep = big & (dist >= 2)
for y, x in zip(*np.nonzero(big)):
d, hot = dist[y, x], near[y, x] > 200
if d == 0:
if hot:
out[y, x, :3] = BRASS[1]
continue
window = deep[max(0, y - 6):y + 7, max(0, x - 6):x + 7]
face_lum = float(np.median(lum[max(0, y - 6):y + 7, max(0, x - 6):x + 7][window])) if window.any() else lum[y, x]
light, dark = (BRASS[3], BRASS[0]) if hot else frame
if d == 1:
out[y, x, :3] = light if lum[y, x] >= face_lum else dark
elif abs(lum[y, x] - face_lum) > 32: # a symbol: kept, white turned to cream
r, g, b = px[y, x, :3]
if max(r, g, b) - min(r, g, b) < 24:
out[y, x, :3] = np.array(CREAM, np.float32) * (lum[y, x] / 255) ** 0.5
else:
base = np.array(face, np.float32) if face is not None else wood[y % 16, x % 16]
out[y, x, :3] = base * (0.55 if face_lum < 70 else 1.12 if hot else 1.0)
return Image.fromarray(np.clip(out, 0, 255).astype(np.uint8), 'RGBA')
def casing_buttons(sheet: Image.Image, wood: np.ndarray, brass_wood: np.ndarray, frame, cell: int = 12) -> Image.Image:
"""EMI's buttons: a grid of 12 x 12 cells, each a black ring, a one-pixel bevel and a flat face with a symbol.
The ring stays (a white ring — the highlighted state — turns brass), the bevel becomes the casing's metal frame,
a grey face becomes wood (brass casing's darker wood when highlighted, dimmed when disabled); a coloured face (EMI's
green "switched on") keeps its colour. Symbols are kept, grey ones in cream."""
px = np.asarray(sheet.convert('RGBA')).astype(np.float32)
out = px.copy()
for cy in range(0, px.shape[0], cell):
for cx in range(0, px.shape[1], cell):
c = px[cy:cy + cell, cx:cx + cell]
if c.shape[:2] != (cell, cell) or (c[..., 3] > 0).sum() < cell * cell * 0.9:
continue
lum = c[..., :3].mean(axis=2)
ring = np.zeros((cell, cell), bool)
ring[0, :] = ring[-1, :] = ring[:, 0] = ring[:, -1] = True
bevel = np.zeros((cell, cell), bool)
bevel[1, 1:-1] = bevel[-2, 1:-1] = bevel[1:-1, 1] = bevel[1:-1, -2] = True
inside = ~ring & ~bevel
if lum[ring].mean() > 90 and lum[ring].mean() < 200:
continue # not a button cell
hot = lum[ring].mean() >= 200
face = np.median(c[inside][:, :3], axis=0) # the face is textured; the symbol covers less of it
face_lum = face.mean()
coloured = face.max() - face.min() > 30
dim = face_lum < 70 and not coloured
light, dark = (BRASS[3], BRASS[0]) if hot else frame
o = out[cy:cy + cell, cx:cx + cell]
if hot:
o[ring, :3] = BRASS[1]
for y in range(cell):
for x in range(cell):
if bevel[y, x]:
o[y, x, :3] = light if (y == 1 or x == 1) else dark
elif inside[y, x]:
p = c[y, x, :3]
if abs(p.mean() - face_lum) <= 28: # the face
if not coloured:
grain = (brass_wood if hot else wood)[(cy + y) % 16, (cx + x) % 16]
o[y, x, :3] = grain * (0.5 if dim else 1.0)
elif p.mean() < face_lum: # the symbol's shadow
o[y, x, :3] = (brass_wood if hot else wood)[(cy + y) % 16, (cx + x) % 16] * 0.4
elif p.max() - p.min() < 24: # a grey symbol
o[y, x, :3] = np.array(CREAM, np.float32) * (0.55 if dim else 1.0)
return Image.fromarray(np.clip(out, 0, 255).astype(np.uint8), 'RGBA') return Image.fromarray(np.clip(out, 0, 255).astype(np.uint8), 'RGBA')
@@ -414,6 +504,13 @@ def main() -> None:
with zipfile.ZipFile(mc_jar) as mc, zipfile.ZipFile(create_jar) as cr: with zipfile.ZipFile(mc_jar) as mc, zipfile.ZipFile(create_jar) as cr:
font = Font(mc) font = Font(mc)
brass = texture(cr, 'assets/create/textures/block/brass_block.png') brass = texture(cr, 'assets/create/textures/block/brass_block.png')
casing_tile = texture(cr, 'assets/create/textures/block/andesite_casing.png').astype(int)
sheet = np.asarray(Image.open(io.BytesIO(cr.read('assets/create/textures/block/andesite_casing_connected.png'))).convert('RGBA')).astype(int)
cells = [sheet[ty:ty + 16, tx:tx + 16] for ty in range(0, sheet.shape[0], 16) for tx in range(0, sheet.shape[1], 16)]
casing_wood = min((c for c in cells if c[..., 3].min() == 255), key=lambda c: c[..., :3].std())[..., :3] * 0.8
sheet = np.asarray(Image.open(io.BytesIO(cr.read('assets/create/textures/block/brass_casing_connected.png'))).convert('RGBA')).astype(int)
cells = [sheet[ty:ty + 16, tx:tx + 16] for ty in range(0, sheet.shape[0], 16) for tx in range(0, sheet.shape[1], 16)]
brass_wood = min((c for c in cells if c[..., 3].min() == 255), key=lambda c: c[..., :3].std())[..., :3] * 1.1
# sprites of Minecraft's widgets, by their path under assets/minecraft/textures/gui/ # sprites of Minecraft's widgets, by their path under assets/minecraft/textures/gui/
vanilla = lambda path: Image.open(io.BytesIO(mc.read('assets/minecraft/textures/gui/' + path))).convert('RGBA') vanilla = lambda path: Image.open(io.BytesIO(mc.read('assets/minecraft/textures/gui/' + path))).convert('RGBA')
gui = {'sprites/widget/button.png': casing_button(cr, 'andesite_casing', tone=0.82), gui = {'sprites/widget/button.png': casing_button(cr, 'andesite_casing', tone=0.82),
@@ -425,7 +522,7 @@ def main() -> None:
'sprites/widget/slider_handle_highlighted.png': plate(brass, 8, 20, 1.15), 'sprites/widget/slider_handle_highlighted.png': plate(brass, 8, 20, 1.15),
'sprites/widget/text_field_highlighted.png': tint(vanilla('sprites/widget/text_field_highlighted.png'), BRASS[3]), 'sprites/widget/text_field_highlighted.png': tint(vanilla('sprites/widget/text_field_highlighted.png'), BRASS[3]),
'sprites/widget/scroller.png': tint(vanilla('sprites/widget/scroller.png'), BRASS[3]), 'sprites/widget/scroller.png': tint(vanilla('sprites/widget/scroller.png'), BRASS[3]),
'sprites/icon/language.png': button_icon(LANGUAGE_ICON, canvas=15)} 'sprites/icon/language.png': on_canvas(globe_icon(13), 15)}
for name, (top, bottom) in (('header', (BRASS[0], BRASS[2])), ('footer', (BRASS[2], BRASS[0]))): for name, (top, bottom) in (('header', (BRASS[0], BRASS[2])), ('footer', (BRASS[2], BRASS[0]))):
line = Image.new('RGBA', (32, 2), top + (255,)) line = Image.new('RGBA', (32, 2), top + (255,))
line.paste(bottom + (255,), (0, 1, 32, 2)) line.paste(bottom + (255,), (0, 1, 32, 2))
@@ -449,15 +546,8 @@ def main() -> None:
def mono(s: int, colour) -> Image.Image: def mono(s: int, colour) -> Image.Image:
return lettering(mask_of(font, NAME, True), colour, s, depth=0, outline=False) return lettering(mask_of(font, NAME, True), colour, s, depth=0, outline=False)
# the logo itself: the same letters as `wordmark`, drawn ten times finer (see detailed_lettering) wordmark(12).save(OUT / 'logo' / 'wordmark.png')
fine = beside([detailed_lettering(mask_of(font, 'CREATE', True), brass, brass), stack([wordmark(12), motto(4)], gap=20).save(OUT / 'logo' / 'logo.png')
detailed_lettering(mask_of(font, 'RP', True), BRICK, brass)], gap=20)
logo = stack([fine, motto(4)], gap=15)
canvas = Image.new('RGBA', (-(-logo.width // 3) * 3, -(-logo.height // 3) * 3)) # sides multiples of 3: the menus
canvas.alpha_composite(logo, ((canvas.width - logo.width) // 2, 0)) # show it at a third, pixel for pixel
logo = canvas
fine.save(OUT / 'logo' / 'wordmark.png')
logo.save(OUT / 'logo' / 'logo.png')
mono(12, (255, 255, 255)).save(OUT / 'logo' / 'wordmark-white.png') mono(12, (255, 255, 255)).save(OUT / 'logo' / 'wordmark-white.png')
mono(12, INK).save(OUT / 'logo' / 'wordmark-dark.png') mono(12, INK).save(OUT / 'logo' / 'wordmark-dark.png')
@@ -497,16 +587,19 @@ def main() -> None:
# --- FancyMenu: title screen background, the logo it shows, window icons ------------------------- # --- 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') shade(cover(art, 1920, 1080), *((0.95, 1.0) if night else (0.80, 0.92))).convert('RGB').save(OUT / 'menu' / 'background.png')
shade(cover(art, 1920, 1080), 0.42, 0.42).convert('RGB').save(OUT / 'menu' / 'background_dim.png') # behind "Connecting…" shade(cover(art, 1920, 1080), 0.42, 0.42).convert('RGB').save(OUT / 'menu' / 'background_dim.png') # behind "Connecting…"
logo.save(OUT / 'menu' / 'logo.png') # shown at a third of its size: one screen pixel per texel at GUI scale 3 stack([wordmark(8), motto(3)], gap=12).save(OUT / 'menu' / 'logo.png')
# --- every button of the game: andesite casing, brass casing under the cursor --------------------------------- # --- every button of the game: andesite casing, brass casing under the cursor ---------------------------------
# EMI: its grey recipe panels and slots in cream, its small buttons in brass # EMI: its grey recipe panels and slots in cream, its small buttons in brass
if emi_jar: if emi_jar:
with zipfile.ZipFile(emi_jar) as emi: with zipfile.ZipFile(emi_jar) as emi:
for name, colour in (('background', CREAM), ('widgets', CREAM), ('buttons', BRASS[3])): andesite = (tuple(int(v) for v in casing_tile[1, 8]), tuple(int(v) for v in casing_tile[14, 8]))
for name, make in (('buttons', lambda s: casing_buttons(s, casing_wood, brass_wood, andesite)),
('background', lambda s: casingify(s, casing_wood, andesite, face=(222, 208, 178))),
('widgets', lambda s: greys_to(s, CREAM))):
sprite = Image.open(io.BytesIO(emi.read(f'assets/emi/textures/gui/{name}.png'))) sprite = Image.open(io.BytesIO(emi.read(f'assets/emi/textures/gui/{name}.png')))
target = OUT / 'resources' / 'emi' / 'textures' / 'gui' / f'{name}.png' target = OUT / 'resources' / 'emi' / 'textures' / 'gui' / f'{name}.png'
target.parent.mkdir(parents=True, exist_ok=True) target.parent.mkdir(parents=True, exist_ok=True)
greys_to(sprite, colour).save(target) make(sprite).save(target)
# branding/resources/<namespace>/… goes into the game as kubejs/assets/<namespace>/… # branding/resources/<namespace>/… goes into the game as kubejs/assets/<namespace>/…
for path, sprite in gui.items(): for path, sprite in gui.items():
@@ -516,8 +609,8 @@ def main() -> None:
if path in meta: if path in meta:
target.with_name(target.name + '.mcmeta').write_text(meta[path], encoding='utf-8', newline='\n') target.with_name(target.name + '.mcmeta').write_text(meta[path], encoding='utf-8', newline='\n')
button_icon(QUIT_ICON).save(OUT / 'menu' / 'quit.png') button_icon(QUIT_ICON, canvas=24).save(OUT / 'menu' / 'quit.png') # the corner buttons are 24 x 24
button_icon(SETTINGS_ICON).save(OUT / 'menu' / 'settings.png') on_canvas(gear_icon(14), 24).save(OUT / 'menu' / 'settings.png')
for name, rows in (('online', ONLINE_ICON), ('offline', OFFLINE_ICON), ('maintenance', MAINTENANCE_ICON)): for name, rows in (('online', ONLINE_ICON), ('offline', OFFLINE_ICON), ('maintenance', MAINTENANCE_ICON)):
button_icon(rows, outline=True, at=4).save(OUT / 'menu' / f'status-{name}.png') button_icon(rows, outline=True, at=4).save(OUT / 'menu' / f'status-{name}.png')
print('done:', ', '.join(sorted(str(p.relative_to(OUT)).replace('\\', '/') for p in OUT.rglob('*.png')))) print('done:', ', '.join(sorted(str(p.relative_to(OUT)).replace('\\', '/') for p in OUT.rglob('*.png'))))
+12 -7
View File
@@ -194,8 +194,9 @@ class Layout:
# --- the screens ------------------------------------------------------------------------------------------------------ # --- the screens ------------------------------------------------------------------------------------------------------
def logo_size() -> tuple: def logo_size() -> tuple:
"""The logo is 221 GUI pixels wide everywhere."""
w, h = Image.open(MENU / 'logo.png').size w, h = Image.open(MENU / 'logo.png').size
return w // 3, h // 3 return 221, round(h * 221 / w)
def title_screen(version: str, labels: dict) -> Layout: def title_screen(version: str, labels: dict) -> Layout:
@@ -209,11 +210,12 @@ def title_screen(version: str, labels: dict) -> Layout:
lay.vanilla('mc_titlescreen_singleplayer_button', anchor='mid-centered', x=-100, y=0, w=98) lay.vanilla('mc_titlescreen_singleplayer_button', anchor='mid-centered', x=-100, y=0, w=98)
lay.vanilla('mc_titlescreen_multiplayer_button', anchor='mid-centered', x=2, y=0, w=98, label='Сервери') lay.vanilla('mc_titlescreen_multiplayer_button', anchor='mid-centered', x=2, y=0, w=98, label='Сервери')
# bottom right corner: language, options, quit. Anchors give the corner; offsets are the element's top left. # bottom right corner: language, options, quit — 24 x 24, so a 14 px icon fits inside the casing frame.
lay.vanilla('376388', anchor='bottom-right', x=-72, y=-24, w=20) # language # Anchors give the corner; offsets are the element's top left.
lay.button('bottom-right', -48, -24, 20, icon='settings.png', tooltip='Налаштування', lay.vanilla('376388', anchor='bottom-right', x=-84, y=-28, w=24, h=24) # language
lay.button('bottom-right', -56, -28, 24, 24, icon='settings.png', tooltip='Налаштування',
action=('opengui', SCREENS + 'options.OptionsScreen')) action=('opengui', SCREENS + 'options.OptionsScreen'))
lay.button('bottom-right', -24, -24, 20, icon='quit.png', tooltip='Вийти з гри', action=('quitgame', '')) lay.button('bottom-right', -28, -28, 24, 24, icon='quit.png', tooltip='Вийти з гри', action=('quitgame', ''))
lay.vanilla('title_screen_copyright_button', anchor='bottom-centered', x=-98, y=-12, w=196, h=10) lay.vanilla('title_screen_copyright_button', anchor='bottom-centered', x=-98, y=-12, w=196, h=10)
# bottom left corner: the pack version and whether a newer release is out # bottom left corner: the pack version and whether a newer release is out
@@ -261,7 +263,10 @@ def game_menu() -> Layout:
lay.button('mid-centered', 2, -4, 100, label='Знайшов баг?', action=('openlink', GIT + '/issues/new'), lay.button('mid-centered', 2, -4, 100, label='Знайшов баг?', action=('openlink', GIT + '/issues/new'),
tooltip='Відкриє в браузері сторінку створення задачі в нашому Git', visible=[(SERVER_IP, 'if_not', HOST)]) tooltip='Відкриє в браузері сторінку створення задачі в нашому Git', visible=[(SERVER_IP, 'if_not', HOST)])
lay.button('mid-centered', -102, 20, 100, label='Налаштування...', action=('opengui', SCREENS + 'options.OptionsScreen')) lay.button('mid-centered', -102, 20, 100, label='Налаштування...', action=('opengui', SCREENS + 'options.OptionsScreen'))
lay.button('mid-centered', 2, 20, 100, label='Скарги на гравців', active=NEVER) lay.button('mid-centered', 2, 20, 100, label='Скарги на гравців', action=('paste_to_chat', 'false:/report '),
tooltip='Напиши нік гравця й що сталося, потім Enter — скаргу отримають модератори',
visible=[(SERVER_IP, 'if', HOST)])
lay.button('mid-centered', 2, 20, 100, label='Скарги на гравців', active=NEVER, visible=[(SERVER_IP, 'if_not', HOST)])
# leaving: from our server straight to the title screen, from another one to the server list as usual # leaving: from our server straight to the title screen, from another one to the server list as usual
ours, online = (SERVER_IP, 'if', HOST), (MULTIPLAYER, 'if', '') ours, online = (SERVER_IP, 'if', HOST), (MULTIPLAYER, 'if', '')
elsewhere = (SERVER_IP, 'if_not', HOST) elsewhere = (SERVER_IP, 'if_not', HOST)
@@ -336,7 +341,7 @@ def main() -> None:
options = option(options, 'custom_window_icon_32', '/config/fancymenu/assets/favicon-32x32.png') options = option(options, 'custom_window_icon_32', '/config/fancymenu/assets/favicon-32x32.png')
options = option(options, 'custom_window_icon_macos', '') options = option(options, 'custom_window_icon_macos', '')
options = option(options, 'global_background_panorama', '') options = option(options, 'global_background_panorama', '')
options = option(options, 'global_menu_background_texture', ASSET + 'background_dim.png') # every other menu screen options = option(options, 'global_menu_background_texture', '') # it also covered the world behind the game menu
(fm / 'options.txt').write_text(options, encoding='utf-8') (fm / 'options.txt').write_text(options, encoding='utf-8')
for source in RESOURCES.rglob('*'): # branding/resources/<namespace>/… → kubejs/assets/<namespace>/… for source in RESOURCES.rglob('*'): # branding/resources/<namespace>/… → kubejs/assets/<namespace>/…