Skip to main content

Dialogue UI Service

Description

A static service that initializes the dialogue UI at runtime. Reads prefab references and configuration from module settings, instantiates the prompt and chat system prefabs, resolves Canvas and View components, applies CanvasScaler settings, and applies the active theme.

Interface

Type
DialogueUiService

Static Methods

NameParametersReturn TypeDescription
InitializeModuleSettings settingsvoidInstantiates UI prefabs and configures Canvas and views.
GetContextN/ADialogueUiRuntimeContextReturns the current runtime UI context (Canvas, views, theme).
ApplyThemeIDialogueUiTheme themevoidApplies a specific theme to all UI views.
RefreshThemeN/AvoidRe-applies the current theme (useful after settings changes).
ClearN/AvoidDestroys instantiated UI and clears the runtime context.

DialogueUiRuntimeContext

The runtime context returned by GetContext() provides access to:

NameTypeDescription
CanvasCanvasThe root Canvas for all dialogue UI.
PanelViewDialoguePanelViewThe main dialogue panel containing speech and options.
PromptViewDialoguePromptViewThe interact prompt shown when targeting an NPC.
ThemeIDialogueUiThemeThe currently active theme.