Hud api
This commit is contained in:
@@ -39,7 +39,7 @@ The code is in `common/mod_loader.ts`, `common/mod_data.ts`, `common/mod_check.t
|
||||
`common/worldgen_loader.ts`, and for worn items `client/rendering/worn_renderer.ts`, `player_model.ts` and
|
||||
`model_math.ts`.
|
||||
|
||||
**In the API types but throwing:** forms, HUD elements, keybinds, `g.slider`, `register_terrain`.
|
||||
**In the API types but throwing:** forms, keybinds, `g.slider`, `register_terrain`.
|
||||
|
||||
**Content scripts** are built, the first part of common scripts: `scripts.content` with `ctx.blocks.register`, see
|
||||
[Content Scripts](#content-scripts-as-built). The code is in `common/content_scripts.ts`, `common/mod_api/content.ts`,
|
||||
@@ -276,7 +276,8 @@ Worn items are drawn by `render_worn`, which puts an item's `worn` model on a pl
|
||||
|
||||
### HUD, Keybinds and Mod Channels
|
||||
|
||||
- `ctx.hud.register(id, { on_render(g) })` draws every frame after the world, under open screens.
|
||||
- `ctx.hud.register(id, { on_render(g, hud) })` draws every frame after the world, under open screens. Built, see
|
||||
[HUD](modding/gui/hud.md).
|
||||
- `ctx.input.bind(id, default_key, on_press)` with ids like `copper_tools:open_smelter`, so a controls menu can rebind
|
||||
them. They only fire while no screen is open.
|
||||
- `ctx.net` on both sides: `on(channel, handler)`, `send`, and `broadcast` on the server. Channel ids are in the mod's
|
||||
@@ -302,7 +303,7 @@ engine assets in `assets/`.
|
||||
| Hoeing, chest, furnace, smithing table, farming, watering can, fishing | `mods/bworld/scripts/server.ts` | Done |
|
||||
| Recipe type `shaped` | engine (`common/mod_loader.ts`, `server/game/crafting.ts`) | Phase 5 |
|
||||
| The player's inventory screen and crafting grid | engine (`client/gui/gui_player_inventory.ts`, `server/game/crafting.ts`) | Phase 5 |
|
||||
| The hotbar and crosshair | engine (`client/gui/hud.ts`) | Phase 5 |
|
||||
| The hotbar, hearts, hunger, crosshair and the rest of the HUD | `mods/bworld/scripts/hud.ts` | Done |
|
||||
| `/give`, `/time` and `/summon` | engine (`server/game/game_server.ts`) | Phase 5 |
|
||||
| Mining: tool speed, `requires_tool`, drops | engine (`client/game_mode.ts`, `server/game/game_server.ts`) | Phase 5 |
|
||||
| Day and night lengths, sky colors | engine (`common/time.ts`, `client/rendering/game_renderer.ts`) | Phase 5 |
|
||||
|
||||
Reference in New Issue
Block a user