Curios and artifacts !

This commit is contained in:
2026-09-30 15:22:32 -03:00
parent 342b45d593
commit 3af5f6e54b
45 changed files with 729 additions and 43 deletions
+21
View File
@@ -0,0 +1,21 @@
// the curios button next to every inventory screen, or G like curios' keybind, asks the server to show the slots
import type { ClientContext } from "bworld/client";
import { active_slots } from "./slots.ts";
const GAP = 16;
const WIDTH = 120;
const HEIGHT = 32;
export function setup(ctx: ClientContext) {
// no item goes in any slot, so there's nothing to show
if (active_slots(ctx.tags).length === 0) return;
ctx.ui.add_inventory_overlay({
on_render(g, screen) {
const clicked = g.button("Curios", screen.x - WIDTH - GAP, screen.y, WIDTH, HEIGHT);
if (clicked || g.key_pressed("KeyG")) {
ctx.net.send("curios:open", {});
}
},
});
}