Files
bworld/mods/farmersdelight/scripts/client.ts
T
2026-10-13 11:57:43 -03:00

27 lines
960 B
TypeScript

// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
// the cooking pot's screen, like the java mod's CookingPotScreen. its slots are in scripts/server.ts, in gui pixels
import type { ClientContext } from "bworld/client";
const WIDTH = 176;
const HEIGHT = 166;
export function setup(ctx: ClientContext) {
ctx.ui.register_menu_screen("farmersdelight:cooking_pot", (menu) => ({
width: WIDTH,
height: HEIGHT,
on_render_background(g) {
g.panel(0, 0, WIDTH, HEIGHT);
// lit under the ingredients while something heats the pot, the arrow fills as the meal cooks
g.progress("bworld:fire_empty", "bworld:fire_full", 47, 53, 18, 18, menu.data.heated, "up");
const { progress, progress_max } = menu.data;
g.progress("bworld:arrow_empty", "bworld:arrow_full", 95, 25, 18, 18, progress / progress_max);
},
on_render_labels(g) {
g.text(menu.title, 8, 6);
g.text("Inventory", 8, 73);
},
}));
}