persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
DialogueComponent Class Reference

#include <DialogueComponent.hpp>

Inheritance diagram for DialogueComponent:
Collaboration diagram for DialogueComponent:

Public Member Functions

void init () override
void destroy () override
void update (ae::q20_12_t) override
 Core update loop that renders & advances through dialogue.
ae::ComponentTypeID getType () const override
void configureDialogue (const DialogueConfig &config)
 Configure the dialogue system.
void start (Dialogue *firstLine)
 Start the currently loaded dialogue.
void end ()
 End the dialogue display.

Static Public Attributes

static constexpr ae::ComponentTypeID TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Dialogue)

Protected Member Functions

void submitToManager () override

Private Member Functions

void advanceTo (Dialogue *next)
 Transition to a new Dialogue node and reset animation state.
void renderAnimFrame ()
 Animate in the dialogue text on appear.
bool skipOrContinueText ()
 Handle input while the line is still being displayed.
void renderOptions ()
 Display the DialogueSelection options.

Private Attributes

Dialogue * current = nullptr
int optionCount = 0
int selectedOption = 0
bool doRenderOptions = false
bool renderBust = true
 track the currently loaded bust
bool opening = false
bool closing = false
u32 prevKeys = 0
TextComponent * text
TextComponent * textAlt
DialogueScreen * screen

Detailed Description

Definition at line 16 of file DialogueComponent.hpp.

Member Function Documentation

◆ advanceTo()

void DialogueComponent::advanceTo ( Dialogue * next)
private

Transition to a new Dialogue node and reset animation state.

Commonly used when decidiing what dialogue to display after a DialogueSelection

Parameters
Pointerto the next Dialogue

Definition at line 242 of file DialogueComponent.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configureDialogue()

void DialogueComponent::configureDialogue ( const DialogueConfig & config)

Configure the dialogue system.

Required to call before calling start().

Parameters
configThe struct containing the dialogue configuration to apply.

Definition at line 176 of file DialogueComponent.cpp.

Here is the call graph for this function:

◆ destroy()

void DialogueComponent::destroy ( )
override

Definition at line 171 of file DialogueComponent.cpp.

◆ end()

void DialogueComponent::end ( )

End the dialogue display.

Definition at line 222 of file DialogueComponent.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getType()

ae::ComponentTypeID DialogueComponent::getType ( ) const
inlineoverride

Definition at line 31 of file DialogueComponent.hpp.

◆ init()

void DialogueComponent::init ( )
override

Definition at line 18 of file DialogueComponent.cpp.

◆ renderAnimFrame()

void DialogueComponent::renderAnimFrame ( )
private

Animate in the dialogue text on appear.

Definition at line 265 of file DialogueComponent.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderOptions()

void DialogueComponent::renderOptions ( )
private

Display the DialogueSelection options.

Definition at line 296 of file DialogueComponent.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skipOrContinueText()

bool DialogueComponent::skipOrContinueText ( )
private

Handle input while the line is still being displayed.

Finishes revealing the current page, or advances to the next page if the current one is full.

Returns
true if input was consumed to finish revealing the current page or advance to the next page; false if the line is fully displayed.

Definition at line 277 of file DialogueComponent.cpp.

Here is the caller graph for this function:

◆ start()

void DialogueComponent::start ( Dialogue * firstLine)

Start the currently loaded dialogue.

Note
Dialogue must be set by configureDialogue() before start() can be called
Parameters
firstLinethe first dialogue line

Definition at line 195 of file DialogueComponent.cpp.

Here is the call graph for this function:

◆ submitToManager()

void DialogueComponent::submitToManager ( )
inlineoverrideprotected

Definition at line 60 of file DialogueComponent.hpp.

◆ update()

void DialogueComponent::update ( ae::q20_12_t )
override

Core update loop that renders & advances through dialogue.

Parameters
dtFixed-point delta time passed from the aegis engine loop (currently unused).

swap the background exactly once per dialogue line, on the first frame, and only if the image has actually changed

Definition at line 23 of file DialogueComponent.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ closing

bool DialogueComponent::closing = false
private

Definition at line 102 of file DialogueComponent.hpp.

◆ current

Dialogue* DialogueComponent::current = nullptr
private

Definition at line 94 of file DialogueComponent.hpp.

◆ doRenderOptions

bool DialogueComponent::doRenderOptions = false
private

Definition at line 97 of file DialogueComponent.hpp.

◆ opening

bool DialogueComponent::opening = false
private

Definition at line 101 of file DialogueComponent.hpp.

◆ optionCount

int DialogueComponent::optionCount = 0
private

Definition at line 95 of file DialogueComponent.hpp.

◆ prevKeys

u32 DialogueComponent::prevKeys = 0
private

Definition at line 104 of file DialogueComponent.hpp.

◆ renderBust

bool DialogueComponent::renderBust = true
private

track the currently loaded bust

Definition at line 100 of file DialogueComponent.hpp.

◆ screen

DialogueScreen* DialogueComponent::screen
private

Definition at line 108 of file DialogueComponent.hpp.

◆ selectedOption

int DialogueComponent::selectedOption = 0
private

Definition at line 96 of file DialogueComponent.hpp.

◆ text

TextComponent* DialogueComponent::text
private

Definition at line 106 of file DialogueComponent.hpp.

◆ textAlt

TextComponent* DialogueComponent::textAlt
private

Definition at line 107 of file DialogueComponent.hpp.

◆ TYPE_ID

ae::ComponentTypeID DialogueComponent::TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Dialogue)
staticconstexpr

Definition at line 19 of file DialogueComponent.hpp.


The documentation for this class was generated from the following files: