Dialogue Manager Interface - Mountea-Framework/MounteaDialogueSystem GitHub Wiki

Mountea Dialogue Manager Interface Documentation

Overview

The Mountea Dialogue Manager Interface (IMounteaDialogueManagerInterface) is an interface designed to manage dialogues within the Mountea Dialogue System. It provides methods for initializing, starting, and closing dialogues, as well as managing the user interface for dialogues. This interface is typically attached to a player controller or any other controller that needs to trigger dialogues.

Class: IMounteaDialogueManagerInterface

Description

This interface provides a comprehensive set of functions to handle dialogue processes within the game, including starting and stopping dialogues, selecting dialogue nodes, and updating the dialogue UI. It also includes several events to notify the system of changes in the dialogue state.


How to Use

C++

To use the IMounteaDialogueManagerInterface in C++, follow these steps:

Implementing the Interface

Include the Interface Header:

#include "Interfaces/MounteaDialogueManagerInterface.h"
Inherit from the Interface:
class YourClass : public AActor, public IMounteaDialogueManagerInterface
{
    // Your class implementation
};
Implement Required Functions:

Implement all pure virtual functions defined in the interface. For example:

void YourClass::StartDialogue_Implementation()
{
    // Your implementation code
}

Calling Interface Methods

Direct Calls:

For methods with default implementations, you can call them directly:

YourClassInstance->StartDialogue();

Using Execute_ Prefix for BlueprintCallable Functions:

For functions that are meant to be called from Blueprints and require BlueprintNativeEvent, use the Execute_ prefix:

IMounteaDialogueManagerInterface::Execute_CallDialogueNodeSelected(YourClassInstance, NodeGUID);

or

TScriptInterface<IMounteaDialogueManagerInterface> interface = YourClassInstance;
interface->Execute_CallDialogueNodeSelected(YourClassInstance, NodeGUID);

Variables

  • FDialogueParticipants
    • MainParticipant (TObjectPtr<AActor>): The main participant in the dialogue.
    • OtherParticipants (TArray<TObjectPtr<AActor>>): Other participants in the dialogue.

Functions

Name Inputs Outputs
CallDialogueNodeSelected NodeGUID (The GUID of the selected node) None
StartDialogue None None
CloseDialogue None None
InvokeDialogueUI Message (A message populated with an error message if the UI cannot be shown) bool (true if the UI can be shown, false otherwise)
UpdateDialogueUI Message (A message populated with an error message if the UI cannot be updated), Command (The command to be processed) bool (true if the UI can be updated, false otherwise)
CloseDialogueUI None bool (true if the UI can be closed, false otherwise)
GetDialogueWidgetClass None TSubclassOf<UUserWidget> (The widget class used to display the dialogue UI)
SetDialogueWidgetClass NewWidgetClass (The new widget class to set) None
SetDialogueUIPtr DialogueUIPtr (The user widget pointer to be set as the dialogue UI) None
StartExecuteDialogueRow None None
FinishedExecuteDialogueRow None None
GetDialogueContextEvent None UMounteaDialogueContext* (The dialogue context object for this instance)
GetDialogueWidget None UUserWidget* (The widget used to display the current dialogue)
GetOwningActor None AActor* (The owning actor for this dialogue manager component)
PrepareNode None None
GetDialogueContext None UMounteaDialogueContext* (The dialogue context)
SetDialogueContext NewContext (The new dialogue context to set) None
GetState None EDialogueManagerState (The current dialogue manager state)
GetDialogueManagerState None EDialogueManagerState (The dialogue manager state)
SetDialogueManagerState NewState (The new manager state to set) None
GetDefaultDialogueManagerState None EDialogueManagerState (The default manager state)
SetDefaultDialogueManagerState NewState (The new default manager state to set) None
InitializeDialogue OwningPlayerState (The player state of the owning player), Participants (The participants in the dialogue) None
GetDialogueInitializedEventHandle None FDialogueInitialized& (The dialogue initialized event handle)
GetDialogueStartedEventHandle None FDialogueEvent& (The dialogue started event handle)
GetDialogueClosedEventHandle None FDialogueEvent& (The dialogue closed event handle)
GetDialogueContextUpdatedEventHande None FDialogueContextUpdated& (The dialogue context updated event handle)
GetDialogueUserInterfaceChangedEventHandle None FDialogueUserInterfaceChanged& (The dialogue user interface changed event handle)
GetDialogueNodeSelectedEventHandle None FDialogueNodeEvent& (The dialogue node selected event handle)
GetDialogueNodeStartedEventHandle None FDialogueNodeEvent& (The dialogue node started event handle)
GetDialogueNodeFinishedEventHandle None FDialogueNodeEvent& (The dialogue node finished event handle)
GetDialogueRowStartedEventHandle None FDialogueRowEvent& (The dialogue row started event handle)
GetDialogueRowFinishedEventHandle None FDialogueRowEvent& (The dialogue row finished event handle)
GetDialogueFailedEventHandle None FDialogueFailed& (The dialogue failed event handle)
GetDialogueManagerStateChangedEventHandle None FDialogueManagerStateChanged& (The dialogue manager state changed event handle)
GetDialogueVoiceStartRequestEventHandle None FDialogueVoiceEvent& (The dialogue voice start request event handle)
GetDialogueVoiceSkipRequestEventHandle None FDialogueVoiceEvent& (The dialogue voice skip request event handle)
GetDialogueRowTimerHandle None FTimerHandle& (The dialogue row timer handle)

Events

Name Inputs Description
FDialogueInitialized UMounteaDialogueContext* Context Event triggered when the dialogue is initialized.
FDialogueEvent UMounteaDialogueContext* Context General event for dialogue actions such as start or close.
FDialogueContextUpdated UMounteaDialogueContext* Context Event triggered when the dialogue context is updated.
FDialogueUserInterfaceChanged TSubclassOf<UUserWidget> DialogueWidgetClass, UUserWidget* DialogueWidget Event triggered when the dialogue user interface changes.
FDialogueNodeEvent UMounteaDialogueContext* Context Event triggered when a dialogue node is interacted with.
FDialogueRowEvent UMounteaDialogueContext* Context Event triggered when a dialogue row is interacted with.
FDialogueFailed const FString& ErrorMessage Event triggered when a dialogue action fails.
FDialogueManagerStateChanged const EDialogueManagerState& NewState Event triggered when the dialogue manager state changes.
FDialogueVoiceEvent class USoundBase* NewDialogueVoice Event triggered for dialogue voice actions.
⚠️ **GitHub.com Fallback** ⚠️