Gorilla.Utils.Dialogue.System Unit Reference

Overview

The Gorilla.Utils.Dialogue.System unit implements the Gorilla3D dialogue system. It provides a hierarchical structure of dialogues, items (questions/answers), events, and characters. Dialogues are organized in collections with support for branching, timeouts, skipping, multi-language names, and XML serialization.

Class Hierarchy

TComponent
  └── TGorillaDialogueSystem

TCollectionItem
  └── TGorillaDialogueCustomItem
        └── TGorillaDialogueParameterizedItem
              ├── TGorillaDialogueItemEvent
              └── TGorillaDialogueParentItem
                    ├── TGorillaDialogueItem
                    ├── TGorillaDialogueCharacter
                    └── TGorillaDialogue

Callback Types

TOnBeginDialogueItemEvent = procedure(const AEvent: TGorillaDialogueItemEvent;
  const AScope: TObject; var AHandled: Boolean) of object;
TOnEndDialogueItemEvent = procedure(const AEvent: TGorillaDialogueItemEvent;
  const AScope: TObject) of object;

TOnBeginDialogueItem = procedure(const AItem: TGorillaDialogueItem;
  const AItems: TArray<TGorillaDialogueItem>) of object;
TOnEndDialogueItem = procedure(const AItem: TGorillaDialogueItem) of object;

TOnStartDialogue = procedure(const ADialogue: TGorillaDialogue;
  const AItems: TArray<TGorillaDialogueItem>) of object;
TOnStopDialogue = procedure(const ADialogue: TGorillaDialogue) of object;
TOnPauseDialogue = procedure(const ADialogue: TGorillaDialogue) of object;

TOnSkippedDialogue = procedure(const ADialogue: TGorillaDialogue;
  const ABeginItem, AEndItem: TGorillaDialogueItem) of object;
TOnSkipAvailability = procedure(const ADialogue: TGorillaDialogue;
  const AItem: TGorillaDialogueItem; const AIsAvailable: Boolean) of object;

TOnBeginItemTimeout = procedure(const AItem: TGorillaDialogueItem;
  const ATime: Integer) of object;
TOnEndItemTimeout = procedure(const AItem: TGorillaDialogueItem) of object;

TGorillaDialogueCustomItem

Base class for all dialogue entities.

Published Properties

Property Type Description
Ident String Unique identifier
Enabled Boolean Whether the item can be used/executed

Public Properties

Property Type Description
DialogueSystem TGorillaDialogueSystem Parent dialogue system
UIElement TObject Linked UI element (used by overlay components)
Position TPointF Flow chart position (for editor layout)

Public Methods

Method Description
GetRandomId() Generate a random identifier
Clone() Clone this item (abstract)

TGorillaDialogueParameterizedItem

Extends TGorillaDialogueCustomItem with a parameter list.

Published Properties

Property Type Description
Parameters TGorillaDialogueParameters Custom key-value parameters

Public Methods

Method Description
AddParameter(AName, AValue) Add or overwrite a parameter
RemoveParameter(AName) Remove parameter by name
GetParameter(AName) Get parameter value by name

TGorillaDialogueItemEvent

An event attached to a dialogue item.

Published Properties

Property Type Description
Kind TGorillaDialogueItemEventKind Event kind (Message, Sound, Animation, etc.)
Trigger TGorillaDialogueItemEventTrigger When to fire (OnBegin, OnEnd, OnTimeout, etc.)
Value String Event payload

TGorillaDialogueItem

A single dialogue entry (question, answer, or text).

Published Properties

Property Type Description
Kind TGorillaDialogueItemKind Item kind: Question, Answer, Text, Group, Random
Text TGorillaLanguageMap Multi-language dialogue text
Timeout Integer Auto-advance timeout in ms (0 = disabled)
Audio String Audio file path
Character TGorillaDialogueCharacter Speaking character
Items TGorillaDialogueItemCollection Child items (for branching)
Events TGorillaDialogueItemEventCollection Attached events
ImageIndex Integer Icon index in TImageList

TGorillaDialogueCharacter

A named character participating in dialogues.

Published Properties

Property Type Description
Items TGorillaDialogueItemCollection Character's dialogue items
ImageIndex Integer Character icon index

TGorillaDialogue

A complete dialogue tree.

Published Properties

Property Type Description
Items TGorillaDialogueItemCollection Root dialogue items
Characters TGorillaDialogueCharacterCollection Participating characters
ImageIndex Integer Dialogue icon index

TGorillaDialogueSystem

Main component managing all dialogues.

Published Properties

Property Type Description
Dialogues TGorillaDialogueCollection Collection of dialogues
Language String Current language for text display
ImageList TImageList Linked image list for icons

Published Events

Event Type Description
OnStartDialogue TOnStartDialogue Dialogue started
OnStopDialogue TOnStopDialogue Dialogue stopped
OnPauseDialogue TOnPauseDialogue Dialogue paused
OnBeginItem TOnBeginDialogueItem Item processing started
OnEndItem TOnEndDialogueItem Item processing ended
OnBeginItemEvent TOnBeginDialogueItemEvent Item event started
OnEndItemEvent TOnEndDialogueItemEvent Item event ended
OnSkipped TOnSkippedDialogue Dialogue skipped
OnSkipAvailability TOnSkipAvailability Skip availability changed
OnBeginTimeout TOnBeginItemTimeout Item timeout started
OnEndTimeout TOnEndItemTimeout Item timeout ended

See Also

  • Gorilla.Utils.Dialogue.Types — enumerations and type definitions (no reference page yet)
  • Dialogue UserGuide — Practical usage guide