[PR #7850] Cosmetics: the game's switches match the Wardrobe's; name tag styles drawn #7862

Open
opened 2026-11-03 07:25:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7850
Author: @ludovic111
Created: 11/2/2026
Status: 🔄 Open

Base: feat/cosmetics-first-light ← Head: feat/cosmetics-game-settings


📝 Commits (2)

  • dd53e11 Cosmetics: the game's switches match the Wardrobe's; name tag styles drawn
  • 5a3e9b0 Merge feat/cosmetics-first-light into feat/cosmetics-game-settings

📊 Changes

12 files changed (+553 additions, -45 deletions)

View changed files

📝 crates/horizon-client-render/src/extras.rs (+80 -17)
📝 crates/horizon-client/assets/horizon/lang/de_de.json (+7 -2)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+7 -2)
📝 crates/horizon-client/assets/horizon/lang/fr_fr.json (+7 -2)
📝 crates/horizon-client/src/game/cosmetics.rs (+107 -5)
📝 crates/horizon-client/src/game/names.rs (+65 -4)
➕ crates/horizon-cosmetics/src/account.rs (+136 -0)
📝 crates/horizon-cosmetics/src/fetch.rs (+9 -1)
📝 crates/horizon-cosmetics/src/lib.rs (+1 -0)
📝 crates/horizon-cosmetics/src/prefs.rs (+83 -9)
📝 docs/cosmetics.md (+13 -2)
📝 launcher/src/wardrobe_page.rs (+38 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Cosmetics (off by default, behind horizon_cosmetics::ON_BY_DEFAULT): the game's switches match the Wardrobe's, and name tag styles are drawn, following the design brief: show mine, others' cosmetics with three choices, and others' auras and trails off by default.

  • Settings (Extras › Cosmetics, shown only with the flag on):

    • My cosmetics: Shown/Hidden is the account's setting on the service, the same switch as the Wardrobe's Show my cosmetics.
      • The game signs in for that one call the way the launcher does (horizon_cosmetics::account: auth/start → Mojang join with the player's own session → auth/finish → PUT /v1/visible). The Minecraft token goes to Mojang only.
      • What the service confirmed is noted per account in cosmetics-visible.txt.
      • An unchanged switch sends nothing. A failed send retries after 15 s, doubling to 10 minutes: that is the offline queue.
      • The launcher writes the same wish and confirmation (tell_the_game), so the two never fight.
    • Other players' cosmetics cycles Shown → Name tags only → Hidden; the right-click goes back. The old true/false line keeps its meaning.
    • Others' auras and trails: off by default. No item of that kind exists yet; the switch is stored for when one does.
  • Name tag styles (game/names.rs): a player's Founder Tag-style mark, 8 text pixels square, before the name, and a one-pixel line in the style's colour under the name's background.

    • They are drawn in all three of the name tag's passes (lit, discrete, see-through), at the same alpha as the text.
    • The mark goes through the atlas slots the other items use.
    • "Name tags only" shows these styles and nothing on other players' bodies.
  • States: a service error or no network keeps every outfit the game last knew (fetch_tests::offline_keeps_the_last_answers_and_backs_off); the switch waits in horizon-extras.txt and is sent once the service answers. An offline account has nothing to send. Outfits are not kept across a restart of the game yet: after a restart with the service down, players look plain until it answers.

Stacked on #7839 (First Light), which sits on #7777 (Wardrobe page).

Tests

  • prefs::a_wish_waits_until_the_service_confirms_it: nothing is sent while nothing was asked. A hidden wish is unsent until confirmed. Each account keeps its own line.
  • account::hiding_goes_through_mojang_and_sends_only_the_services_session: the call order is start, finish, visible; only the last call carries a session, and it is the service's own.
  • account::mojang_refusing_stops_before_the_service_is_asked_to_trust_it.
  • extras::other_players_cosmetics_cycle_three_ways_and_read_the_old_switch: the three-way cycle and the back button; a round trip; the launcher's Prefs reads the same line; the old false means Hidden.

Checks

pr_ready was not run: the Mac mini's disk stayed under the 25 GB floor. What ran, each in its own target dir (-j 4/-j 6, CARGO_INCREMENTAL=0):

cargo clippy -p horizon-cosmetics -p horizon-client-render -p horizon-client --lib --bins --tests -- -D warnings   ok
cargo test -p horizon-cosmetics                         22 passed
cargo test -p horizon-client-render --lib extras        10 passed
launcher: cargo clippy --all-targets -- -D warnings     ok
launcher: cargo test                                    460 + 76 + 3 passed, 6 ignored

Per-frame cost

  • Flag off (the default): cosmetics_frame returns at its first line, as before.
  • Flag on: one bool compare per frame for the switch; Instant::now() only while a failed send waits. The send runs on its own thread, once per change.
  • Name tags: a tag without a style takes the same path as before (style: None). A styled tag adds 2 quads (mark and line) per pass.

🤖 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/7850 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `feat/cosmetics-first-light` ← **Head:** `feat/cosmetics-game-settings` --- ### 📝 Commits (2) - [`dd53e11`](https://github.com/horizon-rust/horizon/commit/dd53e1121ea5133171096ee18abba54bc1b50221) Cosmetics: the game's switches match the Wardrobe's; name tag styles drawn - [`5a3e9b0`](https://github.com/horizon-rust/horizon/commit/5a3e9b02b999f01eb42e7ac444754a3304e856fb) Merge feat/cosmetics-first-light into feat/cosmetics-game-settings ### 📊 Changes **12 files changed** (+553 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/extras.rs` (+80 -17) 📝 `crates/horizon-client/assets/horizon/lang/de_de.json` (+7 -2) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+7 -2) 📝 `crates/horizon-client/assets/horizon/lang/fr_fr.json` (+7 -2) 📝 `crates/horizon-client/src/game/cosmetics.rs` (+107 -5) 📝 `crates/horizon-client/src/game/names.rs` (+65 -4) ➕ `crates/horizon-cosmetics/src/account.rs` (+136 -0) 📝 `crates/horizon-cosmetics/src/fetch.rs` (+9 -1) 📝 `crates/horizon-cosmetics/src/lib.rs` (+1 -0) 📝 `crates/horizon-cosmetics/src/prefs.rs` (+83 -9) 📝 `docs/cosmetics.md` (+13 -2) 📝 `launcher/src/wardrobe_page.rs` (+38 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Cosmetics (off by default, behind `horizon_cosmetics::ON_BY_DEFAULT`): **the game's switches match the Wardrobe's**, and **name tag styles are drawn**, following the design brief: show mine, others' cosmetics with three choices, and others' auras and trails off by default. - **Settings** (Extras › Cosmetics, shown only with the flag on): - *My cosmetics: Shown/Hidden* is the account's setting on the service, the same switch as the Wardrobe's *Show my cosmetics*. - The game signs in for that one call the way the launcher does (`horizon_cosmetics::account`: auth/start → Mojang `join` with the player's own session → auth/finish → `PUT /v1/visible`). The Minecraft token goes to Mojang only. - What the service confirmed is noted per account in `cosmetics-visible.txt`. - An unchanged switch sends nothing. A failed send retries after 15 s, doubling to 10 minutes: that is the offline queue. - The launcher writes the same wish and confirmation (`tell_the_game`), so the two never fight. - *Other players' cosmetics* cycles Shown → Name tags only → Hidden; the right-click goes back. The old `true`/`false` line keeps its meaning. - *Others' auras and trails*: off by default. No item of that kind exists yet; the switch is stored for when one does. - **Name tag styles** (`game/names.rs`): a player's Founder Tag-style mark, 8 text pixels square, before the name, and a one-pixel line in the style's colour under the name's background. - They are drawn in all three of the name tag's passes (lit, discrete, see-through), at the same alpha as the text. - The mark goes through the atlas slots the other items use. - "Name tags only" shows these styles and nothing on other players' bodies. - **States**: a service error or no network keeps every outfit the game last knew (`fetch_tests::offline_keeps_the_last_answers_and_backs_off`); the switch waits in `horizon-extras.txt` and is sent once the service answers. An offline account has nothing to send. Outfits are not kept across a restart of the game yet: after a restart with the service down, players look plain until it answers. Stacked on #7839 (First Light), which sits on #7777 (Wardrobe page). ## Tests - `prefs::a_wish_waits_until_the_service_confirms_it`: nothing is sent while nothing was asked. A hidden wish is unsent until confirmed. Each account keeps its own line. - `account::hiding_goes_through_mojang_and_sends_only_the_services_session`: the call order is start, finish, visible; only the last call carries a session, and it is the service's own. - `account::mojang_refusing_stops_before_the_service_is_asked_to_trust_it`. - `extras::other_players_cosmetics_cycle_three_ways_and_read_the_old_switch`: the three-way cycle and the back button; a round trip; the launcher's `Prefs` reads the same line; the old `false` means Hidden. ## Checks pr_ready was not run: the Mac mini's disk stayed under the 25 GB floor. What ran, each in its own target dir (`-j 4`/`-j 6`, `CARGO_INCREMENTAL=0`): ``` cargo clippy -p horizon-cosmetics -p horizon-client-render -p horizon-client --lib --bins --tests -- -D warnings ok cargo test -p horizon-cosmetics 22 passed cargo test -p horizon-client-render --lib extras 10 passed launcher: cargo clippy --all-targets -- -D warnings ok launcher: cargo test 460 + 76 + 3 passed, 6 ignored ``` ## Per-frame cost - Flag off (the default): `cosmetics_frame` returns at its first line, as before. - Flag on: one `bool` compare per frame for the switch; `Instant::now()` only while a failed send waits. The send runs on its own thread, once per change. - Name tags: a tag without a style takes the same path as before (`style: None`). A styled tag adds 2 quads (mark and line) per pass. 🤖 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>
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#7862
No description provided.