Table of Contents

Interface IDialogueBranch

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

A dialogue branch created by IDialogueBranchFactory.

public interface IDialogueBranch

Remarks

Call members on the game's thread.

Properties

ChosenTopics

The topics of the branch the player chose in the open conversation, or in the last one once it has ended, in the order chosen.

IReadOnlyList<DialogueTopic> ChosenTopics { get; }

Property Value

IReadOnlyList<DialogueTopic>

Remarks

It is emptied as a conversation with the speaker opens, and as a save starts loading or a new game begins.

OnConversationEnd

Raised on the game's thread once a conversation in which the branch showed a topic ends.

IGameEvent<ConversationEndEventArgs> OnConversationEnd { get; }

Property Value

IGameEvent<ConversationEndEventArgs>

Methods

ForgetSaidTopics()

Forgets every topic of the branch the player has chosen, with every speaker, as if none had been chosen.

void ForgetSaidTopics()

Remarks

A shown topic is undimmed when the menu next rebuilds, and a topic whose IsSaidOnce is true is shown again once no conversation with the speaker is open.

Hide()

Hides every topic of the branch, after the next reply where a conversation is open.

void Hide()

Show(QuestReferenceAlias, Func<bool>?)

Shows the branch in conversations with the actor that fills speaker, and hides the branch while the alias is empty or condition returns false.

void Show(QuestReferenceAlias speaker, Func<bool>? condition = null)

Parameters

speaker QuestReferenceAlias

The alias whose actor the branch speaks with.

condition Func<bool>

Called on each frame while no conversation with the current speaker is open. Null shows the branch whenever the alias is filled with an actor.

Remarks

It replaces any earlier speaker, and remains in place when a save starts loading or a new game begins, as Show(Func<Actor?>) does.

Exceptions

ArgumentNullException

speaker is null.

Show(Func<Actor, bool>)

Shows the branch in conversations with each actor speakerFilter accepts, one conversation at a time.

void Show(Func<Actor, bool> speakerFilter)

Parameters

speakerFilter Func<Actor, bool>

Called for the actor under the crosshair at once, and then each time the crosshair lands on an actor, except during a conversation with the current speaker. It is also called for the current speaker on each frame the crosshair is on that actor, and once as a conversation ends. The branch is hidden where it returns false. An actor it returned false for is tested again only once the crosshair lands on that actor again.

Remarks

It replaces any earlier speaker, and remains in place when a save starts loading or a new game begins. A conversation the actor starts, such as a force greet, shows the branch only where the crosshair last landed on that actor. Outside a conversation, the branch's opening topics, greeting, and goodbye are evaluated only while the crosshair is on the speaker, and once as a conversation ends.

Exceptions

ArgumentNullException

speakerFilter is null.

Show(Func<Actor?>)

Shows the branch in conversations with the actor getSpeaker returns, and hides the branch while it returns null.

void Show(Func<Actor?> getSpeaker)

Parameters

getSpeaker Func<Actor?>

Called on each frame while no conversation with the current speaker is open.

Remarks

It replaces any earlier speaker, and remains in place when a save starts loading or a new game begins.

Exceptions

ArgumentNullException

getSpeaker is null.

Show<TSpeaker>(TSpeaker)

Shows the branch in conversations with speaker only, replacing any earlier speaker.

void Show<TSpeaker>(TSpeaker speaker) where TSpeaker : IActor

Parameters

speaker TSpeaker

Type Parameters

TSpeaker

Remarks

A call during a conversation with the speaker shows the topics after the next reply. A save starting to load or a new game beginning hides the branch. The branch also clears its speaker as a save finishes loading, in a handler it subscribed to OnSaveLoaded when it was created, so a plugin that shows the branch from its own handler of that event subscribes the handler after creating the branch.