UI Scripting
Interacting with UI with scripting
Summary
Published: Mar 31 2024 by mana vortex Last documented update: Aug 25 2026 by nolvalir
This section will show you how to interact with the game's UI with scripting.
Wait, this is not what I want!
For help on Logging Widget Trees, check the corresponding wiki page!
You can find guides on how to add custom UI elements in InkWidgets Basics or Codeware's github wiki.
General Information
All different kinds of UI are loaded at the same time. Components don't get added or removed, but are simply rendered inactive (hidden).
At any point in time, by hooking into the right methods or classes, you're able to fully add, modify, or delete any UI element you see on screen (barring the visibility for some, for example the game may force a specific element to be visible, but hiding their parent or grandparent may work).
Additionally, the game has template UIs such as messages or prompts that you can use for your mod, which you see how here: User Interface
Ink Inspector
If you're going to mod this game, (please) download RedHotTools as it gives you various useful toolkits for modding in general, but notably Ink Inspector which is invaluable for messing with UI elements.
In the CET overlay, Ink Inspector gives you a menu to inspect all rendered UI elements on screen in addition to their properties, context, and other important information. Additionally it also has a "Pick" mode where you can move your cursor to an element so you don't have to manually traverse the tree.
Either using the "Pick" option or manually by searching, selecting an ink widget will cause Ink Inspector to show the respective properties and other important information for that widget.
Widget Tab
The widget tab shows information regarding the respective properties of that widget.
For example, if you were to select a inkTextWidget, it would show information such as the text, fontSize, and fontStyle for the widget. If instead you were to select a inkCanvasWidget, it would show properties for containers such as childMargin.
By default, other information that is respective to all widgets such as margins and anchor points are also visible here.
Context Tab
The context tab shows meta-information regarding the widget, such as what .inkWidget file the widget spawned from in addition to the full name and index path to the selected widget.
Example
As an example, here's how it would like when finding the ink widget that contains the minimap.
Ink Inspector gives you a lot of important information, such as what layer it's in and the full name path to get a reference to the selected element (which you can directly use when accessing widgets with inkCompoundWidget#GetWidgetByPathName, as long as the path is unique along each step).

Ink Layers (as of 2.12_a)
The game separates different UI contexts into different layers:
inkHUDLayer
gameuiRootHudGameController
the generic hud
inkWatermarksLayer
inkWaitingSignLayer
inkSystemNotificationsLayer
inkLoadingLayer
inkGameNotificationsLayer
gameuiPopupsManager
inkMenuLayer
gameuiInGameMenuGameController
the container for menus, such as the escape menu, main menu, and all sub menus of the main menu (map, inventory, etc).
inkVideoLayer
gameuiHUDVideoPlayerController
inkWorldLayer
inkOffscreenLayer
inkAdvertisementsLayer
inkStreetSignsLayer
inkPhotoModeLayer
gameuiWidgetGameController
photo mode HUD
Accessing Ink Layers
If you have Codeware installed, at any point in your mod (assuming game systems are available), you're able to get a reference to the game's ink system on demand with GameInstance.GetInkSystem(), allowing you to get a reference to any spawned widget.
More UI Documentation
.inkWidget FilesInk WidgetsInk ControllersLogging Widget TreesInkWidgets BasicsGuides
Guide to UI BasicsMore Snippets & Examples For UI
User InterfaceLast updated