[PR #6641] [MERGED] Native mods: support own_background on NativeScreen (#6565) #7007

Closed
opened 2026-11-03 06:31:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6641
Author: @fy2ne
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feat/6565-native-screen-own-background


📝 Commits (4)

📊 Changes

2 files changed (+33 additions, -28 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+30 -28)
📝 crates/horizon-client/src/mod_api.rs (+3 -0)

📄 Description

Opened by fy2ne's AI agent (Antigravity), not by fy2ne personally.

What and why

Fixes #6565

draw_native_screen unconditionally drew an opaque rectangular grey backdrop and slot frames before calling native_screen_draw. For container screens with non-rectangular shapes (such as Tom's Simple Storage Storage Terminal with an extended scrollbar, or machines with external side tabs), transparent areas in the mod's texture exposed Horizon's hardcoded grey box. Shrinking width moved the screen off-center because width also governs screen centering.

This adds pub own_background: bool to NativeScreen (defaulting to false). When true, draw_native_screen leaves out the background panel fill and default slot frames, letting native_screen_draw manage the background rendering while preserving slot interactions, mouse hit-tests, label placement, and window centering.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only (native mod container API; vanilla container screens draw their own textures via AbstractContainerScreen.renderBg).

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main against upstream/main at db34ce484)

Check Result
Scope ✅ 1 files, +49 −28
Cargo.lock ✅ unchanged
Public tree ✅
rustfmt ✅
tests: horizon-client ✅ 594 passed
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

Generated with Antigravity


🔄 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/6641 **Author:** [@fy2ne](https://github.com/fy2ne) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/6565-native-screen-own-background` --- ### 📝 Commits (4) - [`851d2a3`](https://github.com/horizon-rust/horizon/commit/851d2a359232fd6a291e9cd222d3792926c359f9) Native mods: support own_background on NativeScreen - [`fbf4c86`](https://github.com/horizon-rust/horizon/commit/fbf4c8631e7dda5242071d94cec84abaaa7a44ee) Merge main into #6641 - [`cc635ed`](https://github.com/horizon-rust/horizon/commit/cc635eda92719c3dee0b208cfdc4ac0ab23d4622) Merge main into #6641 - [`22c453a`](https://github.com/horizon-rust/horizon/commit/22c453af4541e72bd43ac5aee16e13edc9a69147) Drop a test that only checked the struct's defaults ### 📊 Changes **2 files changed** (+33 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+30 -28) 📝 `crates/horizon-client/src/mod_api.rs` (+3 -0) </details> ### 📄 Description > Opened by fy2ne's AI agent (Antigravity), not by fy2ne personally. ## What and why Fixes #6565 `draw_native_screen` unconditionally drew an opaque rectangular grey backdrop and slot frames before calling `native_screen_draw`. For container screens with non-rectangular shapes (such as Tom's Simple Storage Storage Terminal with an extended scrollbar, or machines with external side tabs), transparent areas in the mod's texture exposed Horizon's hardcoded grey box. Shrinking `width` moved the screen off-center because `width` also governs screen centering. This adds `pub own_background: bool` to `NativeScreen` (defaulting to `false`). When `true`, `draw_native_screen` leaves out the background panel fill and default slot frames, letting `native_screen_draw` manage the background rendering while preserving slot interactions, mouse hit-tests, label placement, and window centering. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only (native mod container API; vanilla container screens draw their own textures via `AbstractContainerScreen.renderBg`). ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` against upstream/main at db34ce484) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +49 −28 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | rustfmt | ✅ | | tests: horizon-client | ✅ 594 passed | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | Generated with [Antigravity](https://deepmind.google/technologies/antigravity) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:31:55 +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#7007
No description provided.