xoreos
0.0.5
|
#include <dlgfile.h>
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 Line * | getCurrentEntry () const |
const std::vector< const Line * > & | getCurrentReplies () const |
const Line * | getOneLiner () 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... | |
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().
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().
Aurora::DLGFile::~DLGFile | ( | ) |
Definition at line 65 of file dlgfile.cpp.
References 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().
|
private |
Definition at line 257 of file dlgfile.cpp.
References _entriesNPC, and runScript().
Referenced by pickReply(), and startConversation().
|
private |
Definition at line 275 of file dlgfile.cpp.
References _entriesPC, and runScript().
Referenced by pickReply(), and startConversation().
const DLGFile::Line * Aurora::DLGFile::getCurrentEntry | ( | ) | const |
Definition at line 140 of file dlgfile.cpp.
References _currentEntry, and _entriesNPC.
const std::vector< const DLGFile::Line * > & Aurora::DLGFile::getCurrentReplies | ( | ) | const |
Definition at line 147 of file dlgfile.cpp.
References _currentReplies.
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.
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.
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.
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().
bool Aurora::DLGFile::hasEnded | ( | ) | const |
Definition at line 81 of file dlgfile.cpp.
References _ended.
|
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().
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().
|
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().
|
private |
Definition at line 220 of file dlgfile.cpp.
References Aurora::DLGFile::Line::animation, Aurora::GFF3Struct::getList(), Aurora::GFF3Struct::getLocString(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), Aurora::GFF3Struct::hasField(), Aurora::DLGFile::Line::isEnd, Aurora::DLGFile::Entry::line, Aurora::DLGFile::Line::quest, Aurora::DLGFile::Line::questEntry, readLinks(), Aurora::DLGFile::Entry::replies, Aurora::DLGFile::Entry::script, Aurora::DLGFile::Line::sound, Aurora::DLGFile::Line::speaker, Aurora::DLGFile::Line::text, and Aurora::DLGFile::Line::voice.
Referenced by readEntries().
|
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().
Definition at line 212 of file dlgfile.cpp.
References readLink().
Referenced by load(), and readEntry().
|
private |
Definition at line 293 of file dlgfile.cpp.
References _owner, Common::UString::c_str(), Common::UString::empty(), Common::exceptionDispatcherWarning(), Aurora::NWScript::Variable::getFloat(), Aurora::NWScript::Variable::getInt(), Aurora::NWScript::Variable::getType(), Aurora::NWScript::kTypeFloat, Aurora::NWScript::kTypeInt, and Aurora::NWScript::NCSFile::run().
Referenced by abortConversation(), evaluateEntries(), evaluateReplies(), getOneLiner(), pickReply(), and startConversation().
void Aurora::DLGFile::startConversation | ( | ) |
Definition at line 85 of file dlgfile.cpp.
References _currentEntry, _currentReplies, _ended, _entriesNPC, _entriesStart, abortConversation(), evaluateEntries(), evaluateReplies(), and runScript().
|
private |
Script to run when the conversation was aborted.
Definition at line 136 of file dlgfile.h.
Referenced by abortConversation(), and load().
|
private |
Script to run when the conversation ended normally.
Definition at line 137 of file dlgfile.h.
Referenced by load(), and pickReply().
|
private |
The current entry.
Definition at line 146 of file dlgfile.h.
Referenced by abortConversation(), DLGFile(), getCurrentEntry(), pickReply(), and startConversation().
|
private |
The current replies.
Definition at line 147 of file dlgfile.h.
Referenced by abortConversation(), getCurrentReplies(), pickReply(), and startConversation().
|
private |
Number of seconds to wait before showing each entry.
Definition at line 133 of file dlgfile.h.
Referenced by getDelayEntry(), and load().
|
private |
Number of seconds to wait before showing each reply.
Definition at line 134 of file dlgfile.h.
Referenced by getDelayReply(), and load().
|
private |
Has the conversation ended?
Definition at line 149 of file dlgfile.h.
Referenced by abortConversation(), hasEnded(), pickReply(), and startConversation().
|
private |
NPC dialog lines ("entries").
Definition at line 141 of file dlgfile.h.
Referenced by abortConversation(), DLGFile(), evaluateEntries(), getCurrentEntry(), getOneLiner(), load(), pickReply(), and startConversation().
|
private |
PC dialog lines ("replies").
Definition at line 142 of file dlgfile.h.
Referenced by evaluateReplies(), load(), and pickReply().
|
private |
NPC starting lines (greetings).
Definition at line 144 of file dlgfile.h.
Referenced by getOneLiner(), load(), and startConversation().
|
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().
|
private |
Definition at line 131 of file dlgfile.h.
Referenced by runScript().
|
static |
Definition at line 64 of file dlgfile.h.
Referenced by pickReply(), and Engines::NWN::Dialog::updateBox().
|
static |
Definition at line 65 of file dlgfile.h.
Referenced by Engines::NWN::Dialog::checkPicked(), Engines::NWN::DialogBox::getPickedID(), and pickReply().