[PR #295] [MERGED] Recipe toasts show the workstation icon and cycle through the unlocked recipes #2464

Closed
opened 2026-11-02 15:56:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/295
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: feat/recipe-toast-icons


📝 Commits (1)

  • f88bfc6 Recipe toasts show the crafting station and cycle through every unlocked recipe (#283)

📊 Changes

4 files changed (+421 additions, -74 deletions)

View changed files

📝 crates/horizon-client/src/game/advancements.rs (+215 -38)
📝 crates/horizon-client/src/game/recipe_book.rs (+47 -16)
📝 crates/horizon-client/src/recipe_book.rs (+107 -9)
📝 crates/horizon-client/src/stations.rs (+52 -11)

📄 Description

Thanks to Cosmic (@Online5277) for the precise report in #283: the plaque was missing vanilla's small workstation icon and the animation through the unlocked recipes.

What

RecipeToast as vanilla 26.3 draws it:

  • Workstation icon: each unlocked display carries its RecipeDisplay.craftingStation (crafting table for crafting, furnace / blast furnace / smoker / campfire for cooking, stonecutter, smithing table). It's drawn at 0.6 scale at (3, 3), i.e. in the top-left corner of the plaque, over the result at (8, 8).
  • Cycling: the toast keeps every display unlocked while it is queued or shown (addOrUpdate joins the existing toast), and shows displayedRecipeIndex = fullyVisibleFor / max(1, 5000·multiplier / n) % n. Each new unlock keeps it up 5 s more (lastChanged).
  • Results: book recipes use the book's resolved results (components included). Stonecutting, smithing and campfire recipes use their file's result.id. Trims use SmithingTrimDemoSlotDisplay: a random base with a random material, from a random of its own (the level's random isn't touched). show_notification: false recipes (the crafting table's own) unlock silently.
  • Timing, all toasts: ToastManager.ToastInstance is ported: the 600 ms slide eased by the square (Horizon's was linear), notificationDisplayTime scaling the 5 s, and the ui.toast.in / ui.toast.out sounds on each visibility change. This also changes advancement toasts.

Horizon still shows one toast at a time, where vanilla stacks up to five; that is unchanged here.

Screenshots (Horizon, offscreen on the Mac mini, GUI scale 2)

/recipe give for a stick, cooked beef, a stone slab (stonecutting) and the bolt trim, one after another: the toast shows crafting table + stick, then furnace + cooked beef, then stonecutter + stone slab, then smithing table + a trimmed diamond chestplate. Geometry follows RecipeToast.extractRenderState (title at (30, 7) colour -11534256, description at (30, 18) black, station 0.6× at (3, 3), result at (8, 8)).

Self-check

cargo fmt --all -- --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings        ok
cargo test -p horizon-client                                 ok (628 lib + bins, 0 failed)
  new: game::advancements::tests (slide curve, sounds, cycling, extension on new unlocks)
       recipe_book::tests::the_index_knows_each_recipes_toast_station_and_result
python3 tools/parity.py --changed origin/main                79 passed, 0 failed (66.5 min, -j3)

Fixes #283

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/295 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/recipe-toast-icons` --- ### 📝 Commits (1) - [`f88bfc6`](https://github.com/horizon-rust/horizon/commit/f88bfc66f82096347a4cb55883d931d4e1fd5d38) Recipe toasts show the crafting station and cycle through every unlocked recipe (#283) ### 📊 Changes **4 files changed** (+421 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/advancements.rs` (+215 -38) 📝 `crates/horizon-client/src/game/recipe_book.rs` (+47 -16) 📝 `crates/horizon-client/src/recipe_book.rs` (+107 -9) 📝 `crates/horizon-client/src/stations.rs` (+52 -11) </details> ### 📄 Description Thanks to **Cosmic (@Online5277)** for the precise report in #283: the plaque was missing vanilla's small workstation icon and the animation through the unlocked recipes. ## What `RecipeToast` as vanilla 26.3 draws it: - **Workstation icon:** each unlocked display carries its `RecipeDisplay.craftingStation` (crafting table for crafting, furnace / blast furnace / smoker / campfire for cooking, stonecutter, smithing table). It's drawn at 0.6 scale at (3, 3), i.e. in the top-left corner of the plaque, over the result at (8, 8). - **Cycling:** the toast keeps every display unlocked while it is queued or shown (`addOrUpdate` joins the existing toast), and shows `displayedRecipeIndex = fullyVisibleFor / max(1, 5000·multiplier / n) % n`. Each new unlock keeps it up 5 s more (`lastChanged`). - **Results:** book recipes use the book's resolved results (components included). Stonecutting, smithing and campfire recipes use their file's `result.id`. Trims use `SmithingTrimDemoSlotDisplay`: a random base with a random material, from a random of its own (the level's random isn't touched). `show_notification: false` recipes (the crafting table's own) unlock silently. - **Timing, all toasts:** `ToastManager.ToastInstance` is ported: the 600 ms slide eased by the square (Horizon's was linear), `notificationDisplayTime` scaling the 5 s, and the `ui.toast.in` / `ui.toast.out` sounds on each visibility change. This also changes advancement toasts. Horizon still shows one toast at a time, where vanilla stacks up to five; that is unchanged here. ## Screenshots (Horizon, offscreen on the Mac mini, GUI scale 2) `/recipe give` for a stick, cooked beef, a stone slab (stonecutting) and the bolt trim, one after another: the toast shows crafting table + stick, then furnace + cooked beef, then stonecutter + stone slab, then smithing table + a trimmed diamond chestplate. Geometry follows `RecipeToast.extractRenderState` (title at (30, 7) colour `-11534256`, description at (30, 18) black, station 0.6× at (3, 3), result at (8, 8)). ## Self-check ``` cargo fmt --all -- --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-client ok (628 lib + bins, 0 failed) new: game::advancements::tests (slide curve, sounds, cycling, extension on new unlocks) recipe_book::tests::the_index_knows_each_recipes_toast_station_and_result python3 tools/parity.py --changed origin/main 79 passed, 0 failed (66.5 min, -j3) ``` Fixes #283 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:56:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2464
No description provided.