Menus: generator for FancyMenu layouts, Create casing buttons, game menu, connecting screens, update check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fulldroper
2026-10-14 06:28:34 +03:00
co-authored by Claude Opus 5.5
parent 3876cb39a5
commit 4051a18f24
12 changed files with 901 additions and 2086 deletions
+38 -1
View File
@@ -298,14 +298,45 @@ def button_icon(rows: str, outline: bool = False) -> Image.Image:
return im
def casing_button(jar: zipfile.ZipFile, casing: str, tone: float = 1.0, grey: float = 0.0) -> Image.Image:
"""A 200x20 button sprite built from a Create casing: black outline, the casing's 3 px metal frame, its wood
inside. The wood is tiled with the block's own 16 px period and the sprite is nine-sliced with a 4 px border,
so the 192 px middle (12 tiles) repeats without a seam on buttons of any width."""
tile = texture(jar, f'assets/create/textures/block/{casing}.png')[..., :3].astype(int)
sheet = np.asarray(Image.open(io.BytesIO(
jar.read(f'assets/create/textures/block/{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)]
# the plain wood is the opaque tile of the connected sheet with the least contrast: every other one has frame in it
wood = min((c for c in cells if c[..., 3].min() == 255), key=lambda c: c[..., :3].std())[..., :3]
px = np.zeros((20, 200, 3), int)
px[1:19, 1:199] = np.tile(wood, (2, 13, 1))[2:20, :198] # wood everywhere inside the outline
for i in range(3): # frame rows and columns, taken from the block's edges
px[1 + i, 1:199] = np.tile(tile[i, 3:13], (20, 1))[:198]
px[18 - i, 1:199] = np.tile(tile[15 - i, 3:13], (20, 1))[:198]
px[1:19, 1 + i] = np.tile(tile[3:13, i], (2, 1))[:18]
px[1:19, 198 - i] = np.tile(tile[3:13, 15 - i], (2, 1))[:18]
for (y, x), (ty, tx) in (((1, 1), (0, 0)), ((1, 196), (0, 13)), ((16, 1), (13, 0)), ((16, 196), (13, 13))):
px[y:y + 3, x:x + 3] = tile[ty:ty + 3, tx:tx + 3] # the four corners
px[1:19, 1:199] = px[1:19, 1:199] * tone
mean = px.mean(axis=2, keepdims=True)
px = np.clip(px * (1 - grey) + mean * grey, 0, 255)
return Image.fromarray(px.astype(np.uint8), 'RGB').convert('RGBA')
BUTTON_META = '{"gui": {"scaling": {"type": "nine_slice", "width": 200, "height": 20, "border": 4}}}\n'
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
with zipfile.ZipFile(mc_jar) as mc, zipfile.ZipFile(create_jar) as cr:
font = Font(mc)
brass = texture(cr, 'assets/create/textures/block/brass_block.png')
buttons = {'button': casing_button(cr, 'andesite_casing', tone=0.82),
'button_highlighted': casing_button(cr, 'brass_casing', tone=1.12),
'button_disabled': casing_button(cr, 'andesite_casing', tone=0.42, grey=0.6)}
for d in ('logo', 'icons', 'banners', 'menu'):
for d in ('logo', 'icons', 'banners', 'menu', 'ui'):
(OUT / d).mkdir(parents=True, exist_ok=True)
# --- wordmark: CREATE in brass, RP in brick red, the motto underneath -------------------------
@@ -359,7 +390,13 @@ 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')
shade(cover(art, 1920, 1080), 0.42, 0.42).convert('RGB').save(OUT / 'menu' / 'background_dim.png') # behind "Connecting…"
stack([wordmark(8), motto(3)], gap=12).save(OUT / 'menu' / 'logo.png')
# --- every button of the game: andesite casing, brass casing under the cursor ---------------------------------
for name, sprite in buttons.items():
sprite.save(OUT / 'ui' / f'{name}.png')
(OUT / 'ui' / f'{name}.png.mcmeta').write_text(BUTTON_META, encoding='utf-8', newline='\n')
button_icon(QUIT_ICON).save(OUT / 'menu' / 'quit.png')
button_icon(SETTINGS_ICON).save(OUT / 'menu' / 'settings.png')
for name, rows in (('online', ONLINE_ICON), ('offline', OFFLINE_ICON), ('maintenance', MAINTENANCE_ICON)):
+276 -31
View File
@@ -1,20 +1,26 @@
"""Writes the FancyMenu configuration of the Create RP title screen into a game's config folder.
"""Installs the Create RP look of the game's menus into a game folder — a profile or the client pack.
python tools/branding/fancymenu.py <config dir> <1.21.1.jar> [pack version]
<config dir> is the client pack's config/ or a profile's config/. The version is read from pack.toml next to the
config dir when it is not given.
<config dir> is the pack's or the profile's config/. The version is read from pack.toml next to it when not given.
Run it again after every version bump: the version label is a picture and the update check compares with it.
Layout: the key art as the background, our logo instead of Minecraft's, a wide "Грати" button that joins the server
(active only while the server is online) with a status icon beside it, single player and the server list, then a
row of icon buttons: language, options, quit. Minecraft's own lines in the bottom left corner are replaced with
the pack version. The layout file itself is
branding/menu/title_screen_layout.txt; this script copies it with the pictures, draws the version label and
switches the window title, the window icon and the title-screen customisation on.
What it writes:
config/fancymenu/assets/ pictures: background, logo, icons, version and update labels
config/fancymenu/customization/ layouts, built here from fancymenu_template.txt:
createrp_title.txt the title screen
createrp_screens.txt connecting / loading / disconnected screens: our background and logo
createrp_pause.txt the game menu
config/fancymenu/custom_gui_screens.txt the game menu is our own screen that replaces Minecraft's one, so that
buttons other mods add to the pause screen (Mods, Create) never get into it
config/fancymenu/customizablemenus.txt, options.txt which screens are customised; window title and icon
kubejs/assets/minecraft/…/widget/ button sprites for the whole game: andesite casing, brass under the cursor
config/create-client.toml Create's own button is taken out of the title screen and the game menu
"""
import re
import shutil
import sys
import uuid
import zipfile
from pathlib import Path
@@ -23,10 +29,242 @@ from PIL import Image
ROOT = Path(__file__).resolve().parent.parent.parent
sys.path.insert(0, str(ROOT / 'tools' / 'signs'))
from render import Font # noqa: E402 (the pixel font reader made for the building signs)
from render import BASELINE, LINE_H, Font # noqa: E402 (the pixel font reader made for the building signs)
MENU, ICONS = ROOT / 'branding' / 'menu', ROOT / 'branding' / 'icons'
MENU, ICONS, UI = ROOT / 'branding' / 'menu', ROOT / 'branding' / 'icons', ROOT / 'branding' / 'ui'
WINDOW_TITLE = 'Create RP'
HOST = 'create.fulldroper.ks.ua'
GIT = 'https://git.fulldroper.ks.ua/Pinecraft-CreateRP/client'
LATEST_RELEASE = 'https://git.fulldroper.ks.ua/api/v1/repos/Pinecraft-CreateRP/client/releases/latest'
ASSET = '[source:local]/config/fancymenu/assets/'
SCREENS = 'net.minecraft.client.gui.screens.'
# screens that get our background and logo: (FancyMenu's name, class)
PLAIN_SCREENS = [('connect_screen', 'ConnectScreen'), ('disconnected_screen', 'DisconnectedScreen'),
('generic_dirt_message_screen', 'GenericMessageScreen'), ('receiving_level_screen', 'ReceivingLevelScreen'),
('progress_screen', 'ProgressScreen'), ('level_loading_screen', 'LevelLoadingScreen')]
PAUSE_GUI = 'createrp_pause'
# --- FancyMenu's file format: "name {", " key = value" lines, "}" -------------------------------------------------
def parse(text: str) -> list:
blocks = []
for chunk in text.replace('\r\n', '\n').strip().split('\n\n'):
lines = chunk.split('\n')
if not lines[0].endswith('{'):
continue # the "type = …" line
props = {}
for line in lines[1:-1]:
key, _, value = line[2:].partition(' =')
props[key] = value[1:] if value.startswith(' ') else value
blocks.append((lines[0][:-2], props))
return blocks
def dump(kind: str, blocks: list) -> str:
out = [f'type = {kind}']
for name, props in blocks:
out.append('\n'.join([name + ' {'] + [f' {k} = {v}' for k, v in props.items()] + ['}']))
return '\n\n'.join(out) + '\n\n'
TEMPLATE = parse(Path(__file__).with_name('fancymenu_template.txt').read_text(encoding='utf-8'))
HEAD = [b for b in TEMPLATE if b[0] not in ('element', 'vanilla_button')]
IMAGE = next(p for n, p in TEMPLATE if p.get('element_type') == 'image')
BUTTON = next(p for n, p in TEMPLATE if p.get('element_type') == 'custom_button')
VANILLA = next(p for n, p in TEMPLATE if n == 'vanilla_button')
ID = re.compile(r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-\d{13}')
def uid(name: str) -> str:
"""An identifier in the shape FancyMenu gives its own, stable from run to run."""
return f'{uuid.uuid5(uuid.NAMESPACE_URL, "createrp/" + name)}-1791960000000'
# --- requirements: conditions FancyMenu checks while the screen is shown ---------------------------------------------
ONLINE, TEXT, SERVER_IP = ('fancymenu_loading_requirement_is_server_online', 'fancymenu_visibility_requirement_is_text',
'fancymenu_visibility_requirement_is_server_ip')
MULTIPLAYER = 'fancymenu_loading_requirement_is_multiplayer'
MOTD = '{"placeholder":"servermotd","values":{"ip":"%s","line":"1"}}' % HOST
LATEST = '{"placeholder":"json","values":{"source":"%s","json_path":"$.tag_name"}}' % LATEST_RELEASE
def text_is(mode: str, text: str, compare: str) -> str:
return f'["mode":"{mode}","text":"{text}","compare_with":"{compare}"]$'
def server(state: str) -> list:
"""What the server list ping says. No answer: offline. The proxy answers with its own MOTD while the game server
is stopped: maintenance. The game server's MOTD has "Create" in it: online."""
answers, ours = (ONLINE, 'if', HOST), text_is('contains', MOTD, 'Create')
return {'online': [answers, (TEXT, 'if', ours)], 'maintenance': [answers, (TEXT, 'if_not', ours)],
'offline': [(ONLINE, 'if_not', HOST)]}[state]
NEVER = [(TEXT, 'if', text_is('equals', 'a', 'b'))]
class Layout:
def __init__(self, name: str, identifier: str, background: str = '', whitelist=(), fireflies: bool = False):
self.name, self.count, self.blocks = name, 0, []
for kind, template in HEAD:
props = self._fresh(template, kind)
if kind == 'layout-meta':
props['identifier'] = identifier
if whitelist:
props['universal_layout_whitelist'] = ''.join(s + ';' for s in whitelist)
elif kind == 'menu_background':
shown = bool(background) and props['background_type'] == 'image'
props['show_background'] = str(shown).lower()
if shown:
props['image_path'] = ASSET + background
elif kind == 'decoration_overlay':
props['show_decoration_overlay'] = str(fireflies and props['overlay_type'] == 'fireflies').lower()
self.blocks.append((kind, props))
def _fresh(self, template: dict, tag: str) -> dict:
"""A copy of a template block with identifiers of its own."""
self.count += 1
seen = {}
def swap(s: str) -> str:
return ID.sub(lambda m: seen.setdefault(m.group(0), uid(f'{self.name}/{tag}/{self.count}/{len(seen)}')), s)
return {swap(k): swap(v) for k, v in template.items()}
@staticmethod
def _require(props: dict, container_key: str, reqs) -> None:
container, ids = props[container_key], []
for n, (requirement, mode, value) in enumerate(reqs):
ids.append(uid(f'{container}/{n}'))
props[f'[loading_requirement:{requirement}][requirement_mode:{mode}][req_id:{ids[-1]}]'] = value
props[f'[loading_requirement_container_meta:{container}]'] = '[groups:][instances:' + ''.join(i + ';' for i in ids) + ']'
@staticmethod
def _place(props: dict, anchor: str, x: int, y: int, w: int, h: int) -> None:
props.update(anchor_point=anchor, x=str(x), y=str(y), width=str(w), height=str(h))
def image(self, source: str, anchor: str, x: int, y: int, w: int, h: int, visible=()) -> None:
props = self._fresh(IMAGE, 'image')
props['source'] = ASSET + source
self._place(props, anchor, x, y, w, h)
self._require(props, 'element_loading_requirement_container_identifier', visible)
self.blocks.append(('element', props))
def button(self, anchor: str, x: int, y: int, w: int, h: int = 20, label: str = '', icon: str = '', tooltip: str = '',
action=None, transparent: bool = False, active=(), visible=()) -> None:
"""A button of ours. `icon` is a picture drawn over it at the button's height; `action` is (type, value)."""
props = self._fresh(BUTTON, 'button')
if label:
props['label'] = label
if icon:
props['iconnormal'] = props['iconhovered'] = props['icon_texture_inactive'] = ASSET + icon
if tooltip:
props['description'] = tooltip
if action:
act = uid(props['instance_identifier'] + '/action')
props[f'[executable_action_instance:{act}][action_type:{action[0]}]'] = action[1]
props[f"[executable_block:{props['button_element_executable_block_identifier']}][type:generic]"] = f'[executables:{act};]'
props['transparent_background'] = str(transparent).lower()
self._place(props, anchor, x, y, w, h)
self._require(props, 'widget_active_state_requirement_container_identifier', active)
self._require(props, 'element_loading_requirement_container_identifier', visible)
self.blocks.append(('element', props))
def vanilla(self, identifier: str, hidden: bool = False, anchor: str = 'vanilla', x: int = 0, y: int = 0, w: int = 0,
h: int = 20, label: str = '') -> None:
"""A widget of the screen itself: moved (any anchor but "vanilla"), renamed or hidden."""
props = self._fresh(VANILLA, 'vanilla')
props['instance_identifier'] = identifier
if label:
props['label'] = label
self._place(props, anchor, x, y, w, h)
props['is_hidden'] = str(hidden).lower()
self.blocks.append(('vanilla_button', props))
def text(self) -> str:
return dump('fancymenu_layout', self.blocks)
# --- the screens ------------------------------------------------------------------------------------------------------
def title_screen(version: str, labels: dict) -> Layout:
lay = Layout('title', 'title_screen', background='background.png', fireflies=True)
lay.image('logo.png', 'mid-centered', -110, -104, 221, 60)
# a button-high gap under the logo, then rows 24 apart
lay.button('mid-centered', -100, -24, 200, label='Грати', action=('joinserver', HOST), active=server('online'))
for state, tip in (('online', 'Сервер онлайн'), ('maintenance', 'Технічні роботи'), ('offline', 'Сервер офлайн')):
lay.button('mid-centered', 104, -24, 20, icon=f'status-{state}.png', tooltip=tip, transparent=True, visible=server(state))
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='Сервери')
# bottom right corner: language, options, quit. Anchors give the corner; offsets are the element's top left.
lay.vanilla('376388', anchor='bottom-right', x=-72, y=-24, w=20) # language
lay.button('bottom-right', -48, -24, 20, icon='settings.png', tooltip='Налаштування',
action=('opengui', SCREENS + 'options.OptionsScreen'))
lay.button('bottom-right', -24, -24, 20, icon='quit.png', tooltip='Вийти з гри', action=('quitgame', ''))
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
vw, vh = labels['version'].size
lay.image('version.png', 'bottom-left', 2, -vh - 2, vw, vh)
tag, (w, h) = 'v' + version, labels['uptodate'].size
lay.image('uptodate.png', 'bottom-left', vw + 8, -vh - 2, w, h, visible=[(TEXT, 'if', text_is('equals', LATEST, tag))])
w, h = labels['update'].size
lay.button('bottom-left', vw + 8, -vh - 2, w, h, icon='update.png', transparent=True,
tooltip='Нова версія збірки: ' + LATEST + '. Натисни, щоб відкрити сторінку завантаження.',
action=('openlink', GIT + '/releases/latest'),
visible=[(TEXT, 'if', text_is('starts-with', LATEST, 'v')), (TEXT, 'if_not', text_is('equals', LATEST, tag))])
for gone in ('376306', '604388', # Create's button, accessibility
'forge_titlescreen_mods_button', 'mc_titlescreen_options_button', 'mc_titlescreen_quit_button',
'mc_titlescreen_realms_button', 'minecraft_branding_widget', 'minecraft_splash_widget',
'minecraft_logo_widget', 'minecraft_realms_notification_icons_widget'):
lay.vanilla(gone, hidden=True)
return lay
def plain_screens() -> Layout:
"""Connecting, loading terrain, disconnected and the like: the dimmed key art and the logo at the top."""
lay = Layout('screens', '%fancymenu:universal_layout%', background='background_dim.png',
whitelist=[name for name, _ in PLAIN_SCREENS])
lay.image('logo.png', 'top-centered', -110, 16, 221, 60)
return lay
def game_menu() -> Layout:
lay = Layout('pause', PAUSE_GUI)
lay.image('logo.png', 'mid-centered', -110, -112, 221, 60)
lay.button('mid-centered', -102, -28, 204, label='Назад до гри', action=('closegui', ''))
lay.button('mid-centered', -102, -4, 100, label='Залишити відгук', active=NEVER)
lay.button('mid-centered', 2, -4, 100, label='Знайшов баг?', action=('openlink', GIT + '/issues/new'),
tooltip='Відкриє в браузері сторінку створення задачі в нашому Git')
lay.button('mid-centered', -102, 20, 100, label='Налаштування...', action=('opengui', SCREENS + 'options.OptionsScreen'))
lay.button('mid-centered', 2, 20, 100, label='Скарги на гравців', active=NEVER)
# 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', '')
elsewhere = (SERVER_IP, 'if_not', HOST)
for label, after, when in (("Від'єднатися", 'title_screen', [ours]),
("Від'єднатися", 'join_multiplayer_screen', [elsewhere, online]),
('Зберегти й вийти в меню', 'title_screen', [elsewhere, (MULTIPLAYER, 'if_not', '')])):
lay.button('mid-centered', -102, 44, 204, label=label, action=('disconnect_server_or_world', after), visible=when)
return lay
CUSTOM_GUIS = dump('custom_gui_screens', [
('overridden_screens', {'pause_screen': PAUSE_GUI}),
('custom_gui', {'identifier': PAUSE_GUI, 'title': 'Ігрове меню', 'allow_esc': 'true',
'transparent_world_background': 'true', 'transparent_world_background_overlay': 'true',
'pause_game': 'true', 'popup_mode': 'false', 'popup_mode_background_overlay': 'true'})])
# --- pictures made here ---------------------------------------------------------------------------------------------
def label(font: Font, text: str, colour=(255, 255, 255)) -> Image.Image:
"""A line of text exactly as the game draws it: with the dark shadow one pixel down and right. Every label is
10 px high — capitals, room for descenders, the shadow — so labels put side by side share a baseline."""
mask = font.line(text)[BASELINE - 7:LINE_H]
h, w = mask.shape
px = np.zeros((h + 1, w + 1, 4), np.uint8)
px[1:, 1:][mask] = tuple(c // 4 for c in colour) + (255,)
px[:-1, :-1][mask] = colour + (255,)
return Image.fromarray(px, 'RGBA')
def option(text: str, key: str, value: str) -> str:
@@ -36,18 +274,6 @@ def option(text: str, key: str, value: str) -> str:
return pattern.sub(lambda m: m.group(1) + value + m.group(2), text)
def label(font: Font, text: str) -> Image.Image:
"""A line of text exactly as the game draws it: white, with the dark shadow one pixel down and right."""
mask = font.line(text)
rows = np.nonzero(mask.any(axis=1))[0]
mask = mask[rows.min():rows.max() + 1]
h, w = mask.shape
px = np.zeros((h + 1, w + 1, 4), np.uint8)
px[1:, 1:][mask] = (63, 63, 63, 255)
px[:-1, :-1][mask] = (255, 255, 255, 255)
return Image.fromarray(px, 'RGBA')
def main() -> None:
config = Path(sys.argv[1])
fm = config / 'fancymenu'
@@ -56,19 +282,27 @@ def main() -> None:
else:
version = re.search(r'^version = "([^"]+)"', (config.parent / 'pack.toml').read_text(encoding='utf-8'), re.M).group(1)
with zipfile.ZipFile(sys.argv[2]) as jar:
version_label = label(Font(jar), f'{WINDOW_TITLE} {version}')
font = Font(jar)
labels = {'version': label(font, f'{WINDOW_TITLE} {version}'),
'uptodate': label(font, '- остання версія', (130, 200, 120)),
'update': label(font, '- є оновлення, натисни', (255, 216, 61))}
(fm / 'assets').mkdir(parents=True, exist_ok=True)
(fm / 'customization').mkdir(parents=True, exist_ok=True)
for picture in MENU.glob('*.png'): # background, logo, button and status icons
for picture in MENU.glob('*.png'): # backgrounds, logo, button and status icons
shutil.copyfile(picture, fm / 'assets' / picture.name)
version_label.save(fm / 'assets' / 'version.png')
for name, picture in labels.items():
picture.save(fm / 'assets' / f'{name}.png')
for icon in ('favicon-16x16.png', 'favicon-32x32.png'):
shutil.copyfile(ICONS / icon, fm / 'assets' / icon)
layout = (MENU / 'title_screen_layout.txt').read_text(encoding='utf-8')
layout = layout.replace('{version_width}', str(version_label.width)).replace('{version_height}', str(version_label.height))
(fm / 'customization' / 'title_screen_layout.txt').write_text(layout, encoding='utf-8', newline='\n')
(fm / 'customization' / 'title_screen_layout.txt').unlink(missing_ok=True) # the name used before the generator
for name, layout in (('title', title_screen(version, labels)), ('screens', plain_screens()), ('pause', game_menu())):
(fm / 'customization' / f'createrp_{name}.txt').write_text(layout.text(), encoding='utf-8', newline='\n')
(fm / 'custom_gui_screens.txt').write_text(CUSTOM_GUIS, encoding='utf-8', newline='\n')
(fm / 'customizablemenus.txt').write_text(
'type = customizablemenus\n\nnet.minecraft.client.gui.screens.TitleScreen {\n}\n\n', encoding='utf-8')
'type = customizablemenus\n\n' + ''.join(f'{SCREENS}{c} {{\n}}\n\n' for c in ['TitleScreen'] + [c for _, c in PLAIN_SCREENS]),
encoding='utf-8', newline='\n')
options = (fm / 'options.txt').read_text(encoding='utf-8')
options = option(options, 'custom_window_title', WINDOW_TITLE)
@@ -78,7 +312,18 @@ def main() -> None:
options = option(options, 'custom_window_icon_macos', '')
options = option(options, 'global_background_panorama', '')
(fm / 'options.txt').write_text(options, encoding='utf-8')
print('title screen installed into', fm, '| version label:', version, version_label.size)
sprites = config.parent / 'kubejs' / 'assets' / 'minecraft' / 'textures' / 'gui' / 'sprites' / 'widget'
sprites.mkdir(parents=True, exist_ok=True)
for sprite in UI.iterdir(): # button.png, button_highlighted.png, button_disabled.png and their .mcmeta
shutil.copyfile(sprite, sprites / sprite.name)
create = config / 'create-client.toml' # Create draws its button itself; row 0 switches it off
if create.is_file():
text = create.read_text(encoding='utf-8')
text = re.sub(r'^(\s*(?:mainMenu|ingameMenu)ConfigButtonRow = )\d+', r'\g<1>0', text, flags=re.M)
create.write_text(text, encoding='utf-8')
print('menus installed into', config.parent, '| version', version)
if __name__ == '__main__':
+559
View File
@@ -0,0 +1,559 @@
type = fancymenu_layout
layout-meta {
identifier = title_screen
render_custom_elements_behind_vanilla = true
last_edited_time = 1791943841549
is_enabled = true
randommode = false
randomgroup = 1
randomonlyfirsttime = false
layout_index = 0
[loading_requirement_container_meta:44bc0572-ec7b-4ce4-ba68-acb7c06483ea-1778523942417] = [groups:][instances:]
}
menu_background {
instance_identifier = 56410b41-5c93-4890-9c5a-ea4b95d30238-1778341927600
background_type = color_fancymenu
show_background = false
color = #FFC800FF
}
menu_background {
instance_identifier = ff17dd8a-cef9-47cc-94d3-e4b3f8ba754f-1778341927601
background_type = panorama
show_background = false
}
menu_background {
instance_identifier = 2e0adeef-ddd0-4713-83fb-3a9a77892d16-1778341927601
background_type = image
show_background = true
image_path = [source:local]/config/fancymenu/assets/background.png
slide = false
repeat_texture = false
parallax = false
parallax_intensity_x = 0.02
parallax_intensity_y = 0.02
invert_parallax = false
restart_animated_on_menu_load = false
}
menu_background {
instance_identifier = 4738d53f-1514-42c9-ba93-d8fe97d13b75-1778341927601
background_type = slideshow
show_background = false
}
menu_background {
instance_identifier = c374bc2b-db7b-4802-b7a6-d3f354bf4d40-1778341927601
background_type = video
show_background = false
loop = false
volume = 1.0
sound_source = master
parallax = false
parallax_intensity_x = 0.02
parallax_intensity_y = 0.02
invert_parallax = false
play_in_editor = true
}
menu_background {
instance_identifier = e2f01874-4736-42f1-b755-7e3d33a89695-1778341927601
background_type = video_mcef
show_background = false
loop = false
volume = 1.0
sound_source = master
parallax = false
parallax_intensity_x = 0.02
parallax_intensity_y = 0.02
invert_parallax = false
}
menu_background {
instance_identifier = a61ae1c5-1d4d-4b70-a8a2-3ea01337bfad-1778341927601
background_type = browser
show_background = false
url = https://docs.fancymenu.net
consume_mouse_clicks = true
consume_mouse_scrolls = true
consume_keyboard_presses = true
process_mouse_clicks = true
process_mouse_scrolls = true
process_keyboard_presses = true
hide_video_controls = false
loop_videos = false
mute_media = false
media_volume = 1.0
}
menu_background {
instance_identifier = 58d10a53-9b6a-457d-a425-e9b4abb18797-1778341927601
background_type = glsl
show_background = false
inline_shader_source =
buffer_a_inline_source =
buffer_b_inline_source =
buffer_c_inline_source =
buffer_d_inline_source =
image_ichannel0_input = none
image_ichannel1_input = none
image_ichannel2_input = none
image_ichannel3_input = none
buffer_a_ichannel0_input = none
buffer_a_ichannel1_input = none
buffer_a_ichannel2_input = none
buffer_a_ichannel3_input = none
buffer_b_ichannel0_input = none
buffer_b_ichannel1_input = none
buffer_b_ichannel2_input = none
buffer_b_ichannel3_input = none
buffer_c_ichannel0_input = none
buffer_c_ichannel1_input = none
buffer_c_ichannel2_input = none
buffer_c_ichannel3_input = none
buffer_d_ichannel0_input = none
buffer_d_ichannel1_input = none
buffer_d_ichannel2_input = none
buffer_d_ichannel3_input = none
compile_mode = auto
force_shadertoy_compatibility = true
freeze_time = false
time_scale = 1.0
enable_blending = true
use_input = true
mouse_position_requires_hold = false
opacity_multiplier = 1.0
show_compile_errors = true
}
decoration_overlay {
overlay_type = browser
instance_identifier = 320ecc17-9891-4b9b-ad12-2fb7b0e0155a-1778341927601
show_decoration_overlay = false
url = https://docs.fancymenu.net
consume_mouse_clicks = true
consume_mouse_scrolls = true
consume_keyboard_presses = true
process_mouse_clicks = true
process_mouse_scrolls = true
process_keyboard_presses = true
hide_video_controls = false
loop_videos = false
mute_media = false
media_volume = 1.0
}
decoration_overlay {
overlay_type = glsl
instance_identifier = 8e355a84-1d01-4289-8671-0c53b11ac1a4-1778341927601
show_decoration_overlay = false
inline_shader_source =
buffer_a_inline_source =
buffer_b_inline_source =
buffer_c_inline_source =
buffer_d_inline_source =
image_ichannel0_input = none
image_ichannel1_input = none
image_ichannel2_input = none
image_ichannel3_input = none
buffer_a_ichannel0_input = none
buffer_a_ichannel1_input = none
buffer_a_ichannel2_input = none
buffer_a_ichannel3_input = none
buffer_b_ichannel0_input = none
buffer_b_ichannel1_input = none
buffer_b_ichannel2_input = none
buffer_b_ichannel3_input = none
buffer_c_ichannel0_input = none
buffer_c_ichannel1_input = none
buffer_c_ichannel2_input = none
buffer_c_ichannel3_input = none
buffer_d_ichannel0_input = none
buffer_d_ichannel1_input = none
buffer_d_ichannel2_input = none
buffer_d_ichannel3_input = none
compile_mode = auto
force_shadertoy_compatibility = true
freeze_time = false
time_scale = 1.0
enable_blending = true
use_input = true
mouse_position_requires_hold = false
opacity_multiplier = 1.0
show_compile_errors = true
}
decoration_overlay {
overlay_type = buddy
instance_identifier = 4e41b0f5-2e31-4591-a4aa-3f3161ec7db2-1778341927601
show_decoration_overlay = false
buddy_hunger_decay_per_tick = 0.005
buddy_happiness_decay_per_tick = 0.003
buddy_fun_decay_per_tick = 0.002
buddy_energy_decay_per_tick = 0.002
buddy_energy_sleep_regen_per_tick = 0.03
buddy_play_energy_drain_per_tick = 0.03
buddy_play_fun_gain_per_tick = 0.05
buddy_play_happiness_gain_per_tick = 0.01
buddy_play_hunger_drain_per_tick = 0.01
buddy_chase_energy_drain_per_tick = 0.024
buddy_chase_hunger_drain_per_tick = 0.005
buddy_hop_energy_drain_per_tick = 0.005
buddy_hop_hunger_drain_per_tick = 0.002
buddy_excited_energy_drain_per_tick = 0.01
buddy_excited_happiness_gain_per_tick = 0.01
buddy_excited_hunger_drain_per_tick = 0.003
buddy_running_energy_drain_per_tick = 0.01
buddy_running_hunger_drain_per_tick = 0.005
buddy_food_hunger_gain = 20.0
buddy_food_happiness_gain = 5.0
buddy_pet_happiness_gain = 15.0
buddy_wakeup_happiness_penalty = 2.5
buddy_max_poops_cap = 10
buddy_can_die = true
}
decoration_overlay {
overlay_type = string_lights
instance_identifier = d1462f65-f61b-4422-ad27-217e843d8a6a-1778341927601
show_decoration_overlay = false
string_lights_scale = 1.0
string_lights_wind_strength = 1.0
string_lights_flicker_speed = 1.0
string_lights_left_center_to_top_center = true
string_lights_right_center_to_top_center = true
string_lights_bottom_left_to_top_center = false
string_lights_bottom_right_to_top_center = false
string_lights_top_left_to_top_right = true
string_lights_bottom_left_to_bottom_right = false
string_lights_loose_left_top = false
string_lights_loose_right_top = false
string_lights_left_center_to_top_center_christmas_mode = false
string_lights_right_center_to_top_center_christmas_mode = false
string_lights_bottom_left_to_top_center_christmas_mode = false
string_lights_bottom_right_to_top_center_christmas_mode = false
string_lights_top_left_to_top_right_christmas_mode = false
string_lights_bottom_left_to_bottom_right_christmas_mode = false
string_lights_loose_left_top_christmas_mode = false
string_lights_loose_right_top_christmas_mode = false
string_lights_left_center_to_top_center_color_hex = #FFD27A
string_lights_right_center_to_top_center_color_hex = #FFD27A
string_lights_bottom_left_to_top_center_color_hex = #FFD27A
string_lights_bottom_right_to_top_center_color_hex = #FFD27A
string_lights_top_left_to_top_right_color_hex = #FFD27A
string_lights_bottom_left_to_bottom_right_color_hex = #FFD27A
string_lights_loose_left_top_color_hex = #FFD27A
string_lights_loose_right_top_color_hex = #FFD27A
}
decoration_overlay {
overlay_type = fireworks
instance_identifier = 3687a131-3f4f-4df0-aca5-a79565f1b0be-1778341927601
show_decoration_overlay = false
fireworks_scale = 1.0
fireworks_explosion_size = 1.0
fireworks_amount = 1.0
fireworks_show_rockets = true
}
decoration_overlay {
overlay_type = snowfall
instance_identifier = df619a97-2d75-4d51-88c9-324c48c7cd25-1778341927601
show_decoration_overlay = false
snow_intensity = 1.0
snow_scale = 1.0
snow_speed = 1.0
snow_accumulation = true
snow_color_hex = #FFFFFF
}
decoration_overlay {
overlay_type = rainfall
instance_identifier = 8e36f13f-4482-4c29-b971-28a4f5497359-1778341927601
show_decoration_overlay = false
rain_intensity = 1.0
rain_scale = 1.0
rain_thunder_brightness = 1.0
rain_puddles = true
rain_drips = true
rain_thunder = false
rain_color_hex = #CFE7FF
}
decoration_overlay {
overlay_type = fireflies
instance_identifier = 81a3a82e-84dd-4ca8-bf01-6c1558752725-1778341927601
show_decoration_overlay = true
firefly_group_density = 1.0
firefly_group_amount = 1.0
firefly_group_size = 1.0
firefly_scale = 1.0
firefly_follow_mouse = true
firefly_landing = true
firefly_color_hex = #FFE08A
}
decoration_overlay {
overlay_type = leaves
instance_identifier = e896eac8-747d-419d-ae50-1536955ed851-1778341927601
show_decoration_overlay = false
leaves_density = 1.0
leaves_wind_intensity = 1.0
leaves_wind_blows = true
leaves_fall_speed = 1.0
leaves_scale = 1.0
leaves_color_start_hex = #7BA84F
leaves_color_end_hex = #D58A3B
}
decoration_overlay {
overlay_type = confetti
instance_identifier = 80da72d5-fd9b-4552-a51f-11d72d32388d-1778341927601
show_decoration_overlay = false
confetti_scale = 1.0
confetti_fall_speed = 1.0
confetti_burst_density = 1.0
confetti_burst_amount = 1.0
confetti_particle_cap = 500
confetti_color_mix_mode = true
confetti_mouse_click_mode = false
confetti_color_hex = #FFFFFF
}
customization {
action = backgroundoptions
keepaspectratio = false
}
scroll_list_customization {
preserve_scroll_list_header_footer_aspect_ratio = true
render_scroll_list_header_shadow = true
render_scroll_list_footer_shadow = true
show_scroll_list_header_footer_preview_in_editor = false
repeat_scroll_list_header_texture = false
repeat_scroll_list_footer_texture = false
show_screen_background_overlay_on_custom_background = false
apply_vanilla_background_blur = false
}
layout_action_executable_blocks {
}
element {
element_type = image
instance_identifier = 1566f8f7-44f7-41e4-a292-6f8a73be37c6-1778342040128
appearance_delay = no_delay
disappearance_delay = no_delay
fade_in_v2 = no_fading
fade_out = no_fading
auto_sizing = false
auto_sizing_base_screen_width = 2560
auto_sizing_base_screen_height = 1355
sticky_anchor = false
anchor_point = mid-centered
x = -110
y = -104
width = 221
height = 60
stay_on_screen = true
element_loading_requirement_container_identifier = 6735ee2e-e532-4d6d-bcc6-5f8ca1138f7d-1778342040128
[loading_requirement_container_meta:6735ee2e-e532-4d6d-bcc6-5f8ca1138f7d-1778342040128] = [groups:][instances:]
enable_parallax = false
invert_parallax = false
animated_offset_x = 0
animated_offset_y = 0
load_once_per_session = false
layer_hidden_in_editor = false
advanced_rotation_mode = false
advanced_vertical_tilt_mode = false
advanced_horizontal_tilt_mode = false
should_be_affected_by_decoration_overlays = false
in_editor_color = #FFC800FF
advanced_posx = -2147483648
advanced_posy = -2147483648
advanced_width = -2147483648
advanced_height = -2147483648
stretch_x = false
stretch_y = false
appearance_delay_seconds = 1.0
disappearance_delay_seconds = 1.0
fade_in_speed = 1.0
fade_out_speed = 1.0
base_opacity = 1.0
parallax_intensity_x = 0.5
parallax_intensity_y = 0.5
rotation_degrees = 0.0
advanced_rotation_degrees = 0.0
vertical_tilt_degrees = 0.0
advanced_vertical_tilt_degrees = 0.0
horizontal_tilt_degrees = 0.0
advanced_horizontal_tilt_degrees = 0.0
source = [source:local]/config/fancymenu/assets/logo.png
repeat_texture = false
nine_slice_texture = false
nine_slice_texture_border_x = 5
nine_slice_texture_border_y = 5
restart_animated_on_menu_load = false
image_tint = #FFFFFF
rounding_radius_top_left = 0.0
rounding_radius_top_right = 0.0
rounding_radius_bottom_right = 0.0
rounding_radius_bottom_left = 0.0
}
element {
button_element_executable_block_identifier = c0ffee10-0000-4000-8000-000000000000-1791960000000
[executable_block:c0ffee10-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:]
underline_label_on_hover = false
transparent_background = false
restartbackgroundanimations = true
nine_slice_custom_background = false
navigatable = true
widget_active_state_requirement_container_identifier = c0ffee10-0000-4000-8000-000000000002-1791960000000
[loading_requirement_container_meta:c0ffee10-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:]
is_template = false
template_apply_width = false
template_apply_height = false
template_apply_posx = false
template_apply_posy = false
template_apply_opacity = false
template_apply_visibility = false
template_apply_label = false
template_share_with = buttons
nine_slice_slider_handle = false
element_type = custom_button
instance_identifier = c0ffee10-0000-4000-8000-000000000003-1791960000000
appearance_delay = no_delay
disappearance_delay = no_delay
fade_in_v2 = no_fading
fade_out = no_fading
auto_sizing = false
auto_sizing_base_screen_width = 2560
auto_sizing_base_screen_height = 1355
sticky_anchor = false
anchor_point = mid-centered
x = -100
y = -24
width = 200
height = 20
stay_on_screen = true
element_loading_requirement_container_identifier = c0ffee10-0000-4000-8000-000000000004-1791960000000
[loading_requirement_container_meta:c0ffee10-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:]
enable_parallax = false
invert_parallax = false
animated_offset_x = 0
animated_offset_y = 0
load_once_per_session = false
layer_hidden_in_editor = false
advanced_rotation_mode = false
advanced_vertical_tilt_mode = false
advanced_horizontal_tilt_mode = false
should_be_affected_by_decoration_overlays = true
in_editor_color = #FFC800FF
advanced_posx = -2147483648
advanced_posy = -2147483648
advanced_width = -2147483648
advanced_height = -2147483648
stretch_x = false
stretch_y = false
appearance_delay_seconds = 1.0
disappearance_delay_seconds = 1.0
fade_in_speed = 1.0
fade_out_speed = 1.0
base_opacity = 1.0
parallax_intensity_x = 0.5
parallax_intensity_y = 0.5
rotation_degrees = 0.0
advanced_rotation_degrees = 0.0
vertical_tilt_degrees = 0.0
advanced_vertical_tilt_degrees = 0.0
horizontal_tilt_degrees = 0.0
advanced_horizontal_tilt_degrees = 0.0
label_scale = 1.0
label_shadow = true
nine_slice_border_x = 5
nine_slice_border_y = 5
nine_slice_slider_handle_border_x = 5
nine_slice_slider_handle_border_y = 5
}
vanilla_button {
button_element_executable_block_identifier = 7e93cdcb-284d-4684-a0e7-b9b90f6d588c-1778341927602
[executable_block:7e93cdcb-284d-4684-a0e7-b9b90f6d588c-1778341927602][type:generic] = [executables:]
underline_label_on_hover = false
transparent_background = false
restartbackgroundanimations = true
nine_slice_custom_background = false
navigatable = true
widget_active_state_requirement_container_identifier = 27df00e4-37c9-4a4a-b221-b8bd72fc64df-1778341927602
[loading_requirement_container_meta:27df00e4-37c9-4a4a-b221-b8bd72fc64df-1778341927602] = [groups:][instances:]
is_template = false
template_apply_width = false
template_apply_height = false
template_apply_posx = false
template_apply_posy = false
template_apply_opacity = false
template_apply_visibility = false
template_apply_label = false
template_share_with = buttons
nine_slice_slider_handle = false
element_type = vanilla_button
instance_identifier = mc_titlescreen_singleplayer_button
appearance_delay = no_delay
disappearance_delay = no_delay
fade_in_v2 = no_fading
fade_out = no_fading
auto_sizing = false
auto_sizing_base_screen_width = 2560
auto_sizing_base_screen_height = 1355
sticky_anchor = false
anchor_point = mid-centered
x = -100
y = 0
width = 98
height = 20
stay_on_screen = true
element_loading_requirement_container_identifier = 38a7cb67-1ab7-41ac-9952-98ad6f9234b7-1778341927602
[loading_requirement_container_meta:38a7cb67-1ab7-41ac-9952-98ad6f9234b7-1778341927602] = [groups:][instances:]
enable_parallax = false
invert_parallax = false
animated_offset_x = 0
animated_offset_y = 0
load_once_per_session = false
layer_hidden_in_editor = false
advanced_rotation_mode = false
advanced_vertical_tilt_mode = false
advanced_horizontal_tilt_mode = false
should_be_affected_by_decoration_overlays = true
in_editor_color = #FFC800FF
advanced_posx = -2147483648
advanced_posy = -2147483648
advanced_width = -2147483648
advanced_height = -2147483648
stretch_x = false
stretch_y = false
appearance_delay_seconds = 1.0
disappearance_delay_seconds = 1.0
fade_in_speed = 1.0
fade_out_speed = 1.0
base_opacity = 1.0
parallax_intensity_x = 0.5
parallax_intensity_y = 0.5
rotation_degrees = 0.0
advanced_rotation_degrees = 0.0
vertical_tilt_degrees = 0.0
advanced_vertical_tilt_degrees = 0.0
horizontal_tilt_degrees = 0.0
advanced_horizontal_tilt_degrees = 0.0
label_scale = 1.0
label_shadow = true
nine_slice_border_x = 5
nine_slice_border_y = 5
nine_slice_slider_handle_border_x = 5
nine_slice_slider_handle_border_y = 5
automated_button_clicks = 0
is_hidden = false
}