Rewrite Lua UI interface - #6397
Merged
Merged
Conversation
|
Download the built assets for this pull request: |
lahm86
approved these changes
Aug 25, 2026
Collaborator
|
Issues:
|
Collaborator
|
New issue:
|
Collaborator
Author
|
@aredfan I think this is unrelated and also should be happening on develop - can we confirm? |
Collaborator
I just had a quick look at the latest dev snapshot, it seems the bug doesn't manifest there. |
Gives the screen nine named regions across three bands, with widgets in the same region stacked together. Replaces the old six-region layout and removes conflicting dialog and inventory space tracking.
Adds `trxc.events.is_level_script`, which tells a level script from a global one. Modules of the public surface read it to end what a level script made when the level ends, as its event handlers already do.
Adds `trx.signal` for tracking value changes. Signals can be combined with `&`, `|`, and `~`, and only report when their result changes. Settings are exposed through `trx.signal.config`, with other values available through `trx.signal.polled`. Script state now updates on game ticks instead of rendered frames, including in menus.
Lets regions reserve space for script-drawn widgets and reports their layout before drawing. Script drawing is moved out of the overlay and uses all nine regions, so script widgets stack alongside engine widgets and remain independent of the overlay.
Adds persistent script widgets driven by signals, avoiding unnecessary work when nothing changes, and replacing the old per-frame drawing API. - `trx.ui.primitive` provides layout, quads, and text - `trx.ui.widgets` builds widgets from them - `trx.ui.regions` places them on screen
Moves the Race for the Iris clock to a persistent widget that is shown while the level is being played. Replaces the old per-frame drawing calls.
Every level script run now ends with the unload event, whether the level was played or only scanned. Before this, the stats scan that runs every level's script stayed silent, and what such a run left behind stayed for the rest of the session.
Collaborator
Author
|
Sorry – fixed all :happybat: |
aredfan
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Description
Adds a new Lua module,
trx.signal, and rewritestrx.uiaround it. Signals track values and report when they change. Widgets are built once and update only when their signals change, instead of being redrawn every frame. Crucially, widgets stick around once added, and stay in place until removed withtrx.ui.regions.remove, which is different from what we have in the C API. We still emit primitive draws on every frame, but these are only direct draws (put text on this X,Y; put a gradient rectangle there) – the Lua widgets orchestrate those with as few changes as possible across, and are orthogonal to the C widgets.The screen is now split into nine named regions across three bands, replacing the old six. Regions reserve space for script widgets alongside the engine UI, preventing them from overlapping each other.
A level script's widgets and signals last until the level ends, just like its event handlers. A global script's last for the whole session unless stopped early.
No migration notice, since the previous UI Lua integration was never released.
The Race for the Iris clock is the first widget using this system and now persists instead of being redrawn every frame. Nothing else uses the new system yet.
Resolves #5351 / TRX185
Testing