xoreos  0.0.5
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Aurora::DLGFile Class Reference

#include <dlgfile.h>

Inheritance diagram for Aurora::DLGFile:
Inheritance graph
[legend]
Collaboration diagram for Aurora::DLGFile:
Collaboration graph
[legend]

Classes

struct  Entry
 A dialog entry. More...
 
struct  Line
 
struct  Link
 A link to a reply. More...
 

Public Member Functions

 DLGFile (Common::SeekableReadStream *dlg, NWScript::Object *owner=0, bool repairNWNPremium=false)
 Take over this stream and read a DLG file out of it. More...
 
 DLGFile (const Common::UString &dlg, NWScript::Object *owner=0, bool repairNWNPremium=false)
 Request this resource from the ResourceManager and read a DLG file out of it. More...
 
 ~DLGFile ()
 
bool getNoZoomIn () const
 Does starting the conversation zoom in the camera onto the speaker or not? More...
 
uint32 getDelayEntry () const
 Return the number of seconds to wait before showing each entry. More...
 
uint32 getDelayReply () const
 Return the number of seconds to wait before showing each reply. More...
 
bool hasEnded () const
 
void startConversation ()
 
void abortConversation ()
 
void pickReply (uint32 id)
 
const LinegetCurrentEntry () const
 
const std::vector< const Line * > & getCurrentReplies () const
 
const LinegetOneLiner () const
 Return the first active non-branching entry. More...
 

Static Public Attributes

static const uint32 kEndLine = 0xFFFFFFFE
 
static const uint32 kInvalidLine = 0xFFFFFFFF
 

Private Member Functions

void load (const GFF3Struct &dlg)
 
void readEntries (const GFF3List &list, std::vector< Entry > &entries, bool isPC)
 
void readLinks (const GFF3List &list, std::vector< Link > &links)
 
void readEntry (const GFF3Struct &gff, Entry &entry)
 
void readLink (const GFF3Struct &gff, Link &link)
 
bool evaluateEntries (const std::vector< Link > &entries, std::vector< Entry >::iterator &active)
 
bool evaluateReplies (const std::vector< Link > &entries, std::vector< const Line *> &active)
 
bool runScript (const Common::UString &script) const
 

Private Attributes

NWScript::Object_owner
 
uint32 _delayEntry
 Number of seconds to wait before showing each entry. More...
 
uint32 _delayReply
 Number of seconds to wait before showing each reply. More...
 
Common::UString _convAbort
 Script to run when the conversation was aborted. More...
 
Common::UString _convEnd
 Script to run when the conversation ended normally. More...
 
bool _noZoomIn
 Starting the conversation does not zoom the camera onto the speaker. More...
 
std::vector< Entry_entriesNPC
 NPC dialog lines ("entries"). More...
 
std::vector< Entry_entriesPC
 PC dialog lines ("replies"). More...
 
std::vector< Link_entriesStart
 NPC starting lines (greetings). More...
 
std::vector< Entry >::iterator _currentEntry
 The current entry. More...
 
std::vector< const Line * > _currentReplies
 The current replies. More...
 
bool _ended
 Has the conversation ended? More...
 

Detailed Description

Definition at line 62 of file dlgfile.h.

Constructor & Destructor Documentation

◆ DLGFile() [1/2]

Aurora::DLGFile::DLGFile ( Common::SeekableReadStream dlg,
NWScript::Object owner = 0,
bool  repairNWNPremium = false 
)

Take over this stream and read a DLG file out of it.

Definition at line 45 of file dlgfile.cpp.

References _currentEntry, _entriesNPC, Aurora::GFF3File::getTopLevel(), kDLGID, and load().

Here is the call graph for this function:

◆ DLGFile() [2/2]

Aurora::DLGFile::DLGFile ( const Common::UString dlg,
NWScript::Object owner = 0,
bool  repairNWNPremium = false 
)

Request this resource from the ResourceManager and read a DLG file out of it.

Definition at line 57 of file dlgfile.cpp.

References Aurora::GFF3File::getTopLevel(), kDLGID, Aurora::kFileTypeDLG, and load().

Here is the call graph for this function:

◆ ~DLGFile()

Aurora::DLGFile::~DLGFile ( )

Definition at line 65 of file dlgfile.cpp.

References abortConversation().

Here is the call graph for this function:

Member Function Documentation

◆ abortConversation()

void Aurora::DLGFile::abortConversation ( )

Definition at line 100 of file dlgfile.cpp.

References _convAbort, _currentEntry, _currentReplies, _ended, _entriesNPC, and runScript().

Referenced by startConversation(), and ~DLGFile().

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

◆ evaluateEntries()

bool Aurora::DLGFile::evaluateEntries ( const std::vector< Link > &  entries,
std::vector< Entry >::iterator &  active 
)
private

Definition at line 257 of file dlgfile.cpp.

References _entriesNPC, and runScript().

Referenced by pickReply(), and startConversation().

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

◆ evaluateReplies()

bool Aurora::DLGFile::evaluateReplies ( const std::vector< Link > &  entries,
std::vector< const Line *> &  active 
)
private

Definition at line 275 of file dlgfile.cpp.

References _entriesPC, and runScript().

Referenced by pickReply(), and startConversation().

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

◆ getCurrentEntry()

const DLGFile::Line * Aurora::DLGFile::getCurrentEntry ( ) const

Definition at line 140 of file dlgfile.cpp.

References _currentEntry, and _entriesNPC.

◆ getCurrentReplies()

const std::vector< const DLGFile::Line * > & Aurora::DLGFile::getCurrentReplies ( ) const

Definition at line 147 of file dlgfile.cpp.

References _currentReplies.

◆ getDelayEntry()

uint32 Aurora::DLGFile::getDelayEntry ( ) const

Return the number of seconds to wait before showing each entry.

Definition at line 73 of file dlgfile.cpp.

References _delayEntry.

◆ getDelayReply()

uint32 Aurora::DLGFile::getDelayReply ( ) const

Return the number of seconds to wait before showing each reply.

Definition at line 77 of file dlgfile.cpp.

References _delayReply.

◆ getNoZoomIn()

bool Aurora::DLGFile::getNoZoomIn ( ) const

Does starting the conversation zoom in the camera onto the speaker or not?

Definition at line 69 of file dlgfile.cpp.

References _noZoomIn.

◆ getOneLiner()

const DLGFile::Line * Aurora::DLGFile::getOneLiner ( ) const

Return the first active non-branching entry.

Definition at line 151 of file dlgfile.cpp.

References _entriesNPC, _entriesStart, and runScript().

Referenced by Engines::Witcher::Object::speakOneLiner(), Engines::NWN2::Object::speakOneLiner(), and Engines::NWN::Object::speakOneLiner().

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

◆ hasEnded()

bool Aurora::DLGFile::hasEnded ( ) const

Definition at line 81 of file dlgfile.cpp.

References _ended.

◆ load()

void Aurora::DLGFile::load ( const GFF3Struct dlg)
private

Definition at line 165 of file dlgfile.cpp.

References _convAbort, _convEnd, _delayEntry, _delayReply, _entriesNPC, _entriesPC, _entriesStart, _noZoomIn, Aurora::GFF3Struct::getBool(), Aurora::GFF3Struct::getList(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), readEntries(), and readLinks().

Referenced by DLGFile().

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

◆ pickReply()

void Aurora::DLGFile::pickReply ( uint32  id)

Definition at line 112 of file dlgfile.cpp.

References _convEnd, _currentEntry, _currentReplies, _ended, _entriesNPC, _entriesPC, evaluateEntries(), evaluateReplies(), kEndLine, kInvalidLine, and runScript().

Here is the call graph for this function:

◆ readEntries()

void Aurora::DLGFile::readEntries ( const GFF3List list,
std::vector< Entry > &  entries,
bool  isPC 
)
private

Definition at line 198 of file dlgfile.cpp.

References Aurora::DLGFile::Line::id, Aurora::DLGFile::Entry::isPC, Aurora::DLGFile::Entry::line, and readEntry().

Referenced by load().

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

◆ readEntry()

void Aurora::DLGFile::readEntry ( const GFF3Struct gff,
Entry entry 
)
private

◆ readLink()

void Aurora::DLGFile::readLink ( const GFF3Struct gff,
Link link 
)
private

Definition at line 252 of file dlgfile.cpp.

References Aurora::DLGFile::Link::active, Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), and Aurora::DLGFile::Link::index.

Referenced by readLinks().

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

◆ readLinks()

void Aurora::DLGFile::readLinks ( const GFF3List list,
std::vector< Link > &  links 
)
private

Definition at line 212 of file dlgfile.cpp.

References readLink().

Referenced by load(), and readEntry().

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

◆ runScript()

bool Aurora::DLGFile::runScript ( const Common::UString script) const
private

◆ startConversation()

void Aurora::DLGFile::startConversation ( )

Definition at line 85 of file dlgfile.cpp.

References _currentEntry, _currentReplies, _ended, _entriesNPC, _entriesStart, abortConversation(), evaluateEntries(), evaluateReplies(), and runScript().

Here is the call graph for this function:

Member Data Documentation

◆ _convAbort

Common::UString Aurora::DLGFile::_convAbort
private

Script to run when the conversation was aborted.

Definition at line 136 of file dlgfile.h.

Referenced by abortConversation(), and load().

◆ _convEnd

Common::UString Aurora::DLGFile::_convEnd
private

Script to run when the conversation ended normally.

Definition at line 137 of file dlgfile.h.

Referenced by load(), and pickReply().

◆ _currentEntry

std::vector<Entry>::iterator Aurora::DLGFile::_currentEntry
private

The current entry.

Definition at line 146 of file dlgfile.h.

Referenced by abortConversation(), DLGFile(), getCurrentEntry(), pickReply(), and startConversation().

◆ _currentReplies

std::vector<const Line *> Aurora::DLGFile::_currentReplies
private

The current replies.

Definition at line 147 of file dlgfile.h.

Referenced by abortConversation(), getCurrentReplies(), pickReply(), and startConversation().

◆ _delayEntry

uint32 Aurora::DLGFile::_delayEntry
private

Number of seconds to wait before showing each entry.

Definition at line 133 of file dlgfile.h.

Referenced by getDelayEntry(), and load().

◆ _delayReply

uint32 Aurora::DLGFile::_delayReply
private

Number of seconds to wait before showing each reply.

Definition at line 134 of file dlgfile.h.

Referenced by getDelayReply(), and load().

◆ _ended

bool Aurora::DLGFile::_ended
private

Has the conversation ended?

Definition at line 149 of file dlgfile.h.

Referenced by abortConversation(), hasEnded(), pickReply(), and startConversation().

◆ _entriesNPC

std::vector<Entry> Aurora::DLGFile::_entriesNPC
private

NPC dialog lines ("entries").

Definition at line 141 of file dlgfile.h.

Referenced by abortConversation(), DLGFile(), evaluateEntries(), getCurrentEntry(), getOneLiner(), load(), pickReply(), and startConversation().

◆ _entriesPC

std::vector<Entry> Aurora::DLGFile::_entriesPC
private

PC dialog lines ("replies").

Definition at line 142 of file dlgfile.h.

Referenced by evaluateReplies(), load(), and pickReply().

◆ _entriesStart

std::vector<Link> Aurora::DLGFile::_entriesStart
private

NPC starting lines (greetings).

Definition at line 144 of file dlgfile.h.

Referenced by getOneLiner(), load(), and startConversation().

◆ _noZoomIn

bool Aurora::DLGFile::_noZoomIn
private

Starting the conversation does not zoom the camera onto the speaker.

Definition at line 139 of file dlgfile.h.

Referenced by getNoZoomIn(), and load().

◆ _owner

NWScript::Object* Aurora::DLGFile::_owner
private

Definition at line 131 of file dlgfile.h.

Referenced by runScript().

◆ kEndLine

const uint32 Aurora::DLGFile::kEndLine = 0xFFFFFFFE
static

Definition at line 64 of file dlgfile.h.

Referenced by pickReply(), and Engines::NWN::Dialog::updateBox().

◆ kInvalidLine

const uint32 Aurora::DLGFile::kInvalidLine = 0xFFFFFFFF
static

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