UI Scripting

Influencing Cyberpunk's UI with REDscript

Summary

Published: Mar 31 2024 by mana vortex Last documented update: Mar 31 2024 by mana vortex

This page will tell you how to script the UI (turning widgets on and off).

Wait, this is not what I want!

General information

All different kinds of UI are loaded at the same time. Components don't get added or removed, but simply rendered inactive (hidden).

The code snippets on this page are function calls which do nothing on their own; you need to add them to your class and call them from your internal logic.

InkSystemLayers

You can access any existing layer via the game instance's InkSystem. Simply pass the layer's name as CName (for a list of existing options, see the table below):

GameInstance.GetInkSystem().GetLayer(n"inkHUDLayer")

Querying existing layers

List of existing layers (as of 2.12_a)

Layer name (as CName)
Class

inkHUDLayer

gameuiRootHudGameController

the generic hud

inkWatermarksLayer

inkWaitingSignLayer

inkSystemNotificationsLayer

inkLoadingLayer

inkGameNotificationsLayer

gameuiPopupsManager

inkMenuLayer

gameuiInGameMenuGameController

ingame menu (ESC)

inkVideoLayer

gameuiHUDVideoPlayerController

inkWorldLayer

inkOffscreenLayer

inkAdvertisementsLayer

inkStreetSignsLayer

inkPhotoModeLayer

gameuiWidgetGameController

photo mode HUD

Accessing layers

To find functions for traversing widget trees, check the nativeDB page for inkCompoundWidget.

Naturally, CDPR did not give their view elements unique names. Check the Example at the end of the page for how to find and enable a certain widget.

If there are multiple widgets with the same name, the call below can return any of them.

Example

This example only contains the scripting logic. For how to trigger the code, check either How to create a hook or Codeware callbacks.

Last updated

Was this helpful?