Expand description
yog-book — guide books for Yog mods: the format (a .ybook file, see
Book) and the renderer the game and Yog-IDLE draw it with
(BookRenderer, draw2d alone).
A book names what it shows — items, blocks, entities, recipes, its own
entries — through typed references (@item:minecraft:stick, see
refs); tools check them and hand the renderer plain ids.
Re-exports§
pub use renderer::BOOK_PNG;pub use renderer::BOOK_SHEET;pub use renderer::BookRenderer;pub use renderer::CRAFTING_PNG;pub use renderer::CRAFTING_SHEET;pub use renderer::LANG;pub use renderer::PageDrawer;pub use state::BookViewState;pub use theme::BookTheme;
Modules§
- layout
- Recipe layouts: how a kind of recipe is shown — in books and in
Yog-IDLE’s recipe editor. The game’s kinds have built-in layouts
(Patchouli’s: the crafting grid, the furnace strip, the smithing
strip, …); a mod lays out its own kinds, or the game’s, with a
.yuicomponent — drawn and arranged in the screen designer like any UI: - markup
- Book texts are Yog text (
yog_ui::rich:{b|…},{#rrggbb|…}, …) with two words of the book’s own, turned into Yog text’s when the book is prepared: - page_
type - A mod’s own kinds of page (
hexcasting:pattern): a.yuicomponent withbook_page="…"declares one — its properties are the page’s fields, its body what the page shows — andyog buildhands it to the book as aPageType. A page of the kind (CustomPage) is laid out by the book like the built-in ones; what only code can draw is adrawnelement (crate::BookPage::Drawn’s primitive). - refs
- References in a book: what a
.ybooknames — items, blocks, entities, recipes, its own entries and categories — it names through a typed reference,@item:minecraft:stick, never a bare game id. The schema (crate::Book’s#[derive(Schema)]) says which field takes what; tools check every reference through aResolve(yog build: does it exist on every Minecraft version the mod targets?) and get the id the game uses. - renderer
- Book renderer: yog-ui lays the book out and draws its text and
buttons; everything else goes through
draw2dtoo — the sprite sheets, item icons, SVG pages, entities — so the game and Yog-IDLE’s book designer run the same code. - state
- Per-book navigation state.
- theme
- Visual theme for book rendering.
- ui
- The
.yuiXML subset — whatyog buildand Yog-IDLE read screens, book pages and recipe layouts from: elements with attributes in source order and their lines, for messages.
Structs§
- Book
- A guide book: what a
.ybookfile holds. - Book
Category - A category of the book’s home page.
- Book
Entry - One entry: its pages, in a category.
Enums§
- Book
Page - One page of an entry:
{"type": "spotlight", "item": "@item:minecraft:stick", …}.
Functions§
- multiblock_
blocks - The blocks of a multiblock
pattern(layers top to bottom, rows of characters) with theirmapping: ((x, y, z), block state). - set_
unlocked - Tells the books how to know what the reader has unlocked.
- shown
- Whether
entryshows in the book’s lists: not secret, and its advancement (if it waits for one) had.