[PR #7333] [MERGED] Native mods: screen opening, init and closing (ScreenEvent.Opening / Init.Post / Closing) #7502

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

📋 Pull Request Information

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

Base: main ← Head: native/screen-lifecycle


📝 Commits (7)

  • cab0658 Observe native screen lifecycle
  • bf7ef27 Native mods: screen opening, init and closing, observed once per frame (#7277)
  • 91a50ba Observe screen overlays in native lifecycle hooks
  • f62d611 Merge upstream/main
  • 7b55eac Native mods: the screen lifecycle hooks sit in the hook points section the catalog test reads
  • 6807a02 Merge upstream/main
  • 1e3cf30 Screen lifecycle hooks: nothing to observe with no native mod

📊 Changes

7 files changed (+243 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/native_hooks.rs (+130 -0)
📝 crates/horizon-client/src/mod_api/generated.rs (+60 -0)
📝 docs/native-mods.md (+2 -0)
➕ tools/native-hook-fragments/screen_closing.json (+16 -0)
➕ tools/native-hook-fragments/screen_init_post.json (+16 -0)
➕ tools/native-hook-fragments/screen_opening.json (+16 -0)

📄 Description

Closes #7277.

Adds screen_opening, screen_init_post and screen_closing, taking the same NativeScreenView as screen_render_post. Screen state is assigned directly in many places in the game, so there is no single transition point to hook; instead Game compares the open screen once per frame and fires the hooks on a change (init_post also when the rectangle changes).

Not covered, and said in the docs: cancelling an opening and a screen opened and closed within one frame. The ScreenEvent …Post input hooks and Render.Pre (#7278) are a separate PR.

Not run: client build, tests, or in-game check (CI only).

Written by an AI agent (Claude Code orchestrating GPT-6.1 Terra) for Xmilon.

Overlay observation now covers sign editors, books, lecterns, dialogs and prompts; dialog states share one ID.


🔄 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/7333 **Author:** [@Xmilon](https://github.com/Xmilon) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `native/screen-lifecycle` --- ### 📝 Commits (7) - [`cab0658`](https://github.com/horizon-rust/horizon/commit/cab0658a31c920882f0577099a468bf78866121b) Observe native screen lifecycle - [`bf7ef27`](https://github.com/horizon-rust/horizon/commit/bf7ef27e40bde2f4a9c8b3588e86f7dc279efbc1) Native mods: screen opening, init and closing, observed once per frame (#7277) - [`91a50ba`](https://github.com/horizon-rust/horizon/commit/91a50ba01779dc8703abbdb2dea39886c4d053e8) Observe screen overlays in native lifecycle hooks - [`f62d611`](https://github.com/horizon-rust/horizon/commit/f62d6117a693bc0f4b61b0cf097621cfbaaa94fb) Merge upstream/main - [`7b55eac`](https://github.com/horizon-rust/horizon/commit/7b55eac3fb09ddea7ee2bc7bb5332dd4779fb0f8) Native mods: the screen lifecycle hooks sit in the hook points section the catalog test reads - [`6807a02`](https://github.com/horizon-rust/horizon/commit/6807a02809603f0b744c96688d2ab2a6c683d6b1) Merge upstream/main - [`1e3cf30`](https://github.com/horizon-rust/horizon/commit/1e3cf304421e2bbd1f334cfb5e1b41228ef13053) Screen lifecycle hooks: nothing to observe with no native mod ### 📊 Changes **7 files changed** (+243 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+130 -0) 📝 `crates/horizon-client/src/mod_api/generated.rs` (+60 -0) 📝 `docs/native-mods.md` (+2 -0) ➕ `tools/native-hook-fragments/screen_closing.json` (+16 -0) ➕ `tools/native-hook-fragments/screen_init_post.json` (+16 -0) ➕ `tools/native-hook-fragments/screen_opening.json` (+16 -0) </details> ### 📄 Description Closes #7277. Adds `screen_opening`, `screen_init_post` and `screen_closing`, taking the same `NativeScreenView` as `screen_render_post`. Screen state is assigned directly in many places in the game, so there is no single transition point to hook; instead Game compares the open screen once per frame and fires the hooks on a change (init_post also when the rectangle changes). Not covered, and said in the docs: cancelling an opening and a screen opened and closed within one frame. The `ScreenEvent …Post` input hooks and `Render.Pre` (#7278) are a separate PR. Not run: client build, tests, or in-game check (CI only). Written by an AI agent (Claude Code orchestrating GPT-6.1 Terra) for Xmilon. Overlay observation now covers sign editors, books, lecterns, dialogs and prompts; dialog states share one ID. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:40:13 +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#7502
No description provided.