diff --git a/branding/resources/createrp/textures/gui/sprites/tab_frame.png b/branding/resources/createrp/textures/gui/sprites/tab_frame.png new file mode 100644 index 0000000..e019970 Binary files /dev/null and b/branding/resources/createrp/textures/gui/sprites/tab_frame.png differ diff --git a/branding/resources/createrp/textures/gui/sprites/tab_frame.png.mcmeta b/branding/resources/createrp/textures/gui/sprites/tab_frame.png.mcmeta new file mode 100644 index 0000000..65fe1ce --- /dev/null +++ b/branding/resources/createrp/textures/gui/sprites/tab_frame.png.mcmeta @@ -0,0 +1 @@ +{"gui": {"scaling": {"type": "nine_slice", "width": 32, "height": 32, "border": 4}}} diff --git a/branding/resources/createrp/textures/gui/sprites/tab_wood.png b/branding/resources/createrp/textures/gui/sprites/tab_wood.png new file mode 100644 index 0000000..d107cce Binary files /dev/null and b/branding/resources/createrp/textures/gui/sprites/tab_wood.png differ diff --git a/branding/resources/createrp/textures/gui/sprites/tab_wood.png.mcmeta b/branding/resources/createrp/textures/gui/sprites/tab_wood.png.mcmeta new file mode 100644 index 0000000..6d906b5 --- /dev/null +++ b/branding/resources/createrp/textures/gui/sprites/tab_wood.png.mcmeta @@ -0,0 +1 @@ +{"gui": {"scaling": {"type": "tile", "width": 16, "height": 16}}} diff --git a/branding/resources/emi/textures/gui/buttons.png b/branding/resources/emi/textures/gui/buttons.png index 3375dbe..6590850 100644 Binary files a/branding/resources/emi/textures/gui/buttons.png and b/branding/resources/emi/textures/gui/buttons.png differ diff --git a/tools/branding/build.py b/tools/branding/build.py index e8c5c8b..a203d04 100644 --- a/tools/branding/build.py +++ b/tools/branding/build.py @@ -418,7 +418,7 @@ def casingify(sheet: Image.Image, wood: np.ndarray, frame, face=None) -> Image.I 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: +def casing_buttons(sheet: Image.Image, wood: np.ndarray, brass_wood: np.ndarray, frame, tiles, 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 @@ -449,8 +449,10 @@ def casing_buttons(sheet: Image.Image, wood: np.ndarray, brass_wood: np.ndarray, 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 + if bevel[y, x]: # the casing's metal, from the block's own edge + tile = tiles[1] if hot else tiles[0] + o[y, x, :3] = (tile[1, 3 + x % 10] if y == 1 else tile[14, 3 + x % 10] if y == cell - 2 + else tile[3 + y % 10, 1] if x == 1 else tile[3 + y % 10, 14]) elif inside[y, x]: p = c[y, x, :3] if abs(p.mean() - face_lum) <= 28: # the face @@ -613,9 +615,10 @@ def main() -> None: # --- 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 if emi_jar: - with zipfile.ZipFile(emi_jar) as emi: + with zipfile.ZipFile(emi_jar) as emi, zipfile.ZipFile(create_jar) as cr2: 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)), + brass_tile = texture(cr2, 'assets/create/textures/block/brass_casing.png').astype(int) + for name, make in (('buttons', lambda s: casing_buttons(s, casing_wood, brass_wood, andesite, (casing_tile, brass_tile))), ('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'))) @@ -623,6 +626,26 @@ def main() -> None: target.parent.mkdir(parents=True, exist_ok=True) make(sprite).save(target) + # the player list (Tab) as an andesite casing — drawn by the createrp_client mod with these two GUI sprites + sprites = OUT / 'resources' / 'createrp' / 'textures' / 'gui' / 'sprites' + sprites.mkdir(parents=True, exist_ok=True) + Image.fromarray(np.clip(casing_wood / 0.8 * 0.55, 0, 255).astype(np.uint8), 'RGB').save(sprites / 'tab_wood.png') + (sprites / 'tab_wood.png.mcmeta').write_text('{"gui": {"scaling": {"type": "tile", "width": 16, "height": 16}}}\n', + encoding='utf-8', newline='\n') + frame = np.zeros((32, 32, 4), np.uint8) + frame[..., 3] = 255 + frame[4:28, 4:28, 3] = 0 # the middle shows the wood and the list + for i in range(3): + frame[1 + i, 1:31, :3] = np.tile(casing_tile[i, 3:13], (4, 1))[:30] + frame[30 - i, 1:31, :3] = np.tile(casing_tile[15 - i, 3:13], (4, 1))[:30] + frame[1:31, 1 + i, :3] = np.tile(casing_tile[3:13, i], (4, 1))[:30] + frame[1:31, 30 - i, :3] = np.tile(casing_tile[3:13, 15 - i], (4, 1))[:30] + for (y, x), (ty, tx) in (((1, 1), (0, 0)), ((1, 28), (0, 13)), ((28, 1), (13, 0)), ((28, 28), (13, 13))): + frame[y:y + 3, x:x + 3, :3] = casing_tile[ty:ty + 3, tx:tx + 3] + Image.fromarray(frame, 'RGBA').save(sprites / 'tab_frame.png') + (sprites / 'tab_frame.png.mcmeta').write_text( + '{"gui": {"scaling": {"type": "nine_slice", "width": 32, "height": 32, "border": 4}}}\n', encoding='utf-8', newline='\n') + # branding/resources//… goes into the game as kubejs/assets//… for path, sprite in gui.items(): target = OUT / 'resources' / 'minecraft' / 'textures' / 'gui' / path